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