IoT_SCV_CH584M/bsp/inc/bsp_iwdg.h

36 lines
876 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-15 16:13:37
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2025-05-23 18:38:52
* @FilePath : \IoT_SCV_CH584M\bsp\inc\bsp_iwdg.h
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
*/
#ifndef __BSP_IWDG_H__
#define __BSP_IWDG_H__
#include "CONFIG.h"
#define IWDG_TIMEOUT_MS 6000
#define IWDG_FEED_MS 3000
#define IWIG_FEED_EVENT (0x01 << 0)
// 需要定时调用喂狗
// 在看门狗键寄存器 (R32_IWDG_KR) 中,软件要以一定的间隔写入 0xAAAA重装载计数值这就是喂狗的操作。
// 否则,当计数器为 0 时,看门狗会产生复位。
#define FEED_IWDG() {R32_IWDG_KR=0xAAAA;}
void IWDG_Init(uint16_t timeout_ms, uint16_t feed_ms);
void ShowRestartReason(void);
#endif // !__BSP_IWDG_H__