| 1234567891011121314151617181920212223242526272829303132 |
- #include "Fwdgt.h"
- #include "stdint.h"
- #include "gd32e230_fwdgt.h"
- #include "gd32e230_rcu.h"
- void Fwdgt_Init(void)
- {
- uint16_t timeout = 0xFFFFU;
- rcu_osci_on(RCU_IRC40K);
- while(SUCCESS != rcu_osci_stab_wait(RCU_IRC40K))
- {
- if(timeout > 0)
- timeout--;
- else
- break;
- }
-
- fwdgt_config(2000,FWDGT_PSC_DIV64); //3.2s
- fwdgt_write_disable();
- fwdgt_enable();
- }
- void Fwdgt_reload(void)
- {
- fwdgt_write_enable();
- fwdgt_counter_reload();
- }
|