EWDG driver APIs. More...
Modules | |
| EWDG Event definitions | |
| EWDG Events. | |
| EWDG Password definitions | |
| EWDG Password Definitions. | |
| EWDG interrupt definitions | |
| EWDG Interrupts. | |
| EWDG reset source definitions | |
| EWDG Resets. | |
Data Structures | |
| struct | ewdg_func_ctrl_config_t |
| struct | ewdg_interrupt_reset_config_t |
| EWDG Reset and Interrupt Configurations. More... | |
| struct | ewdg_config_t |
| Enhanced Watchdog Configuration Structure. More... | |
Functions | |
| static bool | ewdg_is_ctrl_reg_locked (EWDG_Type *ptr) |
| Check whether the Control Registers are locked. More... | |
| static uint32_t | ewdg_get_count_clk_divider (EWDG_Type *ptr) |
| Get the Divider for Counter Clock. More... | |
| static bool | ewdg_is_refresh_locked (EWDG_Type *ptr) |
| Check whether the Refresh register is locked. More... | |
| static void | ewdg_unlock_ctrl_regs (EWDG_Type *ptr) |
| Unlock Write to Control Registers. More... | |
| static void | ewdg_write_refresh_reg (EWDG_Type *ptr) |
| Write Refresh Magic Number to EWDG Refresh register. More... | |
| static uint32_t | ewdg_get_timeout_reset_ticks (EWDG_Type *ptr) |
| Get the Timeout Reset ticks. More... | |
| static void | ewdg_clear_status_flags (EWDG_Type *ptr, uint32_t mask) |
| Clear Interrupt Status for EWDG. More... | |
| static uint32_t | ewdg_get_status_flags (EWDG_Type *ptr) |
| Get the Status of EWDG. More... | |
| static ewdg_refresh_unlock_method_t | ewdg_get_refresh_unlock_method (EWDG_Type *ptr) |
| Get the Refresh Unlock Mechanism. More... | |
| void | ewdg_enable (EWDG_Type *ptr) |
| Enable EWDG. More... | |
| void | ewdg_disable (EWDG_Type *ptr) |
| Disable EWDG. More... | |
| hpm_stat_t | ewdg_init_ctrl_func (EWDG_Type *ptr, ewdg_func_ctrl_config_t *config, uint32_t cnt_src_freq) |
| Initialize the Control function for EWDG. More... | |
| hpm_stat_t | ewdg_init_interrupt_reset (EWDG_Type *ptr, ewdg_interrupt_reset_config_t *config) |
| Initialize the Error function for EWDG. More... | |
| void | ewdg_get_default_config (EWDG_Type *ptr, ewdg_config_t *config) |
| Get default configuration for EWDG. More... | |
| hpm_stat_t | ewdg_init (EWDG_Type *ptr, ewdg_config_t *config) |
| Initialize the EWDG module. More... | |
| hpm_stat_t | ewdg_unlock_refresh (EWDG_Type *ptr) |
| Unlock the write to refresh register. More... | |
| hpm_stat_t | ewdg_refresh (EWDG_Type *ptr) |
| Refresh EWDG. More... | |
| uint32_t | ewdg_get_count_clock_freq (EWDG_Type *ptr, uint32_t src_clk_freq) |
| Get the Divided Counter Clock Frequency for EWDG. More... | |
| uint64_t | ewdg_convert_timeout_us_to_timeout_ticks (uint32_t src_clk_freq, uint32_t timeout_us) |
| Convert the timeout in terms of microseconds to the timeout in terms of timeout ticks. More... | |
| uint32_t | ewdg_convert_timeout_ticks_to_timeout_us (EWDG_Type *ptr, uint32_t src_clk_freq, uint32_t timeout_ticks) |
| Convert the timeout in terms of timeout ticks to the timeout in terms of microseconds. More... | |
| void | ewdg_enable_interrupt (EWDG_Type *ptr, uint32_t mask) |
| Enable EWDG interrupt. More... | |
| void | ewdg_disable_interrupt (EWDG_Type *ptr, uint32_t mask) |
| Disable EWDG interrupt. More... | |
| void | ewdg_enable_reset (EWDG_Type *ptr, uint32_t mask) |
| Enable EWDG Reset. More... | |
| void | ewdg_disable_reset (EWDG_Type *ptr, uint32_t mask) |
| Disable EWDG Reset. More... | |
| void | ewdg_switch_clock_source (EWDG_Type *ptr, ewdg_cnt_clk_sel_t clk_sel) |
| Switch the EWDG clock source. More... | |
EWDG driver APIs.
| anonymous enum |
#include <drivers/inc/hpm_ewdg_drv.h>
EWDG error codes.
| Enumerator | |
|---|---|
| status_ewdg_tick_out_of_range | The tick is out of range |
| status_ewdg_div_out_of_range | Clock Divider is out of range |
| status_ewdg_feature_unsupported | Feature is not supported |
| enum ewdg_cnt_clk_sel_t |
#include <drivers/inc/hpm_ewdg_drv.h>
EWDG Clock source for internal counter.
| Enumerator | |
|---|---|
| ewdg_cnt_clk_src_bus_clk | Clock is from BUS clock |
| ewdg_cnt_clk_src_ext_osc_clk | Clock is from External OSC |
#include <drivers/inc/hpm_ewdg_drv.h>
| Enumerator | |
|---|---|
| ewdg_low_power_mode_halt | Watchdog is halted in low power mode |
| ewdg_low_power_mode_work_clock_normal | Watchdog is will work with normal clock in low power mode |
#include <drivers/inc/hpm_ewdg_drv.h>
EWDG Refresh Unlock Methods.
#include <drivers/inc/hpm_ewdg_drv.h>
EWDG Lower Window Limitations.
#include <drivers/inc/hpm_ewdg_drv.h>
EWDG Upper Window Limitations.
The Actual Upper Window = Lower Window + Upper Window Limit
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Clear Interrupt Status for EWDG.
| [in] | ptr | EWDG base |
| [in] | mask | Status Mask Bits, EWDG Event definitions |
| uint32_t ewdg_convert_timeout_ticks_to_timeout_us | ( | EWDG_Type * | ptr, |
| uint32_t | src_clk_freq, | ||
| uint32_t | timeout_ticks | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Convert the timeout in terms of timeout ticks to the timeout in terms of microseconds.
| [in] | ptr | EWDG base |
| [in] | src_clk_freq | Clock Frequency of the counter clock source |
| [in] | timeout_ticks | Timeout in terms of ticks |
| uint64_t ewdg_convert_timeout_us_to_timeout_ticks | ( | uint32_t | src_clk_freq, |
| uint32_t | timeout_us | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Convert the timeout in terms of microseconds to the timeout in terms of timeout ticks.
| [in] | src_clk_freq | Clock Frequency of the counter clock source |
| [in] | timeout_us | Timeout in terms of microseconds |
| void ewdg_disable | ( | EWDG_Type * | ptr | ) |
| void ewdg_disable_interrupt | ( | EWDG_Type * | ptr, |
| uint32_t | mask | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Disable EWDG interrupt.
| [in] | ptr | EWDG base |
| [in] | mask | Interrupt Mask, valid value refer to EWDG interrupt definitions |
< Parity bit for Control Register
| void ewdg_disable_reset | ( | EWDG_Type * | ptr, |
| uint32_t | mask | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Disable EWDG Reset.
| [in] | ptr | EWDG base |
| [in] | mask | Reset Mask, valid value refer to EWDG reset source definitions |
< Parity bit for Control Register
| void ewdg_enable | ( | EWDG_Type * | ptr | ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Enable EWDG.
This function enables the functionality of the EWDG and start the watchdog timer
| [in] | ptr | EWDG base |
| void ewdg_enable_interrupt | ( | EWDG_Type * | ptr, |
| uint32_t | mask | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Enable EWDG interrupt.
| [in] | ptr | EWDG base |
| [in] | mask | Interrupt Mask, valid value refer to EWDG interrupt definitions |
< Parity bit for Control Register
| void ewdg_enable_reset | ( | EWDG_Type * | ptr, |
| uint32_t | mask | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Enable EWDG Reset.
| [in] | ptr | EWDG base |
| [in] | mask | Reset Mask, valid value refer to EWDG reset source definitions |
< Parity bit for Control Register
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Get the Divider for Counter Clock.
| [in] | ptr | EWDG base |
| uint32_t ewdg_get_count_clock_freq | ( | EWDG_Type * | ptr, |
| uint32_t | src_clk_freq | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Get the Divided Counter Clock Frequency for EWDG.
| [in] | ptr | EWDG base |
| [in] | src_clk_freq | Source clock of the Counter clock |
| void ewdg_get_default_config | ( | EWDG_Type * | ptr, |
| ewdg_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Get default configuration for EWDG.
| [in] | ptr | EWDG base |
| [out] | config | EWDG Configuration |
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Get the Refresh Unlock Mechanism.
| [in] | ptr | EWDG base |
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Get the Status of EWDG.
| [in] | ptr | EWDG base |
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Get the Timeout Reset ticks.
| [in] | ptr | EWDG base |
| hpm_stat_t ewdg_init | ( | EWDG_Type * | ptr, |
| ewdg_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Initialize the EWDG module.
| [in] | ptr | EWDG base |
| [in] | config | EWDG configuration |
| status_invalid_argument | Invalid argument was detected |
| status_success | No error happened |
| hpm_stat_t ewdg_init_ctrl_func | ( | EWDG_Type * | ptr, |
| ewdg_func_ctrl_config_t * | config, | ||
| uint32_t | cnt_src_freq | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Initialize the Control function for EWDG.
| [in] | ptr | EWDG base |
| [in] | config | Control Function Configuration |
| [in] | cnt_src_freq | Source frequency for EWDG counter |
| status_invalid_argument | Invalid argument was detected |
| status_success | No error happened |
< Parity bit for Control Register
| hpm_stat_t ewdg_init_interrupt_reset | ( | EWDG_Type * | ptr, |
| ewdg_interrupt_reset_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Initialize the Error function for EWDG.
| [in] | ptr | EWDG base |
| [in] | config | Error Function Configuration |
| status_invalid_argument | Invalid argument was detected |
| status_success | No error happened |
< Parity bit for Control Register
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Check whether the Control Registers are locked.
| [in] | ptr | EWDG base |
| true | Control Registers are locked |
| false | Control Registers are unlocked |
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Check whether the Refresh register is locked.
| [in] | ptr | EWDG base |
| true | Control Registers are locked |
| false | Control Registers are unlocked |
| hpm_stat_t ewdg_refresh | ( | EWDG_Type * | ptr | ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Refresh EWDG.
| [in] | ptr | EWDG base |
| status_invalid_argument | Invalid argument was detected |
| status_success | No error happened |
| void ewdg_switch_clock_source | ( | EWDG_Type * | ptr, |
| ewdg_cnt_clk_sel_t | clk_sel | ||
| ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Switch the EWDG clock source.
| [in] | ptr | EWDG base |
| [in] | clk_sel | Clock source selection for EWDG counter |
< Parity bit for Control Register
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Unlock Write to Control Registers.
| [in] | ptr | EWDG base |
| hpm_stat_t ewdg_unlock_refresh | ( | EWDG_Type * | ptr | ) |
#include <drivers/inc/hpm_ewdg_drv.h>
Unlock the write to refresh register.
| [in] | ptr | EWDG base |
| status_invalid_argument | Invalid argument was detected |
| status_success | No error happened |
|
inlinestatic |
#include <drivers/inc/hpm_ewdg_drv.h>
Write Refresh Magic Number to EWDG Refresh register.
| [in] | ptr | EWDG base |
< EWDG Refresh key