![]() |
![]() |
The section has a list of all the exported API which the applications need to invoke in order to use the UART driver. More...
Functions | |
void | UART_close (UART_Handle handle) |
Function to close a UART peripheral specified by the UART handle. More... | |
int32_t | UART_control (UART_Handle handle, uint32_t cmd, void *arg) |
Function performs implementation specific features on a given UART_Handle. More... | |
void | UART_init (void) |
Function to initialize the UART module. More... | |
UART_Handle | UART_open (uint32_t index, UART_Params *params) |
Function to initialize a given UART peripheral. More... | |
void | UART_Params_init (UART_Params *params) |
Function to initialize the UART_Params struct to its defaults. More... | |
int32_t | UART_write (UART_Handle handle, uint8_t *buffer, uint32_t size) |
Function that writes data to a UART with interrupts enabled. Usage of this API is mutually exclusive with usage of UART_writePolling(). In other words, for an opened UART peripheral, either UART_write() or UART_writePolling() may be used, but not both. More... | |
int32_t | UART_writePolling (UART_Handle handle, uint8_t *buffer, uint32_t size) |
Function that writes data to a UART, polling the peripheral to wait until new data can be written. Usage of this API is mutually exclusive with usage of UART_write(). More... | |
void | UART_writeCancel (UART_Handle handle) |
Function that cancels a UART_write() function call. More... | |
int32_t | UART_read (UART_Handle handle, uint8_t *buffer, uint32_t size) |
Function that reads data from a UART with interrupt enabled. This API must be used mutually exclusive with UART_readPolling(). More... | |
int32_t | UART_readPolling (UART_Handle handle, uint8_t *buffer, uint32_t size) |
Function that reads data from a UART without interrupts. This API must be used mutually exclusive with UART_read(). More... | |
void | UART_readCancel (UART_Handle handle) |
Function that cancels a UART_read() function call. This function cancels a UART_read() operation for a UART peripheral. More... | |
The section has a list of all the exported API which the applications need to invoke in order to use the UART driver.
void UART_close | ( | UART_Handle | handle | ) |
Function to close a UART peripheral specified by the UART handle.
handle | A UART_Handle returned from UART_open() |
int32_t UART_control | ( | UART_Handle | handle, |
uint32_t | cmd, | ||
void * | arg | ||
) |
Function performs implementation specific features on a given UART_Handle.
Commands for UART_control can originate from UART.h or from implementation specific UART*.h (UARTCC26XX.h, UARTTiva.h, etc.. ) files. While commands from UART.h are API portable across driver implementations, not all implementations may support all these commands. Conversely, commands from driver implementation specific UART*.h files add unique driver capabilities but are not API portable across all UART driver implementations.
Commands supported by UART.h follow a UART_CMD_<cmd> naming convention.
Commands supported by UART*.h follow a UART*_CMD_<cmd> naming convention.
Each control command defines arg differently. The types of arg are documented with each command.
See UART_control command codes for command codes.
See UART_control return status codes for status codes.
handle | A UART handle returned from UART_open() |
cmd | UART.h or UART*.h commands. |
arg | An optional R/W (read/write) command argument accompanied with cmd |
void UART_init | ( | void | ) |
Function to initialize the UART module.
UART_Handle UART_open | ( | uint32_t | index, |
UART_Params * | params | ||
) |
Function to initialize a given UART peripheral.
Function to initialize a given UART peripheral specified by the particular index value.
index | Logical peripheral number for the UART indexed into the UART_config table |
params | Pointer to a parameter block. If NULL, default parameter values will be used. All the fields in this structure are RO (read-only). |
void UART_Params_init | ( | UART_Params * | params | ) |
Function to initialize the UART_Params struct to its defaults.
params | An pointer to UART_Params structure for initialization |
Defaults values are: readTimeout = UART_WAIT_FOREVER; writeTimeout = UART_WAIT_FOREVER; readReturnMode = UART_RETURN_NEWLINE; readDataMode = UART_DATA_TEXT; writeDataMode = UART_DATA_TEXT; readEcho = UART_ECHO_ON; baudRate = 115200; dataLength = UART_LEN_8; stopBits = UART_STOP_ONE; parityType = UART_PAR_NONE;
int32_t UART_read | ( | UART_Handle | handle, |
uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Function that reads data from a UART with interrupt enabled. This API must be used mutually exclusive with UART_readPolling().
This function initiates an operation to read data from a UART controller.
In UART_MODE_BLOCKING, UART_read() will block task execution until all the data in buffer has been read.
handle | A UART_Handle |
buffer | A RO (read-only) pointer to an empty buffer in which received data should be written to. |
size | The number of bytes to be written into buffer |
void UART_readCancel | ( | UART_Handle | handle | ) |
Function that cancels a UART_read() function call. This function cancels a UART_read() operation for a UART peripheral.
handle | A UART_Handle |
int32_t UART_readPolling | ( | UART_Handle | handle, |
uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Function that reads data from a UART without interrupts. This API must be used mutually exclusive with UART_read().
This function initiates an operation to read data from a UART peripheral.
UART_readPolling will not return until size data was read to the UART.
handle | A UART_Handle |
buffer | A RO (read-only) pointer to an empty buffer in which received data should be written to. |
size | The number of bytes to be written into buffer |
int32_t UART_write | ( | UART_Handle | handle, |
uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Function that writes data to a UART with interrupts enabled. Usage of this API is mutually exclusive with usage of UART_writePolling(). In other words, for an opened UART peripheral, either UART_write() or UART_writePolling() may be used, but not both.
In UART_MODE_BLOCKING, UART_write() will block task execution until all the data in buffer has been written.
handle | A UART_Handle |
buffer | A WO (write-only) pointer to buffer containing data to be written to the UART. |
size | The number of bytes in the buffer that should be written to the UART. |
void UART_writeCancel | ( | UART_Handle | handle | ) |
Function that cancels a UART_write() function call.
This function cancels a UART_write() operation to a UART peripheral.
handle | A UART_Handle |
int32_t UART_writePolling | ( | UART_Handle | handle, |
uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Function that writes data to a UART, polling the peripheral to wait until new data can be written. Usage of this API is mutually exclusive with usage of UART_write().
This function initiates an operation to write data to a UART controller.
UART_writePolling() will not return until all the data was written to the UART (or to its FIFO if applicable).
handle | A UART_Handle |
buffer | A pointer to the buffer containing the data to be written to the UART. |
size | The number of bytes in the buffer that should be written to the UART. |