WDT Class

WDT Class

Description
A class used for initializing, starting, stopping watchdog timer.

Syntax

class WDT

Members

Public Constructors 
A public constructor should not be used as this class is intended to be a singleton class. Access member functions using the object instance named WDT.
Public Methods 
WDT::InitWatchdogInitialize the watchdog, including time setting, and mode register.
WDT::StartWatchdogEnable and start the watchdog timer.
WDT::StopWatchdogStop the watchdog timer.
WDT::RefreshWatchdogRefresh the watchdog timer to prevent WDT timeout.
WDT::InitWatchdogIRQSwitch the watchdog timer to interrupt mode and register a watchdog timer timeout interrupt handler.

WDT::InitWatchdog

Description
Initialize the watchdog, including time setting, and mode register.

Syntax
void InitWatchdog(uint32_t timeout_ms);

Parameters
timeout_ms: the watch-dog timer timeout value in millisecond (ms). The default action after watchdog timer timeout is to reset the whole system.

Returns
NA

Example Code
Example: WatchdogTimer
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Watchdog/examples/WatchdogTimer/WatchdogTimer.ino)

Notes and Warnings
“WDT.h” must be included to use the class function.

WDT::StartWatchdog

Description
Enable and start the watchdog timer.

Syntax
void StartWatchdog(void);

Parameters
NA

Returns
NA

Example Code
Example: WatchdogTimer
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Watchdog/examples/WatchdogTimer/WatchdogTimer.ino)

Notes and Warnings
“WDT.h” must be included to use the class function.

WDT::StopWatchdog

Description
Stop the watchdog timer.

Syntax
void StopWatchdog(void);

Parameters
NA

Returns
NA

Example Code
Example: WatchdogTimer
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Watchdog/examples/WatchdogTimer/WatchdogTimer.ino)

Notes and Warnings
“WDT.h” must be included to use the class function.

WDT::RefreshWatchdog

Description
Refresh the watchdog timer to prevent WDT timeout.

Syntax
void RefreshWatchdog(void);

Parameters
NA

Returns
NA

Example Code
Example: WatchdogTimer
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Watchdog/examples/WatchdogTimer/WatchdogTimer.ino)

Notes and Warnings
“WDT.h” must be included to use the class function.

WDT::InitWatchdogIRQ

Description
Switch the watchdog timer to interrupt mode and register a watchdog timer timeout interrupt handler. The interrupt handler will be called when the watchdog timer is timeout.

Syntax
void InitWatchdogIRQ(wdt_irq_handler handler, uint32_t id);

Parameters
handler: the callback function for WDT timeout interrupt.
id: the parameter for the callback function.

Returns
NA

Example Code
Example: WatchdogTimer
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Watchdog/examples/WatchdogTimer/WatchdogTimer.ino)

Notes and Warnings
“WDT.h” must be included to use the class function.

Please confirm that QQ communication software is installed
請先確認已安裝QQ通訊軟體