aversive_10-03-12/modules/comm/uart/uart_host.c File Reference

#include <uart.h>
#include <uart_private.h>

Go to the source code of this file.

Functions

void uart_init (void)
int8_t uart_setconf (uint8_t num, struct uart_config *u)
void uart_getconf (uint8_t num, struct uart_config *u)
int uart_recv (uint8_t num)
int uart_send_nowait (uint8_t num, char c)
int uart_send (uint8_t num, char c)
void uart_register_tx_event (uint8_t num, void(*f)(char))
void uart_register_rx_event (uint8_t num, void(*f)(char))

Variables

eventrx_event [UART_HW_NUM]
eventtx_event [UART_HW_NUM]


Function Documentation

void uart_getconf ( uint8_t  num,
struct uart_config u 
)

Get the current configuration of the uart 'num'

Definition at line 43 of file uart_host.c.

void uart_init ( void   ) 

Initialisation function. This function puts the registers of the microcontroler in a correct state in order to use the uart. It uses the configuration file <uart_config.h> ; this function is equivalent to call uartX_setconf(NULL) for each uart.

Definition at line 30 of file uart_host.c.

References uart_setconf().

int uart_recv ( uint8_t  num  ) 

uart_recv returns the next character, taken from the fifo (if any). If there is nothing to read, the function waits until something come on the uart.

Definition at line 47 of file uart_host.c.

void uart_register_rx_event ( uint8_t  num,
void(*)(char)  f 
)

This function is used to register another function which will be executed at each byte reception (5, 6 ,7 ,8 bits)

Definition at line 67 of file uart_host.c.

References parse_symbols::f, and rx_event.

void uart_register_tx_event ( uint8_t  num,
void(*)(char)  f 
)

This function is used to register another function which will be executed at each byte transmission (5, 6 ,7 ,8 bits)

Definition at line 62 of file uart_host.c.

References parse_symbols::f, and tx_event.

int uart_send ( uint8_t  num,
char  c 
)

uart_send is used to send data to the uart 'num'. The data is first stored in the FIFO before beeing sent. If the FIFO is full, the function wait until the uart is ready. The function returns c.

Definition at line 57 of file uart_host.c.

int uart_send_nowait ( uint8_t  num,
char  c 
)

uart_send_nowait is used to send data to the uart 'num'. The data is first stored in the FIFO before beeing sent. If the FIFO is full, data is dropped and the function returns -1, else it returns the character c.

Definition at line 52 of file uart_host.c.

int8_t uart_setconf ( uint8_t  num,
struct uart_config u 
)

Configure the uart 'num' with the given configuration. Returns 0 on success.

Definition at line 38 of file uart_host.c.


Variable Documentation

event* rx_event[UART_HW_NUM]

Definition at line 35 of file uart_host.c.

event* tx_event[UART_HW_NUM]

Definition at line 36 of file uart_host.c.


Generated on Fri Mar 12 06:32:05 2010 for AVR by  doxygen 1.5.6