Main Page   Modules   Data Structures   File List   Data Fields   Globals  

uart.h File Reference

UART driver with buffer support. More...

#include "global.h"
#include "buffer.h"

Go to the source code of this file.

Defines

#define UART_DEFAULT_BAUD_RATE   9600
#define UART_TX_BUFFER_SIZE   0x0040
 number of bytes for uart transmit buffer

#define UART_RX_BUFFER_SIZE   0x0040
 number of bytes for uart receive buffer

#define UART_INTERRUPT_HANDLER   SIGNAL

Functions

void uartInitBuffers (void)
 initializes transmit and receive buffers

void uartInit (void)
 initializes uart

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 data)
 sends a single byte over the uart

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

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

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

void uartAddToTxBuffer (u08 data)
 add byte to end of uart Tx buffer

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


Detailed Description

UART driver with buffer support.

Definition in file uart.h.


Define Documentation

#define UART_DEFAULT_BAUD_RATE   9600
 

default baud rate can be changed by using uartSetBaudRate()

Definition at line 26 of file uart.h.


Generated on Sun Feb 22 19:12:32 2004 for Procyon AVRlib by doxygen1.3-rc2