2 ******************************************************************************
\r
3 * @file stm32l1xx_iwdg.h
\r
4 * @author MCD Application Team
\r
6 * @date 05-March-2012
\r
7 * @brief This file contains all the functions prototypes for the IWDG
\r
9 ******************************************************************************
\r
12 * <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
\r
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
\r
15 * You may not use this file except in compliance with the License.
\r
16 * You may obtain a copy of the License at:
\r
18 * http://www.st.com/software_license_agreement_liberty_v2
\r
20 * Unless required by applicable law or agreed to in writing, software
\r
21 * distributed under the License is distributed on an "AS IS" BASIS,
\r
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
23 * See the License for the specific language governing permissions and
\r
24 * limitations under the License.
\r
26 ******************************************************************************
\r
29 /* Define to prevent recursive inclusion -------------------------------------*/
\r
30 #ifndef __STM32L1xx_IWDG_H
\r
31 #define __STM32L1xx_IWDG_H
\r
37 /* Includes ------------------------------------------------------------------*/
\r
38 #include "stm32l1xx.h"
\r
40 /** @addtogroup STM32L1xx_StdPeriph_Driver
\r
44 /** @addtogroup IWDG
\r
48 /* Exported types ------------------------------------------------------------*/
\r
49 /* Exported constants --------------------------------------------------------*/
\r
51 /** @defgroup IWDG_Exported_Constants
\r
55 /** @defgroup IWDG_WriteAccess
\r
59 #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
\r
60 #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
\r
61 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
\r
62 ((ACCESS) == IWDG_WriteAccess_Disable))
\r
67 /** @defgroup IWDG_prescaler
\r
71 #define IWDG_Prescaler_4 ((uint8_t)0x00)
\r
72 #define IWDG_Prescaler_8 ((uint8_t)0x01)
\r
73 #define IWDG_Prescaler_16 ((uint8_t)0x02)
\r
74 #define IWDG_Prescaler_32 ((uint8_t)0x03)
\r
75 #define IWDG_Prescaler_64 ((uint8_t)0x04)
\r
76 #define IWDG_Prescaler_128 ((uint8_t)0x05)
\r
77 #define IWDG_Prescaler_256 ((uint8_t)0x06)
\r
78 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
\r
79 ((PRESCALER) == IWDG_Prescaler_8) || \
\r
80 ((PRESCALER) == IWDG_Prescaler_16) || \
\r
81 ((PRESCALER) == IWDG_Prescaler_32) || \
\r
82 ((PRESCALER) == IWDG_Prescaler_64) || \
\r
83 ((PRESCALER) == IWDG_Prescaler_128)|| \
\r
84 ((PRESCALER) == IWDG_Prescaler_256))
\r
89 /** @defgroup IWDG_Flag
\r
93 #define IWDG_FLAG_PVU ((uint16_t)0x0001)
\r
94 #define IWDG_FLAG_RVU ((uint16_t)0x0002)
\r
95 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
\r
96 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
\r
105 /* Exported macro ------------------------------------------------------------*/
\r
106 /* Exported functions ------------------------------------------------------- */
\r
108 /* Prescaler and Counter configuration functions ******************************/
\r
109 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
\r
110 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
\r
111 void IWDG_SetReload(uint16_t Reload);
\r
112 void IWDG_ReloadCounter(void);
\r
114 /* IWDG activation function ***************************************************/
\r
115 void IWDG_Enable(void);
\r
117 /* Flag management function ***************************************************/
\r
118 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
\r
124 #endif /* __STM32L1xx_IWDG_H */
\r
134 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r