Subversion Repositories idreammicro-avr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12 jlesech 1
/**************************************************************************//**
2
 * \brief USART library - Test program
3
 * \author Copyright (C) 2011  Julien Le Sech - www.idreammicro.com
4
 * \version 1.0
5
 * \date 20090314
6
 *
7
 * This file is part of the iDreamMicro library.
8
 *
9
 * This library is free software: you can redistribute it and/or modify it under
10
 * the terms of the GNU Lesser General Public License as published by the Free
11
 * Software Foundation, either version 3 of the License, or (at your option) any
12
 * later version.
13
 *
14
 * This library is distributed in the hope that it will be useful, but WITHOUT
15
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17
 * details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with this program. If not, see http://www.gnu.org/licenses/
21
 ******************************************************************************/
22
 
23
/**************************************************************************//**
24
 * \file usart0__test.c
25
 ******************************************************************************/
26
 
27
/******************************************************************************
28
 * Header file inclusions.
29
 ******************************************************************************/
30
 
31
#include "../usart0.h"
32
 
33
#include <util/delay.h>
34
 
35
#include <stdlib.h>
36
 
37
/******************************************************************************
38
 * Main function.
39
 ******************************************************************************/
40
 
41
/**************************************************************************//**
42
 * \fn int main(void)
43
 *
44
 * \brief Main function.
45
 *****************************************************************************/
46
int
47
main
48
(
49
    void
50
){
51
    // Initialize USART0.
52
    usart0__initialize(NULL);
53
 
54
    // Enbale transmitter.
55
    usart0__enable_transmitter();
56
 
57
    // Transmit characters.
58
    while (1)
59
    {
60
        usart0__transmit_byte('H');
61
        usart0__transmit_byte('e');
62
        usart0__transmit_byte('l');
63
        usart0__transmit_byte('l');
64
        usart0__transmit_byte('o');
65
        usart0__transmit_byte(' ');
66
        usart0__transmit_byte('W');
67
        usart0__transmit_byte('o');
68
        usart0__transmit_byte('r');
69
        usart0__transmit_byte('l');
70
        usart0__transmit_byte('d');
71
        usart0__transmit_byte('!');
72
        usart0__transmit_byte('\n');
73
 
74
        _delay_ms(500);
75
    }
76
 
77
    return 0;
78
}