WDG APIs. More...
Data Structures | |
| struct | wdg_control_struct |
| WDG Control configuration structure. More... | |
Macros | |
| #define | WDG_WRITE_ENABLE_MAGIC_NUM (0x5AA5UL) |
| #define | WDG_RESTART_MAGIC_NUM (0xCAFEUL) |
| #define | WDG_EXT_CLK_FREQ (32768UL) |
Typedefs | |
| typedef enum reset_interval_enum | reset_interval_t |
| WDG Reset Interval definitions. More... | |
| typedef enum interrupt_interval_enum | interrupt_interval_t |
| WDG Interrupt interval definitions. More... | |
| typedef enum wdg_clksrc_enum | wdg_clksrc_t |
| WDG clock source definitions. More... | |
| typedef struct wdg_control_struct | wdg_control_t |
| WDG Control configuration structure. More... | |
Functions | |
| static void | wdg_write_enable (WDG_Type *base) |
| WDG write enable function. More... | |
| static void | wdg_enable (WDG_Type *base) |
| WDG Enable function. More... | |
| static void | wdg_disable (WDG_Type *base) |
| WDG Disable function. More... | |
| static void | wdg_reset_enable (WDG_Type *base) |
| WDG reset enable function. More... | |
| static void | wdg_reset_disable (WDG_Type *base) |
| WDG reset disable function. More... | |
| static void | wdg_interrupt_enable (WDG_Type *base) |
| WDG interrupt enable function. More... | |
| static void | wdg_interrupt_disable (WDG_Type *base) |
| WDG interrupt disable function. More... | |
| static void | wdg_clksrc_select (WDG_Type *base, wdg_clksrc_t clksrc) |
| WDG Clock Source selection function. More... | |
| static void | wdg_restart (WDG_Type *base) |
| WDG restart function. More... | |
| static uint32_t | wdg_get_status (WDG_Type *base) |
| WDG Get Status function. More... | |
| static void | wdg_clear_status (WDG_Type *base, uint32_t status_mask) |
| WDG clear status function. More... | |
| hpm_stat_t | wdg_init (WDG_Type *base, wdg_control_t *wdg_ctrl) |
| WDG initialization function. More... | |
| reset_interval_t | wdg_convert_reset_interval_from_us (const uint32_t src_freq, const uint32_t reset_us) |
| Convert the Reset interval value based on the WDG source clock frequency and the expected reset interval in terms of microseconds. More... | |
| uint64_t | wdg_convert_interrupt_interval_to_us (const uint32_t src_freq, interrupt_interval_t interval) |
| Convert the interrupt interval value based on the WDG source clock frequency and the expected interrupt interval in terms of microseconds. More... | |
| uint32_t | wdg_convert_reset_interval_to_us (const uint32_t src_freq, reset_interval_t interval) |
| Convert the Reset interval value based on the WDG source clock frequency and the expected reset interval in terms of microseconds. More... | |
| interrupt_interval_t | wdg_convert_interrupt_interval_from_us (const uint32_t src_freq, uint32_t interval_us) |
| Convert the interrupt interval value based on the WDG source clock frequency and the expected interrupt interval in terms of microseconds. More... | |
| uint64_t | wdg_get_interrupt_interval_in_us (WDG_Type *base, const uint32_t src_freq) |
| Get Actual WDG Interrupt Interval in terms of microseconds. More... | |
| uint64_t | wdg_get_total_reset_interval_in_us (WDG_Type *base, const uint32_t src_freq) |
| Get Actual WDG Reset Interval in terms of microseconds. More... | |
WDG APIs.
| #define WDG_EXT_CLK_FREQ (32768UL) |
#include <drivers/inc/hpm_wdg_drv.h>
WDG External CLock frequency: 32768 Hz
| #define WDG_RESTART_MAGIC_NUM (0xCAFEUL) |
#include <drivers/inc/hpm_wdg_drv.h>
WDG restart magic number
| #define WDG_WRITE_ENABLE_MAGIC_NUM (0x5AA5UL) |
#include <drivers/inc/hpm_wdg_drv.h>
WDG enable magic number
| typedef enum interrupt_interval_enum interrupt_interval_t |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Interrupt interval definitions.
| typedef enum reset_interval_enum reset_interval_t |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Reset Interval definitions.
| typedef enum wdg_clksrc_enum wdg_clksrc_t |
#include <drivers/inc/hpm_wdg_drv.h>
WDG clock source definitions.
| typedef struct wdg_control_struct wdg_control_t |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Control configuration structure.
#include <drivers/inc/hpm_wdg_drv.h>
WDG Interrupt interval definitions.
| enum reset_interval_enum |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Reset Interval definitions.
| enum wdg_clksrc_enum |
#include <drivers/inc/hpm_wdg_drv.h>
WDG clock source definitions.
| Enumerator | |
|---|---|
| wdg_clksrc_extclk | WDG clock source: external clock |
| wdg_clksrc_pclk | WDG clock source: Peripheral clock |
| wdg_clksrc_max | |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG clear status function.
| [in] | base | WDG base address |
| [in] | status_mask | WDG status mask value |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Clock Source selection function.
| [in] | base | WDG base address |
| [in] | clksrc | WDG clock source
|
| interrupt_interval_t wdg_convert_interrupt_interval_from_us | ( | const uint32_t | src_freq, |
| uint32_t | interval_us | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Convert the interrupt interval value based on the WDG source clock frequency and the expected interrupt interval in terms of microseconds.
| [in] | src_freq | WDG source clock frequency |
| [in] | interval_us | Expected Interrupt interval in terms of microseconds |
| Converted | WDG interrupt interval |
| uint64_t wdg_convert_interrupt_interval_to_us | ( | const uint32_t | src_freq, |
| interrupt_interval_t | interval | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Convert the interrupt interval value based on the WDG source clock frequency and the expected interrupt interval in terms of microseconds.
| [in] | src_freq | WDG source clock frequency |
| [in] | interval | Expected Interrupt interval |
| Converted | WDG interrupt interval in us |
| reset_interval_t wdg_convert_reset_interval_from_us | ( | const uint32_t | src_freq, |
| const uint32_t | reset_us | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Convert the Reset interval value based on the WDG source clock frequency and the expected reset interval in terms of microseconds.
| [in] | src_freq | WDG source clock frequency |
| [in] | reset_us | Expected Reset interval in terms of microseconds |
| Converted | WDG reset interval |
| uint32_t wdg_convert_reset_interval_to_us | ( | const uint32_t | src_freq, |
| reset_interval_t | interval | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Convert the Reset interval value based on the WDG source clock frequency and the expected reset interval in terms of microseconds.
| [in] | src_freq | WDG source clock frequency |
| [in] | interval | Expected Reset interval |
| Converted | WDG reset interval in us |
|
inlinestatic |
|
inlinestatic |
| uint64_t wdg_get_interrupt_interval_in_us | ( | WDG_Type * | base, |
| const uint32_t | src_freq | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Get Actual WDG Interrupt Interval in terms of microseconds.
| [in] | base | WDG base address |
| [in] | src_freq | WDG source clock frequency |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG Get Status function.
| [in] | base | WDG base address |
| WDG | status register value |
| uint64_t wdg_get_total_reset_interval_in_us | ( | WDG_Type * | base, |
| const uint32_t | src_freq | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
Get Actual WDG Reset Interval in terms of microseconds.
| [in] | base | WDG base address |
| [in] | src_freq | WDG source clock frequency |
| hpm_stat_t wdg_init | ( | WDG_Type * | base, |
| wdg_control_t * | wdg_ctrl | ||
| ) |
#include <drivers/inc/hpm_wdg_drv.h>
WDG initialization function.
| [in] | base | WDG base address |
| [in] | wdg_ctrl | WDG control structure |
| API | execution status |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG interrupt disable function.
| [in] | base | WDG base address |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG interrupt enable function.
| [in] | base | WDG base address |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG reset disable function.
| [in] | base | WDG base address |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG restart function.
| [in] | base | WDG base address |
< WDG restart magic number
|
inlinestatic |
#include <drivers/inc/hpm_wdg_drv.h>
WDG write enable function.
| [in] | base | WDG base address |
< WDG enable magic number