Detailed Description

Watchdog Peripheral Abstraction Layer.

Data Structures

struct  wdg_option_mode_t
 WDG PAL option mode configuration structure Implements : wdg_option_mode_t_Class. More...
 
struct  wdg_config_t
 WDG PAL configuration structure Implements : wdg_config_t_Class. More...
 

Enumerations

enum  wdg_clock_source_t { WDG_PAL_BUS_CLOCK = 0x00U, WDG_PAL_LPO_CLOCK = 0x01U, WDG_PAL_SOSC_CLOCK = 0x02U, WDG_PAL_SIRC_CLOCK = 0x03U }
 Clock sources for the WDG PAL. Implements : wdg_clock_source_t_Class. More...
 
enum  wdg_inst_type_t { WDG_INST_TYPE_WDOG = 0U }
 Enumeration with the types of peripherals supported by Watchdog PAL. More...
 

WDG PAL API

status_t WDG_Init (const wdg_instance_t *const instance, const wdg_config_t *configPtr)
 Initializes the WDG PAL. More...
 
void WDG_GetDefaultConfig (wdg_config_t *const config)
 Gets default configuration of the WDG PAL. More...
 
void WDG_Refresh (const wdg_instance_t *const instance)
 Refreshes the WDG PAL counter. More...
 
status_t WDG_Deinit (const wdg_instance_t *const instance)
 De-initializes the WDG PAL. More...
 
status_t WDG_SetInt (const wdg_instance_t *const instance, bool enable)
 Set interrupt for WDG PAL. More...
 
status_t WDG_SetTimeout (const wdg_instance_t *const instance, uint32_t value)
 Sets the value of the WDG PAL timeout. More...
 
status_t WDG_SetWindow (const wdg_instance_t *const instance, bool enable, uint32_t value)
 Set window mode and window value of the WDG PAL. More...
 
status_t WDG_GetCounter (const wdg_instance_t *const instance, uint32_t *value)
 Gets the value of the WDG PAL counter. More...
 
void WDG_ClearIntFlag (const wdg_instance_t *const instance)
 Clears the Timeout Interrupt Flag. More...
 

Enumeration Type Documentation

Clock sources for the WDG PAL. Implements : wdg_clock_source_t_Class.

Enumerator
WDG_PAL_BUS_CLOCK 

Bus clock

WDG_PAL_LPO_CLOCK 

LPO clock

WDG_PAL_SOSC_CLOCK 

SOSC clock

WDG_PAL_SIRC_CLOCK 

SIRC clock

Definition at line 55 of file wdg_pal.h.

Enumeration with the types of peripherals supported by Watchdog PAL.

This enumeration contains the types of peripherals supported by Watchdog PAL. Implements : wdg_inst_type_t_Class

Enumerator
WDG_INST_TYPE_WDOG 

Definition at line 45 of file wdg_pal_mapping.h.

Function Documentation

void WDG_ClearIntFlag ( const wdg_instance_t *const  instance)

Clears the Timeout Interrupt Flag.

This function clears the Timeout Interrupt Flag.

Parameters
[in]instanceThe name of the instance.

Definition at line 471 of file wdg_pal.c.

status_t WDG_Deinit ( const wdg_instance_t *const  instance)

De-initializes the WDG PAL.

This function resets all configuration to default and disable the WDG PAL instance.

Parameters
[in]instanceThe name of the instance.
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed due to WDG PAL was locked.
  • STATUS_UNSUPPORTED : Operation was unsupported.

Definition at line 285 of file wdg_pal.c.

status_t WDG_GetCounter ( const wdg_instance_t *const  instance,
uint32_t *  value 
)

Gets the value of the WDG PAL counter.

This function gets counter of WDG PAL module. Note that: Counter will be reset to timeout value if WDG PAL uses SWT. The counter will continue to run if WDG PAL uses WDOG.

Parameters
[in]instanceThe name of the instance.
[out]valuePointer to the counter value
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed due to SWT was lock by hard lock.
  • STATUS_UNSUPPORTED : Operation was unsupported.

Definition at line 427 of file wdg_pal.c.

void WDG_GetDefaultConfig ( wdg_config_t *const  config)

Gets default configuration of the WDG PAL.

This function gets the default configuration of the WDG PAL.

Parameters
[out]configuresthe default configuration

Definition at line 209 of file wdg_pal.c.

status_t WDG_Init ( const wdg_instance_t *const  instance,
const wdg_config_t configPtr 
)

Initializes the WDG PAL.

This function initializes the WDG instance by user configuration

Parameters
[in]instanceThe name of the instance.
[in]configPtrPointer to the WDG PAL user configuration structure
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed. Possible causes: previous clock source or the one specified in the configuration structure is disabled; WDG PAL configuration updates are not allowed.
  • STATUS_UNSUPPORTED : Operation was unsupported.

Definition at line 83 of file wdg_pal.c.

void WDG_Refresh ( const wdg_instance_t *const  instance)

Refreshes the WDG PAL counter.

This function resets the WDG PAL counter

Parameters
[in]instanceThe name of the instance.

Definition at line 246 of file wdg_pal.c.

status_t WDG_SetInt ( const wdg_instance_t *const  instance,
bool  enable 
)

Set interrupt for WDG PAL.

This function enables/disables the WDG PAL timeout interrupt and sets a function to be called when a timeout interrupt is received, before reset.

Parameters
[in]instanceThe name of the instance.
[in]enable
  • true : Enable interrupt
  • false : Disable interrupt
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed. Possible causes: failed to WDG PAL configuration updates not allowed.
  • STATUS_UNSUPPORTED: Operation was unsupported.

Definition at line 319 of file wdg_pal.c.

status_t WDG_SetTimeout ( const wdg_instance_t *const  instance,
uint32_t  value 
)

Sets the value of the WDG PAL timeout.

This function sets the value of the WDG PAL timeout.

Parameters
[in]instanceThe name of the instance.
[in]valueThe value of the WDG PAL timeout.
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed due to WDG PAL was locked.
  • STATUS_UNSUPPORTED : Operation was unsupported.

Definition at line 354 of file wdg_pal.c.

status_t WDG_SetWindow ( const wdg_instance_t *const  instance,
bool  enable,
uint32_t  value 
)

Set window mode and window value of the WDG PAL.

This function set window mode, window value is set when window mode enabled.

Parameters
[in]instanceThe name of the instance.
[in]enable
  • true : Enable window mode
  • false : Disable window mode
[in]valueThe value of the WDG PAL window.
Returns
operation status
  • STATUS_SUCCESS : Operation was successful.
  • STATUS_ERROR : Operation failed due to WDG PAL was locked.
  • STATUS_UNSUPPORTED : Operation was unsupported.

Definition at line 389 of file wdg_pal.c.