MCUSW
Loading...
Searching...
No Matches
Cdd_Uart.h File Reference

Introduction

This file contains interface header for UART Complex Device Driver.

Go to the source code of this file.

MCAL Driver states

#define MCAL_STATE_RESET   (0U)
 
#define MCAL_STATE_READY   (1U)
 
#define MCAL_STATE_BUSY   (2U)
 
#define MCAL_STATE_ERROR   (3U)
 
typedef uint8 CddUartDataBufferType
 Typedef for the data buffer elements.
 
typedef uint8_least CddUartDataDirectionType
 Type for defining the direction of data transfer, i.e., sending or receival.
 
void Cdd_Uart_GetVersionInfo (Std_VersionInfoType *VersionInfoPtr)
 Service for getting CDD UART version.
 
Std_ReturnType Cdd_Uart_RegisterReadback (uint8 ChannelID, CddUart_RegisterReadbackType *RegisterSetPtr)
 Service for reading HW IP registers of a CDD UART instance.
 
void Cdd_Uart_Init (const Cdd_Uart_CfgType *ConfigurationPtr)
 Service for CDD UART Initialization.
 
void Cdd_Uart_DeInit (void)
 Service for deinitializing CDD UART.
 
Std_ReturnType Cdd_Uart_Write (uint8 ChannelID, CddUartDataBufferType *SrcBufferPtr, uint32 Count, uint32 Timeout)
 Service to transmit message using UART.
 
Std_ReturnType Cdd_Uart_Read (uint8 ChannelID, CddUartDataBufferType *DestBufferPtr, uint32 Count, uint32 Timeout)
 Service to read message or command from the UART.
 
boolean Cdd_Uart_Cancel (uint8 ChannelID, CddUartDataDirectionType TransferType)
 Service to cancel an ongoing transaction with UART.
 
uint32 Cdd_Uart_GetRemainingWords (uint8 ChannelID, CddUartDataDirectionType TransferType)
 Service to get remaining words to be transmitted from the UART for any ongoing transaction.
 

Macros

#define UART_FIFO_SIZE   (64U)
 Uart FIFO Size.
 
#define UART_TRANSMITEMPTY_TRIALCOUNT   (3000U)
 Timeout in ms used for TX FIFO empty at the time of delete. Three seconds is more than sufficient to transfer 64 bytes (FIFO size) at the lowest baud rate of 2400.
 
#define UART_STATE_RX_DISABLED   (0x0U)
 
#define UART_STATE_RX_ENABLED   (0x1U)
 
#define IS_DATA_LENGTH_VALID(dataLength)
 Macro to check if the Data length is valid.
 
#define IS_STOP_BITS_VALID(stopBits)
 Macro to check if the Number of stop bits is valid.
 
#define IS_PARITY_TYPE_VALID(parityType)
 Macro to check if the Parity type is valid.
 
#define IS_OPER_MODE_VALID(operMode)
 Macro to check if the Operation mode is valid.
 
#define IS_RXTRIG_LVL_VALID(rxTrigLvl)
 Macro to check if the RX Trigger level is valid.
 
#define IS_TXTRIG_LVL_VALID(txTrigLvl)
 Macro to check if the TX Trigger level is valid.
 
CDD UART Driver ID Info

name CDD UART Driver ID Info

#define CDD_UART_MODULE_ID   255U
 CDD Module ID.
 
#define CDD_UART_VENDOR_ID   44U
 Texas Instruments Vendor ID.
 
#define CDD_UART_INSTANCE_ID   0U
 Texas Instruments Vendor ID.
 
CDD UART Driver Module Version Info

Defines for CDD Driver version used for compatibility checks

#define CDD_UART_SW_MAJOR_VERSION   CDD_UART_MAJOR_VERSION
 Driver Implementation Major Version.
 
#define CDD_UART_SW_MINOR_VERSION   CDD_UART_MINOR_VERSION
 Driver Implementation Minor Version.
 
#define CDD_UART_SW_PATCH_VERSION   CDD_UART_CFG_PATCH_VERSION
 Driver Implementation patch Version.
 
CDD UART Driver Module AUTOSAR Version Info

Defines for CDD Driver AUTOSAR version used for compatibility checks

#define CDD_UART_AR_RELEASE_MAJOR_VERSION   4U
 AUTOSAR Major version specification implemented by CDD Driver.
 
#define CDD_UART_AR_RELEASE_MINOR_VERSION   3U
 AUTOSAR Minor version specification implemented by CDD Driver.
 
#define CDD_UART_AR_RELEASE_REVISION_VERSION   1U
 AUTOSAR Patch version specification implemented by CDD Driver.
 
CDD UART API Service ID
#define CDD_UART_INIT_SERVICE_ID   0x01U
 API Service ID for initialization.
 
#define CDD_UART_GETVERSIONINFO_SERVICE_ID   0x02U
 API Service ID for get version info.
 
#define CDD_UART_REGISTERREADBACK_SERVICE_ID   0x0DU
 API Service ID for Register Readback service ID.
 
#define CDD_UART_READDATA_SERVICE_ID   0x03U
 API Service ID for read API.
 
#define CDD_UART_WRITEDATA_SERVICE_ID   0x04U
 API Service ID for write API.
 
#define CDD_UART_ERROR_SERVICE_ID   0x05U
 API Service ID for error API.
 
#define CDD_UART_CANCEL_SERVICE_ID   0x06U
 API Service ID for cancel API.
 
#define CDD_UART_GETREMAININGWORDS_SERVICE_ID   0x07U
 API Service ID for get remaining words API.
 
#define CDD_UART_READNOTIF_SERVICE_ID   0x08U
 API Service ID for read notification handler.
 
#define CDD_UART_WRITENOTIF_SERVICE_ID   0x09U
 API Service ID for write notification handler.
 
#define CDD_UART_ERRORNOTIF_SERVICE_ID   0x0AU
 API Service ID for error notification handler.
 
#define CDD_UART_DEINIT_SERVICE_ID   0x0BU
 API Service ID for deinitialization.
 
#define CDD_UART_INTERNAL_ISR_ID   0x0CU
 API Service ID for ISR.
 
CDD UART Error Codes
#define CDD_UART_E_UNINIT   0x01U
 Error code indicating the UART is uninitialized.
 
#define CDD_UART_E_INVALID_EVENT   0x02U
 Error code indicating an invalid event.
 
#define CDD_UART_E_READ_LOCKED   0x03U
 Error code indicating UART reading mode ongoing.
 
#define CDD_UART_E_WRITE_LOCKED   0x04U
 Error code indicating UART writing mode ongoing.
 
#define CDD_UART_E_PARAM_POINTER   0x05U
 Error code indicating invalid parameter pointer.
 
#define CDD_UART_E_ALREADY_INITIALIZED   0x06U
 Error code indicating UART is already initialized.
 
#define CDD_UART_E_PARAM_VALUE   0x07U
 Error code indicating Service called with wrong param.
 
#define CDD_UART_E_PARAM_LENGTH   0x08U
 Error code indicating Service called with invalid length.
 
#define CDD_UART_E_INVALID_CHANNEL   0x09U
 Error code indicating invalid UART channel.
 
#define CDD_UART_E_INVALID_CONFIG   0x0AU
 Error code indicating invalid UART configuration.
 
Values indicating the filled status of TX FIFO

Note: The values should not be changed since it represents the actual register configuration values used to configure the UART

#define UART_TX_FIFO_NOT_FULL
 
#define UART_TX_FIFO_FULL
 
Values related to status of Interrupt souces.

#define UART_INTID_MODEM_STAT
 Values pertaining to status of UART Interrupt sources.
 
#define UART_INTID_TX_THRES_REACH
 
#define UART_INTID_RX_THRES_REACH
 
#define UART_INTID_RX_LINE_STAT_ERROR
 
#define UART_INTID_CHAR_TIMEOUT
 
#define UART_INTID_XOFF_SPEC_CHAR_DETECT
 
#define UART_INTID_MODEM_SIG_STATE_CHANGE
 
#define UART_INTR_PENDING   (0U)
 Values indicating the UART Interrupt pending status.
 
#define UART_NO_INTR_PENDING   (1U)
 
Values related to enabling/disabling of Interrupts.
#define UART_INTR_CTS   (UART_IER_CTS_IT_MASK)
 Values for enabling/disabling the interrupts of UART.
 
#define UART_INTR_RTS   (UART_IER_RTS_IT_MASK)
 
#define UART_INTR_XOFF   (UART_IER_XOFF_IT_MASK)
 
#define UART_INTR_SLEEPMODE   (UART_IER_SLEEP_MODE_MASK)
 
#define UART_INTR_MODEM_STAT   (UART_IER_MODEM_STS_IT_MASK)
 
#define UART_INTR_LINE_STAT   (UART_IER_LINE_STS_IT_MASK)
 
#define UART_INTR_THR   (UART_IER_THR_IT_MASK)
 
#define UART_INTR_RHR_CTI   (UART_IER_RHR_IT_MASK)
 
#define UART_INTR2_RX_EMPTY   (UART_IER2_EN_RXFIFO_EMPTY_MASK)
 
#define UART_INTR2_TX_EMPTY   (UART_IER2_EN_TXFIFO_EMPTY_MASK)
 
Values related to Line Status information.
#define UART_FIFO_PE_FE_BI_DETECTED   (UART_LSR_RX_FIFO_STS_MASK)
 Values pertaining to UART Line Status information.
 
#define UART_BREAK_DETECTED_ERROR   (UART_LSR_RX_BI_MASK)
 
#define UART_FRAMING_ERROR   (UART_LSR_RX_FE_MASK)
 
#define UART_PARITY_ERROR   (UART_LSR_RX_PE_MASK)
 
#define UART_OVERRUN_ERROR   (UART_LSR_RX_OE_MASK)