![]() |
MCUSW
|
The WDG driver provides services for handlign the watch dog timer on the SOC.
* Digital Windowed Watchdog(DWWD) Overview : * The Digital Watchdog Timer(DWT) generates reset after a programmable * period, if not serviced within that period. In DWT, time-out * boundary is configurable. * In DWWD, along with configurable time-out boundary, the start time * boundary is also configurable. The DWWD can generate Reset or * Interrupt, if not serviced within window(Open Window) defined by * start time and time-out boundary. Also the DWWD can generate Reset or * Interrupt if serviced outside Open Window (within Closed Window). * Generation of Reset or Interrupt depends on the DWWD Reaction * configuration. * * DWWD Down Counter Overview : * Upper 12 bit part of the down counter is configurable and * remaining 13 bit are always 1. * Minimum possible time-out value is 2^13 RTI clock cycles. * Maximum possible time-out value is 2^25 RTI clock cycles. * Example : * RTI frequency : 32kHz * 12 bit preload value : 0x004 * 25 bit preload value : 0x0009FFF * time-out value(in RTI clock cycles) : 40959. * time-out value(in seconds) : 40959 + 1 / 32000 = 1.28 seconds. * * * DWWD Window Sizes Overview : * time-out value...........................................3 2 1 0 * (100%)|___________________________Open Window________________________| * (50%)| Closed Window |________Open Window___________| * (25%)| Closed Window |___OW_________| * (12.5%)| Closed Window |_OW___| * (6.25%)| Closed Window |OW | * (3.125%)| Closed Window |OW| * For time-out value calculation refer DWWD Down Counter Overview. * * *
Sub Modules | |
| WDG Configuration | |
WDG Driver Module SW Version Info | |
Defines for WDG Driver version used for compatibility checks | |
| #define | WDG_SW_MAJOR_VERSION (9U) |
| Driver Implementation Major Version. More... | |
| #define | WDG_SW_MINOR_VERSION (1U) |
| Driver Implementation Minor Version. More... | |
| #define | WDG_SW_PATCH_VERSION (0U) |
| Driver Implementation Patch Version. More... | |
WDG Driver Module AUTOSAR Version Info | |
Defines for WDG Driver AUTOSAR version used for compatibility checks | |
| #define | WDG_AR_RELEASE_MAJOR_VERSION (4U) |
| AUTOSAR Major version specification implemented by WDG Driver. More... | |
| #define | WDG_AR_RELEASE_MINOR_VERSION (3U) |
| AUTOSAR Minor version specification implemented by WDG Driver. More... | |
| #define | WDG_AR_RELEASE_REVISION_VERSION (1U) |
| AUTOSAR Patch version specification implemented by WDG Driver. More... | |
WDG Driver ID Info | |
| #define | WDG_VENDOR_ID ((uint16) 44U) |
| Texas Instruments Vendor ID. More... | |
| #define | WDG_MODULE_ID ((uint16) 102U) |
| WDG Driver Module ID. More... | |
| #define | WDG_INSTANCE_ID ((uint8) 0U) |
| WDG Driver Instance ID. More... | |
WDG Error Codes | |
| #define | WDG_E_DRIVER_STATE ((uint8) 0x10U) |
| ERROR:Invalid driver state. More... | |
| #define | WDG_E_PARAM_MODE ((uint8) 0x11U) |
| ERROR:Invalid mode param. More... | |
| #define | WDG_E_PARAM_CONFIG ((uint8) 0x12U) |
| ERROR:Invalid config param. More... | |
| #define | WDG_E_PARAM_TIMEOUT ((uint8) 0x13U) |
| ERROR:Invalid timeout value. More... | |
| #define | WDG_E_PARAM_POINTER ((uint8) 0x14U) |
| ERROR:Invalid NULL ptr param. More... | |
| #define | WDG_E_INIT_FAILED ((uint8) 0x15U) |
| ERROR:Invalid configuration set selection. More... | |
WDG Service Ids | |
The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error | |
| #define | WDG_API_INIT ((uint8) 0x00U) |
| Wdg_Init() More... | |
| #define | WDG_API_SET_MODE ((uint8) 0x01U) |
| Wdg_SetMode() More... | |
| #define | WDG_SET_TRIGGER_CONDITION ((uint8) 0x03U) |
| Wdg_SetTriggerCondition() More... | |
| #define | WDG_API_GET_VERSION_INFO ((uint8) 0x04U) |
| Wdg_GetVersionInfo() More... | |
| #define | WDG_API_TRIGGER ((uint8) 0x05U) |
| Wdg_Trigger() More... | |
| #define | WDG_API_REGISTER_READBACK ((uint8) 0x06U) |
| Wdg_RegisterReadback() More... | |
Watchdog Window Size | |
| #define | WDG_WINDOW_100_PERCENT ((uint32) 0x00000005U) |
| Window open 100% of interval. More... | |
| #define | WDG_WINDOW_50_PERCENT ((uint32) 0x00000050U) |
| Window open 50% of interval. More... | |
| #define | WDG_WINDOW_25_PERCENT ((uint32) 0x00000500U) |
| Window open 25% of interval. More... | |
| #define | WDG_WINDOW_12P5_PERCENT ((uint32) 0x00005000U) |
| Window open 12.5% of interval. More... | |
| #define | WDG_WINDOW_6P25_PERCENT ((uint32) 0x00050000U) |
| Window open 6.25% of interval. More... | |
| #define | WDG_WINDOW_3P125_PERCENT ((uint32) 0x00500000U) |
| Window open 3.125% of interval. More... | |
| #define | INIT_VAL_ZERO (0U) |
| For assigning use macro name instead of value 0U to avoid MISRAC violation. More... | |
| enum | Wdg_StatusType { WDG_UNINIT, WDG_IDLE, WDG_BUSY } |
| Watchdog driver state. More... | |
| AUTOMATIC | |
| WDG_APPL_CONST | CfgPtr |
| WDG_APPL_DATA | regRbPtr |
| FUNC (void, WDG_CODE) Wdg_GetVersionInfo(Std_VersionInfoType *versioninfo) | |
| This service returns the version information of this module. More... | |
| FUNC (Std_ReturnType, WDG_CODE) Wdg_SetMode(WdgIf_ModeType Mode) | |
| This function triggers the servicing of the watchdog. More... | |
| #define WDG_SW_MAJOR_VERSION (9U) |
Driver Implementation Major Version.
| #define WDG_SW_MINOR_VERSION (1U) |
Driver Implementation Minor Version.
| #define WDG_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version.
| #define WDG_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by WDG Driver.
| #define WDG_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by WDG Driver.
| #define WDG_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by WDG Driver.
| #define WDG_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID.
| #define WDG_MODULE_ID ((uint16) 102U) |
WDG Driver Module ID.
| #define WDG_INSTANCE_ID ((uint8) 0U) |
WDG Driver Instance ID.
| #define WDG_E_DRIVER_STATE ((uint8) 0x10U) |
ERROR:Invalid driver state.
| #define WDG_E_PARAM_MODE ((uint8) 0x11U) |
ERROR:Invalid mode param.
| #define WDG_E_PARAM_CONFIG ((uint8) 0x12U) |
ERROR:Invalid config param.
| #define WDG_E_PARAM_TIMEOUT ((uint8) 0x13U) |
ERROR:Invalid timeout value.
| #define WDG_E_PARAM_POINTER ((uint8) 0x14U) |
ERROR:Invalid NULL ptr param.
| #define WDG_E_INIT_FAILED ((uint8) 0x15U) |
ERROR:Invalid configuration set selection.
| #define WDG_API_INIT ((uint8) 0x00U) |
Wdg_Init()
| #define WDG_API_SET_MODE ((uint8) 0x01U) |
Wdg_SetMode()
| #define WDG_SET_TRIGGER_CONDITION ((uint8) 0x03U) |
Wdg_SetTriggerCondition()
| #define WDG_API_GET_VERSION_INFO ((uint8) 0x04U) |
Wdg_GetVersionInfo()
| #define WDG_API_TRIGGER ((uint8) 0x05U) |
Wdg_Trigger()
| #define WDG_API_REGISTER_READBACK ((uint8) 0x06U) |
Wdg_RegisterReadback()
| #define WDG_WINDOW_100_PERCENT ((uint32) 0x00000005U) |
Window open 100% of interval.
| #define WDG_WINDOW_50_PERCENT ((uint32) 0x00000050U) |
Window open 50% of interval.
| #define WDG_WINDOW_25_PERCENT ((uint32) 0x00000500U) |
Window open 25% of interval.
| #define WDG_WINDOW_12P5_PERCENT ((uint32) 0x00005000U) |
Window open 12.5% of interval.
| #define WDG_WINDOW_6P25_PERCENT ((uint32) 0x00050000U) |
Window open 6.25% of interval.
| #define WDG_WINDOW_3P125_PERCENT ((uint32) 0x00500000U) |
Window open 3.125% of interval.
| #define INIT_VAL_ZERO (0U) |
For assigning use macro name instead of value 0U to avoid MISRAC violation.
| enum Wdg_StatusType |
Watchdog driver state.
The WDG state is used internally to check that Watchdog trigger happens only in IDLE state.Also additional check to check Wdg_Init is invoked before any other Wdg API is called.
| FUNC | ( | void | , |
| WDG_CODE | |||
| ) |
This service returns the version information of this module.
This function triggers the servicing of the watchdog.
Sets the timeout value for the trigger counter.
This service initializes the WDG driver.
* Service name : Wdg_GetVersionInfo * Syntax : void Wdg_GetVersionInfo(Std_VersionInfoType* * versioninfo) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x04U * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout): None * Parameters (out) : versioninfo - Pointer to where to store the version * information of this module. * Return value : None * Description : This service returns the version information of this * module *
* Service name : Wdg_Init * Syntax : void Wdg_Init(const Wdg_ConfigType* CfgPtr) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x0 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : CfgPtr - Pointer to WDG driver configuration set. * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : This service initializes the WDG driver *
* Service name : Wdg_SetTriggerCondition * Syntax : void Wdg_SetTriggerCondition( uint16 timeout ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x03 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : timeout - Timeout value (milliseconds) for setting the * trigger counter * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : Sets the timeout value for the trigger counter *
* Function name : Wdg_Trigger * Syntax : void Wdg_Trigger( void ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x05 * Sync/Async : Synchronous * Reentrancy : Non-Reentrant * Parameters (in) : None * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : This function is the watchdog trigger * This function is invoked from WdgIsr *
| FUNC | ( | Std_ReturnType | , |
| WDG_CODE | |||
| ) |
This function triggers the servicing of the watchdog.
This function reads the important registers of the hardware unit and returns the value in the structure.
* Function name : Wdg_SetMode * Syntax : Std_ReturnType Wdg_SetMode(WdgIf_ModeType Mode) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x01 * Sync/Async : Synchronous * Reentrancy : Non-Reentrant * Parameters (in) : Mode * Parameters (inout): None * Parameters (out) : None * Return value : E_OK * Description : This function is not supported. * Always returns E_OK, Wdg_SetMode is made available because * WDG Interface layer expects this function to be present. *
This API should be called after Wdg_Init is called. Otherwise this API will return E_NOT_OK.
This API could be used to readback the register contents after Wdg_Init and then the readback value could be compared during WDG execution to check the correctness of the HW unit. Since this API is used for this purpose, register returned are the ones which doesn't change after init.
* Service name : Wdg_RegisterReadback * Mode : Supervisor Mode (Privileged Mode) * Sync/Async : Synchronous * Service ID[hex] : 0x06 * Reentrancy : Reentrant * Parameters (inout) : regRbPtr - Pointer to where to store the readback * values. If this pointer is NULL_PTR, then the API * will return E_NOT_OK. * Return value : Std_ReturnType * E_OK: Register read back has been done * E_NOT_OK: Register read back failed *
| AUTOMATIC |
| WDG_APPL_CONST CfgPtr |
| WDG_APPL_DATA regRbPtr |