1.1.9.4 Library Interface

USART driver library provides the following interfaces:

Functions

NameDescriptionAsynchronous ModeSynchronous Mode
DRV_USART_InitializeInitializes the USART instance for the specified driver indexYesYes
DRV_USART_StatusGets the current status of the USART driver moduleYesYes
DRV_USART_OpenOpens the specified USART driver instance and returns a handle to itYesYes
DRV_USART_CloseCloses an opened-instance of the USART driverYesYes
DRV_USART_ErrorGetGets the USART hardware errors associated with the transfer requestYesYes
DRV_USART_SerialSetupSets the USART serial communication settings dynamicallyYesYes
DRV_USART_BufferEventHandlerSetAllows a client to identify a buffer event handling function for the driver to call back when queued buffer transfers have finishedYesNo
DRV_USART_WriteBufferAddQueues a write operationYesNo
DRV_USART_ReadBufferAddQueues a read operationYesNo
DRV_USART_BufferCompletedBytesGetReturns the number of bytes that have been processed for the specified buffer requestYesNo
DRV_USART_BufferStatusGetReturns the transmit/receive request statusYesNo
DRV_USART_WriteQueuePurgeRemoves all write requests from the queue for the given client. This API does not abort the on-going write transferYesNo
DRV_USART_ReadQueuePurgeRemoves all buffer requests from the queue for the given client and also aborts the on-going read requestYesNo
DRV_USART_ReadAbortAborts an on-going read requestYesNo
DRV_USART_WriteBufferThis is a blocking function that writes data over USARTNoYes
DRV_USART_ReadBufferThis is a blocking function that reads data over USARTNoYes

Data types and constants

NameTypeDescription
DRV_USART_BUFFER_HANDLETypedefHandle identifying a read or write buffer passed to the driver
DRV_USART_BUFFER_HANDLE_INVALIDMacroDefinition of an invalid buffer handle
DRV_USART_BUFFER_EVENTEnumIdentifies the possible events that can result from a buffer add request
DRV_USART_BUFFER_EVENT_HANDLERTypedefPointer to a USART Driver Buffer Event handler function
DRV_USART_ERROREnumDefines the different types of errors for USART driver
DRV_USART_INITStructDefines the data required to initialize the USART driver
DRV_USART_SERIAL_SETUPStructDefines the data required to dynamically set the serial settings.