hw_watchdog.h
1.06 KB
#ifndef _HW_WATCHDOG_H_
#define _HW_WATCHDOG_H_
#define WATCHDOG_TIME_RESET REG_WATDOG_UNLOCK = UNLOCK_DWORD; \
REG_WATDOG_RESET = WDT_RESET_DWORD0; \
REG_WATDOG_UNLOCK = UNLOCK_DWORD; \
REG_WATDOG_RESET = WDT_RESET_DWORD1;
//2^(10 + WTACHDOG_CLK_DIV)
#define WTACHDOG_CLK_DIV_0 (0)
#define WTACHDOG_CLK_DIV_1 (1)
#define WTACHDOG_CLK_DIV_2 (2)
#define WTACHDOG_CLK_DIV_3 (3)
#define WTACHDOG_CLK_DIV_4 (4)
#define WTACHDOG_CLK_DIV_5 (5)
#define WTACHDOG_CLK_DIV_6 (6)
#define WTACHDOG_CLK_DIV_7 (7)
#define WTACHDOG_CLK_DIV_8 (8)
#define WTACHDOG_CLK_DIV_9 (9)
#define WTACHDOG_CLK_DIV_10 (10)
#define WTACHDOG_CLK_DIV_11 (11)
#define WTACHDOG_CLK_DIV_12 (12)
#define WTACHDOG_CLK_DIV_13 (13)
#define WTACHDOG_CLK_DIV_14 (14)
#define WTACHDOG_CLK_DIV_15 (15)
void watchdog_init(U8 pre_scale, U8 clk_div);
void wtachdog_enable(void);
void wtachdog_disable(void);
void watchdog_time_reset(void);
#endif //_HW_WATCHDOG_H_