ChibiOS/HAL  6.1.0
WDG Driver

Generic WDG Driver. More...

Collaboration diagram for WDG Driver:

Detailed Description

Generic WDG Driver.

This module defines an abstract interface for a watchdog timer.

Precondition
In order to use the WDG driver the HAL_USE_WDG option must be enabled in halconf.h.

Macros

#define wdgResetI(wdgp)   wdg_lld_reset(wdgp)
 Resets WDG's counter. More...
 

Configuration options

#define PLATFORM_WDG_USE_WDG1   FALSE
 WDG1 driver enable switch. More...
 

Typedefs

typedef struct WDGDriver WDGDriver
 Type of a structure representing an WDG driver. More...
 

Data Structures

struct  WDGConfig
 Driver configuration structure. More...
 
struct  WDGDriver
 Structure representing an WDG driver. More...
 

Functions

void wdgInit (void)
 WDG Driver initialization. More...
 
void wdgStart (WDGDriver *wdgp, const WDGConfig *config)
 Configures and activates the WDG peripheral. More...
 
void wdgStop (WDGDriver *wdgp)
 Deactivates the WDG peripheral. More...
 
void wdgReset (WDGDriver *wdgp)
 Resets WDG's counter. More...
 
void wdg_lld_init (void)
 Low level WDG driver initialization. More...
 
void wdg_lld_start (WDGDriver *wdgp)
 Configures and activates the WDG peripheral. More...
 
void wdg_lld_stop (WDGDriver *wdgp)
 Deactivates the WDG peripheral. More...
 
void wdg_lld_reset (WDGDriver *wdgp)
 Reloads WDG's counter. More...
 

Enumerations

Macro Definition Documentation

#define wdgResetI (   wdgp)    wdg_lld_reset(wdgp)

Resets WDG's counter.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 68 of file hal_wdg.h.

Referenced by wdgReset().

#define PLATFORM_WDG_USE_WDG1   FALSE

WDG1 driver enable switch.

Note
The default is FALSE.

Definition at line 47 of file hal_wdg_lld.h.

Typedef Documentation

typedef struct WDGDriver WDGDriver

Type of a structure representing an WDG driver.

Definition at line 62 of file hal_wdg_lld.h.

Enumeration Type Documentation

enum wdgstate_t

Driver state machine possible states.

Enumerator
WDG_UNINIT 

Not initialized.

WDG_STOP 

Stopped.

WDG_READY 

Ready.

Definition at line 49 of file hal_wdg.h.

Function Documentation

void wdgInit ( void  )

WDG Driver initialization.

Note
This function is implicitly invoked by halInit(), there is no need to explicitly initialize the driver.
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 56 of file hal_wdg.c.

References wdg_lld_init().

Referenced by halInit().

Here is the call graph for this function:

void wdgStart ( WDGDriver wdgp,
const WDGConfig config 
)

Configures and activates the WDG peripheral.

Parameters
[in]wdgppointer to the WDGDriver object
[in]configpointer to the WDGConfig object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 69 of file hal_wdg.c.

References WDGDriver::config, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), WDGDriver::state, wdg_lld_start(), WDG_READY, and WDG_STOP.

Here is the call graph for this function:

void wdgStop ( WDGDriver wdgp)

Deactivates the WDG peripheral.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 89 of file hal_wdg.c.

References WDGDriver::config, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), WDGDriver::state, wdg_lld_stop(), WDG_READY, and WDG_STOP.

Here is the call graph for this function:

void wdgReset ( WDGDriver wdgp)

Resets WDG's counter.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 112 of file hal_wdg.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), WDGDriver::state, WDG_READY, and wdgResetI.

Here is the call graph for this function:

void wdg_lld_init ( void  )

Low level WDG driver initialization.

Function Class:Not an API, this function is for internal use only.

Definition at line 62 of file hal_wdg_lld.c.

Referenced by wdgInit().

void wdg_lld_start ( WDGDriver wdgp)

Configures and activates the WDG peripheral.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 73 of file hal_wdg_lld.c.

Referenced by wdgStart().

void wdg_lld_stop ( WDGDriver wdgp)

Deactivates the WDG peripheral.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 85 of file hal_wdg_lld.c.

Referenced by wdgStop().

void wdg_lld_reset ( WDGDriver wdgp)

Reloads WDG's counter.

Parameters
[in]wdgppointer to the WDGDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 97 of file hal_wdg_lld.c.