47 #include "wdog_hw_access.h"
64 #ifdef DEV_ERROR_DETECT
114 #ifdef DEV_ERROR_DETECT
115 uint32_t prevClockHz, crtClockHz;
119 prevClockHz = WDOG_DRV_GetClockSourceFreq(WDOG_GetClockSource(s_wdogBase[instance]));
120 crtClockHz = WDOG_DRV_GetClockSourceFreq(userConfigPtr->
clkSource);
122 if ((prevClockHz == 0U) || (crtClockHz == 0U))
139 status = WDOG_Config(base, userConfigPtr);
172 if (WDOG_IsUpdateEnabled(base))
203 const WDOG_Type *baseAddr = s_wdogBase[instance];
205 *config = WDOG_GetConfig(baseAddr);
249 if (WDOG_IsUpdateEnabled(base))
254 WDOG_SetInt(base, enable);
279 WDOG_ClearIntFlag(base);
307 const WDOG_Type * base = s_wdogBase[instance];
309 return (uint16_t)base->
CNT;
321 uint16_t windowvalue)
328 if (WDOG_IsUpdateEnabled(base))
331 WDOG_SetWindowMode(base, enable);
337 WDOG_SetWindowValue(base, windowvalue);
364 if (WDOG_IsUpdateEnabled(base))
370 WDOG_SetDebug(base, enable);
374 WDOG_SetWait(base, enable);
378 WDOG_SetStop(base, enable);
408 if (WDOG_IsUpdateEnabled(base))
412 base->
TOVAL = timeout;
434 uint32_t regValue = base->
CS;
438 if (WDOG_IsUpdateEnabled(base))
465 const WDOG_Type * base = s_wdogBase[instance];
469 switch (WDOG_GetTestMode(base))
void WDOG_DRV_GetDefaultConfig(wdog_user_config_t *const config)
Gets default configuration of the WDOG.
status_t WDOG_DRV_Deinit(uint32_t instance)
De-initializes the WDOG driver.
status_t WDOG_DRV_Init(uint32_t instance, const wdog_user_config_t *userConfigPtr)
Initializes the WDOG driver.
void WDOG_DRV_ClearIntFlag(uint32_t instance)
Clear interrupt flag of the WDOG.
static WDOG_Type *const s_wdogBase[]
Table of base addresses for WDOG instances.
#define FEATURE_WDOG_TO_RESET_VALUE
static const IRQn_Type s_wdogIrqId[]
Table to save WDOG IRQ enum numbers defined in CMSIS header file.
void INT_SYS_DisableIRQ(IRQn_Type irqNumber)
Disables an interrupt for a given IRQ number.
void INT_SYS_DisableIRQGlobal(void)
Disable system interrupt.
WDOG user configuration structure Implements : wdog_user_config_t_Class.
status_t CLOCK_SYS_GetFreq(clock_names_t clockName, uint32_t *frequency)
Gets the clock frequency for a specific clock name.
status_t WDOG_DRV_SetTestMode(uint32_t instance, wdog_test_mode_t testMode)
Changes the WDOG test mode.
status_t WDOG_DRV_SetMode(uint32_t instance, bool enable, wdog_set_mode_t Setmode)
Sets the mode operation of the WDOG.
#define FEATURE_WDOG_WIN_RESET_VALUE
wdog_clk_source_t clkSource
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
IRQn_Type
Defines the Interrupt Numbers definitions.
uint16_t WDOG_DRV_GetCounter(uint32_t instance)
Gets the value of the WDOG counter.
void INT_SYS_EnableIRQGlobal(void)
Enables system interrupt.
#define WDOG_INSTANCE_COUNT
wdog_test_mode_t
Test modes for the WDOG. Implements : wdog_test_mode_t_Class.
wdog_set_mode_t
set modes for the WDOG. Implements : wdog_set_mode_t_Class
void INT_SYS_EnableIRQ(IRQn_Type irqNumber)
Enables an interrupt for a given IRQ number.
wdog_clk_source_t
Clock sources for the WDOG. Implements : wdog_clk_source_t_Class.
status_t WDOG_DRV_SetWindow(uint32_t instance, bool enable, uint16_t windowvalue)
Set window mode and window value of the WDOG.
void WDOG_DRV_Trigger(uint32_t instance)
Refreshes the WDOG counter.
#define FEATURE_WDOG_MINIMUM_TIMEOUT_VALUE
wdog_test_mode_t WDOG_DRV_GetTestMode(uint32_t instance)
Gets the WDOG test mode.
void WDOG_DRV_GetConfig(uint32_t instance, wdog_user_config_t *const config)
Gets the current configuration of the WDOG.
status_t WDOG_DRV_SetTimeout(uint32_t instance, uint16_t timeout)
Sets the value of the WDOG timeout.
status_t WDOG_DRV_SetInt(uint32_t instance, bool enable)
Enables/Disables the WDOG timeout interrupt and sets a function to be called when a timeout interrupt...