Jump to main content

##

# 1.1.9.4 Library Interface

USART driver library provides the following interfaces:

Functions

Name | Description | Asynchronous Mode | Synchronous Mode
--- | --- | --- | ---
DRV_USART_Initialize | Initializes the USART instance for the specified driver index | Yes | Yes
DRV_USART_Status | Gets the current status of the USART driver module | Yes | Yes
DRV_USART_Open | Opens the specified USART driver instance and returns a handle to it | Yes | Yes
DRV_USART_Close | Closes an opened-instance of the USART driver | Yes | Yes
DRV_USART_ErrorGet | Gets the USART hardware errors associated with the transfer request | Yes | Yes
DRV_USART_SerialSetup | Sets the USART serial communication settings dynamically | Yes | Yes
DRV_USART_BufferEventHandlerSet | Allows a client to identify a buffer event handling function for the driver to call back when queued buffer transfers have finished | Yes | No
DRV_USART_WriteBufferAdd | Queues a write operation | Yes | No
DRV_USART_ReadBufferAdd | Queues a read operation | Yes | No
DRV_USART_BufferCompletedBytesGet | Returns the number of bytes that have been processed for the specified buffer request | Yes | No
DRV_USART_BufferStatusGet | Returns the transmit/receive request status | Yes | No
DRV_USART_WriteQueuePurge | Removes all write requests from the queue for the given client. This API does not abort the on-going write transfer | Yes | No
DRV_USART_ReadQueuePurge | Removes all buffer requests from the queue for the given client and also aborts the on-going read request | Yes | No
DRV_USART_ReadAbort | Aborts an on-going read request | Yes | No
DRV_USART_WriteBuffer | This is a blocking function that writes data over USART | No | Yes
DRV_USART_ReadBuffer | This is a blocking function that reads data over USART | No | Yes

Data types and constants

Name | Type | Description
--- | --- | ---
DRV_USART_BUFFER_HANDLE | Typedef | Handle identifying a read or write buffer passed to the driver
DRV_USART_BUFFER_HANDLE_INVALID | Macro | Definition of an invalid buffer handle
DRV_USART_BUFFER_EVENT | Enum | Identifies the possible events that can result from a buffer add request
DRV_USART_BUFFER_EVENT_HANDLER | Typedef | Pointer to a USART Driver Buffer Event handler function
DRV_USART_ERROR | Enum | Defines the different types of errors for USART driver
DRV_USART_INIT | Struct | Defines the data required to initialize the USART driver
DRV_USART_SERIAL_SETUP | Struct | Defines the data required to dynamically set the serial settings.