Files
mcu-codegen-template/Shared/iwdg_config.h
T

22 lines
744 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.
#ifndef __IWDG_CONFIG_H
#define __IWDG_CONFIG_H
/**
* @file iwdg_config.h
* @brief IWDG 超时参数(APP / Bootloader 共用,换芯片时与 HAL 预分频一并调整)
*
* 当前:LSI ≈ 40 kHz,预分频 /16 → 计数 2.5 kHzReload = 2500 → 超时约 1 s。
*
* APP 侧使用 HALPrescaler = IWDG_PRESCALER_16Reload = IWDG_RELOAD_VALUE。
* Bootloader 跳转前使能 IWDGAPP 启动后须尽早 HAL_IWDG_Init / Refresh。
*
* 约束:IWDG 一旦启动,LSI 被硬件锁定,APP 时钟配置中不可写 LSI OFF。
*/
#define IWDG_RELOAD_VALUE 2500U
/* Bootloader 裸寄存器写 PR 时的值(= IWDG_PRESCALER_16 对应位域) */
#define IWDG_PR_REG 0x02U
#endif /* __IWDG_CONFIG_H */