summaryrefslogtreecommitdiffstats
path: root/uc_str912/prj_template91x/str91x_lib/include/91x_wdg.h
blob: fc70547adc161cb8b2e6e5b8173adc33d945a4d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
* File Name          : 91x_wdg.h
* Author             : MCD Application Team
* Date First Issued  : 05/18/2006 : Version 1.0
* Description        : This file contains all the functions prototypes for the
*                      WDG software library.
********************************************************************************
* History:
* 05/24/2006 : Version 1.1
* 05/18/2006 : Version 1.0
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __91x_WDG_H
#define __91x_WDG_H

/* Includes ------------------------------------------------------------------*/
#include "91x_map.h"

/* Exported types ------------------------------------------------------------*/
typedef struct
{
u16 WDG_Mode;
u16 WDG_ClockSource;
u16 WDG_Prescaler;
u16 WDG_Preload;

} WDG_InitTypeDef;

/* Exported constants --------------------------------------------------------*/

/* WDG_Mode */
#define WDG_Mode_Wdg	0x0001	/*WDG configured to run in watchdog mode.*/
#define WDG_Mode_Timer	0xFFFE	/*WDG configured to be in Free-running Timer mode.*/


/* WDG_ClockSource */
#define WDG_ClockSource_Rtc 	0x0004	/* External clock ( 32 khz RTC clock ) will be used as counting clock.*/
#define WDG_ClockSource_Apb	0xFFFB	/*The APB clock signal will be used as counting clock.*/

/* WDG_Prescaler */
/*This member must be  a number between 0x00 and 0xFF.
Specifies the  Prescaler value to divide the clock source.
The clock of the Watchdog Timer Counter is divided by " WDG_Prescaler + 1".*/



/* WDG_Preload */
/*This member must be  a number between 0x0000 and 0xFFFF.
This value is loaded in the WDG Counter when it starts counting.*/


/* WDG Sequence */
#define WDG_KeyValue1      0xA55A
#define WDG_KeyValue2      0x5AA5

/* Exported macro ------------------------------------------------------------*/


/* Exported functions ------------------------------------------------------- */

void WDG_DeInit(void);
void WDG_Init(WDG_InitTypeDef* WDG_InitStruct);
void WDG_StructInit(WDG_InitTypeDef* WDG_InitStruct);
void WDG_Cmd(FunctionalState NewState);
void WDG_ITConfig(FunctionalState NewState);
u16 WDG_GetCounter(void);
FlagStatus WDG_GetFlagStatus(void);
void WDG_ClearFlag(void);
ITStatus WDG_GetITStatus(void);
void WDG_ClearITPendingBit(void);

#endif /* __WDG_H */

/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/
OpenPOWER on IntegriCloud