#include <stdarg.h>
#include "tll_config.h"
#include <bf52x_uart.h>
Include dependency graph for bf52x_uart.c:
Functions | |
int | bf52x_uart_init (bf52x_uart_settings *sett) |
Initialize the uart. | |
void | bf52x_uart_deinit (void) |
Deinitialize the uart. | |
int | bf52x_uart_transmit (char *data, unsigned char datalen) |
Transfers the data over uart. | |
int | bf52x_uart_receive (char *data, unsigned char datalen) |
Receives the data over uart. | |
int | bf52x_uart_receiveNb (char *data, unsigned char datalen) |
Receives the data over uart. |
void bf52x_uart_deinit | ( | void | ) |
Deinitialize the uart.
This function disables the uart by programming the uart global control reg.
Pre-conditions:
Post condtions:
Parameters:
sett | - Holds the baud rate and parity information to be used. |
int bf52x_uart_init | ( | bf52x_uart_settings * | sett | ) |
Initialize the uart.
This function:- 1. Configures the uart to the baud rate mentioned by the application. 2. Configure for 8 bits, 1 stop bit
Pre-conditions:
Post condtions:
Parameters:
sett | - Holds the baud rate and parity information to be used. |
int bf52x_uart_receive | ( | char * | data, | |
unsigned char | datalen | |||
) |
Receives the data over uart.
This function waits for each byte to be received over uart untill data of length datalen is received. The data received is stored in data.
Pre-conditions:
Post condtions:
Parameters:
data | - Pointer to data in which the data will be stored. datalen - Length in bytes to be received. |
int bf52x_uart_receiveNb | ( | char * | data, | |
unsigned char | datalen | |||
) |
Receives the data over uart.
Non blocking receive of serial data. Will return 0 if nothing received.
Pre-conditions:
Post condtions:
Parameters:
data | - Pointer to data in which the data will be stored. datalen - max number of bytes to receive |
int bf52x_uart_transmit | ( | char * | data, | |
unsigned char | datalen | |||
) |
Transfers the data over uart.
This function transfers the data of total datalen bytes in blocking mode.
Pre-conditions:
Post condtions:
Parameters:
data | - Pointer to data to be transmitted. datalen - Length in bytes to be transmitted. |