5.15. CDD_UART
5.15.1. Types
Base type |
Type Name |
Brief |
|---|---|---|
enum |
Uart Configuration Instance ID. |
|
enum |
UART Word Length. |
|
enum |
UART Stop Bits. |
|
enum |
UART Mode. |
|
enum |
UART FIFO Level. |
|
typedef void(*)(void) |
Cdd Uart Callback type. |
|
typedef uint8 |
Typedef for the data buffer elements. |
5.15.1.1. enum Cdd_Uart_Instance
Enumerator |
Value |
Description |
|---|---|---|
CDD_UART_INSTANCE_UARTA |
0U |
UARTA Config Instance. |
CDD_UART_INSTANCE_UARTB |
1U |
UARTB Config Instance. |
CDD_UART_INSTANCE_UARTC |
2U |
UARTC Config Instance. |
CDD_UART_INSTANCE_UARTD |
3U |
UARTD Config Instance. |
CDD_UART_INSTANCE_UARTE |
4U |
UARTE Config Instance. |
CDD_UART_INSTANCE_UARTF |
5U |
UARTF Config Instance. |
Brief: Uart Configuration Instance ID.
5.15.1.2. enum Cdd_Uart_WordLength
Enumerator |
Value |
Description |
|---|---|---|
CDD_UART_WORD_LENGTH_5 |
0U |
UART Word Length 5 bits. |
CDD_UART_WORD_LENGTH_6 |
1U |
UART Word Length 6 bits. |
CDD_UART_WORD_LENGTH_7 |
2U |
UART Word Length 7 bits. |
CDD_UART_WORD_LENGTH_8 |
3U |
UART Word Length 8 bits. |
Brief: UART Word Length.
5.15.1.3. enum Cdd_Uart_StopBits
Enumerator |
Value |
Description |
|---|---|---|
CDD_UART_STOP_BITS_1 |
0U |
UART Stop Bits 1 bit. |
CDD_UART_STOP_BITS_2 |
1U |
UART Stop Bits 2 bits. |
Brief: UART Stop Bits.
5.15.1.4. enum Cdd_Uart_Mode
Enumerator |
Value |
Description |
|---|---|---|
CDD_UART_MODE_POLLING |
0U |
UART Mode Polling. |
CDD_UART_MODE_INTERRUPT |
1U |
UART Mode Interrupt. |
Brief: UART Mode.
5.15.1.5. enum Cdd_Uart_FifoLevel
Enumerator |
Value |
Description |
|---|---|---|
CDD_UART_FIFO_LEVEL_1_8 |
0U |
UART FIFO Level 1/8. |
CDD_UART_FIFO_LEVEL_1_4 |
1U |
UART FIFO Level 1/4. |
CDD_UART_FIFO_LEVEL_1_2 |
2U |
UART FIFO Level 1/2. |
CDD_UART_FIFO_LEVEL_3_4 |
3U |
UART FIFO Level 3/4. |
CDD_UART_FIFO_LEVEL_7_8 |
4U |
UART FIFO Level 7/8. |
Brief: UART FIFO Level.
5.15.1.6. typedef Cdd_Uart_CallbackType
typedef void(* Cdd_Uart_CallbackType) (void);
Brief: Cdd Uart Callback type.
5.15.1.7. typedef Cdd_Uart_DataBufferType
typedef uint8 Cdd_Uart_DataBufferType;
Brief: Typedef for the data buffer elements.
5.15.2. Structures
Name |
Brief |
|---|---|
UART configuration data structure for a channel. |
|
UART configuration structure for all channels in use. |
|
Typedef for the Write Status. |
|
Typedef for the Read Status. |
5.15.3. Defines
Name |
Brief |
|---|---|
CDD_UART_SW_MAJOR_VERSION |
Driver Implementation Major Version. |
CDD_UART_SW_MINOR_VERSION |
Driver Implementation Minor Version. |
CDD_UART_SW_PATCH_VERSION |
Driver Implementation Patch Version. |
CDD_UART_AR_RELEASE_MAJOR_VERSION |
AUTOSAR Major version specification implemented by CDD_UART Driver. |
CDD_UART_AR_RELEASE_MINOR_VERSION |
AUTOSAR Minor version specification implemented by CDD_UART Driver. |
CDD_UART_AR_RELEASE_REVISION_VERSION |
AUTOSAR Patch version specification implemented by CDD_UART Driver. |
CDD_UART_VENDOR_ID |
Texas Instruments Vendor ID. |
CDD_UART_MODULE_ID |
CDD UART Driver Module ID. |
CDD_UART_INSTANCE_ID |
CDD UART Instance ID. |
CDD_UART_E_UNINIT |
API service used without module initialization. |
CDD_UART_E_ALREADY_INITIALIZED |
API Cdd_Uart_Init service called while the UART driver has already been initialized. |
CDD_UART_E_PARAM_VALUE |
API service called with invalid parameter value. |
CDD_UART_E_PARAM_POINTER |
API service called with invalid data buffer pointer. |
CDD_UART_E_PARAM_HWINDEX |
API service called with invalid hardware index. |
CDD_UART_E_BUSY |
|
CDD_UART_NO_ERROR |
|
CDD_UART_SID_GET_VERSION_INFO |
Cdd_Uart_GetVersionInfo API Service ID. |
CDD_UART_SID_INIT |
Cdd_Uart_Init() API Service ID. |
CDD_UART_SID_DEINIT |
Cdd_Uart_DeInit() API Service ID. |
CDD_UART_SID_WRITE |
Cdd_Uart_Write() API Service ID. |
CDD_UART_SID_READ |
Cdd_Uart_Read() API Service ID. |
CDD_UART_SID_CANCEL_WRITE |
Cdd_Uart_CancelWrite() API Service ID. |
CDD_UART_SID_CANCEL_READ |
Cdd_Uart_CancelRead() API Service ID. |
CDD_UART_SID_GET_WRITE_STATUS |
Cdd_Uart_GetWriteStatus() API Service ID. |
CDD_UART_SID_GET_READ_STATUS |
Cdd_Uart_GetReadStatus() API Service ID. |
CDD_UART_SID_MAIN_FUN_WRITE |
Cdd_Uart_MainFunction_Write() API Service ID. |
CDD_UART_SID_POLL_READ |
Cdd_Uart_Poll_Read() API Service ID. |
CDD_UART_SID_ERROR_STATUS |
Cdd_Uart_GetErrorStatus() API Service ID. |
CDD_UART_SID_FLUSH_READ_BUFFER |
Cdd_Uart_FlushReadFIFO() API Service ID. |
5.15.4. Functions
Return type |
Function Name |
Brief |
|---|---|---|
void |
Cdd_Uart_GetVersionInfo(Std_VersionInfoType * VersionInfoPtr) |
Service to provide the version information of Cdd Uart module. |
void |
Cdd_Uart_Init(const Cdd_Uart_ConfigType * ConfigPtr) |
Cdd_Uart_Init : Initializes the CDD_UART module. |
void |
Cdd_Uart_Deinit(void ) |
Cdd_Uart_Deinit : De-initializes the CDD_UART module. |
Std_ReturnType |
Cdd_Uart_Write(uint8 HwUnitId, const Cdd_Uart_DataBufferType * SrcBufferPtr, uint32 Count) |
Service to transmit data. |
Std_ReturnType |
Cdd_Uart_Read(uint8 HwUnitId, Cdd_Uart_DataBufferType * DestBufferPtr, uint32 Count) |
Service to reception of data. |
Std_ReturnType |
Cdd_Uart_CancelWrite(uint8 HwUnitId) |
Service to cancel the ongoing transmission. |
Std_ReturnType |
Cdd_Uart_CancelRead(uint8 HwUnitId) |
Service to cancel the ongoing transmission. |
Std_ReturnType |
Cdd_Uart_GetWriteStatus(uint8 HwUnitId, Cdd_Uart_WriteStatusType * WriteStatus) |
Service to get the status of the ongoing transmission. |
Std_ReturnType |
Cdd_Uart_GetReadStatus(uint8 HwUnitId, Cdd_Uart_ReadStatusType * ReadStatus) |
Service to get the status of the ongoing transmission. |
void |
Cdd_Uart_MainFunction_Write(void ) |
Service to auto perform the polling of configured UART Write channel. |
void |
Cdd_Uart_Poll_Read(void ) |
Service to perform the polling of confgured UART Read channel by user. |
Std_ReturnType |
Cdd_Uart_GetErrorStatus(uint8 HwUnitId, uint8 * ErrorStatus) |
Service to get the status of the Uart error. User can use this service in the Error callback implementation to fetch the exact Uart Error. |
void |
Cdd_Uart_FlushReadFIFO(uint8 HwUnitId) |
Service to flush the read buffer. User can use this service to flush the readbuffer incase of any unread data after any Uart Error. |
5.15.4.1. function Cdd_Uart_GetVersionInfo
void Cdd_Uart_GetVersionInfo(
Std_VersionInfoType * VersionInfoPtr
)
Brief: Service to provide the version information of Cdd Uart module.
Parameters:
VersionInfoPtr is the pointer to CDD UART driver version information
Returns:
None
Return: None
Precondition: This API is available only if CDD_UART_GET_VERSION_INFO_API is STD_ON
Postcondition: None
5.15.4.2. function Cdd_Uart_Init
void Cdd_Uart_Init(
const Cdd_Uart_ConfigType * ConfigPtr
)
Brief: Cdd_Uart_Init : Initializes the CDD_UART module.
This service initialize the CDD_UART driver
Parameters:
ConfigPtr Pointer to CDD_UART driver configuration set
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.15.4.3. function Cdd_Uart_Deinit
void Cdd_Uart_Deinit(
void
)
Brief: Cdd_Uart_Deinit : De-initializes the CDD_UART module.
This service deinitialize the CDD_UART driver
Returns:
None
Return: None
Precondition: Cdd_Uart_Init should be called first, before calling this service.
Postcondition: None
5.15.4.4. function Cdd_Uart_Write
Std_ReturnType Cdd_Uart_Write(
uint8 HwUnitId,
const Cdd_Uart_DataBufferType * SrcBufferPtr,
uint32 Count
)
Brief: Service to transmit data.
Parameters:
HwUnitId number to be used for writing data
SrcBufferPtr - Pointer to source data buffer
Count - number of data elements to be transmitted from SrcBufferPtr
Returns:
E_OK Write request has been accepted.
E_NOT_OK Write request has not been accepted.
Return: Cdd_Uart_Write request is accepted or not
Precondition: None
Postcondition: None
5.15.4.5. function Cdd_Uart_Read
Std_ReturnType Cdd_Uart_Read(
uint8 HwUnitId,
Cdd_Uart_DataBufferType * DestBufferPtr,
uint32 Count
)
Brief: Service to reception of data.
Parameters:
HwUnitId number to be used for writing data
DestBufferPtr - Pointer to dest data buffer
Count - number of data elements to be read into DestBufferPtr
Returns:
E_OK Read request has been accepted.
E_NOT_OK Read request has not been accepted.
Return: Cdd_Uart_Read request is accepted or not
Precondition: None
Postcondition: None
5.15.4.6. function Cdd_Uart_CancelWrite
Std_ReturnType Cdd_Uart_CancelWrite(
uint8 HwUnitId
)
Brief: Service to cancel the ongoing transmission.
Parameters:
HwUnitId number to be used for cancellation of Write
Returns:
E_OK CancelWrite request has been accepted.
E_NOT_OK CancelWrite request has not been accepted.
Return: Cdd_Uart_CancelWrite request is accepted or not
Precondition: None
Postcondition: None
5.15.4.7. function Cdd_Uart_CancelRead
Std_ReturnType Cdd_Uart_CancelRead(
uint8 HwUnitId
)
Brief: Service to cancel the ongoing transmission.
Parameters:
HwUnitId number to be used for cancellation of Write
Returns:
E_OK CancelRead request has been accepted.
E_NOT_OK CancelRead request has not been accepted.
Return: Cdd_Uart_CancelRead request is accepted or not
Precondition: None
Postcondition: None
5.15.4.8. function Cdd_Uart_GetWriteStatus
Std_ReturnType Cdd_Uart_GetWriteStatus(
uint8 HwUnitId,
Cdd_Uart_WriteStatusType * WriteStatus
)
Brief: Service to get the status of the ongoing transmission.
Parameters:
HwUnitId hw id to be used for status of Write
WriteStatus pointer to Cdd_Uart_WriteStatusType
Returns:
E_OK GetWriteStatus request has been accepted.
E_NOT_OK GetWriteStatus request has not been accepted.
Return: Cdd_Uart_GetWriteStatus request is accepted or not
Precondition: None
Postcondition: None
5.15.4.9. function Cdd_Uart_GetReadStatus
Std_ReturnType Cdd_Uart_GetReadStatus(
uint8 HwUnitId,
Cdd_Uart_ReadStatusType * ReadStatus
)
Brief: Service to get the status of the ongoing transmission.
Parameters:
HwUnitId hw id to be used for status of Read
ReadStatus pointer to Cdd_Uart_ReadStatusType
Returns:
E_OK GetReadStatus request has been accepted.
E_NOT_OK GetReadStatus request has not been accepted.
Return: Cdd_Uart_GetReadStatus request is accepted or not
Precondition: None
Postcondition: None
5.15.4.10. function Cdd_Uart_MainFunction_Write
void Cdd_Uart_MainFunction_Write(
void
)
Brief: Service to auto perform the polling of configured UART Write channel.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.15.4.11. function Cdd_Uart_Poll_Read
void Cdd_Uart_Poll_Read(
void
)
Brief: Service to perform the polling of confgured UART Read channel by user.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.15.4.12. function Cdd_Uart_GetErrorStatus
Std_ReturnType Cdd_Uart_GetErrorStatus(
uint8 HwUnitId,
uint8 * ErrorStatus
)
Brief: Service to get the status of the Uart error. User can use this service in the Error callback implementation to fetch the exact Uart Error.
Parameters:
HwUnitId hw id to be used for status of Error
ErrorStatus pointer to Cdd_Uart_Error type
Returns:
E_OK Error status request has been accepted
E_NOT_OK Error status request has not been accepted
Return: Uart error : PE,OE,BE,FE
Precondition: None
Postcondition: None
5.15.4.13. function Cdd_Uart_FlushReadFIFO
void Cdd_Uart_FlushReadFIFO(
uint8 HwUnitId
)
Brief: Service to flush the read buffer. User can use this service to flush the readbuffer incase of any unread data after any Uart Error.
Parameters:
HwUnitId hw id to be used to flush the read buffer
Returns:
None
Return: None
Precondition: None
Postcondition: None