4.26.2 EUSART - Enhanced USART
Enhanced Universal Synchronous Asynchronous Receiver Transmitter
4.26.2.1 Introduction
The Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) module is a serial I/O communications peripheral. It contains all the clock generators, shift registers and data buffers necessary to perform an input or output serial data transfer independent of device program execution. The EUSART, also known as a Serial Communications Interface (SCI), can be configured as a full-duplex asynchronous system or half-duplex synchronous system.
4.26.2.2 Supported Device Families
PIC12/16F150x | PIC12/16F157x | PIC12/16F161x |
PIC12/16F184x | PIC12/16LF155x | PIC16F145x |
PIC16F151x | PIC16F152x | PIC16F152xx |
PIC16F153xx | PIC16F170x | PIC16F171x |
PIC16F171xx | PIC16F176x | PIC16F177x |
PIC16F178x | PIC16F180xx | PIC16F181xx |
PIC16F183xx | PIC16F184xx | PIC16F188xx |
PIC16F191xx | PIC16F194x | PIC16LF156x |
PIC16LF190x | PIC18F-K20 | PIC18F-K22 |
PIC18F-K40 | PIC18F-K50 | PIC18F-K80 |
PIC18F-K90 | PIC18F-Q10 |
4.26.2.3 Required header files:
#include "mcc_generated_files/uart/eusart.h"
4.26.2.4 How to use the EUSART PLIB Driver
For use cases for the EUSART, see: How to use the UART Driver.
The examples there use the portable API interface of the driver, but could easily be modified to directly us the PLIB API.
4.26.2.5 Module Documentation
4.26.2.5.1 EUSART
This file contains API prototypes and other datatypes for the Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
Module description
This file contains API prototypes and other datatypes for the Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
Data structures
struct eusart_status_t
Functions
void EUSART_Initialize (void)
This API initializes the EUSART driver. This routine initializes the EUSART module. This is the first called EUSART routine, and it must only be called during the system initialization.
void EUSART_Deinitialize (void)
This API disables the EUSART driver. This routine disables the EUSART module.
void EUSART_Enable (void)
This API enables the EUSART module.
void EUSART_Disable (void)
This API disables the EUSART module.
void EUSART_TransmitEnable (void)
This API enables the EUSART transmitter. The EUSART must be enabled to sent the bytes over to the TX pin.
void EUSART_TransmitDisable (void)
This API disables the EUSART transmitter.
void EUSART_ReceiveEnable (void)
This API enables the EUSART receiver. The EUSART must be enabled to receive the bytes sent by the RX pin.
void EUSART_ReceiveDisable (void)
This API disables the EUSART receiver.
void EUSART_TransmitInterruptEnable (void)
This API enables the EUSART transmitter interrupt.
void EUSART_TransmitInterruptDisable (void)
This API disables the EUSART transmitter interrupt.
void EUSART_ReceiveInterruptEnable (void)
This API enables the EUSART receiver interrupt.
void EUSART_ReceiveInterruptDisable (void)
This API disables the EUSART receiver interrupt.
void EUSART_SendBreakControlEnable (void)
This API enables the EUSART to send a break control.
void EUSART_SendBreakControlDisable (void)
This API disables the EUSART send break control.
void EUSART_AutoBaudSet (bool enable)
This API enables the EUSART AutoBaud Detection (ABR).
bool EUSART_AutoBaudQuery (void)
This API reads the EUSART ABR Complete bit.
bool EUSART_IsAutoBaudDetectOverflow (void)
This API reads the EUSART ABR Overflow bit.
void EUSART_AutoBaudDetectOverflowReset (void)
This API resets the EUSART ABR Overflow bit.
bool EUSART_IsRxReady (void)
This API checks if the EUSART has received available data.
bool EUSART_IsTxReady (void)
This function checks if the EUSART transmitter is ready to accept a data byte.
bool EUSART_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
void EUSART_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon Transmitter interrupt.
void EUSART_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon receiver interrupt.
void EUSART_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
Variables
const uart_drv_interface_t UART1
External object for eusart_interface.
void(* EUSART_TxInterruptHandler )(void)
This indicates the function that will be called upon transmit interrupt.
void(* EUSART_RxInterruptHandler )(void)
This indicates the function that will be called upon receive interrupt.
Function Documentation
EUSART_AutoBaudDetectOverflowReset()
void EUSART_AutoBaudDetectOverflowReset (void )[inline]
This API resets the EUSART ABR Overflow bit.
None. |
None. |
EUSART_AutoBaudQuery()
bool EUSART_AutoBaudQuery (void )[inline]
This API reads the EUSART ABR Complete bit.
None. |
bool. |
EUSART_AutoBaudSet()
void EUSART_AutoBaudSet (bool enable)[inline]
This API enables the EUSART AutoBaud Detection (ABR).
bool |
enable. |
None. |
EUSART_Deinitialize()
void EUSART_Deinitialize (void )
This API disables the EUSART driver. This routine disables the EUSART module.
None. |
None. |
EUSART_Disable()
void EUSART_Disable (void )[inline]
This API disables the EUSART module.
None. |
None. |
EUSART_Enable()
void EUSART_Enable (void )[inline]
This API enables the EUSART module.
None. |
None. |
EUSART_ErrorGet()
size_t EUSART_ErrorGet (void )
This function receives the error status of the last read byte.
None. |
Status of the last read byte. See eusart_status_t struct for more details. |
EUSART_FramingErrorCallbackRegister()
void EUSART_FramingErrorCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon framing error.
callbackHandler |
- a function pointer which will be called upon framing error condition. |
None. |
EUSART_Initialize()
void EUSART_Initialize (void )
This API initializes the EUSART driver. This routine initializes the EUSART module. This is the first called EUSART routine, and it must only be called during the system initialization.
None. |
None. |
Section: EUSART APIs
EUSART_IsAutoBaudDetectOverflow()
bool EUSART_IsAutoBaudDetectOverflow (void )[inline]
This API reads the EUSART ABR Overflow bit.
None. |
None. |
EUSART_IsRxReady()
bool EUSART_IsRxReady (void )
This API checks if the EUSART has received available data.
None. |
true |
if EUSART receiver FIFO has a data |
false |
EUSART receiver FIFO is empty |
EUSART_IsTxDone()
bool EUSART_IsTxDone (void )
This function returns the status of Transmit Shift Register (TSR).
None. |
true |
if Data completely shifted out from the TSR |
false |
if Data is present in Transmit FIFO and/or in TSR |
EUSART_IsTxReady()
bool EUSART_IsTxReady (void )
This function checks if the EUSART transmitter is ready to accept a data byte.
None. |
true |
if EUSART transmitter FIFO has atleast 1 byte space |
false |
if EUSART transmitter FIFO is full |
EUSART_OverrunErrorCallbackRegister()
void EUSART_OverrunErrorCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon overrun error.
callbackHandler |
- a function pointer which will be called upon overrun error condition. |
None. |
EUSART_Read()
uint8_t EUSART_Read (void )
This function reads the 8 bits from the FIFO register receiver.
The transfer status must be checked to see if the receiver is not empty before calling this function. Verify the EUSART_IsRxReady(), before calling this API. |
None. |
8-bit data from RX FIFO register. |
EUSART_ReceiveDisable()
void EUSART_ReceiveDisable (void )[inline]
This API disables the EUSART receiver.
None. |
None. |
EUSART_ReceiveEnable()
void EUSART_ReceiveEnable (void )[inline]
This API enables the EUSART receiver. The EUSART must be enabled to receive the bytes sent by the RX pin.
None. |
None. |
EUSART_ReceiveInterruptDisable()
void EUSART_ReceiveInterruptDisable (void )[inline]
This API disables the EUSART receiver interrupt.
None. |
None. |
EUSART_ReceiveInterruptEnable()
void EUSART_ReceiveInterruptEnable (void )[inline]
This API enables the EUSART receiver interrupt.
None. |
None. |
EUSART_ReceiveISR()
void EUSART_ReceiveISR (void )
This ISR function is called upon receiver interrupt.
void. |
None. |
EUSART_RxCompleteCallbackRegister()
void EUSART_RxCompleteCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon receiver interrupt.
callbackHandler |
- a function pointer which will be called upon receiver interrupt condition. |
None. |
EUSART_SendBreakControlDisable()
void EUSART_SendBreakControlDisable (void )[inline]
This API disables the EUSART send break control.
None. |
None. |
EUSART_SendBreakControlEnable()
void EUSART_SendBreakControlEnable (void )[inline]
This API enables the EUSART to send a break control.
None. |
None. |
EUSART_TransmitDisable()
void EUSART_TransmitDisable (void )[inline]
This API disables the EUSART transmitter.
None. |
None. |
EUSART_TransmitEnable()
void EUSART_TransmitEnable (void )[inline]
This API enables the EUSART transmitter. The EUSART must be enabled to sent the bytes over to the TX pin.
None. |
None. |
EUSART_TransmitInterruptDisable()
void EUSART_TransmitInterruptDisable (void )[inline]
This API disables the EUSART transmitter interrupt.
None. |
None. |
EUSART_TransmitInterruptEnable()
void EUSART_TransmitInterruptEnable (void )[inline]
This API enables the EUSART transmitter interrupt.
None. |
None. |
EUSART_TransmitISR()
void EUSART_TransmitISR (void )
This ISR function is called upon transmitter interrupt.
void. |
None. |
EUSART_TxCompleteCallbackRegister()
void EUSART_TxCompleteCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon Transmitter interrupt.
callbackHandler |
- a function pointer which will be called upon transmitter interrupt condition. |
None. |
EUSART_Write()
void EUSART_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
The transfer status must be checked to see if the transmitter is ready to accept a byte before calling this function. Verify the EUSART_IsTxReady() before calling this API. |
txData |
- Data byte to write to the TX FIFO. |
None. |
Variable Documentation
EUSART_RxInterruptHandler
void(* EUSART_RxInterruptHandler) (void)
This indicates the function that will be called upon receive interrupt.
Initialize the EUSART module with receive interrupt enabled |
None. |
None. |
EUSART_TxInterruptHandler
void(* EUSART_TxInterruptHandler) (void)
This indicates the function that will be called upon transmit interrupt.
Initialize the EUSART module with transmit interrupt enabled |
None. |
None. |
UART1
const uart_drv_interface_t UART1
External object for eusart_interface.
Section: Driver Interface
4.26.2.5.2 UART_DRV_INTERFACE
This file contains APIs for the Universal Asynchronous Receiver-Transmitter module.
This file contains APIs for the Universal Asynchronous Receiver-Transmitter module.
4.26.2.5.3 UART_TYPES
This file contains APIs for UART module.
This file contains APIs for UART module.
4.26.2.6 Class Documentation
4.26.2.6.1 eusart_status_t Struct Reference
Detailed Description
@breif This is a structre defined for errors in reception of data.
#include <eusart.h>
Public Attributes
Member Data Documentation
@1
struct { ... }
ferr
uint8_t ferr
This is a bit field for Framing Error status
oerr
uint8_t oerr
This is a bit field for Overfrun Error status
perr
uint8_t perr
This is a bit field for Parity Error status
reserved
uint8_t reserved
Reserved
status
size_t status
Group byte for status errors
4.26.2.6.2 uart_drv_interface_t Struct Reference
Structure containing the function pointers of UART driver.
Detailed Description
Structure containing the function pointers of UART driver.
Section: Included Files Section: Data Type Definitions
#include <uart_drv_interface.h>
Public Attributes
void(* Initialize )(void)
void(* Deinitialize )(void)
uint8_t(* Read )(void)
void(* Write )(uint8_t)
bool(* IsRxReady )(void)
bool(* IsTxReady )(void)
bool(* IsTxDone )(void)
void(* TransmitEnable )(void)
void(* TransmitDisable )(void)
void(* AutoBaudSet )(bool enable)
bool(* AutoBaudQuery )(void)
bool(* AutoBaudEventEnableGet )(void)
void(* BRGCountSet )(uint32_t brgValue)
uint32_t(* BRGCountGet )(void)
void(* BaudRateSet )(uint32_t baudRate)
uint32_t(* BaudRateGet )(void)
size_t(* ErrorGet )(void)
void(* TxCompleteCallbackRegister )(void(*CallbackHandler)(void))
void(* RxCompleteCallbackRegister )(void(*CallbackHandler)(void))
void(* TxCollisionCallbackRegister )(void(*CallbackHandler)(void))
void(* FramingErrorCallbackRegister )(void(*CallbackHandler)(void))
void(* OverrunErrorCallbackRegister )(void(*CallbackHandler)(void))
void(* ParityErrorCallbackRegister )(void(*CallbackHandler)(void))
void(* EventCallbackRegister )(void(*CallbackHandler)(void))
Member Data Documentation
The documentation for this struct was generated from the following file:
source/
AutoBaudEventEnableGet
bool(* AutoBaudEventEnableGet) (void)
AutoBaudQuery
bool(* AutoBaudQuery) (void)
AutoBaudSet
void(* AutoBaudSet) (bool enable)
BaudRateGet
uint32_t(* BaudRateGet) (void)
BaudRateSet
void(* BaudRateSet) (uint32_t baudRate)
BRGCountGet
uint32_t(* BRGCountGet) (void)
BRGCountSet
void(* BRGCountSet) (uint32_t brgValue)
Deinitialize
void(* Deinitialize) (void)
ErrorGet
size_t(* ErrorGet) (void)
EventCallbackRegister
void(* EventCallbackRegister) (void(*CallbackHandler)(void))
FramingErrorCallbackRegister
void(* FramingErrorCallbackRegister) (void(*CallbackHandler)(void))
Initialize
void(* Initialize) (void)
IsRxReady
bool(* IsRxReady) (void)
IsTxDone
bool(* IsTxDone) (void)
IsTxReady
bool(* IsTxReady) (void)
OverrunErrorCallbackRegister
void(* OverrunErrorCallbackRegister) (void(*CallbackHandler)(void))
ParityErrorCallbackRegister
void(* ParityErrorCallbackRegister) (void(*CallbackHandler)(void))
Read
uint8_t(* Read) (void)
RxCompleteCallbackRegister
void(* RxCompleteCallbackRegister) (void(*CallbackHandler)(void))
TransmitDisable
void(* TransmitDisable) (void)
TransmitEnable
void(* TransmitEnable) (void)
TxCollisionCallbackRegister
void(* TxCollisionCallbackRegister) (void(*CallbackHandler)(void))
TxCompleteCallbackRegister
void(* TxCompleteCallbackRegister) (void(*CallbackHandler)(void))
Write
void(* Write) (uint8_t)
4.26.2.7 File Documentation
4.26.2.7.1 source/eusart.c File Reference
This is the generated driver implementation file for the EUSART driver using CCL.
#include "../eusart.h"
Functions
static void EUSART_DefaultFramingErrorCallback (void)
static void EUSART_DefaultOverrunErrorCallback (void)
void EUSART_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
void EUSART_Initialize (void)
This API initializes the EUSART driver. This routine initializes the EUSART module. This is the first called EUSART routine, and it must only be called during the system initialization.
void EUSART_Deinitialize (void)
This API disables the EUSART driver. This routine disables the EUSART module.
void EUSART_Enable (void)
This API enables the EUSART module.
void EUSART_Disable (void)
This API disables the EUSART module.
void EUSART_TransmitEnable (void)
This API enables the EUSART transmitter. The EUSART must be enabled to sent the bytes over to the TX pin.
void EUSART_TransmitDisable (void)
This API disables the EUSART transmitter.
void EUSART_ReceiveEnable (void)
This API enables the EUSART receiver. The EUSART must be enabled to receive the bytes sent by the RX pin.
void EUSART_ReceiveDisable (void)
This API disables the EUSART receiver.
void EUSART_SendBreakControlEnable (void)
This API enables the EUSART to send a break control.
void EUSART_SendBreakControlDisable (void)
This API disables the EUSART send break control.
void EUSART_AutoBaudSet (bool enable)
This API enables the EUSART AutoBaud Detection (ABR).
bool EUSART_AutoBaudQuery (void)
This API reads the EUSART ABR Complete bit.
bool EUSART_IsAutoBaudDetectOverflow (void)
This API reads the EUSART ABR Overflow bit.
void EUSART_AutoBaudDetectOverflowReset (void)
This API resets the EUSART ABR Overflow bit.
void EUSART_TransmitInterruptEnable (void)
This API enables the EUSART transmitter interrupt.
void EUSART_TransmitInterruptDisable (void)
This API disables the EUSART transmitter interrupt.
void EUSART_ReceiveInterruptEnable (void)
This API enables the EUSART receiver interrupt.
void EUSART_ReceiveInterruptDisable (void)
This API disables the EUSART receiver interrupt.
bool EUSART_IsRxReady (void)
This API checks if the EUSART has received available data.
bool EUSART_IsTxReady (void)
This function checks if the EUSART transmitter is ready to accept a data byte.
bool EUSART_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
void EUSART_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon receiver interrupt.
void EUSART_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon Transmitter interrupt.
Macros
#define EUSART_TX_BUFFER_SIZE (8)
#define EUSART_TX_BUFFER_MASK (EUSART_TX_BUFFER_SIZE - 1)
#define EUSART_RX_BUFFER_SIZE (8)
#define EUSART_RX_BUFFER_MASK (EUSART_RX_BUFFER_SIZE - 1)
Variables
const uart_drv_interface_t UART1
External object for eusart_interface.
static volatile uint8_t eusartTxHead = 0
static volatile uint8_t eusartTxTail = 0
static volatile uint8_t eusartTxBuffer [EUSART_TX_BUFFER_SIZE]
volatile uint8_t eusartTxBufferRemaining
static volatile uint8_t eusartRxHead = 0
static volatile uint8_t eusartRxTail = 0
static volatile uint8_t eusartRxBuffer [EUSART_RX_BUFFER_SIZE]
static volatile eusart_status_t eusartRxStatusBuffer [EUSART_RX_BUFFER_SIZE]
volatile uint8_t eusartRxCount
volatile eusart_status_t eusartRxLastError
void(* EUSART_TxInterruptHandler )(void)
void(* EUSART_RxInterruptHandler )(void)
void(* EUSART_FramingErrorHandler )(void)
void(* EUSART_OverrunErrorHandler )(void)
Detailed Description
This is the generated driver implementation file for the EUSART driver using CCL.
EUSART Generated Driver API Header File
Function Documentation
EUSART_DefaultFramingErrorCallback()
static void EUSART_DefaultFramingErrorCallback (void )[static]
EUSART_DefaultOverrunErrorCallback()
static void EUSART_DefaultOverrunErrorCallback (void )[static]
Macro Definition Documentation
EUSART_RX_BUFFER_MASK
#define EUSART_RX_BUFFER_MASK (EUSART_RX_BUFFER_SIZE - 1)
EUSART_RX_BUFFER_SIZE
#define EUSART_RX_BUFFER_SIZE (8)
EUSART_TX_BUFFER_MASK
#define EUSART_TX_BUFFER_MASK (EUSART_TX_BUFFER_SIZE - 1)
EUSART_TX_BUFFER_SIZE
#define EUSART_TX_BUFFER_SIZE (8)
Section: Included Files Section: Macro Declarations
Variable Documentation
EUSART_FramingErrorHandler
void(* EUSART_FramingErrorHandler) (void)
EUSART_OverrunErrorHandler
void(* EUSART_OverrunErrorHandler) (void)
EUSART_RxInterruptHandler
void(* EUSART_RxInterruptHandler) (void)
EUSART_TxInterruptHandler
void(* EUSART_TxInterruptHandler) (void)
Section: EUSART APIs
eusartRxBuffer
volatile uint8_t eusartRxBuffer[EUSART_RX_BUFFER_SIZE][static]
eusartRxCount
volatile uint8_t eusartRxCount
eusartRxHead
volatile uint8_t eusartRxHead = 0[static]
eusartRxLastError
volatile eusart_status_t eusartRxLastError
eusartRxStatusBuffer
volatile eusart_status_t eusartRxStatusBuffer[EUSART_RX_BUFFER_SIZE][static]
eusartRxTail
volatile uint8_t eusartRxTail = 0[static]
eusartTxBuffer
volatile uint8_t eusartTxBuffer[EUSART_TX_BUFFER_SIZE][static]
eusartTxBufferRemaining
volatile uint8_t eusartTxBufferRemaining
eusartTxHead
volatile uint8_t eusartTxHead = 0[static]
Section: EUSART variables
eusartTxTail
volatile uint8_t eusartTxTail = 0[static]
4.26.2.7.2 source/eusart.h File Reference
#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "../system/system.h" #include "uart_drv_interface.h"
Data structures
struct eusart_status_t
Functions
void EUSART_Initialize (void)
This API initializes the EUSART driver. This routine initializes the EUSART module. This is the first called EUSART routine, and it must only be called during the system initialization.
void EUSART_Deinitialize (void)
This API disables the EUSART driver. This routine disables the EUSART module.
void EUSART_Enable (void)
This API enables the EUSART module.
void EUSART_Disable (void)
This API disables the EUSART module.
void EUSART_TransmitEnable (void)
This API enables the EUSART transmitter. The EUSART must be enabled to sent the bytes over to the TX pin.
void EUSART_TransmitDisable (void)
This API disables the EUSART transmitter.
void EUSART_ReceiveEnable (void)
This API enables the EUSART receiver. The EUSART must be enabled to receive the bytes sent by the RX pin.
void EUSART_ReceiveDisable (void)
This API disables the EUSART receiver.
void EUSART_TransmitInterruptEnable (void)
This API enables the EUSART transmitter interrupt.
void EUSART_TransmitInterruptDisable (void)
This API disables the EUSART transmitter interrupt.
void EUSART_ReceiveInterruptEnable (void)
This API enables the EUSART receiver interrupt.
void EUSART_ReceiveInterruptDisable (void)
This API disables the EUSART receiver interrupt.
void EUSART_SendBreakControlEnable (void)
This API enables the EUSART to send a break control.
void EUSART_SendBreakControlDisable (void)
This API disables the EUSART send break control.
void EUSART_AutoBaudSet (bool enable)
This API enables the EUSART AutoBaud Detection (ABR).
bool EUSART_AutoBaudQuery (void)
This API reads the EUSART ABR Complete bit.
bool EUSART_IsAutoBaudDetectOverflow (void)
This API reads the EUSART ABR Overflow bit.
void EUSART_AutoBaudDetectOverflowReset (void)
This API resets the EUSART ABR Overflow bit.
bool EUSART_IsRxReady (void)
This API checks if the EUSART has received available data.
bool EUSART_IsTxReady (void)
This function checks if the EUSART transmitter is ready to accept a data byte.
bool EUSART_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
void EUSART_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon Transmitter interrupt.
void EUSART_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon receiver interrupt.
void EUSART_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
Macros
#define UART1_interface UART1
#define UART1_Initialize EUSART_Initialize
#define UART1_Write EUSART_Write
#define UART1_Read EUSART_Read
#define UART1__IsRxReady EUSART_IsRxReady
#define UART1_IsTxReady EUSART_IsTxReady
#define UART1_IsTxDone EUSART_IsTxDone
#define UART1_AutoBaudSet EUSART_AutoBaudSet
#define UART1_BRGCountSet (NULL)
#define UART1_BRGCountGet (NULL)
#define UART1_BaudRateSet (NULL)
#define UART1_BaudRateGet (NULL)
#define UART1__AutoBaudEventEnableGet (NULL)
#define UART1_ErrorGet EUSART_ErrorGet
#define UART1_TxCompleteCallbackRegister EUSART_TxCompleteCallbackRegister
#define UART1_RxCompleteCallbackRegister EUSART_RxCompleteCallbackRegister
#define UART1_TxCollisionCallbackRegister (NULL)
#define UART1_FramingErrorCallbackRegister EUSART_FramingErrorCallbackRegister
#define UART1_OverrunErrorCallbackRegister EUSART_OverrunErrorCallbackRegister
#define UART1_ParityErrorCallbackRegister (NULL)
#define UART1_EventCallbackRegister (NULL)
Variables
const uart_drv_interface_t UART1
External object for eusart_interface.
void(* EUSART_TxInterruptHandler )(void)
This indicates the function that will be called upon transmit interrupt.
void(* EUSART_RxInterruptHandler )(void)
This indicates the function that will be called upon receive interrupt.
Detailed Description
EUSART Generated Driver API Header File
Macro Definition Documentation
UART1__AutoBaudEventEnableGet
#define UART1__AutoBaudEventEnableGet (NULL)
UART1__IsRxReady
#define UART1__IsRxReady EUSART_IsRxReady
UART1_AutoBaudQuery
#define UART1_AutoBaudQuery EUSART_AutoBaudQuery
UART1_AutoBaudSet
#define UART1_AutoBaudSet EUSART_AutoBaudSet
UART1_BaudRateGet
#define UART1_BaudRateGet (NULL)
UART1_BaudRateSet
#define UART1_BaudRateSet (NULL)
UART1_BRGCountGet
#define UART1_BRGCountGet (NULL)
UART1_BRGCountSet
#define UART1_BRGCountSet (NULL)
UART1_Deinitialize
#define UART1_Deinitialize EUSART_Deinitialize
UART1_ErrorGet
#define UART1_ErrorGet EUSART_ErrorGet
UART1_EventCallbackRegister
#define UART1_EventCallbackRegister (NULL)
UART1_FramingErrorCallbackRegister
#define UART1_FramingErrorCallbackRegister EUSART_FramingErrorCallbackRegister
UART1_Initialize
#define UART1_Initialize EUSART_Initialize
UART1_interface
#define UART1_interface UART1
UART1_IsTxDone
#define UART1_IsTxDone EUSART_IsTxDone
UART1_IsTxReady
#define UART1_IsTxReady EUSART_IsTxReady
UART1_OverrunErrorCallbackRegister
#define UART1_OverrunErrorCallbackRegister EUSART_OverrunErrorCallbackRegister
UART1_ParityErrorCallbackRegister
#define UART1_ParityErrorCallbackRegister (NULL)
UART1_Read
#define UART1_Read EUSART_Read
UART1_RxCompleteCallbackRegister
#define UART1_RxCompleteCallbackRegister EUSART_RxCompleteCallbackRegister
UART1_TransmitDisable
#define UART1_TransmitDisable EUSART_TransmitDisable
UART1_TransmitEnable
#define UART1_TransmitEnable EUSART_TransmitEnable
UART1_TxCollisionCallbackRegister
#define UART1_TxCollisionCallbackRegister (NULL)
UART1_TxCompleteCallbackRegister
#define UART1_TxCompleteCallbackRegister EUSART_TxCompleteCallbackRegister
UART1_Write
#define UART1_Write EUSART_Write
4.26.2.7.3 source/uart_drv_interface.h File Reference
#include <stdbool.h> #include <stdint.h> #include "uart_types.h"
Data structures
struct uart_drv_interface_t
Structure containing the function pointers of UART driver.
Detailed Description
UART Generated Driver Interface Header File
4.26.2.7.4 source/uart_types.h File Reference
#include <stdbool.h> #include <stdint.h>
Enumerations
enum UART_STANDARD_BAUDS { UART_110 = 0, UART_300 = 1, UART_600 = 2, UART_1200 = 3, UART_2400 = 4, UART_4800 = 5, UART_9600 = 6, UART_14400 = 7, UART_19200 = 8, UART_38400 = 9, UART_57600 = 10, UART_115200 = 11, UART_230400 = 12, UART_460800 = 13, UART_921600 = 14 }
This Enum can be used to set the UART standard baud rates using UARTx_BRGSet function e.g. UART1_BRGSet.
Detailed Description
UART Generated Driver Interface Header File
Enumeration Type Documentation
UART_STANDARD_BAUDS
enum UART_STANDARD_BAUDS
This Enum can be used to set the UART standard baud rates using UARTx_BRGSet function e.g. UART1_BRGSet.
Section: Included Files Section: Data Type Definitions
UART_110 | |
UART_300 | |
UART_600 | |
UART_1200 | |
UART_2400 | |
UART_4800 | |
UART_9600 | |
UART_14400 | |
UART_19200 | |
UART_38400 | |
UART_57600 | |
UART_115200 | |
UART_230400 | |
UART_460800 | |
UART_921600 |