MCU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
WatchdogInterface Class Reference

#include <WatchdogInterface.h>

Collaboration diagram for WatchdogInterface:
Collaboration graph

Public Member Functions

 WatchdogInterface (int wd_input_pin)
 
void init (unsigned long curr_millis)
 
void set_start_state ()
 
void kick_watchdog (unsigned long curr_millis)
 
bool get_watchdog_state ()
 
void set_watchdog_state (bool state)
 
 WatchdogInterface (int wd_input_pin)
 
void init (unsigned long curr_millis)
 
void set_start_state ()
 
void kick_watchdog (unsigned long curr_millis)
 

Private Attributes

unsigned long watchdog_time
 
bool watchdog_state
 
int pin_watchdog_input_
 

Detailed Description

Definition at line 8 of file WatchdogInterface.h.

Constructor & Destructor Documentation

◆ WatchdogInterface() [1/2]

WatchdogInterface::WatchdogInterface ( int  wd_input_pin)
inline

Definition at line 21 of file WatchdogInterface.h.

21: pin_watchdog_input_(wd_input_pin){};

◆ WatchdogInterface() [2/2]

WatchdogInterface::WatchdogInterface ( int  wd_input_pin)
inline

Definition at line 20 of file WatchdogInterface.h.

20{};

Member Function Documentation

◆ get_watchdog_state()

bool WatchdogInterface::get_watchdog_state ( )

Definition at line 32 of file WatchdogInterface.cpp.

32 {
33 return watchdog_state;
34}

◆ init() [1/2]

void WatchdogInterface::init ( unsigned long  curr_millis)

Definition at line 4 of file WatchdogInterface.cpp.

4 {
5 // Set pin mode
6 pinMode(pin_watchdog_input_, OUTPUT);
7
8 watchdog_time = curr_millis;
10
11}
unsigned long watchdog_time
void set_watchdog_state(bool state)

◆ init() [2/2]

void WatchdogInterface::init ( unsigned long  curr_millis)
inline

Definition at line 23 of file WatchdogInterface.h.

23{return;};

◆ kick_watchdog() [1/2]

void WatchdogInterface::kick_watchdog ( unsigned long  curr_millis)

Definition at line 21 of file WatchdogInterface.cpp.

21 {
22
23 if ((curr_millis - watchdog_time) > WATCHDOG_KICK_INTERVAL) {
26 watchdog_time = curr_millis;
27 }
28
29}
const unsigned long WATCHDOG_KICK_INTERVAL

◆ kick_watchdog() [2/2]

void WatchdogInterface::kick_watchdog ( unsigned long  curr_millis)
inline

Definition at line 30 of file WatchdogInterface.h.

30{};

◆ set_start_state() [1/2]

void WatchdogInterface::set_start_state ( )

Definition at line 14 of file WatchdogInterface.cpp.

14 {
15
16 digitalWrite(pin_watchdog_input_, HIGH);
17
18}

◆ set_start_state() [2/2]

void WatchdogInterface::set_start_state ( )
inline

Definition at line 27 of file WatchdogInterface.h.

27{return;};

◆ set_watchdog_state()

void WatchdogInterface::set_watchdog_state ( bool  state)

Definition at line 37 of file WatchdogInterface.cpp.

37 {
38 watchdog_state = state;
39}

Member Data Documentation

◆ pin_watchdog_input_

int WatchdogInterface::pin_watchdog_input_
private

Definition at line 18 of file WatchdogInterface.h.

◆ watchdog_state

bool WatchdogInterface::watchdog_state
private

Definition at line 15 of file WatchdogInterface.h.

◆ watchdog_time

unsigned long WatchdogInterface::watchdog_time
private

Definition at line 12 of file WatchdogInterface.h.


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