标签:独立 时钟 time ble 溢出 bsp span pre esc
几个寄存器
键值寄存器IWDG_KR:
预分频寄存器:IWDG_PR
重装载寄存器:IWDG_RLR
状态寄存器:IWDG_SR
void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);//取消写保护:0x5555使能 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);//设置预分频系数:写PR void IWDG_SetReload(uint16_t Reload);//设置重装载值:写RLR void IWDG_ReloadCounter(void);//喂狗:写0xAAAA到KR void IWDG_Enable(void);//使能看门狗:写0xCCCC到KR FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);//状态:重装载/预分频 更新
void IWDG_Init(u8 prer,u16 rlr) { IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); IWDG_SetPrescaler(prer); IWDG_SetReload(rlr); IWDG_ReloadCounter(); IWDG_Enable(); }
标签:独立 时钟 time ble 溢出 bsp span pre esc
原文地址:https://www.cnblogs.com/pquan/p/12901830.html