Main Page   Modules   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.

Typedefs

typedef void(* voidFuncPtru08 )(unsigned char)

Functions

void uartInit (void)
 initializes uart

void uartInitBuffers (void)
 initializes transmit and receive buffers

void uartSetRxHandler (void(*rx_func)(unsigned char c))
 redirects received data to a user function

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 uartAddToTxBuffer (u08 data)
 add byte to end of uart Tx buffer

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

 UART_INTERRUPT_HANDLER (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 Sun Feb 22 19:12:32 2004 for Procyon AVRlib by doxygen1.3-rc2