USART Driver Library Interface

Detailed descriptions for this library can be found in the MPLAB® Harmony Documentation.
(found in the <harmony install directory>/doc folder)

System Functions

Function Name Description
DRV_USART_Initialize Initializes the USART instance for the specified driver index.
Implementation: Static/Dynamic
DRV_USART_Deinitialize Deinitializes the specified instance of the USART driver module.
Implementation: Static/Dynamic
DRV_USART_Status Gets the current status of the USART driver module.
Implementation: Dynamic
DRV_USART_TasksReceive Maintains the driver's receive state machine and implements its ISR.
Implementation: Dynamic
DRV_USART_TasksTransmit Maintains the driver's transmit state machine and implements its ISR.
Implementation: Dynamic
DRV_USART_TasksError Maintains the driver's error state machine and implements its ISR.
Implementation: Dynamic

Core Client Functions

Function Name Description
DRV_USART_Open Opens the specified USART driver instance and returns a handle to it.
Implementation: Dynamic
DRV_USART_Close Closes an opened-instance of the USART driver.
Implementation: Dynamic
DRV_USART_ClientStatus Gets the current client-specific status the USART driver.
Implementation: Dynamic
DRV_USART_ErrorGet This function returns the error(if any) associated with the last client request.
Implementation: Dynamic

Communication Management Client Functions

Function Name Description
DRV_USART_BaudSet This function changes the USART module baud to the specified value.
Implementation: Dynamic
DRV_USART_LineControlSet This function changes the USART module line control to the specified value.
Implementation: Dynamic

Buffer Queue Read/Write Client Functions

Function Name Description
DRV_USART_BufferAddRead Schedule a non-blocking driver read operation.
Implementation: Dynamic
DRV_USART_BufferAddWrite Schedule a non-blocking driver write operation.
Implementation: Dynamic
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.
Implementation: Dynamic
DRV_USART_BufferProcessedSizeGet This function returns number of bytes that have been processed for the specified buffer.
Implementation: Dynamic

File I/O Type Read/Write Functions

Function Name Description
DRV_USART_Read Reads data from the USART.
Implementation: Dynamic
DRV_USART_Write Writes data to the USART.
Implementation: Dynamic

Byte Transfer Functions

Function Name Description
DRV_USART_ReadByte Reads a byte of data from the USART.
Implementation: Static/Dynamic
DRV_USART_WriteByte Writes a byte of data to the USART.
Implementation: Static/Dynamic
DRV_USART_TransmitBufferSizeGet Returns the size of the transmit buffer.
Implementation: Dynamic
DRV_USART_ReceiverBufferSizeGet Returns the size of the receive buffer.
Implementation: Dynamic
DRV_USART_TransferStatus Returns the transmitter and receiver transfer status.
Implementation: Dynamic
DRV_USART_TransmitBufferIsFull Provides the status of the driver's transmit buffer.
Implementation: Dynamic
DRV_USART_ReceiverBufferIsEmpty Provides the status of the driver's receive buffer.
Implementation: Static/Dynamic

Data Types and Constants

Name Description
DRV_USART_CLIENT_STATUS Defines the client-specific status of the USART driver.
DRV_USART_INIT Defines the data required to initialize or reinitialize the USART driver
DRV_USART_INIT_FLAGS Flags identifying features that can be enabled when the driver is initialized.
DRV_USART_TRANSFER_STATUS Specifies the status of the receive or transmit
DRV_USART_INDEX_0 USART driver index definitions
DRV_USART_INDEX_1 This is macro DRV_USART_INDEX_1.
DRV_USART_INDEX_2 This is macro DRV_USART_INDEX_2.
DRV_USART_INDEX_3 This is macro DRV_USART_INDEX_3.
DRV_USART_INDEX_4 This is macro DRV_USART_INDEX_4.
DRV_USART_INDEX_5 This is macro DRV_USART_INDEX_5.
DRV_USART_BAUD_SET_RESULT Identifies the handshaking modes supported by the USART driver.
DRV_USART_BUFFER_EVENT Identifies the possible events that can result from a buffer add request.
DRV_USART_BUFFER_EVENT_HANDLER Pointer to a USART Driver Buffer Event handler function
DRV_USART_BUFFER_HANDLE Handle identifying a read or write buffer passed to the driver.
DRV_USART_ERROR Defines the possible errors that can occur during driver operation.
DRV_USART_LINE_CONTROL_SET_RESULT Identifies the results of the baud set function.
DRV_USART_OPERATION_MODE_DATA Defines the initialization data required for different operation modes of USART.
DRV_USART_BUFFER_HANDLE_INVALID Definition of an invalid buffer handle.
DRV_USART_COUNT Number of valid USART drivers
DRV_USART_READ_ERROR USART Driver Read Error.
DRV_USART_WRITE_ERROR USART Driver Write Error.
DRV_USART_LINE_CONTROL Identifies the line control modes supported by the USART driver.
DRV_USART_OPERATION_MODE Identifies the modes of the operation of the USART module
© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.