1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef GD32F30X_WWDGT_H
- #define GD32F30X_WWDGT_H
- #include "gd32f30x.h"
- #define WWDGT WWDGT_BASE
- #define WWDGT_CTL REG32((WWDGT) + 0x00U)
- #define WWDGT_CFG REG32((WWDGT) + 0x04U)
- #define WWDGT_STAT REG32((WWDGT) + 0x08U)
- #define WWDGT_CTL_CNT BITS(0,6)
- #define WWDGT_CTL_WDGTEN BIT(7)
- #define WWDGT_CFG_WIN BITS(0,6)
- #define WWDGT_CFG_PSC BITS(7,8)
- #define WWDGT_CFG_EWIE BIT(9)
- #define WWDGT_STAT_EWIF BIT(0)
- #define CFG_PSC(regval) (BITS(7,8) & ((uint32_t)(regval) << 7))
- #define WWDGT_CFG_PSC_DIV1 CFG_PSC(0)
- #define WWDGT_CFG_PSC_DIV2 CFG_PSC(1)
- #define WWDGT_CFG_PSC_DIV4 CFG_PSC(2)
- #define WWDGT_CFG_PSC_DIV8 CFG_PSC(3)
- #define CTL_CNT(regval) (BITS(0,6) & ((uint32_t)(regval) << 0))
- #define CFG_WIN(regval) (BITS(0,6) & ((uint32_t)(regval) << 0))
- void wwdgt_deinit(void);
- void wwdgt_enable(void);
- void wwdgt_counter_update(uint16_t counter_value);
- void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler);
- FlagStatus wwdgt_flag_get(void);
- void wwdgt_flag_clear(void);
- void wwdgt_interrupt_enable(void);
- #endif
|