watchdog.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _HARDWARE_WATCHDOG_H
8 #define _HARDWARE_WATCHDOG_H
9 
10 #include "pico.h"
11 #include "hardware/structs/watchdog.h"
12 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
45 void watchdog_reboot(uint32_t pc, uint32_t sp, uint32_t delay_ms);
46 
53 void watchdog_start_tick(uint cycles);
54 
59 void watchdog_update(void);
60 
78 void watchdog_enable(uint32_t delay_ms, bool pause_on_debug);
79 
87 bool watchdog_caused_reboot(void);
88 
107 
114 uint32_t watchdog_get_count(void);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif
watchdog_get_count
uint32_t watchdog_get_count(void)
Returns the number of microseconds before the watchdog will reboot the chip.
Definition: watchdog.c:30
watchdog_reboot
void watchdog_reboot(uint32_t pc, uint32_t sp, uint32_t delay_ms)
Define actions to perform at watchdog timeout.
Definition: watchdog.c:77
watchdog_enable_caused_reboot
bool watchdog_enable_caused_reboot(void)
Did watchdog_enable cause the last reboot?
Definition: watchdog.c:104
pico.h
watchdog_start_tick
void watchdog_start_tick(uint cycles)
Start the watchdog tick.
Definition: watchdog.c:14
watchdog_enable
void watchdog_enable(uint32_t delay_ms, bool pause_on_debug)
Enable the watchdog.
Definition: watchdog.c:70
watchdog_caused_reboot
bool watchdog_caused_reboot(void)
Did the watchdog cause the last reboot?
Definition: watchdog.c:99
watchdog_update
void watchdog_update(void)
Reload the watchdog counter with the amount of time set in watchdog_enable.
Definition: watchdog.c:25