]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_iwdg.h
2 ******************************************************************************
3 * @file stm32f30x_iwdg.h
4 * @author MCD Application Team
6 * @date 27-February-2014
7 * @brief This file contains all the functions prototypes for the IWDG
9 ******************************************************************************
12 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
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.
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.
36 ******************************************************************************
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F30x_IWDG_H
41 #define __STM32F30x_IWDG_H
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f30x.h"
50 /** @addtogroup STM32F30x_StdPeriph_Driver
58 /* Exported types ------------------------------------------------------------*/
59 /* Exported constants --------------------------------------------------------*/
61 /** @defgroup IWDG_Exported_Constants
65 /** @defgroup IWDG_WriteAccess
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))
77 /** @defgroup IWDG_prescaler
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))
99 /** @defgroup IWDG_Flag
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))
112 /** @defgroup IWDG_Reload_Value
115 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
121 /** @defgroup IWDG_CounterWindow_Value
124 #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
133 /* Exported macro ------------------------------------------------------------*/
134 /* Exported functions --------------------------------------------------------*/
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
);
143 /* IWDG activation function ***************************************************/
144 void IWDG_Enable(void);
146 /* Flag management function ***************************************************/
147 FlagStatus
IWDG_GetFlagStatus(uint16_t IWDG_FLAG
);
153 #endif /* __STM32F30x_IWDG_H */
163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/