]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_iwdg.h
Merge commit 'fdc38ef3f92af7adeeb4de49550d8838c8a39b5c'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32F3XX / stm32f30x_iwdg.h
1 /**
2 ******************************************************************************
3 * @file stm32f30x_iwdg.h
4 * @author MCD Application Team
5 * @version V1.1.0
6 * @date 27-February-2014
7 * @brief This file contains all the functions prototypes for the IWDG
8 * firmware library.
9 ******************************************************************************
10 * @attention
11 *
12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
13 *
14 * Redistribution and use in source and binary forms, with or without modification,
15 * are permitted provided that the following conditions are met:
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 ******************************************************************************
37 */
38
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F30x_IWDG_H
41 #define __STM32F30x_IWDG_H
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f30x.h"
49
50 /** @addtogroup STM32F30x_StdPeriph_Driver
51 * @{
52 */
53
54 /** @addtogroup IWDG
55 * @{
56 */
57
58 /* Exported types ------------------------------------------------------------*/
59 /* Exported constants --------------------------------------------------------*/
60
61 /** @defgroup IWDG_Exported_Constants
62 * @{
63 */
64
65 /** @defgroup IWDG_WriteAccess
66 * @{
67 */
68
69 #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
70 #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
71 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
72 ((ACCESS) == IWDG_WriteAccess_Disable))
73 /**
74 * @}
75 */
76
77 /** @defgroup IWDG_prescaler
78 * @{
79 */
80
81 #define IWDG_Prescaler_4 ((uint8_t)0x00)
82 #define IWDG_Prescaler_8 ((uint8_t)0x01)
83 #define IWDG_Prescaler_16 ((uint8_t)0x02)
84 #define IWDG_Prescaler_32 ((uint8_t)0x03)
85 #define IWDG_Prescaler_64 ((uint8_t)0x04)
86 #define IWDG_Prescaler_128 ((uint8_t)0x05)
87 #define IWDG_Prescaler_256 ((uint8_t)0x06)
88 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
89 ((PRESCALER) == IWDG_Prescaler_8) || \
90 ((PRESCALER) == IWDG_Prescaler_16) || \
91 ((PRESCALER) == IWDG_Prescaler_32) || \
92 ((PRESCALER) == IWDG_Prescaler_64) || \
93 ((PRESCALER) == IWDG_Prescaler_128)|| \
94 ((PRESCALER) == IWDG_Prescaler_256))
95 /**
96 * @}
97 */
98
99 /** @defgroup IWDG_Flag
100 * @{
101 */
102
103 #define IWDG_FLAG_PVU ((uint16_t)0x0001)
104 #define IWDG_FLAG_RVU ((uint16_t)0x0002)
105 #define IWDG_FLAG_WVU ((uint16_t)0x0002)
106 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU) || \
107 ((FLAG) == IWDG_FLAG_WVU))
108 /**
109 * @}
110 */
111
112 /** @defgroup IWDG_Reload_Value
113 * @{
114 */
115 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
116
117 /**
118 * @}
119 */
120
121 /** @defgroup IWDG_CounterWindow_Value
122 * @{
123 */
124 #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
125 /**
126 * @}
127 */
128
129 /**
130 * @}
131 */
132
133 /* Exported macro ------------------------------------------------------------*/
134 /* Exported functions --------------------------------------------------------*/
135
136 /* Prescaler and Counter configuration functions ******************************/
137 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
138 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
139 void IWDG_SetReload(uint16_t Reload);
140 void IWDG_ReloadCounter(void);
141 void IWDG_SetWindowValue(uint16_t WindowValue);
142
143 /* IWDG activation function ***************************************************/
144 void IWDG_Enable(void);
145
146 /* Flag management function ***************************************************/
147 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif /* __STM32F30x_IWDG_H */
154
155 /**
156 * @}
157 */
158
159 /**
160 * @}
161 */
162
163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Imprint / Impressum