@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
watchdog.h
Go to the documentation of this file.
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _HARDWARE_WATCHDOG_H
#define _HARDWARE_WATCHDOG_H
#include "pico.h"
#include "hardware/structs/watchdog.h"
#ifdef __cplusplus
extern "C" {
#endif
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG, Enable/disable assertions in the hardware_watchdog module, type=bool, default=0, group=hardware_watchdog
#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG
#ifdef PARAM_ASSERTIONS_ENABLED_WATCHDOG // backwards compatibility with SDK < 2.0.0
#define PARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG PARAM_ASSERTIONS_ENABLED_WATCHDOG
#else
#define PARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG 0
#endif
#endif
void watchdog_reboot(uint32_t pc, uint32_t sp, uint32_t delay_ms);
void watchdog_start_tick(uint cycles);
void watchdog_update(void);
void watchdog_enable(uint32_t delay_ms, bool pause_on_debug);
void watchdog_disable(void);
bool watchdog_caused_reboot(void);
bool watchdog_enable_caused_reboot(void);
uint32_t watchdog_get_time_remaining_us(void);
uint32_t watchdog_get_time_remaining_ms(void);
// backwards compatibility with SDK < 2.0.0
static inline uint32_t watchdog_get_count(void) {
return watchdog_get_time_remaining_us();
}
#ifdef __cplusplus
}
#endif
#endif
watchdog_update
void watchdog_update(void)
Reload the watchdog counter with the amount of time set in watchdog_enable.
Definition watchdog.c:26
watchdog_enable_caused_reboot
bool watchdog_enable_caused_reboot(void)
Did watchdog_enable cause the last reboot?
Definition watchdog.c:125
watchdog_get_time_remaining_ms
uint32_t watchdog_get_time_remaining_ms(void)
Returns the number of milliseconds before the watchdog will reboot the chip.
Definition watchdog.c:42
watchdog_caused_reboot
bool watchdog_caused_reboot(void)
Did the watchdog cause the last reboot?
Definition watchdog.c:116
watchdog_enable
void watchdog_enable(uint32_t delay_ms, bool pause_on_debug)
Enable the watchdog.
Definition watchdog.c:81
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:92
watchdog_start_tick
void watchdog_start_tick(uint cycles)
Start the watchdog tick.
Definition watchdog.c:16
watchdog_get_time_remaining_us
uint32_t watchdog_get_time_remaining_us(void)
Returns the number of microseconds before the watchdog will reboot the chip.
Definition watchdog.c:38
watchdog_disable
void watchdog_disable(void)
Disable the watchdog.
Definition watchdog.c:88
pico.h