106 #define WDOG_UNLOCK32(base) \
108 (base)->CNT = FEATURE_WDOG_UNLOCK_VALUE; \
111 #define WDOG_UNLOCK16(base) \
113 (base)->CNT = FEATURE_WDOG_UNLOCK16_FIRST_VALUE; \
115 (base)->CNT = FEATURE_WDOG_UNLOCK16_SECOND_VALUE; \
118 #define WDOG_UNLOCK(base) \
120 if (((base)->CS & WDOG_CS_CMD32EN_MASK) != 0U) \
122 WDOG_UNLOCK32(base); \
126 WDOG_UNLOCK16(base); \
134 #if defined(__cplusplus)
521 return (uint16_t) base->
CNT;
551 return (uint16_t) base->
TOVAL;
568 base->
TOVAL = (uint32_t) timeout;
585 base->
WIN = (uint32_t) window;
639 #if defined(__cplusplus)
static bool WDOG_HAL_IsEnabled(const WDOG_Type *base)
Verifies if the WDOG is enabled.
static void WDOG_HAL_SetUpdate(WDOG_Type *base, bool enable)
Enables/Disables WDOG updates.
static void WDOG_HAL_SetCounter(WDOG_Type *base, uint32_t counter)
Sets the value of the WDOG counter.
void WDOG_HAL_Config(WDOG_Type *base, const wdog_user_config_t *config)
Configures all WDOG registers.
static void WDOG_HAL_SetWait(WDOG_Type *base, bool enable)
Enables/Disables WDOG in wait mode.
static void WDOG_HAL_SetStop(WDOG_Type *base, bool enable)
Enables/Disables WDOG in stop mode.
wdog_user_config_t WDOG_HAL_GetConfig(const WDOG_Type *base)
Gets the current WDOG configuration.
static wdog_test_mode_t WDOG_HAL_GetTestMode(const WDOG_Type *base)
Gets the WDOG test mode.
static void WDOG_HAL_SetDebug(WDOG_Type *base, bool enable)
Enables/Disables WDOG in debug mode.
static void WDOG_HAL_Disable(WDOG_Type *base)
Disables the WDOG.
static void WDOG_HAL_SetCmd32(WDOG_Type *base, bool enable)
Enables/Disables support for 32-bit refresh/unlock command write words.
#define WDOG_CS_UPDATE(x)
static bool WDOG_HAL_IsUnlocked(const WDOG_Type *base)
Checks if the WDOG is unlocked.
static void WDOG_HAL_SetTestMode(WDOG_Type *base, wdog_test_mode_t testMode)
Changes the WDOG test mode.
static bool WDOG_HAL_GetInt(const WDOG_Type *base)
Gets Interrupt Flag (FLG) status.
#define WDOG_CS_PRES_MASK
WDOG configuration structure Implements : wdog_user_config_t_Class.
#define WDOG_CS_RCS_SHIFT
#define FEATURE_WDOG_TRIGGER16_FIRST_VALUE
#define FEATURE_WDOG_TRIGGER16_SECOND_VALUE
static void WDOG_HAL_SetPrescaler(WDOG_Type *base, bool enable)
Enables/Disables prescaler.
#define WDOG_CS_FLG_SHIFT
void WDOG_HAL_Init(WDOG_Type *base)
Initializes the WDOG.
static uint16_t WDOG_HAL_GetCounter(const WDOG_Type *base)
Gets the value of the WDOG counter.
wdog_clk_source_t clkSource
static void WDOG_HAL_SetTimeout(WDOG_Type *base, uint16_t timeout)
Sets the value of the WDOG timeout.
wdog_clk_source_t
Clock sources for the WDOG. Implements : wdog_clk_source_t_Class.
static bool WDOG_HAL_IsReconfigurationComplete(const WDOG_Type *base)
Checks if the last configuration of the WDOG was successful.
#define WDOG_CS_WAIT_MASK
#define FEATURE_WDOG_TRIGGER_VALUE
WDOG configuration structure Implements : wdog_op_mode_t_Class.
#define WDOG_CS_CMD32EN(x)
static void WDOG_HAL_SetWindow(WDOG_Type *base, bool enable)
Enables/Disables window mode.
#define WDOG_UNLOCK(base)
#define WDOG_CS_ULK_SHIFT
#define WDOG_CS_STOP_MASK
static void WDOG_HAL_ClearInt(WDOG_Type *base)
Clears the Interrupt Flag.
static void WDOG_HAL_SetWindowValue(WDOG_Type *base, uint16_t window)
Sets the value of the WDOG window.
static void WDOG_HAL_SetClockSource(WDOG_Type *base, wdog_clk_source_t clkSource)
Selects the clock source used by the WDOG.
static void WDOG_HAL_SetInt(WDOG_Type *base, bool enable)
Enables/Disables WDOG interrupt.
static void WDOG_HAL_Trigger(WDOG_Type *base)
Refreshes the WDOG counter.
#define WDOG_CS_CMD32EN_MASK
static void WDOG_HAL_Enable(WDOG_Type *base)
Enables the WDOG.
#define WDOG_CS_UPDATE_MASK
#define WDOG_CS_TST_SHIFT
#define WDOG_CS_UPDATE_SHIFT
static bool WDOG_HAL_IsUpdateEnabled(const WDOG_Type *base)
Verifies if the WDOG updates are allowed.
static uint16_t WDOG_HAL_GetTimeout(const WDOG_Type *base)
Gets the value of the WDOG timeout.
wdog_test_mode_t
Test modes for the WDOG. Implements : wdog_test_mode_t_Class.