![]() |
S32 SDK
|
Watchdog Timer Hardware Abstraction Level.
This HAL provides low-level access to all hardware features of the WDOG.
Data Structures | |
struct | wdog_op_mode_t |
WDOG configuration structure Implements : wdog_op_mode_t_Class. More... | |
struct | wdog_user_config_t |
WDOG configuration structure Implements : wdog_user_config_t_Class. More... | |
Macros | |
#define | WDOG_UNLOCK32(base) |
#define | WDOG_UNLOCK16(base) |
#define | WDOG_UNLOCK(base) |
Enumerations | |
enum | wdog_clk_source_t { WDOG_BUS_CLOCK = 0x00U, WDOG_LPO_CLOCK = 0x01U, WDOG_SOSC_CLOCK = 0x02U, WDOG_SIRC_CLOCK = 0x03U } |
Clock sources for the WDOG. Implements : wdog_clk_source_t_Class. More... | |
enum | wdog_test_mode_t { WDOG_TST_DISABLED = 0x00U, WDOG_TST_USER = 0x01U, WDOG_TST_LOW = 0x02U, WDOG_TST_HIGH = 0x03U } |
Test modes for the WDOG. Implements : wdog_test_mode_t_Class. More... | |
WDOG Common Configurations | |
void | WDOG_HAL_Init (WDOG_Type *base) |
Initializes the WDOG. More... | |
static bool | WDOG_HAL_IsEnabled (const WDOG_Type *base) |
Verifies if the WDOG is enabled. More... | |
static void | WDOG_HAL_Enable (WDOG_Type *base) |
Enables the WDOG. More... | |
static void | WDOG_HAL_Disable (WDOG_Type *base) |
Disables the WDOG. More... | |
static void | WDOG_HAL_Trigger (WDOG_Type *base) |
Refreshes the WDOG counter. More... | |
void | WDOG_HAL_Config (WDOG_Type *base, const wdog_user_config_t *config) |
Configures all WDOG registers. More... | |
wdog_user_config_t | WDOG_HAL_GetConfig (const WDOG_Type *base) |
Gets the current WDOG configuration. More... | |
static void | WDOG_HAL_SetWindow (WDOG_Type *base, bool enable) |
Enables/Disables window mode. More... | |
static bool | WDOG_HAL_GetInt (const WDOG_Type *base) |
Gets Interrupt Flag (FLG) status. More... | |
static void | WDOG_HAL_ClearInt (WDOG_Type *base) |
Clears the Interrupt Flag. More... | |
static void | WDOG_HAL_SetPrescaler (WDOG_Type *base, bool enable) |
Enables/Disables prescaler. More... | |
static void | WDOG_HAL_SetClockSource (WDOG_Type *base, wdog_clk_source_t clkSource) |
Selects the clock source used by the WDOG. More... | |
static void | WDOG_HAL_SetInt (WDOG_Type *base, bool enable) |
Enables/Disables WDOG interrupt. More... | |
static bool | WDOG_HAL_IsUpdateEnabled (const WDOG_Type *base) |
Verifies if the WDOG updates are allowed. More... | |
static void | WDOG_HAL_SetUpdate (WDOG_Type *base, bool enable) |
Enables/Disables WDOG updates. More... | |
static wdog_test_mode_t | WDOG_HAL_GetTestMode (const WDOG_Type *base) |
Gets the WDOG test mode. More... | |
static void | WDOG_HAL_SetTestMode (WDOG_Type *base, wdog_test_mode_t testMode) |
Changes the WDOG test mode. More... | |
static void | WDOG_HAL_SetDebug (WDOG_Type *base, bool enable) |
Enables/Disables WDOG in debug mode. More... | |
static void | WDOG_HAL_SetWait (WDOG_Type *base, bool enable) |
Enables/Disables WDOG in wait mode. More... | |
static void | WDOG_HAL_SetStop (WDOG_Type *base, bool enable) |
Enables/Disables WDOG in stop mode. More... | |
static uint16_t | WDOG_HAL_GetCounter (const WDOG_Type *base) |
Gets the value of the WDOG counter. More... | |
static void | WDOG_HAL_SetCounter (WDOG_Type *base, uint32_t counter) |
Sets the value of the WDOG counter. More... | |
static uint16_t | WDOG_HAL_GetTimeout (const WDOG_Type *base) |
Gets the value of the WDOG timeout. More... | |
static void | WDOG_HAL_SetTimeout (WDOG_Type *base, uint16_t timeout) |
Sets the value of the WDOG timeout. More... | |
static void | WDOG_HAL_SetWindowValue (WDOG_Type *base, uint16_t window) |
Sets the value of the WDOG window. More... | |
static bool | WDOG_HAL_IsUnlocked (const WDOG_Type *base) |
Checks if the WDOG is unlocked. More... | |
static bool | WDOG_HAL_IsReconfigurationComplete (const WDOG_Type *base) |
Checks if the last configuration of the WDOG was successful. More... | |
static void | WDOG_HAL_SetCmd32 (WDOG_Type *base, bool enable) |
Enables/Disables support for 32-bit refresh/unlock command write words. More... | |
#define WDOG_UNLOCK | ( | base | ) |
Definition at line 118 of file wdog_hal.h.
#define WDOG_UNLOCK16 | ( | base | ) |
Definition at line 111 of file wdog_hal.h.
#define WDOG_UNLOCK32 | ( | base | ) |
Definition at line 106 of file wdog_hal.h.
enum wdog_clk_source_t |
Clock sources for the WDOG. Implements : wdog_clk_source_t_Class.
Enumerator | |
---|---|
WDOG_BUS_CLOCK |
Bus clock |
WDOG_LPO_CLOCK |
LPO clock |
WDOG_SOSC_CLOCK |
SOSC clock |
WDOG_SIRC_CLOCK |
SIRC clock |
Definition at line 58 of file wdog_hal.h.
enum wdog_test_mode_t |
Test modes for the WDOG. Implements : wdog_test_mode_t_Class.
Definition at line 69 of file wdog_hal.h.
|
inlinestatic |
Clears the Interrupt Flag.
This function clears the Interrupt Flag (FLG).
[in] | base | WDOG base pointer. Implements : WDOG_HAL_ClearInt_Activity |
Definition at line 287 of file wdog_hal.h.
void WDOG_HAL_Config | ( | WDOG_Type * | base, |
const wdog_user_config_t * | config | ||
) |
Configures all WDOG registers.
This function configures all WDOG registers.
[in] | base | WDOG base pointer. |
[in] | config | the new configuration to be used. |
Definition at line 64 of file wdog_hal.c.
|
inlinestatic |
Disables the WDOG.
This function diables the WDOG.
[in] | base | WDOG base pointer. Implements : WDOG_HAL_Disable_Activity |
Definition at line 195 of file wdog_hal.h.
|
inlinestatic |
Enables the WDOG.
This function enables the WDOG.
[in] | base | WDOG base pointer. Implements : WDOG_HAL_Enable_Activity |
Definition at line 179 of file wdog_hal.h.
wdog_user_config_t WDOG_HAL_GetConfig | ( | const WDOG_Type * | base | ) |
Gets the current WDOG configuration.
This function gets the current WDOG configuration
[in] | base | WDOG base pointer. |
Definition at line 103 of file wdog_hal.c.
|
inlinestatic |
Gets the value of the WDOG counter.
This function gets the value of the WDOG counter.
[in] | base | WDOG base pointer. |
Definition at line 519 of file wdog_hal.h.
|
inlinestatic |
Gets Interrupt Flag (FLG) status.
This function verifies if an interrupt occurred.
[in] | base | WDOG base pointer. |
Definition at line 273 of file wdog_hal.h.
|
inlinestatic |
Gets the WDOG test mode.
This function verifies the test mode of the WDOG.
[in] | base | WDOG base pointer. |
Definition at line 403 of file wdog_hal.h.
|
inlinestatic |
Gets the value of the WDOG timeout.
This function gets the value of the WDOG timeout.
[in] | base | WDOG base pointer. |
Definition at line 549 of file wdog_hal.h.
void WDOG_HAL_Init | ( | WDOG_Type * | base | ) |
Initializes the WDOG.
This function initializes the WDOG to known state.
[in] | base | WDOG base pointer. |
Definition at line 42 of file wdog_hal.c.
|
inlinestatic |
Verifies if the WDOG is enabled.
This function verifies the state of the WDOG.
[in] | base | WDOG base pointer. |
Definition at line 165 of file wdog_hal.h.
|
inlinestatic |
Checks if the last configuration of the WDOG was successful.
This function checks if the last configuration of the WDOG was successful.
[in] | base | WDOG base pointer. |
Definition at line 614 of file wdog_hal.h.
|
inlinestatic |
Checks if the WDOG is unlocked.
This function checks if the WDOG is unlocked. If the module is unlocked, reconfiguration of the registers is allowed.
[in] | base | WDOG base pointer. |
Definition at line 599 of file wdog_hal.h.
|
inlinestatic |
Verifies if the WDOG updates are allowed.
This function verifies if software is allowed to reconfigure the WDOG without a reset.
[in] | base | WDOG base pointer. |
Definition at line 367 of file wdog_hal.h.
|
inlinestatic |
Selects the clock source used by the WDOG.
This function selects the clock source used by the WDOG.
[in] | base | WDOG base pointer. |
[in] | clkSource | the clock source to be used by the WDOG:
|
Definition at line 325 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables support for 32-bit refresh/unlock command write words.
This function enables/disables support for 32-bit refresh/unlock command write words.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable 32-bit refresh/unlock command write words. Implements : WDOG_HAL_SetCmd32_Activity |
Definition at line 629 of file wdog_hal.h.
|
inlinestatic |
Sets the value of the WDOG counter.
This sets the value of the WDOG counter.
[in] | base | WDOG base pointer. |
[in] | counter | the value of the WDOG counter. Implements : WDOG_HAL_SetCounter_Activity |
Definition at line 534 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables WDOG in debug mode.
This function enables/disables the WDOG in debug mode.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable WDOG in debug mode Implements : WDOG_HAL_SetDebug_Activity |
Definition at line 468 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables WDOG interrupt.
This function enables/disables the interrupts from the WDOG.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable interrupts. Implements : WDOG_HAL_SetInt_Activity |
Definition at line 347 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables prescaler.
This function enables/disables the prescaler for the WDOG.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable prescaler. Implements : WDOG_HAL_SetPrescaler_Activity |
Definition at line 304 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables WDOG in stop mode.
This function enables/disables the WDOG in stop mode.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable WDOG in stop mode. Implements : WDOG_HAL_SetStop_Activity |
Definition at line 502 of file wdog_hal.h.
|
inlinestatic |
Changes the WDOG test mode.
This function changes the test mode of the WDOG. If the WDOG is tested in mode, software should set this field to 0x01U in order to indicate that the WDOG is functioning normally.
[in] | base | WDOG base pointer. |
testMode | the test mode:
|
Definition at line 446 of file wdog_hal.h.
|
inlinestatic |
Sets the value of the WDOG timeout.
This sets the value of the WDOG timeout.
[in] | base | WDOG base pointer. |
[in] | timeout | the value of the WDOG timeout. Implements : WDOG_HAL_SetTimeout_Activity |
Definition at line 564 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables WDOG updates.
This function enables/disables the possibility to update the WDOG config.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable updates. Implements : WDOG_HAL_SetUpdate_Activity |
Definition at line 382 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables WDOG in wait mode.
This function enables/disables the WDOG in wait mode.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable WDOG in wait mode. Implements : WDOG_HAL_SetWait_Activity |
Definition at line 485 of file wdog_hal.h.
|
inlinestatic |
Enables/Disables window mode.
This function enables/disables window mode for the WDOG.
[in] | base | WDOG base pointer. |
[in] | enable | enable/disable window mode Implements : WDOG_HAL_SetWindow_Activity |
Definition at line 254 of file wdog_hal.h.
|
inlinestatic |
Sets the value of the WDOG window.
This sets the value of the WDOG window.
[in] | base | WDOG base pointer. |
[in] | window | the value of the WDOG window. Implements : WDOG_HAL_SetWindowValue_Activity |
Definition at line 581 of file wdog_hal.h.
|
inlinestatic |
Refreshes the WDOG counter.
[in] | base | WDOG base pointer. Implements : WDOG_HAL_Trigger_Activity |
Definition at line 208 of file wdog_hal.h.