Main Page   Data Structures   File List   Data Fields   Globals  

uart.c File Reference

UART driver with buffer support. More...

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include "buffer.h"
#include "uart.h"

Go to the source code of this file.

Functions

void uartInit (void)
 initializes uart

void uartInitBuffers (void)
 initializes transmit and receive buffers

void uartSetBaudRate (u32 baudrate)
 sets the uart baud rate

cBuffer * uartGetRxBuffer (void)
 returns pointer to the receive buffer structure

cBuffer * uartGetTxBuffer (void)
 returns pointer to the transmit buffer structure

void uartSendByte (u08 txData)
 sends a single byte over the uart

u08 uartReceiveByte (u08 *rxData)
 gets a single byte from the uart receive buffer

void uartFlushReceiveBuffer (void)
 flushes (deletes) all data from receive buffer

u08 uartReceiveBufferIsEmpty (void)
 returns TRUE/FALSE if receive buffer is empty/not-empty

void uartSendTxBuffer (void)
 begins transmission of the transmit buffer under interrupt control

u08 uartSendBuffer (char *buffer, u16 nBytes)
 sends a buffer of length nBytes via the uart using interrupt control

 SIGNAL (SIG_UART_TRANS)
 UART Transmit Complete Interrupt Handler.


Variables

volatile u08 uartReadyTx
 uartReadyTx flag

volatile u08 uartBufferedTx
 uartBufferedTx flag

cBuffer uartRxBuffer
 uart receive buffer

cBuffer uartTxBuffer
 uart transmit buffer

unsigned short uartRxOverflow
 receive overflow counter


Detailed Description

UART driver with buffer support.

Definition in file uart.c.


Generated on Tue Feb 4 20:18:38 2003 for Procyon AVRlib by doxygen1.3-rc2