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