iwag.c 369 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "iwag.h"
  2. void IWDG_Config(u8 prer,u16 rlr)
  3. {
  4. IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);//使能对IWDG->PR IWDG->RLR的写
  5. IWDG_SetPrescaler(prer); //设置IWDG分频系数
  6. IWDG_SetReload(rlr); //设置IWDG装载值
  7. IWDG_ReloadCounter(); //reload
  8. IWDG_Enable(); //使能看门狗
  9. }
  10. void IWDG_Feed(void)
  11. {
  12. IWDG_ReloadCounter();
  13. }