The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
128:9bcdf88f62b0
Child:
145:64910690c574
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 89:552587b429a1 1 /**
bogdanm 89:552587b429a1 2 ******************************************************************************
bogdanm 89:552587b429a1 3 * @file stm32f4xx_hal_iwdg.h
bogdanm 89:552587b429a1 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.0
Kojto 122:f9eeca106725 6 * @date 06-May-2016
bogdanm 89:552587b429a1 7 * @brief Header file of IWDG HAL module.
bogdanm 89:552587b429a1 8 ******************************************************************************
bogdanm 89:552587b429a1 9 * @attention
bogdanm 89:552587b429a1 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
bogdanm 89:552587b429a1 12 *
bogdanm 89:552587b429a1 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 89:552587b429a1 14 * are permitted provided that the following conditions are met:
bogdanm 89:552587b429a1 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 89:552587b429a1 16 * this list of conditions and the following disclaimer.
bogdanm 89:552587b429a1 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 89:552587b429a1 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 89:552587b429a1 19 * and/or other materials provided with the distribution.
bogdanm 89:552587b429a1 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 89:552587b429a1 21 * may be used to endorse or promote products derived from this software
bogdanm 89:552587b429a1 22 * without specific prior written permission.
bogdanm 89:552587b429a1 23 *
bogdanm 89:552587b429a1 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 89:552587b429a1 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 89:552587b429a1 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 89:552587b429a1 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 89:552587b429a1 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 89:552587b429a1 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 89:552587b429a1 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 89:552587b429a1 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 89:552587b429a1 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 89:552587b429a1 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 89:552587b429a1 34 *
bogdanm 89:552587b429a1 35 ******************************************************************************
Kojto 122:f9eeca106725 36 */
bogdanm 89:552587b429a1 37
bogdanm 89:552587b429a1 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 89:552587b429a1 39 #ifndef __STM32F4xx_HAL_IWDG_H
bogdanm 89:552587b429a1 40 #define __STM32F4xx_HAL_IWDG_H
bogdanm 89:552587b429a1 41
bogdanm 89:552587b429a1 42 #ifdef __cplusplus
bogdanm 89:552587b429a1 43 extern "C" {
bogdanm 89:552587b429a1 44 #endif
bogdanm 89:552587b429a1 45
bogdanm 89:552587b429a1 46 /* Includes ------------------------------------------------------------------*/
bogdanm 89:552587b429a1 47 #include "stm32f4xx_hal_def.h"
bogdanm 89:552587b429a1 48
bogdanm 89:552587b429a1 49 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 89:552587b429a1 50 * @{
bogdanm 89:552587b429a1 51 */
bogdanm 89:552587b429a1 52
bogdanm 89:552587b429a1 53 /** @addtogroup IWDG
bogdanm 89:552587b429a1 54 * @{
Kojto 122:f9eeca106725 55 */
bogdanm 89:552587b429a1 56
bogdanm 89:552587b429a1 57 /* Exported types ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 58 /** @defgroup IWDG_Exported_Types IWDG Exported Types
Kojto 99:dbbf35b96557 59 * @{
Kojto 99:dbbf35b96557 60 */
bogdanm 89:552587b429a1 61
bogdanm 89:552587b429a1 62 /**
Kojto 122:f9eeca106725 63 * @brief IWDG Init structure definition
Kojto 122:f9eeca106725 64 */
bogdanm 89:552587b429a1 65 typedef struct
bogdanm 89:552587b429a1 66 {
Kojto 122:f9eeca106725 67 uint32_t Prescaler; /*!< Select the prescaler of the IWDG.
bogdanm 89:552587b429a1 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 89:552587b429a1 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;
bogdanm 89:552587b429a1 74
Kojto 122:f9eeca106725 75 /**
Kojto 122:f9eeca106725 76 * @brief IWDG Handle Structure definition
Kojto 122:f9eeca106725 77 */
bogdanm 89:552587b429a1 78 typedef struct
bogdanm 89:552587b429a1 79 {
Kojto 122:f9eeca106725 80 IWDG_TypeDef *Instance; /*!< Register base address */
Kojto 122:f9eeca106725 81
bogdanm 89:552587b429a1 82 IWDG_InitTypeDef Init; /*!< IWDG required parameters */
Kojto 122:f9eeca106725 83
bogdanm 89:552587b429a1 84 }IWDG_HandleTypeDef;
bogdanm 89:552587b429a1 85
bogdanm 89:552587b429a1 86 /**
bogdanm 89:552587b429a1 87 * @}
bogdanm 89:552587b429a1 88 */
bogdanm 89:552587b429a1 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
bogdanm 89:552587b429a1 113 /**
bogdanm 89:552587b429a1 114 * @}
bogdanm 89:552587b429a1 115 */
bogdanm 89:552587b429a1 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 */
bogdanm 89:552587b429a1 121
Kojto 122:f9eeca106725 122 /**
Kojto 122:f9eeca106725 123 * @brief Enable the IWDG peripheral.
Kojto 122:f9eeca106725 124 * @param __HANDLE__ IWDG handle
bogdanm 89:552587b429a1 125 * @retval None
bogdanm 89:552587b429a1 126 */
Kojto 122:f9eeca106725 127 #define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE)
bogdanm 89:552587b429a1 128
bogdanm 89:552587b429a1 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
bogdanm 89:552587b429a1 134 */
Kojto 122:f9eeca106725 135 #define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD)
bogdanm 89:552587b429a1 136
Kojto 99:dbbf35b96557 137 /**
Kojto 99:dbbf35b96557 138 * @}
Kojto 99:dbbf35b96557 139 */
bogdanm 89:552587b429a1 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 */
bogdanm 89:552587b429a1 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);
bogdanm 89:552587b429a1 160 /**
bogdanm 89:552587b429a1 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 */
bogdanm 89:552587b429a1 235
Kojto 122:f9eeca106725 236
bogdanm 89:552587b429a1 237 #ifdef __cplusplus
bogdanm 89:552587b429a1 238 }
bogdanm 89:552587b429a1 239 #endif
bogdanm 89:552587b429a1 240
bogdanm 89:552587b429a1 241 #endif /* __STM32F4xx_HAL_IWDG_H */
bogdanm 89:552587b429a1 242
bogdanm 89:552587b429a1 243 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/