]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_wwdg.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32F3XX / stm32f30x_wwdg.h
1 /**
2   ******************************************************************************
3   * @file    stm32f30x_wwdg.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 WWDG 
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_WWDG_H
41 #define __STM32F30x_WWDG_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 WWDG
55   * @{
56   */ 
57 /* Exported types ------------------------------------------------------------*/
58 /* Exported constants --------------------------------------------------------*/
59
60 /** @defgroup WWDG_Exported_Constants
61   * @{
62   */ 
63   
64 /** @defgroup WWDG_Prescaler 
65   * @{
66   */ 
67   
68 #define WWDG_Prescaler_1    ((uint32_t)0x00000000)
69 #define WWDG_Prescaler_2    ((uint32_t)0x00000080)
70 #define WWDG_Prescaler_4    ((uint32_t)0x00000100)
71 #define WWDG_Prescaler_8    ((uint32_t)0x00000180)
72 #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
73                                       ((PRESCALER) == WWDG_Prescaler_2) || \
74                                       ((PRESCALER) == WWDG_Prescaler_4) || \
75                                       ((PRESCALER) == WWDG_Prescaler_8))
76 #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
77 #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
78
79 /**
80   * @}
81   */ 
82
83 /**
84   * @}
85   */ 
86
87 /* Exported macro ------------------------------------------------------------*/
88 /* Exported functions ------------------------------------------------------- */
89 /*  Function used to set the WWDG configuration to the default reset state ****/  
90 void WWDG_DeInit(void);
91
92 /* Prescaler, Refresh window and Counter configuration functions **************/
93 void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
94 void WWDG_SetWindowValue(uint8_t WindowValue);
95 void WWDG_EnableIT(void);
96 void WWDG_SetCounter(uint8_t Counter);
97
98 /* WWDG activation functions **************************************************/
99 void WWDG_Enable(uint8_t Counter);
100
101 /* Interrupts and flags management functions **********************************/
102 FlagStatus WWDG_GetFlagStatus(void);
103 void WWDG_ClearFlag(void);
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif /* __STM32F30x_WWDG_H */
110
111 /**
112   * @}
113   */ 
114
115 /**
116   * @}
117   */ 
118
119 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/