MCUSW
Loading...
Searching...
No Matches
WDG Configuration

Introduction

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
 

Variables

uint32 Wdg_ModeInfoType::reaction
 
uint32 Wdg_ModeInfoType::windowSize
 
uint32 Wdg_ModeInfoType::timeOutVal
 
WdgIf_ModeType Wdg_ConfigType::defaultMode
 
Wdg_ModeInfoType Wdg_ConfigType::fastModeCfg
 
Wdg_ModeInfoType Wdg_ConfigType::slowModeCfg
 
uint16 Wdg_ConfigType_PC::instanceId
 
uint32 Wdg_ConfigType_PC::initialTimeOut
 
uint32 Wdg_RegisterReadbackType::rtiDwdCtrl
 
uint32 Wdg_RegisterReadbackType::rtiDwdprld
 
uint32 Wdg_RegisterReadbackType::rtiWdStatus
 
uint32 Wdg_RegisterReadbackType::rtiWdKey
 
uint32 Wdg_RegisterReadbackType::rtiWwdRxnCtrl
 
uint32 Wdg_RegisterReadbackType::rtiWwdSizeCtrl
 

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.
 

Macro Definition Documentation

◆ WDG_VARIANT_PRE_COMPILE

#define WDG_VARIANT_PRE_COMPILE   (STD_ON)

WDG Build Variant. Build variants.(i.e Pre Compile,Link Time And Post Build)

◆ WDG_INIT_CONFIG_PC

#define WDG_INIT_CONFIG_PC   WdgSettingsConfig

Pre Compile config macro name.

◆ WDG_DEV_ERROR_DETECT

#define WDG_DEV_ERROR_DETECT   (STD_ON)

Enable/Disable Development Error Detection.

◆ WDG_GET_VERSION_INFO_API

#define WDG_GET_VERSION_INFO_API   (STD_ON)

Enable/Disable Version Info API.

◆ WDG_REGISTER_READBACK_API

#define WDG_REGISTER_READBACK_API   (STD_ON)

Enable/Disable Register Readback API.

◆ WDG_MAX_TIMEOUT

#define WDG_MAX_TIMEOUT   ((uint16)65535)

Watchdog Maximum Timeout x 1000U - converting from secs so milli secs.

◆ WDG_RTI_FREQUENCY

#define WDG_RTI_FREQUENCY   ((uint32)12500000)

RTI Clock Frequency.

◆ WDG_DISABLE_ALLOWED

#define WDG_DISABLE_ALLOWED   (STD_OFF)

Watchdog Disable Allowed.

◆ WdgConf_WdgGeneral_WdgIndex_0

#define WdgConf_WdgGeneral_WdgIndex_0   (0U)

Wdg Module Instance Id, always 0 as only one instance in this case.

◆ WDG_E_MODE_FAILED

#define WDG_E_MODE_FAILED   (DemConf_DemEventParameter_WDG_E_MODE_FAILED)

Wdg write channel event ID.

◆ WDG_E_DISABLE_REJECTED

#define WDG_E_DISABLE_REJECTED   (DemConf_DemEventParameter_WDG_E_DISABLE_REJECTED)

Wdg disable rejected Dem.

◆ WDG_NUM_INSTANCE

#define WDG_NUM_INSTANCE   (12U)

Enumeration Type Documentation

◆ 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

Function Documentation

◆ Wdg_GetVersionInfo()

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
*  

◆ Wdg_Init()

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
*  

◆ Wdg_SetTriggerCondition()

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
*  

◆ Wdg_Trigger()

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
*  

◆ Wdg_SetMode()

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.
*  

◆ Wdg_RegisterReadback()

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
*  

Variable Documentation

◆ reaction

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.

◆ windowSize

uint32 Wdg_ModeInfoType::windowSize

Different Window Sizes Refer Watchdog Window Size section above for different Window sizes

◆ timeOutVal

uint32 Wdg_ModeInfoType::timeOutVal

Watchdog timeout value in milli seconds

◆ defaultMode

WdgIf_ModeType Wdg_ConfigType::defaultMode

Default mode

◆ fastModeCfg

Wdg_ModeInfoType Wdg_ConfigType::fastModeCfg

Fast mode config

◆ slowModeCfg

Wdg_ModeInfoType Wdg_ConfigType::slowModeCfg

Slow mode config

◆ instanceId

uint16 Wdg_ConfigType_PC::instanceId

Hardware Instance ID

◆ initialTimeOut

uint32 Wdg_ConfigType_PC::initialTimeOut

The initial timeout (seconds) for the trigger condition to be initialized during Init function. It shall not be > WdgMaxTimeout.

◆ rtiDwdCtrl

uint32 Wdg_RegisterReadbackType::rtiDwdCtrl

Digital Watchdog Control, To Enable DWD

◆ rtiDwdprld

uint32 Wdg_RegisterReadbackType::rtiDwdprld

Digital Watchdog Preload Value

◆ rtiWdStatus

uint32 Wdg_RegisterReadbackType::rtiWdStatus

Digital Watchdog Status Register

◆ rtiWdKey

uint32 Wdg_RegisterReadbackType::rtiWdKey

Digital Watchdog Key

◆ rtiWwdRxnCtrl

uint32 Wdg_RegisterReadbackType::rtiWwdRxnCtrl

Digital Windowed Watchdog Reaction

◆ rtiWwdSizeCtrl

uint32 Wdg_RegisterReadbackType::rtiWwdSizeCtrl

Digital Windowed Watchdog Window Size

◆ WdgSettingsConfig

const struct Wdg_ConfigType_s WdgSettingsConfig
extern

WDG Configuration struct declaration.

◆ WdgSettingsConfig_PC

const struct Wdg_ConfigType_PC_s WdgSettingsConfig_PC
extern

WDG Configuration pre compile struct declaration.

◆ RTIHwUnit_BaseAddr

const uint32 RTIHwUnit_BaseAddr[WDG_NUM_INSTANCE]
extern

Base Address of the watchdog instances.