AM273x MCU+ SDK  09.02.00

Introduction

This file contains the prototype of UART driver APIs.

Go to the source code of this file.

Data Structures

struct  UART_Transaction
 Data structure used with UART_read() and UART_write() More...
 
struct  UART_Params
 UART Parameters. More...
 
struct  UART_Attrs
 UART instance attributes - used during init time. More...
 
struct  UART_EdmaParams
 UART EDMA Parameters. More...
 
struct  UART_Object
 UART driver object. More...
 
struct  UART_Config
 UART global configuration array. More...
 

Macros

Transfer Status Code

Status codes that are set by the UART driver

#define UART_TRANSFER_STATUS_SUCCESS   (0U)
 Transaction success. More...
 
#define UART_TRANSFER_STATUS_TIMEOUT   (1U)
 Time out error. More...
 
#define UART_TRANSFER_STATUS_ERROR_BI   (2U)
 Break condition error. More...
 
#define UART_TRANSFER_STATUS_ERROR_FE   (3U)
 Framing error. More...
 
#define UART_TRANSFER_STATUS_ERROR_PE   (4U)
 Parity error. More...
 
#define UART_TRANSFER_STATUS_ERROR_OE   (5U)
 Overrun error. More...
 
#define UART_TRANSFER_STATUS_CANCELLED   (6U)
 Cancelled. More...
 
#define UART_TRANSFER_STATUS_STARTED   (7U)
 Transaction started. More...
 
#define UART_TRANSFER_STATUS_READ_TIMEOUT   (8U)
 Read timeout error. More...
 
#define UART_TRANSFER_STATUS_ERROR_INUSE   (9U)
 UART is currently in use. More...
 
#define UART_TRANSFER_STATUS_ERROR_OTH   (10U)
 Other errors. More...
 
Transfer Mode

This determines whether the driver operates synchronously or asynchronously

In UART_TRANSFER_MODE_BLOCKING mode UART_read() and UART_write() blocks code execution until the transaction has completed

In UART_TRANSFER_MODE_CALLBACK UART_read() and UART_write() does not block code execution and instead calls a UART_CallbackFxn callback function when the transaction has completed

#define UART_TRANSFER_MODE_BLOCKING   (0U)
 UART read/write APIs blocks execution. This mode can only be used when called within a Task context. More...
 
#define UART_TRANSFER_MODE_CALLBACK   (1U)
 UART read/write APIs does not block code execution and will call a UART_CallbackFxn. This mode can be used in a Task, Swi, or Hwi context. More...
 
UART data length

Note: The values should not be changed since it represents the actual register configuration values used to configure the UART

#define UART_LEN_1   (0U)
 
#define UART_LEN_2   (1U)
 
#define UART_LEN_3   (2U)
 
#define UART_LEN_4   (3U)
 
#define UART_LEN_5   (4U)
 
#define UART_LEN_6   (5U)
 
#define UART_LEN_7   (6U)
 
#define UART_LEN_8   (7U)
 
UART stop bits

Note: The values should not be changed since it represents the actual register configuration values used to configure the UART

#define UART_STOPBITS_1   (0U)
 
#define UART_STOPBITS_2   (1U)
 
UART Parity

Note: The values should not be changed since it represents the actual register configuration values used to configure the UART

#define UART_PARITY_NONE   (0x00U)
 
#define UART_PARITY_ODD   (0x01U)
 
#define UART_PARITY_EVEN   (0x03U)
 
UART Configration Mode

This determines whether the driver configuration mode like Polled, Interrupt, Dma used for the transfer function

#define UART_CONFIG_MODE_POLLED   (0x00U)
 
#define UART_CONFIG_MODE_INTERRUPT   (0x01U)
 
#define UART_CONFIG_MODE_USER_INTR   (0x02U)
 
#define UART_CONFIG_MODE_DMA   (0x03U)
 

Typedefs

typedef void * UART_Handle
 A handle that is returned from a UART_open() call. More...
 
typedef void(* UART_CallbackFxn) (UART_Handle handle, UART_Transaction *transaction)
 The definition of a callback function used by the UART driver when used in UART_TRANSFER_MODE_CALLBACK. More...
 

Functions

void UART_init (void)
 This function initializes the UART module. More...
 
void UART_deinit (void)
 This function de-initializes the UART module. More...
 
UART_Handle UART_open (uint32_t index, const UART_Params *prms)
 This function opens a given UART peripheral. More...
 
void UART_close (UART_Handle handle)
 Function to close a UART peripheral specified by the UART handle. More...
 
int32_t UART_write (UART_Handle handle, UART_Transaction *trans)
 Function to perform UART write operation. More...
 
int32_t UART_read (UART_Handle handle, UART_Transaction *trans)
 Function to perform UART read operation. More...
 
int32_t UART_writeCancel (UART_Handle handle, UART_Transaction *trans)
 Function to perform UART canceling of current write transaction. More...
 
int32_t UART_readCancel (UART_Handle handle, UART_Transaction *trans)
 Function to perform UART canceling of current read transaction. More...
 
UART_Handle UART_getHandle (uint32_t index)
 Function to return a open'ed UART handle given a UART instance index. More...
 
void UART_flushTxFifo (UART_Handle handle)
 Function to flush a TX FIFO of peripheral specified by the UART handle. More...
 
static void UART_Params_init (UART_Params *prms)
 Function to initialize the UART_Params struct to its defaults. More...
 
static void UART_Transaction_init (UART_Transaction *trans)
 Function to initialize the UART_Transaction struct to its defaults. More...
 

Variables

UART_Config gUartConfig []
 Externally defined driver configuration array. More...
 
uint32_t gUartConfigNum
 Externally defined driver configuration array size. More...