46 lines
1.4 KiB
C
46 lines
1.4 KiB
C
/**
|
|
* @file iwdgs.h
|
|
* @brief This file contains the declaration of the Independent Watchdog (IWDG) module.
|
|
*
|
|
* The Independent Watchdog (IWDG) is a hardware module in STM32 microcontrollers that provides a mechanism for system reset in case of software failures or malfunctions. This file declares the functions and constants related to the IWDG module.
|
|
*
|
|
* @author xxx
|
|
* @date 2023-12-27 14:44:03
|
|
* @version 1.0
|
|
* @copyright Copyright (c) 2024 by xxx, All Rights Reserved.
|
|
*/
|
|
#ifndef __IWDGS_H__
|
|
#define __IWDGS_H__
|
|
|
|
#include "main.h"
|
|
#include "lib.h"
|
|
/**
|
|
* @brief Reloads the watchdog counter.
|
|
*
|
|
* This macro is used to reload the watchdog counter, preventing the system from resetting.
|
|
*/
|
|
#define WATCHDOG_RESET() LL_IWDG_ReloadCounter(IWDG)
|
|
|
|
/**
|
|
* @brief Checks if the system has been reset by the watchdog.
|
|
*
|
|
* @return BOOL Returns TRUE if the system has been reset by the watchdog, FALSE otherwise.
|
|
*/
|
|
extern BOOL check_watchdog_reset(void);
|
|
|
|
/**
|
|
* @brief Freezes the watchdog timer for debugging purposes.
|
|
*
|
|
* This function freezes the watchdog timer, allowing for debugging without triggering a watchdog reset.
|
|
*/
|
|
extern void debug_freeze_watchdog(void);
|
|
|
|
/**
|
|
* @brief Unfreezes the watchdog timer after debugging.
|
|
*
|
|
* This function unfreezes the watchdog timer, allowing it to resume normal operation after debugging.
|
|
*/
|
|
extern void debug_unfreeze_watchdog(void);
|
|
|
|
#endif
|