1 |
577 |
jeremybenn |
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
|
2 |
|
|
* File Name : 91x_wdg.h
|
3 |
|
|
* Author : MCD Application Team
|
4 |
|
|
* Date First Issued : 05/18/2006 : Version 1.0
|
5 |
|
|
* Description : This file contains all the functions prototypes for the
|
6 |
|
|
* WDG software library.
|
7 |
|
|
********************************************************************************
|
8 |
|
|
* History:
|
9 |
|
|
* 05/24/2006 : Version 1.1
|
10 |
|
|
* 05/18/2006 : Version 1.0
|
11 |
|
|
********************************************************************************
|
12 |
|
|
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
13 |
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
14 |
|
|
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
|
15 |
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
|
16 |
|
|
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
|
17 |
|
|
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
18 |
|
|
*******************************************************************************/
|
19 |
|
|
|
20 |
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
21 |
|
|
#ifndef __91x_WDG_H
|
22 |
|
|
#define __91x_WDG_H
|
23 |
|
|
|
24 |
|
|
/* Includes ------------------------------------------------------------------*/
|
25 |
|
|
#include "91x_map.h"
|
26 |
|
|
|
27 |
|
|
/* Exported types ------------------------------------------------------------*/
|
28 |
|
|
typedef struct
|
29 |
|
|
{
|
30 |
|
|
u16 WDG_Mode;
|
31 |
|
|
u16 WDG_ClockSource;
|
32 |
|
|
u16 WDG_Prescaler;
|
33 |
|
|
u16 WDG_Preload;
|
34 |
|
|
|
35 |
|
|
} WDG_InitTypeDef;
|
36 |
|
|
|
37 |
|
|
/* Exported constants --------------------------------------------------------*/
|
38 |
|
|
|
39 |
|
|
/* WDG_Mode */
|
40 |
|
|
#define WDG_Mode_Wdg 0x0001 /*WDG configured to run in watchdog mode.*/
|
41 |
|
|
#define WDG_Mode_Timer 0xFFFE /*WDG configured to be in Free-running Timer mode.*/
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
/* WDG_ClockSource */
|
45 |
|
|
#define WDG_ClockSource_Rtc 0x0004 /* External clock ( 32 khz RTC clock ) will be used as counting clock.*/
|
46 |
|
|
#define WDG_ClockSource_Apb 0xFFFB /*The APB clock signal will be used as counting clock.*/
|
47 |
|
|
|
48 |
|
|
/* WDG_Prescaler */
|
49 |
|
|
/*This member must be a number between 0x00 and 0xFF.
|
50 |
|
|
Specifies the Prescaler value to divide the clock source.
|
51 |
|
|
The clock of the Watchdog Timer Counter is divided by " WDG_Prescaler + 1".*/
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
/* WDG_Preload */
|
56 |
|
|
/*This member must be a number between 0x0000 and 0xFFFF.
|
57 |
|
|
This value is loaded in the WDG Counter when it starts counting.*/
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
/* WDG Sequence */
|
61 |
|
|
#define WDG_KeyValue1 0xA55A
|
62 |
|
|
#define WDG_KeyValue2 0x5AA5
|
63 |
|
|
|
64 |
|
|
/* Exported macro ------------------------------------------------------------*/
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
/* Exported functions ------------------------------------------------------- */
|
68 |
|
|
|
69 |
|
|
void WDG_DeInit(void);
|
70 |
|
|
void WDG_Init(WDG_InitTypeDef* WDG_InitStruct);
|
71 |
|
|
void WDG_StructInit(WDG_InitTypeDef* WDG_InitStruct);
|
72 |
|
|
void WDG_Cmd(FunctionalState NewState);
|
73 |
|
|
void WDG_ITConfig(FunctionalState NewState);
|
74 |
|
|
u16 WDG_GetCounter(void);
|
75 |
|
|
FlagStatus WDG_GetFlagStatus(void);
|
76 |
|
|
void WDG_ClearFlag(void);
|
77 |
|
|
ITStatus WDG_GetITStatus(void);
|
78 |
|
|
void WDG_ClearITPendingBit(void);
|
79 |
|
|
|
80 |
|
|
#endif /* __WDG_H */
|
81 |
|
|
|
82 |
|
|
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/
|