Files

file  k_uart.h
 UART interface.
 

Data Structures

struct  uart_conf
 Usart configuration, to be used with the uart_init call. More...
 

Typedefs

typedef void(* uart_callback_t) (void *extra_data, uint8_t *buf, int len, void *pxTaskWoken)
 In order to catch incoming chars use the callback. More...
 

Functions

void uart_init (struct uart_conf *conf)
 Initialise UART with the uart_conf data structure. More...
 
void uart_set_callback (void *arg, uart_callback_t callback)
 
void uart_insert (char c, void *pxTaskWoken)
 Insert a character to the RX buffer of a uart. More...
 
void uart_putc (char c)
 Polling putchar. More...
 
void uart_putstr (char *buf, int len)
 Send char buffer on UART. More...
 
char uart_getc (void)
 Buffered getchar. More...
 
int uart_messages_waiting (int handle)
 

Typedef Documentation

typedef void(* uart_callback_t) (void *extra_data, uint8_t *buf, int len, void *pxTaskWoken)

In order to catch incoming chars use the callback.

Only one callback per interface.

Parameters
handleuart[0,1,2,3]
callbackfunction pointer

Function Documentation

char uart_getc ( void  )

Buffered getchar.

Parameters
handleuart[0,1,2,3]
Returns
Character received
void uart_init ( struct uart_conf conf)

Initialise UART with the uart_conf data structure.

Parameters
uart_conffull configuration structure
void uart_insert ( char  c,
void *  pxTaskWoken 
)

Insert a character to the RX buffer of a uart.

Parameters
handleuart[0,1,2,3]
cCharacter to insert
int uart_messages_waiting ( int  handle)
void uart_putc ( char  c)

Polling putchar.

Parameters
handleuart[0,1,2,3]
cCharacter to transmit
void uart_putstr ( char *  buf,
int  len 
)

Send char buffer on UART.

Parameters
handleuart[0,1,2,3]
bufPointer to data
lenLength of data
void uart_set_callback ( void *  arg,
uart_callback_t  callback 
)