| AVR Z-LINKŪ | |||||
Definition in file usart.c.
#include "usart.h"
Include dependency graph for usart.c:

Go to the source code of this file.
Functions | |
| void | uartInitialization (const baudRate_t rate) |
| Initialize USART0 8-N-1. | |
| void | uartSendSymbol (const uint8_t symbol) |
| Send one symbol on the serial line. | |
| void uartInitialization | ( | const baudRate_t | rate | ) |
Initialize USART0 8-N-1.
| rate | Baudrate to run the USART0 at. The tested rates are: 9600, 19200 and 38400. |
Definition at line 39 of file usart.c.
References ENABLE_RECEIVE_COMPLETE_INTERRUPT, ENABLE_RECEIVER, and ENABLE_TRANSMITTER.
Referenced by serialInterfaceInitialization().
00039 { 00040 00041 //Initialize USART module. 00042 UBRR0H = 0x00; 00043 UBRR0L = rate; 00044 00045 //Enable USART transmitter module. Always on. 00046 ENABLE_RECEIVER; 00047 ENABLE_TRANSMITTER; 00048 00049 //8-N-1. 00050 UCSR0C |= ( 1 << UCSZ01 ) | ( 1 << UCSZ00 ); 00051 00052 ENABLE_RECEIVE_COMPLETE_INTERRUPT; 00053 00054 return; 00055 }
| void uartSendSymbol | ( | const uint8_t | symbol | ) |
Send one symbol on the serial line.
This function passes one symbol (8 bits) to the USART module on the AVR.
| symbol | Symbol to be sent. |
Definition at line 66 of file usart.c.
Referenced by sendSymbol().
00066 { 00067 00068 //Wait until the USART module is ready to 00069 //transmit a new symbol. 00070 for( ; !( UCSR0A & ( 1 << UDRE0 ) ); ){ 00071 00072 ; 00073 } 00074 00075 //Put symbol in data register. 00076 UDR0 = symbol; 00077 00078 return; 00079 }
Generated on Sat Dec 2 16:05:51 2006 for AVR414 User's Guide - ATAVRRZ502 - Accessory Kit by 1.4.7
|