rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
|
This is the driver for the UART0/2/3. More...
Enumerations | |
enum | rflpc_uart_t { RFLPC_UART0 = 0, RFLPC_UART2 = 2, RFLPC_UART3 = 3 } |
Constants that represents the UART port you want to use in uart driver functions. More... | |
Functions | |
int | rflpc_uart_init (rflpc_uart_t uart_num) |
Inits the UART e, using 11520 baud, 8 bits data, no parity and 1 stop bit. More... | |
int | rflpc_uart_init_ex (rflpc_uart_t uart_num, int dll, int dlm, int divadd, int mulval) |
Inits the UART e, using 8 bits data, no parity and 1 stop bit. More... | |
void | rflpc_uart_putchar (rflpc_uart_t uart_num, char c) |
Sends a byte to the uart. More... | |
int | rflpc_uart_byte_available (rflpc_uart_t uart_num) |
Test the reception FIFO. More... | |
char | rflpc_uart_getchar (rflpc_uart_t uart_num) |
Gets a character from the uart. More... | |
void | rflpc_uart_set_rx_callback (rflpc_uart_t uart_num, rflpc_irq_handler_t callback) |
Sets the uart rx callback. More... | |
This is the driver for the UART0/2/3.
At the moment, this driver is only usable when the CPU is clocked at 96Mhz and the UART mode is set to
enum rflpc_uart_t |
int rflpc_uart_byte_available | ( | rflpc_uart_t | uart_num | ) |
Test the reception FIFO.
uart_num | the uart to use |
char rflpc_uart_getchar | ( | rflpc_uart_t | uart_num | ) |
Gets a character from the uart.
uart_num | the uart to use |
int rflpc_uart_init | ( | rflpc_uart_t | uart_num | ) |
Inits the UART e, using 11520 baud, 8 bits data, no parity and 1 stop bit.
int rflpc_uart_init_ex | ( | rflpc_uart_t | uart_num, |
int | dll, | ||
int | dlm, | ||
int | divadd, | ||
int | mulval | ||
) |
Inits the UART e, using 8 bits data, no parity and 1 stop bit.
The baud rate is computed from dll, dlm, divadd and mulval. you can use the baud_rate_calc.pl script in the tools folder to generate the values for the desired baud rate
void rflpc_uart_putchar | ( | rflpc_uart_t | uart_num, |
char | c | ||
) |
Sends a byte to the uart.
uart_num | the uart to use |
c | character to send |
void rflpc_uart_set_rx_callback | ( | rflpc_uart_t | uart_num, |
rflpc_irq_handler_t | callback | ||
) |
Sets the uart rx callback.
This enables the uart0 interrupt and set the handler accordingly
uart_num | the uart to use |
callback | a pointer to a rflpc_irq_handler_t function |