![]() |
MCUSW
|
This files defines WDG MCAL configuration structures
Data Structures | |
struct | Wdg_ModeInfoType |
Mode info type. More... | |
struct | Wdg_ConfigType |
WDG config structure. More... | |
struct | Wdg_ConfigType_PC |
WDG pre-compile config structure. More... | |
struct | Wdg_RegisterReadbackType |
Macros | |
#define | WDG_VARIANT_PRE_COMPILE (STD_ON) |
WDG Build Variant. Build variants.(i.e Pre Compile,Link Time And Post Build) | |
#define | WDG_INIT_CONFIG_PC WdgSettingsConfig |
Pre Compile config macro name. | |
#define | WDG_DEV_ERROR_DETECT (STD_ON) |
Enable/Disable Development Error Detection. | |
#define | WDG_GET_VERSION_INFO_API (STD_ON) |
Enable/Disable Version Info API. | |
#define | WDG_REGISTER_READBACK_API (STD_ON) |
Enable/Disable Register Readback API. | |
#define | WDG_MAX_TIMEOUT ((uint16)65535) |
Watchdog Maximum Timeout x 1000U - converting from secs so milli secs. | |
#define | WDG_RTI_FREQUENCY ((uint32)12500000) |
RTI Clock Frequency. | |
#define | WDG_DISABLE_ALLOWED (STD_OFF) |
Watchdog Disable Allowed. | |
Watchdog Window Size | |
Windowed watchdog trigger window size define | |
enum | Wdg_StatusType { WDG_UNINIT , WDG_IDLE , WDG_BUSY } |
Watchdog driver state. More... | |
void | Wdg_GetVersionInfo (Std_VersionInfoType *versioninfo) |
This service returns the version information of this module. | |
void | Wdg_Init (const Wdg_ConfigType *CfgPtr) |
This service initializes the WDG driver. | |
void | Wdg_SetTriggerCondition (uint16 timeout) |
Sets the timeout value for the trigger counter. | |
void | Wdg_Trigger (void) |
This function triggers the servicing of the watchdog. | |
Std_ReturnType | Wdg_SetMode (WdgIf_ModeType Mode) |
This function triggers the servicing of the watchdog. | |
Std_ReturnType | Wdg_RegisterReadback (Wdg_RegisterReadbackType *regRbPtr) |
This function reads the important registers of the hardware unit and returns the value in the structure. | |
WDG DEM Error codes to report | |
Pre-compile switches for enabling/disabling DEM events | |
const struct Wdg_ConfigType_s | WdgSettingsConfig |
WDG Configuration struct declaration. | |
const struct Wdg_ConfigType_PC_s | WdgSettingsConfig_PC |
WDG Configuration pre compile struct declaration. | |
const uint32 | RTIHwUnit_BaseAddr [WDG_NUM_INSTANCE] |
Base Address of the watchdog instances. | |
#define | WDG_E_MODE_FAILED (DemConf_DemEventParameter_WDG_E_MODE_FAILED) |
Wdg write channel event ID. | |
#define | WDG_E_DISABLE_REJECTED (DemConf_DemEventParameter_WDG_E_DISABLE_REJECTED) |
Wdg disable rejected Dem. | |
#define | WDG_NUM_INSTANCE (12U) |
WDG Module Instance Id | |
Symbolic names for module instance id | |
#define | WdgConf_WdgGeneral_WdgIndex_0 (0U) |
Wdg Module Instance Id, always 0 as only one instance in this case. | |
#define WDG_VARIANT_PRE_COMPILE (STD_ON) |
WDG Build Variant. Build variants.(i.e Pre Compile,Link Time And Post Build)
#define WDG_INIT_CONFIG_PC WdgSettingsConfig |
Pre Compile config macro name.
#define WDG_DEV_ERROR_DETECT (STD_ON) |
Enable/Disable Development Error Detection.
#define WDG_GET_VERSION_INFO_API (STD_ON) |
Enable/Disable Version Info API.
#define WDG_REGISTER_READBACK_API (STD_ON) |
Enable/Disable Register Readback API.
#define WDG_MAX_TIMEOUT ((uint16)65535) |
Watchdog Maximum Timeout x 1000U - converting from secs so milli secs.
#define WDG_RTI_FREQUENCY ((uint32)12500000) |
RTI Clock Frequency.
#define WDG_DISABLE_ALLOWED (STD_OFF) |
Watchdog Disable Allowed.
#define WdgConf_WdgGeneral_WdgIndex_0 (0U) |
Wdg Module Instance Id, always 0 as only one instance in this case.
#define WDG_E_MODE_FAILED (DemConf_DemEventParameter_WDG_E_MODE_FAILED) |
Wdg write channel event ID.
#define WDG_E_DISABLE_REJECTED (DemConf_DemEventParameter_WDG_E_DISABLE_REJECTED) |
Wdg disable rejected Dem.
#define WDG_NUM_INSTANCE (12U) |
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.
Enumerator | |
---|---|
WDG_UNINIT | Watchdog driver is uninitialized. State on power on before invoking Wdg_Init() |
WDG_IDLE | Watchdog driver is in idle state. Default state when WDG timer regs are not being programmed |
WDG_BUSY | Watchdog driver is reprogramming the WD to trigger the watchdog |
void Wdg_GetVersionInfo | ( | Std_VersionInfoType * | versioninfo | ) |
This service returns the version information of this module.
* 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 *
void Wdg_Init | ( | const Wdg_ConfigType * | CfgPtr | ) |
This service initializes the WDG driver.
* 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 *
void Wdg_SetTriggerCondition | ( | uint16 | timeout | ) |
Sets the timeout value for the trigger counter.
* 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 *
void Wdg_Trigger | ( | void | ) |
This function triggers the servicing of the watchdog.
* 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 *
Std_ReturnType Wdg_SetMode | ( | WdgIf_ModeType | Mode | ) |
This function triggers the servicing of the watchdog.
* 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. *
Std_ReturnType Wdg_RegisterReadback | ( | Wdg_RegisterReadbackType * | regRbPtr | ) |
This function reads the important registers of the hardware unit and returns the value in the structure.
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 *
uint32 Wdg_ModeInfoType::reaction |
Reaction type 0x5 - This value causes a reset if the watchdog is serviced outside the time window defined by the configuration, or if the watchdog is not serviced at all. 0xA - The windowed watchdog will generate a non-maskable interrupt to the CPU if the watchdog is serviced outside the time window defined by the configuration, or if the watchdog is not serviced at all.
uint32 Wdg_ModeInfoType::windowSize |
Different Window Sizes Refer Watchdog Window Size section above for different Window sizes
uint32 Wdg_ModeInfoType::timeOutVal |
Watchdog timeout value in milli seconds
WdgIf_ModeType Wdg_ConfigType::defaultMode |
Default mode
Wdg_ModeInfoType Wdg_ConfigType::fastModeCfg |
Fast mode config
Wdg_ModeInfoType Wdg_ConfigType::slowModeCfg |
Slow mode config
uint16 Wdg_ConfigType_PC::instanceId |
Hardware Instance ID
uint32 Wdg_ConfigType_PC::initialTimeOut |
The initial timeout (seconds) for the trigger condition to be initialized during Init function. It shall not be > WdgMaxTimeout.
uint32 Wdg_RegisterReadbackType::rtiDwdCtrl |
Digital Watchdog Control, To Enable DWD
uint32 Wdg_RegisterReadbackType::rtiDwdprld |
Digital Watchdog Preload Value
uint32 Wdg_RegisterReadbackType::rtiWdStatus |
Digital Watchdog Status Register
uint32 Wdg_RegisterReadbackType::rtiWdKey |
Digital Watchdog Key
uint32 Wdg_RegisterReadbackType::rtiWwdRxnCtrl |
Digital Windowed Watchdog Reaction
uint32 Wdg_RegisterReadbackType::rtiWwdSizeCtrl |
Digital Windowed Watchdog Window Size
|
extern |
WDG Configuration struct declaration.
|
extern |
WDG Configuration pre compile struct declaration.
|
extern |
Base Address of the watchdog instances.