mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
110:165afa46840b
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 77:869cf507173a 1 /**
emilmont 77:869cf507173a 2 ******************************************************************************
emilmont 77:869cf507173a 3 * @file stm32f4xx_hal_iwdg.h
emilmont 77:869cf507173a 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.0
Kojto 122:f9eeca106725 6 * @date 06-May-2016
emilmont 77:869cf507173a 7 * @brief Header file of IWDG HAL module.
emilmont 77:869cf507173a 8 ******************************************************************************
emilmont 77:869cf507173a 9 * @attention
emilmont 77:869cf507173a 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
emilmont 77:869cf507173a 12 *
emilmont 77:869cf507173a 13 * Redistribution and use in source and binary forms, with or without modification,
emilmont 77:869cf507173a 14 * are permitted provided that the following conditions are met:
emilmont 77:869cf507173a 15 * 1. Redistributions of source code must retain the above copyright notice,
emilmont 77:869cf507173a 16 * this list of conditions and the following disclaimer.
emilmont 77:869cf507173a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
emilmont 77:869cf507173a 18 * this list of conditions and the following disclaimer in the documentation
emilmont 77:869cf507173a 19 * and/or other materials provided with the distribution.
emilmont 77:869cf507173a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
emilmont 77:869cf507173a 21 * may be used to endorse or promote products derived from this software
emilmont 77:869cf507173a 22 * without specific prior written permission.
emilmont 77:869cf507173a 23 *
emilmont 77:869cf507173a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
emilmont 77:869cf507173a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
emilmont 77:869cf507173a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
emilmont 77:869cf507173a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
emilmont 77:869cf507173a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
emilmont 77:869cf507173a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
emilmont 77:869cf507173a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
emilmont 77:869cf507173a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
emilmont 77:869cf507173a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
emilmont 77:869cf507173a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
emilmont 77:869cf507173a 34 *
emilmont 77:869cf507173a 35 ******************************************************************************
Kojto 122:f9eeca106725 36 */
emilmont 77:869cf507173a 37
emilmont 77:869cf507173a 38 /* Define to prevent recursive inclusion -------------------------------------*/
emilmont 77:869cf507173a 39 #ifndef __STM32F4xx_HAL_IWDG_H
emilmont 77:869cf507173a 40 #define __STM32F4xx_HAL_IWDG_H
emilmont 77:869cf507173a 41
emilmont 77:869cf507173a 42 #ifdef __cplusplus
emilmont 77:869cf507173a 43 extern "C" {
emilmont 77:869cf507173a 44 #endif
emilmont 77:869cf507173a 45
emilmont 77:869cf507173a 46 /* Includes ------------------------------------------------------------------*/
emilmont 77:869cf507173a 47 #include "stm32f4xx_hal_def.h"
emilmont 77:869cf507173a 48
emilmont 77:869cf507173a 49 /** @addtogroup STM32F4xx_HAL_Driver
emilmont 77:869cf507173a 50 * @{
emilmont 77:869cf507173a 51 */
emilmont 77:869cf507173a 52
emilmont 77:869cf507173a 53 /** @addtogroup IWDG
emilmont 77:869cf507173a 54 * @{
Kojto 122:f9eeca106725 55 */
emilmont 77:869cf507173a 56
bogdanm 81:7d30d6019079 57 /* Exported types ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 58 /** @defgroup IWDG_Exported_Types IWDG Exported Types
Kojto 99:dbbf35b96557 59 * @{
Kojto 99:dbbf35b96557 60 */
emilmont 77:869cf507173a 61
emilmont 77:869cf507173a 62 /**
Kojto 122:f9eeca106725 63 * @brief IWDG Init structure definition
Kojto 122:f9eeca106725 64 */
emilmont 77:869cf507173a 65 typedef struct
emilmont 77:869cf507173a 66 {
Kojto 122:f9eeca106725 67 uint32_t Prescaler; /*!< Select the prescaler of the IWDG.
emilmont 77:869cf507173a 68 This parameter can be a value of @ref IWDG_Prescaler */
Kojto 122:f9eeca106725 69
Kojto 122:f9eeca106725 70 uint32_t Reload; /*!< Specifies the IWDG down-counter reload value.
bogdanm 81:7d30d6019079 71 This parameter must be a number between Min_Data = 0 and Max_Data = 0x0FFF */
Kojto 122:f9eeca106725 72
Kojto 122:f9eeca106725 73 } IWDG_InitTypeDef;
emilmont 77:869cf507173a 74
Kojto 122:f9eeca106725 75 /**
Kojto 122:f9eeca106725 76 * @brief IWDG Handle Structure definition
Kojto 122:f9eeca106725 77 */
emilmont 77:869cf507173a 78 typedef struct
emilmont 77:869cf507173a 79 {
Kojto 122:f9eeca106725 80 IWDG_TypeDef *Instance; /*!< Register base address */
Kojto 122:f9eeca106725 81
emilmont 77:869cf507173a 82 IWDG_InitTypeDef Init; /*!< IWDG required parameters */
Kojto 122:f9eeca106725 83
emilmont 77:869cf507173a 84 }IWDG_HandleTypeDef;
emilmont 77:869cf507173a 85
emilmont 77:869cf507173a 86 /**
emilmont 77:869cf507173a 87 * @}
emilmont 77:869cf507173a 88 */
emilmont 77:869cf507173a 89
Kojto 99:dbbf35b96557 90 /* Exported constants --------------------------------------------------------*/
Kojto 99:dbbf35b96557 91 /** @defgroup IWDG_Exported_Constants IWDG Exported Constants
Kojto 99:dbbf35b96557 92 * @{
Kojto 99:dbbf35b96557 93 */
Kojto 99:dbbf35b96557 94
Kojto 122:f9eeca106725 95 /** @defgroup IWDG_Prescaler IWDG Prescaler
Kojto 99:dbbf35b96557 96 * @{
Kojto 99:dbbf35b96557 97 */
Kojto 122:f9eeca106725 98 #define IWDG_PRESCALER_4 0x00000000U /*!< IWDG prescaler set to 4 */
Kojto 122:f9eeca106725 99 #define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */
Kojto 122:f9eeca106725 100 #define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */
Kojto 122:f9eeca106725 101 #define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */
Kojto 122:f9eeca106725 102 #define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */
Kojto 122:f9eeca106725 103 #define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */
Kojto 122:f9eeca106725 104 #define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */
Kojto 99:dbbf35b96557 105 /**
Kojto 99:dbbf35b96557 106 * @}
Kojto 99:dbbf35b96557 107 */
Kojto 99:dbbf35b96557 108
Kojto 99:dbbf35b96557 109 /**
Kojto 99:dbbf35b96557 110 * @}
Kojto 99:dbbf35b96557 111 */
Kojto 99:dbbf35b96557 112
emilmont 77:869cf507173a 113 /**
emilmont 77:869cf507173a 114 * @}
emilmont 77:869cf507173a 115 */
emilmont 77:869cf507173a 116
Kojto 99:dbbf35b96557 117 /* Exported macros -----------------------------------------------------------*/
Kojto 99:dbbf35b96557 118 /** @defgroup IWDG_Exported_Macros IWDG Exported Macros
Kojto 99:dbbf35b96557 119 * @{
Kojto 99:dbbf35b96557 120 */
emilmont 77:869cf507173a 121
Kojto 122:f9eeca106725 122 /**
Kojto 122:f9eeca106725 123 * @brief Enable the IWDG peripheral.
Kojto 122:f9eeca106725 124 * @param __HANDLE__ IWDG handle
bogdanm 85:024bf7f99721 125 * @retval None
bogdanm 85:024bf7f99721 126 */
Kojto 122:f9eeca106725 127 #define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE)
emilmont 77:869cf507173a 128
emilmont 77:869cf507173a 129 /**
Kojto 122:f9eeca106725 130 * @brief Reload IWDG counter with value defined in the reload register
Kojto 122:f9eeca106725 131 * (write access to IWDG_PR & IWDG_RLR registers disabled).
Kojto 122:f9eeca106725 132 * @param __HANDLE__ IWDG handle
Kojto 122:f9eeca106725 133 * @retval None
emilmont 77:869cf507173a 134 */
Kojto 122:f9eeca106725 135 #define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD)
emilmont 77:869cf507173a 136
Kojto 99:dbbf35b96557 137 /**
Kojto 99:dbbf35b96557 138 * @}
Kojto 99:dbbf35b96557 139 */
emilmont 77:869cf507173a 140
Kojto 122:f9eeca106725 141 /* Exported functions --------------------------------------------------------*/
Kojto 122:f9eeca106725 142 /** @defgroup IWDG_Exported_Functions IWDG Exported Functions
Kojto 99:dbbf35b96557 143 * @{
Kojto 99:dbbf35b96557 144 */
Kojto 122:f9eeca106725 145
Kojto 122:f9eeca106725 146 /** @defgroup IWDG_Exported_Functions_Group1 Initialization and Start functions
Kojto 122:f9eeca106725 147 * @{
Kojto 122:f9eeca106725 148 */
Kojto 122:f9eeca106725 149 /* Initialization/Start functions ********************************************/
Kojto 122:f9eeca106725 150 HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg);
Kojto 99:dbbf35b96557 151 /**
Kojto 99:dbbf35b96557 152 * @}
Kojto 99:dbbf35b96557 153 */
emilmont 77:869cf507173a 154
Kojto 122:f9eeca106725 155 /** @defgroup IWDG_Exported_Functions_Group2 IO operation functions
Kojto 99:dbbf35b96557 156 * @{
Kojto 99:dbbf35b96557 157 */
Kojto 122:f9eeca106725 158 /* I/O operation functions ****************************************************/
Kojto 122:f9eeca106725 159 HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg);
emilmont 77:869cf507173a 160 /**
emilmont 77:869cf507173a 161 * @}
Kojto 99:dbbf35b96557 162 */
Kojto 99:dbbf35b96557 163
Kojto 99:dbbf35b96557 164 /**
Kojto 99:dbbf35b96557 165 * @}
Kojto 122:f9eeca106725 166 */
Kojto 122:f9eeca106725 167
Kojto 122:f9eeca106725 168 /* Private constants ---------------------------------------------------------*/
Kojto 122:f9eeca106725 169 /** @defgroup IWDG_Private_Constants IWDG Private Constants
Kojto 122:f9eeca106725 170 * @{
Kojto 122:f9eeca106725 171 */
Kojto 99:dbbf35b96557 172
Kojto 122:f9eeca106725 173 /**
Kojto 122:f9eeca106725 174 * @brief IWDG Key Register BitMask
Kojto 122:f9eeca106725 175 */
Kojto 122:f9eeca106725 176 #define IWDG_KEY_RELOAD 0x0000AAAAU /*!< IWDG Reload Counter Enable */
Kojto 122:f9eeca106725 177 #define IWDG_KEY_ENABLE 0x0000CCCCU /*!< IWDG Peripheral Enable */
Kojto 122:f9eeca106725 178 #define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555U /*!< IWDG KR Write Access Enable */
Kojto 122:f9eeca106725 179 #define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000U /*!< IWDG KR Write Access Disable */
Kojto 122:f9eeca106725 180
Kojto 122:f9eeca106725 181 /**
Kojto 122:f9eeca106725 182 * @}
Kojto 122:f9eeca106725 183 */
Kojto 122:f9eeca106725 184
Kojto 122:f9eeca106725 185 /* Private macros ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 186 /** @defgroup IWDG_Private_Macros IWDG Private Macros
Kojto 99:dbbf35b96557 187 * @{
Kojto 99:dbbf35b96557 188 */
Kojto 99:dbbf35b96557 189
Kojto 99:dbbf35b96557 190 /**
Kojto 122:f9eeca106725 191 * @brief Enable write access to IWDG_PR and IWDG_RLR registers.
Kojto 122:f9eeca106725 192 * @param __HANDLE__ IWDG handle
Kojto 99:dbbf35b96557 193 * @retval None
Kojto 99:dbbf35b96557 194 */
Kojto 122:f9eeca106725 195 #define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE)
Kojto 99:dbbf35b96557 196
Kojto 99:dbbf35b96557 197 /**
Kojto 122:f9eeca106725 198 * @brief Disable write access to IWDG_PR and IWDG_RLR registers.
Kojto 122:f9eeca106725 199 * @param __HANDLE__ IWDG handle
Kojto 99:dbbf35b96557 200 * @retval None
Kojto 99:dbbf35b96557 201 */
Kojto 99:dbbf35b96557 202 #define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE)
Kojto 99:dbbf35b96557 203
Kojto 122:f9eeca106725 204 /**
Kojto 122:f9eeca106725 205 * @brief Check IWDG prescaler value.
Kojto 122:f9eeca106725 206 * @param __PRESCALER__ IWDG prescaler value
Kojto 122:f9eeca106725 207 * @retval None
Kojto 122:f9eeca106725 208 */
Kojto 122:f9eeca106725 209 #define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \
Kojto 122:f9eeca106725 210 ((__PRESCALER__) == IWDG_PRESCALER_8) || \
Kojto 122:f9eeca106725 211 ((__PRESCALER__) == IWDG_PRESCALER_16) || \
Kojto 122:f9eeca106725 212 ((__PRESCALER__) == IWDG_PRESCALER_32) || \
Kojto 122:f9eeca106725 213 ((__PRESCALER__) == IWDG_PRESCALER_64) || \
Kojto 122:f9eeca106725 214 ((__PRESCALER__) == IWDG_PRESCALER_128)|| \
Kojto 122:f9eeca106725 215 ((__PRESCALER__) == IWDG_PRESCALER_256))
Kojto 99:dbbf35b96557 216
Kojto 122:f9eeca106725 217 /**
Kojto 122:f9eeca106725 218 * @brief Check IWDG reload value.
Kojto 122:f9eeca106725 219 * @param __RELOAD__ IWDG reload value
Kojto 122:f9eeca106725 220 * @retval None
Kojto 122:f9eeca106725 221 */
Kojto 122:f9eeca106725 222 #define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL)
Kojto 99:dbbf35b96557 223
Kojto 99:dbbf35b96557 224 /**
Kojto 99:dbbf35b96557 225 * @}
Kojto 99:dbbf35b96557 226 */
Kojto 99:dbbf35b96557 227
Kojto 99:dbbf35b96557 228 /**
Kojto 99:dbbf35b96557 229 * @}
Kojto 99:dbbf35b96557 230 */
Kojto 99:dbbf35b96557 231
Kojto 99:dbbf35b96557 232 /**
Kojto 99:dbbf35b96557 233 * @}
Kojto 122:f9eeca106725 234 */
emilmont 77:869cf507173a 235
Kojto 122:f9eeca106725 236
emilmont 77:869cf507173a 237 #ifdef __cplusplus
emilmont 77:869cf507173a 238 }
emilmont 77:869cf507173a 239 #endif
emilmont 77:869cf507173a 240
emilmont 77:869cf507173a 241 #endif /* __STM32F4xx_HAL_IWDG_H */
emilmont 77:869cf507173a 242
emilmont 77:869cf507173a 243 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/