Elisa3
usart.c File Reference
#include <avr/eeprom.h>
#include "usart.h"
#include "leds.h"

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 closeUsart ()
 Close the usart peripheral and disable all interrupts.
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).
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.
 ISR (USART0_RX_vect)

Function Documentation

void closeUsart ( )

Close the usart peripheral and disable all interrupts.

Returns:
none
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.

Returns:
none
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.

Returns:
none
ISR ( USART0_RX_vect  )

Check whether there is something to read from usart0.

Return values:
0input buffer not empty
1input buffer empty
unsigned char usart0Receive ( )

Wait until a byte has been received or the timeout is expired.

Returns:
byte received
void usart0Transmit ( unsigned char  data,
unsigned char  isBlocking 
)

Transfer one byte of data; it's blocking (wait until the buffer is empty).

Parameters:
datadata to be sent through usart0
Returns:
none
void usart1Transmit ( unsigned char  data,
unsigned char  isBlocking 
)

Transfer one byte of data; it's blocking (wait until the buffer is empty).

Parameters:
datadata to be sent through usart1
Returns:
none
 All Files Functions Variables Defines