Developer World
Spresense Arduino Library v3.2.0-77d75a4
WatchdogClass Class Reference

Watchdog controller. More...

#include <Watchdog.h>

Public Member Functions

 WatchdogClass (void)
 Create WatchdogClass object. More...
 
void begin (void)
 Initialize the Watchdog library. More...
 
void end (void)
 Disable the Watchdog. More...
 
void start (uint32_t timeout)
 Start to check timer for bite watchdog. More...
 
void stop (void)
 Stop to check timer for avoid bite watchdog. More...
 
void kick (void)
 Kick to watchdog for notify keep alive. More...
 
uint32_t timeleft (void)
 Get a remain time for bite watchdog. More...
 

Detailed Description

Watchdog controller.

You can reset your application when application freezed by operating WatchdogClass objects instantiated in your application.

Constructor & Destructor Documentation

◆ WatchdogClass()

WatchdogClass::WatchdogClass ( void  )

Create WatchdogClass object.

Application need to take instance for using watchdog.

Member Function Documentation

◆ begin()

void WatchdogClass::begin ( void  )

Initialize the Watchdog library.

Open the hardware watchdog device file and keep it.

◆ end()

void WatchdogClass::end ( void  )

Disable the Watchdog.

Stop the hardware watchdog and close device file for release it.

◆ start()

void WatchdogClass::start ( uint32_t  timeout)

Start to check timer for bite watchdog.

Start to count and check time for bite watchdog. And if it expire timeout value, device will reboot by hardware trigger.

Parameters
[in]timeoutTimeout value in milliseconds for bite a watchdog (1 ~ 40000)

◆ stop()

void WatchdogClass::stop ( void  )

Stop to check timer for avoid bite watchdog.

Stop to count and check timer. After call this function, device will not reboot by watchdog.

◆ kick()

void WatchdogClass::kick ( void  )

Kick to watchdog for notify keep alive.

Kick the dog to avoid bite a watchdog, it mean "Keep alive". If expire a timeout, device will reboot by hardware trigger.

◆ timeleft()

uint32_t WatchdogClass::timeleft ( void  )

Get a remain time for bite watchdog.

Get a remain time to expire timeout.

Returns
Remain time in milliseconds >= 0

The documentation for this class was generated from the following file: