1 /******************************************************************************
2 ** File Name: wdg_drvapi.h *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic input and output operations *
7 ** on hardware, it can be treated as a hardware abstract *
9 ******************************************************************************
11 ******************************************************************************
13 ** ------------------------------------------------------------------------- *
14 ** DATE NAME DESCRIPTION *
15 ** 06/12/2010 Xuepeng.Zhang Create. *
16 ******************************************************************************/
18 #ifndef _WDG_DRVAPI_H_
19 #define _WDG_DRVAPI_H_
21 /*----------------------------------------------------------------------------*
23 **------------------------------------------------------------------------- */
26 /**---------------------------------------------------------------------------*
28 **--------------------------------------------------------------------------*/
34 /**---------------------------------------------------------------------------*
36 **---------------------------------------------------------------------------*/
37 #define WDG_MAX_COUNT (0xFFFFFFFF)
39 /**----------------------------------------------------------------------------*
40 ** Function Prototype **
41 **----------------------------------------------------------------------------*/
43 /*****************************************************************************/
44 // Description: This function disable WDG timer
46 // Note: no rtc_clk to drive the counter
48 /*****************************************************************************/
49 PUBLIC void WDG_TimerStop (void);
52 /*****************************************************************************/
53 // Description: This function initialize and setup timer with given value
55 // Note: rtc_clk drive the counter
56 // load regiter is 32 bits wide so that don't check if param's valid
57 /*****************************************************************************/
58 PUBLIC void WDG_TimerStart (uint32 init_val);
61 /*****************************************************************************/
62 // Description: This function handle WatchDog Interrupt
63 // Author: Binggo Zhou
65 /*****************************************************************************/
66 PUBLIC void WDG_TimerHandler (uint32 int_num);
67 /*****************************************************************************/
68 // Description: This function init WatchDog
69 // Author: Binggo Zhou
71 /*****************************************************************************/
72 PUBLIC void WDG_TimerInit (void);
74 /*****************************************************************************/
75 // Description: This function Reset MCU
76 // Author: Younger.Yang
78 /*****************************************************************************/
79 PUBLIC void WDG_ResetMCU (void);
81 /*****************************************************************************/
82 // Description: This function Load WatchDog Timer Value
83 // Author: Binggo Zhou
85 /*****************************************************************************/
86 PUBLIC void WDG_TimerLoad (uint32 time_ms);
87 PUBLIC void WDG_ClockOn(void);
88 PUBLIC uint32 WDG_PHY_RST_INT_ON(void);
90 /**----------------------------------------------------------------------------*
92 **----------------------------------------------------------------------------*/
98 #endif // _WDG_DRVAPI_H_