Elisa3
|
Usart module. More...
Go to the source code of this file.
Functions | |
void | initUsart0 () |
Configure the usart0 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled. | |
void | initUsart1 () |
Configure the usart1 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled. | |
void | usart0Transmit (unsigned char data, unsigned char isBlocking) |
Transfer one byte of data; it's blocking (wait until the buffer is empty). | |
void | usart1Transmit (unsigned char data, unsigned char isBlocking) |
Transfer one byte of data; it's blocking (wait until the buffer is empty). | |
void | closeUsart () |
Close the usart peripheral and disable all interrupts. | |
char | usart0InputBufferEmpty () |
Check whether there is something to read from usart0. | |
unsigned char | usart0Receive () |
Wait until a byte has been received or the timeout is expired. |
Usart module.
The usart peripheral is used primarly for debugging purposes; it's initialized to work at 57600 baud that is the maximum throughput usable with the main clock at 8 MHz. An interrupt is generated at each character reception; a function for transfer data is also available.
void closeUsart | ( | ) |
Close the usart peripheral and disable all interrupts.
void initUsart0 | ( | ) |
Configure the usart0 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled.
void initUsart1 | ( | ) |
Configure the usart1 registers to work at 57600 baud (8-bit data, no parity, 1 stop bit). Moreover the interrupt for reception is enabled.
char usart0InputBufferEmpty | ( | ) |
Check whether there is something to read from usart0.
0 | input buffer not empty |
1 | input buffer empty |
unsigned char usart0Receive | ( | ) |
Wait until a byte has been received or the timeout is expired.
void usart0Transmit | ( | unsigned char | data, |
unsigned char | isBlocking | ||
) |
Transfer one byte of data; it's blocking (wait until the buffer is empty).
data | data to be sent through usart0 |
void usart1Transmit | ( | unsigned char | data, |
unsigned char | isBlocking | ||
) |
Transfer one byte of data; it's blocking (wait until the buffer is empty).
data | data to be sent through usart1 |