3.26.2 EUSART - Enhanced USART
Enhanced Universal Synchronous Asynchronous Receiver Transmitter
3.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.
3.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 |
3.26.2.3 Required header files:
#include "mcc_generated_files/uart/eusart.h"
3.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.
3.26.2.5 Module Documentation
3.26.2.5.1 EUSART1
This file contains API prototypes and other datatypes for the Enhanced Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
Module description
This file contains API prototypes and other datatypes for the Enhanced Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
Data structures
struct eusart1_status_t
This is a structure defined for errors in reception of data.
Functions
void EUSART1_Initialize (void)
Initializes the EUSART1 module. This routine is called only once during system initialization, before calling other APIs.
void EUSART1_Deinitialize (void)
Deinitializes and disables the EUSART1 module.
void EUSART1_Enable (void)
This API enables the EUSART1 module.
void EUSART1_Disable (void)
This API disables the EUSART1 module.
void EUSART1_TransmitEnable (void)
This API enables the EUSART1 transmitter. The EUSART1 must be enabled to send the bytes over to the TX pin.
void EUSART1_TransmitDisable (void)
This API disables the EUSART1 transmitter.
void EUSART1_ReceiveEnable (void)
This API enables the EUSART1 receiver. The EUSART1 must be enabled to receive the bytes sent by the RX pin.
void EUSART1_ReceiveDisable (void)
This API disables the EUSART1 receiver.
void EUSART1_TransmitInterruptEnable (void)
This API enables the EUSART1 transmitter interrupt.
void EUSART1_TransmitInterruptDisable (void)
This API disables the EUSART1 transmitter interrupt.
void EUSART1_ReceiveInterruptEnable (void)
This API enables the EUSART1 receiver interrupt.
void EUSART1_ReceiveInterruptDisable (void)
This API disables the EUSART1 receiver interrupt.
void EUSART1_SendBreakControlEnable (void)
This API enables the EUSART1 to send a break control.
void EUSART1_SendBreakControlDisable (void)
This API disables the EUSART1 send break control.
void EUSART1_AutoBaudSet (bool enable)
This API enables the EUSART1 AutoBaud Detection (ABR).
bool EUSART1_AutoBaudQuery (void)
This API reads the EUSART1 ABR Complete bit.
bool EUSART1_IsAutoBaudDetectOverflow (void)
This API reads the EUSART1 ABR Overflow bit.
void EUSART1_AutoBaudDetectOverflowReset (void)
This API resets the EUSART1 ABR Overflow bit.
bool EUSART1_IsRxReady (void)
This API checks if the EUSART1 has received available data.
bool EUSART1_IsTxReady (void)
This function checks if the EUSART1 transmitter is ready to accept a data byte.
bool EUSART1_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART1_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART1_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART1_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
void EUSART1_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART1_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART1_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully transmitted.
void EUSART1_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART1_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully received.
void EUSART1_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
int getch (void)
This function used to printf support for reads the 8 bits from the FIFO register receiver.
void putch (char txData)
This function used to printf support for writes a byte of data to the transmitter FIFO register.
Variables
const uart_drv_interface_t UART1
External object for eusart1_interface.
void(* EUSART1_TxInterruptHandler )(void)
This indicates the function that will be called upon transmit interrupt.
void(* EUSART1_RxInterruptHandler )(void)
This indicates the function that will be called upon receive interrupt.
Function Documentation
EUSART1_AutoBaudDetectOverflowReset()
void EUSART1_AutoBaudDetectOverflowReset (void )
This API resets the EUSART1 ABR Overflow bit.
None. |
None. |
EUSART1_AutoBaudQuery()
bool EUSART1_AutoBaudQuery (void )
This API reads the EUSART1 ABR Complete bit.
None. |
bool. |
EUSART1_AutoBaudSet()
void EUSART1_AutoBaudSet (bool enable)
This API enables the EUSART1 AutoBaud Detection (ABR).
bool |
enable. |
None. |
EUSART1_Deinitialize()
void EUSART1_Deinitialize (void )
Deinitializes and disables the EUSART1 module.
None. |
None. |
EUSART1_Disable()
void EUSART1_Disable (void )
This API disables the EUSART1 module.
None. |
None. |
EUSART1_Enable()
void EUSART1_Enable (void )
This API enables the EUSART1 module.
None. |
None. |
EUSART1_ErrorGet()
size_t EUSART1_ErrorGet (void )
This function receives the error status of the last read byte.
None. |
Status of the last read byte. See eusart1_status_t struct for more details. |
EUSART1_FramingErrorCallbackRegister()
void EUSART1_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. |
EUSART1_Initialize()
void EUSART1_Initialize (void )
Initializes the EUSART1 module. This routine is called only once during system initialization, before calling other APIs.
None. |
None. |
Section: EUSART1 APIs
EUSART1_IsAutoBaudDetectOverflow()
bool EUSART1_IsAutoBaudDetectOverflow (void )
This API reads the EUSART1 ABR Overflow bit.
None. |
None. |
EUSART1_IsRxReady()
bool EUSART1_IsRxReady (void )
This API checks if the EUSART1 has received available data.
None. |
true |
if EUSART1 receiver FIFO has a data |
false |
EUSART1 receiver FIFO is empty |
EUSART1_IsTxDone()
bool EUSART1_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 |
EUSART1_IsTxReady()
bool EUSART1_IsTxReady (void )
This function checks if the EUSART1 transmitter is ready to accept a data byte.
None. |
true |
if EUSART1 transmitter FIFO has atleast 1 byte space |
false |
if EUSART1 transmitter FIFO is full |
EUSART1_OverrunErrorCallbackRegister()
void EUSART1_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. |
EUSART1_Read()
uint8_t EUSART1_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 EUSART1_IsRxReady(), before calling this API. |
None. |
8-bit data from RX FIFO register. |
EUSART1_ReceiveDisable()
void EUSART1_ReceiveDisable (void )
This API disables the EUSART1 receiver.
None. |
None. |
EUSART1_ReceiveEnable()
void EUSART1_ReceiveEnable (void )
This API enables the EUSART1 receiver. The EUSART1 must be enabled to receive the bytes sent by the RX pin.
None. |
None. |
EUSART1_ReceiveInterruptDisable()
void EUSART1_ReceiveInterruptDisable (void )
This API disables the EUSART1 receiver interrupt.
None. |
None. |
EUSART1_ReceiveInterruptEnable()
void EUSART1_ReceiveInterruptEnable (void )
This API enables the EUSART1 receiver interrupt.
None. |
None. |
EUSART1_ReceiveISR()
void EUSART1_ReceiveISR (void )
This ISR function is called upon receiver interrupt.
void. |
None. |
EUSART1_RxCompleteCallbackRegister()
void EUSART1_RxCompleteCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon after data has been successfully received.
callbackHandler |
- a function pointer which will be called upon receiver interrupt condition. |
None. |
EUSART1_SendBreakControlDisable()
void EUSART1_SendBreakControlDisable (void )
This API disables the EUSART1 send break control.
None. |
None. |
EUSART1_SendBreakControlEnable()
void EUSART1_SendBreakControlEnable (void )
This API enables the EUSART1 to send a break control.
None. |
None. |
EUSART1_TransmitDisable()
void EUSART1_TransmitDisable (void )
This API disables the EUSART1 transmitter.
None. |
None. |
EUSART1_TransmitEnable()
void EUSART1_TransmitEnable (void )
This API enables the EUSART1 transmitter. The EUSART1 must be enabled to send the bytes over to the TX pin.
None. |
None. |
EUSART1_TransmitInterruptDisable()
void EUSART1_TransmitInterruptDisable (void )
This API disables the EUSART1 transmitter interrupt.
None. |
None. |
EUSART1_TransmitInterruptEnable()
void EUSART1_TransmitInterruptEnable (void )
This API enables the EUSART1 transmitter interrupt.
None. |
None. |
EUSART1_TransmitISR()
void EUSART1_TransmitISR (void )
This ISR function is called upon transmitter interrupt.
void. |
None. |
EUSART1_TxCompleteCallbackRegister()
void EUSART1_TxCompleteCallbackRegister (void(*)(void) callbackHandler)
This API registers the function to be called upon after data has been successfully transmitted.
callbackHandler |
- a function pointer which will be called upon transmitter interrupt condition. |
None. |
EUSART1_Write()
void EUSART1_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 EUSART1_IsTxReady() before calling this API. |
txData |
- Data byte to write to the TX FIFO. |
None. |
getch()
int getch (void )
This function used to printf support for reads the 8 bits from the FIFO register receiver.
None. |
8-bit data from RX FIFO register. |
putch()
void putch (char txData)
This function used to printf support for writes a byte of data to the transmitter FIFO register.
txData |
- Data byte to write to the TX FIFO. |
None. |
Variable Documentation
EUSART1_RxInterruptHandler
void(* EUSART1_RxInterruptHandler) (void)
This indicates the function that will be called upon receive interrupt.
Initialize the EUSART1 module with receive interrupt enabled |
None. |
None. |
EUSART1_TxInterruptHandler
void(* EUSART1_TxInterruptHandler) (void)
This indicates the function that will be called upon transmit interrupt.
Initialize the EUSART1 module with transmit interrupt enabled |
None. |
None. |
Section: EUSART1 APIs
UART1
const uart_drv_interface_t UART1
External object for eusart1_interface.
Section: Driver Interface
3.26.2.5.2 UART_DRV_INTERFACE
This file contains API prototypes and data types of the Universal Asynchronous Receiver and Transmitter (UART) interface.
This file contains API prototypes and data types of the Universal Asynchronous Receiver and Transmitter (UART) interface.
3.26.2.5.3 UART_TYPES
This file contains the enumeration of different Universal Asynchronous Receiver and Transmitter (UART) baud rates.
This file contains the enumeration of different Universal Asynchronous Receiver and Transmitter (UART) baud rates.
3.26.2.6 Data Structure Documentation
3.26.2.6.1 eusart1_status_t Struct Reference
This is a structure defined for errors in reception of data.
Detailed Description
This is a structure defined for errors in reception of data.
#include <eusart1.h>
Data Fields
Field Documentation
The documentation for this struct was generated from the following file:
source/source-files/
@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
3.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>
Data Fields
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))
Field Documentation
The documentation for this struct was generated from the following file:
source/source-files/
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)
3.26.2.7 File Documentation
3.26.2.7.1 source/source-files/eusart1.c File Reference
This is the generated driver implementation file for the EUSART1 driver using the Enhanced Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
#include "../eusart1.h"
Functions
static void EUSART1_DefaultFramingErrorCallback (void)
static void EUSART1_DefaultOverrunErrorCallback (void)
void EUSART1_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART1_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
void EUSART1_Initialize (void)
Initializes the EUSART1 module. This routine is called only once during system initialization, before calling other APIs.
void EUSART1_Deinitialize (void)
Deinitializes and disables the EUSART1 module.
void EUSART1_Enable (void)
This API enables the EUSART1 module.
void EUSART1_Disable (void)
This API disables the EUSART1 module.
void EUSART1_TransmitEnable (void)
This API enables the EUSART1 transmitter. The EUSART1 must be enabled to send the bytes over to the TX pin.
void EUSART1_TransmitDisable (void)
This API disables the EUSART1 transmitter.
void EUSART1_ReceiveEnable (void)
This API enables the EUSART1 receiver. The EUSART1 must be enabled to receive the bytes sent by the RX pin.
void EUSART1_ReceiveDisable (void)
This API disables the EUSART1 receiver.
void EUSART1_SendBreakControlEnable (void)
This API enables the EUSART1 to send a break control.
void EUSART1_SendBreakControlDisable (void)
This API disables the EUSART1 send break control.
void EUSART1_AutoBaudSet (bool enable)
This API enables the EUSART1 AutoBaud Detection (ABR).
bool EUSART1_AutoBaudQuery (void)
This API reads the EUSART1 ABR Complete bit.
bool EUSART1_IsAutoBaudDetectOverflow (void)
This API reads the EUSART1 ABR Overflow bit.
void EUSART1_AutoBaudDetectOverflowReset (void)
This API resets the EUSART1 ABR Overflow bit.
void EUSART1_TransmitInterruptEnable (void)
This API enables the EUSART1 transmitter interrupt.
void EUSART1_TransmitInterruptDisable (void)
This API disables the EUSART1 transmitter interrupt.
void EUSART1_ReceiveInterruptEnable (void)
This API enables the EUSART1 receiver interrupt.
void EUSART1_ReceiveInterruptDisable (void)
This API disables the EUSART1 receiver interrupt.
bool EUSART1_IsRxReady (void)
This API checks if the EUSART1 has received available data.
bool EUSART1_IsTxReady (void)
This function checks if the EUSART1 transmitter is ready to accept a data byte.
bool EUSART1_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART1_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART1_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART1_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
int getch (void)
This function used to printf support for reads the 8 bits from the FIFO register receiver.
void putch (char txData)
This function used to printf support for writes a byte of data to the transmitter FIFO register.
void EUSART1_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART1_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART1_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully received.
void EUSART1_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully transmitted.
Macros
#define EUSART1_TX_BUFFER_SIZE (8U)
#define EUSART1_TX_BUFFER_MASK (EUSART1_TX_BUFFER_SIZE - 1U)
#define EUSART1_RX_BUFFER_SIZE (8U)
#define EUSART1_RX_BUFFER_MASK (EUSART1_RX_BUFFER_SIZE - 1U)
Variables
const uart_drv_interface_t UART1
External object for eusart1_interface.
static volatile uint8_t eusart1TxHead = 0
static volatile uint8_t eusart1TxTail = 0
static volatile uint8_t eusart1TxBuffer [EUSART1_TX_BUFFER_SIZE]
static volatile uint8_t eusart1TxBufferRemaining
static volatile uint8_t eusart1RxHead = 0
static volatile uint8_t eusart1RxTail = 0
static volatile uint8_t eusart1RxBuffer [EUSART1_RX_BUFFER_SIZE]
static volatile eusart1_status_t eusart1RxStatusBuffer [EUSART1_RX_BUFFER_SIZE]
static volatile uint8_t eusart1RxCount
static volatile eusart1_status_t eusart1RxLastError
void(* EUSART1_TxInterruptHandler )(void)
This indicates the function that will be called upon transmit interrupt.
static void(* EUSART1_TxCompleteInterruptHandler )(void) = NULL
void(* EUSART1_RxInterruptHandler )(void)
This indicates the function that will be called upon receive interrupt.
static void(* EUSART1_RxCompleteInterruptHandler )(void) = NULL
static void(* EUSART1_FramingErrorHandler )(void) = NULL
static void(* EUSART1_OverrunErrorHandler )(void) = NULL
Detailed Description
This is the generated driver implementation file for the EUSART1 driver using the Enhanced Universal Synchronous and Asynchronous Receiver Transceiver (EUSART) module.
EUSART1 Generated Driver API Header File
Function Documentation
EUSART1_DefaultFramingErrorCallback()
static void EUSART1_DefaultFramingErrorCallback (void )[static]
EUSART1_DefaultOverrunErrorCallback()
static void EUSART1_DefaultOverrunErrorCallback (void )[static]
Macro Definition Documentation
EUSART1_RX_BUFFER_MASK
#define EUSART1_RX_BUFFER_MASK (EUSART1_RX_BUFFER_SIZE - 1U)
EUSART1_RX_BUFFER_SIZE
#define EUSART1_RX_BUFFER_SIZE (8U)
EUSART1_TX_BUFFER_MASK
#define EUSART1_TX_BUFFER_MASK (EUSART1_TX_BUFFER_SIZE - 1U)
EUSART1_TX_BUFFER_SIZE
#define EUSART1_TX_BUFFER_SIZE (8U)
Section: Included Files Section: Macro Declarations
Variable Documentation
EUSART1_FramingErrorHandler
void(* EUSART1_FramingErrorHandler) (void) = NULL[static]
EUSART1_OverrunErrorHandler
void(* EUSART1_OverrunErrorHandler) (void) = NULL[static]
EUSART1_RxCompleteInterruptHandler
void(* EUSART1_RxCompleteInterruptHandler) (void) = NULL[static]
EUSART1_TxCompleteInterruptHandler
void(* EUSART1_TxCompleteInterruptHandler) (void) = NULL[static]
eusart1RxBuffer
volatile uint8_t eusart1RxBuffer[EUSART1_RX_BUFFER_SIZE][static]
eusart1RxCount
volatile uint8_t eusart1RxCount[static]
eusart1RxHead
volatile uint8_t eusart1RxHead = 0[static]
eusart1RxLastError
volatile eusart1_status_t eusart1RxLastError[static]
eusart1RxStatusBuffer
volatile eusart1_status_t eusart1RxStatusBuffer[EUSART1_RX_BUFFER_SIZE][static]
eusart1RxTail
volatile uint8_t eusart1RxTail = 0[static]
eusart1TxBuffer
volatile uint8_t eusart1TxBuffer[EUSART1_TX_BUFFER_SIZE][static]
eusart1TxBufferRemaining
volatile uint8_t eusart1TxBufferRemaining[static]
eusart1TxHead
volatile uint8_t eusart1TxHead = 0[static]
Section: EUSART1 variables
eusart1TxTail
volatile uint8_t eusart1TxTail = 0[static]
3.26.2.7.2 source/source-files/eusart1.h File Reference
#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "../system/system.h" #include "uart_drv_interface.h"
Data structures
struct eusart1_status_t
This is a structure defined for errors in reception of data.
Functions
void EUSART1_Initialize (void)
Initializes the EUSART1 module. This routine is called only once during system initialization, before calling other APIs.
void EUSART1_Deinitialize (void)
Deinitializes and disables the EUSART1 module.
void EUSART1_Enable (void)
This API enables the EUSART1 module.
void EUSART1_Disable (void)
This API disables the EUSART1 module.
void EUSART1_TransmitEnable (void)
This API enables the EUSART1 transmitter. The EUSART1 must be enabled to send the bytes over to the TX pin.
void EUSART1_TransmitDisable (void)
This API disables the EUSART1 transmitter.
void EUSART1_ReceiveEnable (void)
This API enables the EUSART1 receiver. The EUSART1 must be enabled to receive the bytes sent by the RX pin.
void EUSART1_ReceiveDisable (void)
This API disables the EUSART1 receiver.
void EUSART1_TransmitInterruptEnable (void)
This API enables the EUSART1 transmitter interrupt.
void EUSART1_TransmitInterruptDisable (void)
This API disables the EUSART1 transmitter interrupt.
void EUSART1_ReceiveInterruptEnable (void)
This API enables the EUSART1 receiver interrupt.
void EUSART1_ReceiveInterruptDisable (void)
This API disables the EUSART1 receiver interrupt.
void EUSART1_SendBreakControlEnable (void)
This API enables the EUSART1 to send a break control.
void EUSART1_SendBreakControlDisable (void)
This API disables the EUSART1 send break control.
void EUSART1_AutoBaudSet (bool enable)
This API enables the EUSART1 AutoBaud Detection (ABR).
bool EUSART1_AutoBaudQuery (void)
This API reads the EUSART1 ABR Complete bit.
bool EUSART1_IsAutoBaudDetectOverflow (void)
This API reads the EUSART1 ABR Overflow bit.
void EUSART1_AutoBaudDetectOverflowReset (void)
This API resets the EUSART1 ABR Overflow bit.
bool EUSART1_IsRxReady (void)
This API checks if the EUSART1 has received available data.
bool EUSART1_IsTxReady (void)
This function checks if the EUSART1 transmitter is ready to accept a data byte.
bool EUSART1_IsTxDone (void)
This function returns the status of Transmit Shift Register (TSR).
size_t EUSART1_ErrorGet (void)
This function receives the error status of the last read byte.
uint8_t EUSART1_Read (void)
This function reads the 8 bits from the FIFO register receiver.
void EUSART1_Write (uint8_t txData)
This function writes a byte of data to the transmitter FIFO register.
void EUSART1_FramingErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon framing error.
void EUSART1_OverrunErrorCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon overrun error.
void EUSART1_TxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully transmitted.
void EUSART1_TransmitISR (void)
This ISR function is called upon transmitter interrupt.
void EUSART1_RxCompleteCallbackRegister (void(*callbackHandler)(void))
This API registers the function to be called upon after data has been successfully received.
void EUSART1_ReceiveISR (void)
This ISR function is called upon receiver interrupt.
int getch (void)
This function used to printf support for reads the 8 bits from the FIFO register receiver.
void putch (char txData)
This function used to printf support for writes a byte of data to the transmitter FIFO register.
Macros
#define UART1_interface UART1
#define UART1_Initialize EUSART1_Initialize
#define UART1_Write EUSART1_Write
#define UART1_Read EUSART1_Read
#define UART1__IsRxReady EUSART1_IsRxReady
#define UART1_IsTxReady EUSART1_IsTxReady
#define UART1_IsTxDone EUSART1_IsTxDone
#define UART1_AutoBaudSet EUSART1_AutoBaudSet
#define UART1_BRGCountSet (NULL)
#define UART1_BRGCountGet (NULL)
#define UART1_BaudRateSet (NULL)
#define UART1_BaudRateGet (NULL)
#define UART1__AutoBaudEventEnableGet (NULL)
#define UART1_ErrorGet EUSART1_ErrorGet
#define UART1_TxCompleteCallbackRegister EUSART1_TxCompleteCallbackRegister
#define UART1_RxCompleteCallbackRegister EUSART1_RxCompleteCallbackRegister
#define UART1_TxCollisionCallbackRegister (NULL)
#define UART1_FramingErrorCallbackRegister EUSART1_FramingErrorCallbackRegister
#define UART1_OverrunErrorCallbackRegister EUSART1_OverrunErrorCallbackRegister
#define UART1_ParityErrorCallbackRegister (NULL)
#define UART1_EventCallbackRegister (NULL)
Variables
const uart_drv_interface_t UART1
External object for eusart1_interface.
void(* EUSART1_TxInterruptHandler )(void)
This indicates the function that will be called upon transmit interrupt.
void(* EUSART1_RxInterruptHandler )(void)
This indicates the function that will be called upon receive interrupt.
Detailed Description
EUSART1 Generated Driver API Header File
Macro Definition Documentation
UART1__AutoBaudEventEnableGet
#define UART1__AutoBaudEventEnableGet (NULL)
UART1__IsRxReady
#define UART1__IsRxReady EUSART1_IsRxReady
UART1_AutoBaudQuery
#define UART1_AutoBaudQuery EUSART1_AutoBaudQuery
UART1_AutoBaudSet
#define UART1_AutoBaudSet EUSART1_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 EUSART1_Deinitialize
UART1_ErrorGet
#define UART1_ErrorGet EUSART1_ErrorGet
UART1_EventCallbackRegister
#define UART1_EventCallbackRegister (NULL)
UART1_FramingErrorCallbackRegister
#define UART1_FramingErrorCallbackRegister EUSART1_FramingErrorCallbackRegister
UART1_Initialize
#define UART1_Initialize EUSART1_Initialize
UART1_interface
#define UART1_interface UART1
UART1_IsTxDone
#define UART1_IsTxDone EUSART1_IsTxDone
UART1_IsTxReady
#define UART1_IsTxReady EUSART1_IsTxReady
UART1_OverrunErrorCallbackRegister
#define UART1_OverrunErrorCallbackRegister EUSART1_OverrunErrorCallbackRegister
UART1_ParityErrorCallbackRegister
#define UART1_ParityErrorCallbackRegister (NULL)
UART1_Read
#define UART1_Read EUSART1_Read
UART1_RxCompleteCallbackRegister
#define UART1_RxCompleteCallbackRegister EUSART1_RxCompleteCallbackRegister
UART1_TransmitDisable
#define UART1_TransmitDisable EUSART1_TransmitDisable
UART1_TransmitEnable
#define UART1_TransmitEnable EUSART1_TransmitEnable
UART1_TxCollisionCallbackRegister
#define UART1_TxCollisionCallbackRegister (NULL)
UART1_TxCompleteCallbackRegister
#define UART1_TxCompleteCallbackRegister EUSART1_TxCompleteCallbackRegister
UART1_Write
#define UART1_Write EUSART1_Write
3.26.2.7.3 source/source-files/uart_drv_interface.h File Reference
#include <stdbool.h> #include <stdint.h> #include <stddef.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
3.26.2.7.4 source/source-files/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 |