Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32f30x_iwdg.h Source File

stm32f30x_iwdg.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f30x_iwdg.h
00004   * @author  MCD Application Team
00005   * @version V1.2.3
00006   * @date    10-July-2015
00007   * @brief   This file contains all the functions prototypes for the IWDG 
00008   *          firmware library.  
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
00013   *
00014   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00015   * You may not use this file except in compliance with the License.
00016   * You may obtain a copy of the License at:
00017   *
00018   *        http://www.st.com/software_license_agreement_liberty_v2
00019   *
00020   * Unless required by applicable law or agreed to in writing, software 
00021   * distributed under the License is distributed on an "AS IS" BASIS, 
00022   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00023   * See the License for the specific language governing permissions and
00024   * limitations under the License.
00025   *
00026   ******************************************************************************
00027   */
00028 
00029 /* Define to prevent recursive inclusion -------------------------------------*/
00030 #ifndef __STM32F30x_IWDG_H
00031 #define __STM32F30x_IWDG_H
00032 
00033 #ifdef __cplusplus
00034  extern "C" {
00035 #endif
00036 
00037 /* Includes ------------------------------------------------------------------*/
00038 #include "stm32f30x.h"
00039 
00040 /** @addtogroup STM32F30x_StdPeriph_Driver
00041   * @{
00042   */
00043 
00044 /** @addtogroup IWDG
00045   * @{
00046   */
00047 
00048 /* Exported types ------------------------------------------------------------*/
00049 /* Exported constants --------------------------------------------------------*/
00050 
00051 /** @defgroup IWDG_Exported_Constants
00052   * @{
00053   */
00054 
00055 /** @defgroup IWDG_WriteAccess
00056   * @{
00057   */
00058 
00059 #define IWDG_WriteAccess_Enable     ((uint16_t)0x5555)
00060 #define IWDG_WriteAccess_Disable    ((uint16_t)0x0000)
00061 #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
00062                                       ((ACCESS) == IWDG_WriteAccess_Disable))
00063 /**
00064   * @}
00065   */
00066 
00067 /** @defgroup IWDG_prescaler 
00068   * @{
00069   */
00070 
00071 #define IWDG_Prescaler_4            ((uint8_t)0x00)
00072 #define IWDG_Prescaler_8            ((uint8_t)0x01)
00073 #define IWDG_Prescaler_16           ((uint8_t)0x02)
00074 #define IWDG_Prescaler_32           ((uint8_t)0x03)
00075 #define IWDG_Prescaler_64           ((uint8_t)0x04)
00076 #define IWDG_Prescaler_128          ((uint8_t)0x05)
00077 #define IWDG_Prescaler_256          ((uint8_t)0x06)
00078 #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4)  || \
00079                                       ((PRESCALER) == IWDG_Prescaler_8)  || \
00080                                       ((PRESCALER) == IWDG_Prescaler_16) || \
00081                                       ((PRESCALER) == IWDG_Prescaler_32) || \
00082                                       ((PRESCALER) == IWDG_Prescaler_64) || \
00083                                       ((PRESCALER) == IWDG_Prescaler_128)|| \
00084                                       ((PRESCALER) == IWDG_Prescaler_256))
00085 /**
00086   * @}
00087   */
00088 
00089 /** @defgroup IWDG_Flag 
00090   * @{
00091   */
00092 
00093 #define IWDG_FLAG_PVU               ((uint16_t)0x0001)
00094 #define IWDG_FLAG_RVU               ((uint16_t)0x0002)
00095 #define IWDG_FLAG_WVU               ((uint16_t)0x0002)
00096 #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)  || \
00097                             ((FLAG) == IWDG_FLAG_WVU))
00098 /**
00099   * @}
00100   */
00101   
00102 /** @defgroup IWDG_Reload_Value
00103   * @{
00104   */
00105 #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
00106 
00107 /**
00108   * @}
00109   */
00110 
00111 /** @defgroup IWDG_CounterWindow_Value
00112   * @{
00113   */
00114 #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
00115 /**
00116   * @}
00117   */
00118 
00119 /**
00120   * @}
00121   */
00122 
00123 /* Exported macro ------------------------------------------------------------*/
00124 /* Exported functions --------------------------------------------------------*/
00125 
00126 /* Prescaler and Counter configuration functions ******************************/
00127 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
00128 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
00129 void IWDG_SetReload(uint16_t Reload);
00130 void IWDG_ReloadCounter(void);
00131 void IWDG_SetWindowValue(uint16_t WindowValue);
00132 
00133 /* IWDG activation function ***************************************************/
00134 void IWDG_Enable(void);
00135 
00136 /* Flag management function ***************************************************/
00137 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
00138 
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142 
00143 #endif /* __STM32F30x_IWDG_H */
00144 
00145 /**
00146   * @}
00147   */
00148 
00149 /**
00150   * @}
00151   */
00152 
00153 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/