src/bf52x_uart.c File Reference

#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.

Function Documentation

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:

Parameters:
sett - Holds the baud rate and parity information to be used.
Returns:
Zero if the uart is initialized properly. Negative value if the init fails.

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:

Parameters:
sett - Holds the baud rate and parity information to be used.
Returns:
Zero if the uart is initialized properly. Negative value if the init fails.

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:

Parameters:
data - Pointer to data in which the data will be stored. datalen - Length in bytes to be received.
Returns:
Zero if the data transfer was done. Negative value if the transfer fails.

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:

Parameters:
data - Pointer to data in which the data will be stored. datalen - max number of bytes to receive
Returns:
Number of bytes received, zero if UART buffer is empty -1 if UART error Negative value if the transfer fails.

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:

Parameters:
data - Pointer to data to be transmitted. datalen - Length in bytes to be transmitted.
Returns:
Zero if the data transfer was done. Negative value if the transfer fails.


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7