1 /** 2 ****************************************************************************** 3 * @file yc_wdt.h 4 * @author Yichip 5 * @version V1.0 6 * @date 7-Dec-2019 7 * @brief watchdog encapsulation. 8 * 9 ****************************************************************************** 10 */ 11 12 #ifndef __YC_WDT_H__ 13 #define __YC_WDT_H__ 14 15 #include "yc3121.h" 16 17 /** 18 * @brief timer number Structure definition 19 */ 20 typedef enum 21 { 22 WDT_CPUReset = 0, 23 WDT_Interrupt, 24 } WDT_ModeTypeDef; 25 26 #define ISWDTRELOAD(load) (load>0&&load<=0x1f) 27 28 /** 29 * @brief Set reload counter 30 * @param Reload: Reload counter equal to 2^reload. 31 * @retval none 32 */ 33 void WDT_SetReload(uint32_t Reload); 34 35 /** 36 * @brief Set WDT mode 37 * @param WDT_Mode : Select the following values : 38 * WDT_CPUReset 39 * WDT_Interrupt. 40 * @retval none 41 * @description If Select WDT_CPUReset Mode,the bit for WDT RESET will be set;if 42 * Select WDT_Interrupt the bit for WDT RESET will 43 */ 44 void WDT_ModeConfig(WDT_ModeTypeDef WDT_Mode); 45 46 /** 47 * @brief Get interrupt Status 48 * @param none 49 * @retval SET:interrupt ocuured. 50 */ 51 ITStatus WDT_GetITStatus(void); 52 53 /** 54 * @brief Clear interrupt 55 * @param none 56 * @retval none 57 */ 58 void WDT_ClearITPendingBit(void); 59 60 /** 61 * @brief Enable WDT 62 * @param none 63 * @retval none 64 */ 65 void WDT_Enable(void); 66 67 /** 68 * @brief Feed the watchdog function 69 * @param none 70 * @retval none 71 */ 72 void WDT_ReloadCounter(void); 73 74 #endif /*__YC_WDT_H__*/ 75