mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

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

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
489:119543c9f674
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32l0xx_hal_firewall.c
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.2.0
mbed_official 489:119543c9f674 6 * @date 06-February-2015
mbed_official 489:119543c9f674 7 * @brief FIREWALL HAL module driver.
mbed_official 489:119543c9f674 8 *
mbed_official 489:119543c9f674 9 * This file provides firmware functions to manage the Firewall
mbed_official 489:119543c9f674 10 * Peripheral initialization and enabling.
mbed_official 489:119543c9f674 11 *
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 @verbatim
mbed_official 489:119543c9f674 14 ===============================================================================
mbed_official 489:119543c9f674 15 ##### How to use this driver #####
mbed_official 489:119543c9f674 16 ===============================================================================
mbed_official 489:119543c9f674 17 [..]
mbed_official 489:119543c9f674 18 The FIREWALL HAL driver can be used as follows:
mbed_official 489:119543c9f674 19
mbed_official 489:119543c9f674 20 (#) Declare a FIREWALL_InitTypeDef initialization structure.
mbed_official 489:119543c9f674 21
mbed_official 489:119543c9f674 22 (#) Resort to HAL_FIREWALL_Config() API to initialize the Firewall
mbed_official 489:119543c9f674 23
mbed_official 489:119543c9f674 24 (#) Enable the FIREWALL in calling HAL_FIREWALL_EnableFirewall() API
mbed_official 489:119543c9f674 25
mbed_official 489:119543c9f674 26 (#) To ensure that any code executed outside the protected segment closes the
mbed_official 489:119543c9f674 27 FIREWALL, the user must set the flag FIREWALL_PRE_ARM_SET in calling
mbed_official 489:119543c9f674 28 __HAL_FIREWALL_PREARM_ENABLE() macro if called within a protected code segment
mbed_official 489:119543c9f674 29 or
mbed_official 489:119543c9f674 30 HAL_FIREWALL_EnablePreArmFlag() API if called outside of protected code segment
mbed_official 489:119543c9f674 31 after HAL_FIREWALL_Config() call.
mbed_official 489:119543c9f674 32
mbed_official 489:119543c9f674 33
mbed_official 489:119543c9f674 34 @endverbatim
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 * @attention
mbed_official 489:119543c9f674 37 *
mbed_official 489:119543c9f674 38 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 39 *
mbed_official 489:119543c9f674 40 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 41 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 42 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 43 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 44 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 45 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 46 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 47 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 48 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 49 * without specific prior written permission.
mbed_official 489:119543c9f674 50 *
mbed_official 489:119543c9f674 51 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 52 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 53 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 54 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 55 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 56 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 57 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 58 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 59 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 61 *
mbed_official 489:119543c9f674 62 ******************************************************************************
mbed_official 489:119543c9f674 63 */
mbed_official 489:119543c9f674 64
mbed_official 489:119543c9f674 65 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 66 #include "stm32l0xx_hal.h"
mbed_official 489:119543c9f674 67
mbed_official 489:119543c9f674 68 /** @addtogroup STM32L0xx_HAL_Driver
mbed_official 489:119543c9f674 69 * @{
mbed_official 489:119543c9f674 70 */
mbed_official 489:119543c9f674 71
mbed_official 489:119543c9f674 72 /** @defgroup FIREWALL FIREWALL
mbed_official 489:119543c9f674 73 * @brief HAL FIREWALL module driver
mbed_official 489:119543c9f674 74 * @{
mbed_official 489:119543c9f674 75 */
mbed_official 489:119543c9f674 76 #ifdef HAL_FIREWALL_MODULE_ENABLED
mbed_official 489:119543c9f674 77
mbed_official 489:119543c9f674 78 /* Private typedef -----------------------------------------------------------*/
mbed_official 489:119543c9f674 79 /* Private define ------------------------------------------------------------*/
mbed_official 489:119543c9f674 80 /* Private macro -------------------------------------------------------------*/
mbed_official 489:119543c9f674 81 /* Private variables ---------------------------------------------------------*/
mbed_official 489:119543c9f674 82 /* Private function prototypes -----------------------------------------------*/
mbed_official 489:119543c9f674 83 /* Private functions ---------------------------------------------------------*/
mbed_official 489:119543c9f674 84
mbed_official 489:119543c9f674 85
mbed_official 489:119543c9f674 86 /** @defgroup FIREWALL_Exported_Functions FIREWALL Exported Functions
mbed_official 489:119543c9f674 87 * @{
mbed_official 489:119543c9f674 88 */
mbed_official 489:119543c9f674 89
mbed_official 489:119543c9f674 90 /** @defgroup FIREWALL_Exported_Functions_Group1 Initialization Functions
mbed_official 489:119543c9f674 91 * @brief Initialization and Configuration Functions
mbed_official 489:119543c9f674 92 *
mbed_official 489:119543c9f674 93 @verbatim
mbed_official 489:119543c9f674 94 ===============================================================================
mbed_official 489:119543c9f674 95 ##### Initialization and Configuration functions #####
mbed_official 489:119543c9f674 96 ===============================================================================
mbed_official 489:119543c9f674 97 [..]
mbed_official 489:119543c9f674 98 This subsection provides the functions allowing to initialize the Firewall.
mbed_official 489:119543c9f674 99 Initialization is done by HAL_FIREWALL_Config():
mbed_official 489:119543c9f674 100
mbed_official 489:119543c9f674 101 (+) Enable the Firewall clock thru __HAL_RCC_FIREWALL_CLK_ENABLE() macro.
mbed_official 489:119543c9f674 102
mbed_official 489:119543c9f674 103 (+) Set the protected code segment address start and length.
mbed_official 489:119543c9f674 104
mbed_official 489:119543c9f674 105 (+) Set the protected non-volatile and/or volatile data segments
mbed_official 489:119543c9f674 106 address starts and lengths if applicable.
mbed_official 489:119543c9f674 107
mbed_official 489:119543c9f674 108 (+) Set the volatile data segment execution and sharing status.
mbed_official 489:119543c9f674 109
mbed_official 489:119543c9f674 110 (+) Length must be set to 0 for an unprotected segment.
mbed_official 489:119543c9f674 111
mbed_official 489:119543c9f674 112 @endverbatim
mbed_official 489:119543c9f674 113 * @{
mbed_official 489:119543c9f674 114 */
mbed_official 489:119543c9f674 115
mbed_official 489:119543c9f674 116 /**
mbed_official 489:119543c9f674 117 * @brief Initialize the Firewall according to the FIREWALL_InitTypeDef structure parameters.
mbed_official 489:119543c9f674 118 * @param fw_init: Firewall initialization structure
mbed_official 489:119543c9f674 119 * @note The API returns HAL_ERROR if the Firewall is already enabled.
mbed_official 489:119543c9f674 120 * @retval HAL status
mbed_official 489:119543c9f674 121 */
mbed_official 489:119543c9f674 122 HAL_StatusTypeDef HAL_FIREWALL_Config(FIREWALL_InitTypeDef * fw_init)
mbed_official 489:119543c9f674 123 {
mbed_official 489:119543c9f674 124 /* Check the Firewall initialization structure allocation */
mbed_official 489:119543c9f674 125 if(fw_init == NULL)
mbed_official 489:119543c9f674 126 {
mbed_official 489:119543c9f674 127 return HAL_ERROR;
mbed_official 489:119543c9f674 128 }
mbed_official 489:119543c9f674 129
mbed_official 489:119543c9f674 130 /* Enable Firewall clock */
mbed_official 489:119543c9f674 131 __HAL_RCC_FIREWALL_CLK_ENABLE();
mbed_official 489:119543c9f674 132
mbed_official 489:119543c9f674 133 /* Make sure that Firewall is not enabled already */
mbed_official 489:119543c9f674 134 if (__HAL_FIREWALL_IS_ENABLED() != RESET)
mbed_official 489:119543c9f674 135 {
mbed_official 489:119543c9f674 136 return HAL_ERROR;
mbed_official 489:119543c9f674 137 }
mbed_official 489:119543c9f674 138
mbed_official 489:119543c9f674 139 /* Check Firewall configuration addresses and lengths when segment is protected */
mbed_official 489:119543c9f674 140 /* Code segment */
mbed_official 489:119543c9f674 141 if (fw_init->CodeSegmentLength != 0)
mbed_official 489:119543c9f674 142 {
mbed_official 489:119543c9f674 143 assert_param(IS_FIREWALL_CODE_SEGMENT_ADDRESS(fw_init->CodeSegmentStartAddress));
mbed_official 489:119543c9f674 144 assert_param(IS_FIREWALL_CODE_SEGMENT_LENGTH(fw_init->CodeSegmentStartAddress, fw_init->CodeSegmentLength));
mbed_official 489:119543c9f674 145 }
mbed_official 489:119543c9f674 146 /* Non volatile data segment */
mbed_official 489:119543c9f674 147 if (fw_init->NonVDataSegmentLength != 0)
mbed_official 489:119543c9f674 148 {
mbed_official 489:119543c9f674 149 assert_param(IS_FIREWALL_NONVOLATILEDATA_SEGMENT_ADDRESS(fw_init->NonVDataSegmentStartAddress));
mbed_official 489:119543c9f674 150 assert_param(IS_FIREWALL_NONVOLATILEDATA_SEGMENT_LENGTH(fw_init->NonVDataSegmentStartAddress, fw_init->NonVDataSegmentLength));
mbed_official 489:119543c9f674 151 }
mbed_official 489:119543c9f674 152 /* Volatile data segment */
mbed_official 489:119543c9f674 153 if (fw_init->VDataSegmentLength != 0)
mbed_official 489:119543c9f674 154 {
mbed_official 489:119543c9f674 155 assert_param(IS_FIREWALL_VOLATILEDATA_SEGMENT_ADDRESS(fw_init->VDataSegmentStartAddress));
mbed_official 489:119543c9f674 156 assert_param(IS_FIREWALL_VOLATILEDATA_SEGMENT_LENGTH(fw_init->VDataSegmentStartAddress, fw_init->VDataSegmentLength));
mbed_official 489:119543c9f674 157 }
mbed_official 489:119543c9f674 158
mbed_official 489:119543c9f674 159 /* Check Firewall Configuration Register parameters */
mbed_official 489:119543c9f674 160 assert_param(IS_FIREWALL_VOLATILEDATA_EXECUTE(fw_init->VolatileDataExecution));
mbed_official 489:119543c9f674 161 assert_param(IS_FIREWALL_VOLATILEDATA_SHARE(fw_init->VolatileDataShared));
mbed_official 489:119543c9f674 162
mbed_official 489:119543c9f674 163
mbed_official 489:119543c9f674 164 /* Configuration */
mbed_official 489:119543c9f674 165
mbed_official 489:119543c9f674 166 /* Protected code segment start address configuration */
mbed_official 489:119543c9f674 167 WRITE_REG(FW->CSSA, (FW_CSSA_ADD & fw_init->CodeSegmentStartAddress));
mbed_official 489:119543c9f674 168 /* Protected code segment length configuration */
mbed_official 489:119543c9f674 169 WRITE_REG(FW->CSL, (FW_CSL_LENG & fw_init->CodeSegmentLength));
mbed_official 489:119543c9f674 170
mbed_official 489:119543c9f674 171 /* Protected non volatile data segment start address configuration */
mbed_official 489:119543c9f674 172 WRITE_REG(FW->NVDSSA, (FW_NVDSSA_ADD & fw_init->NonVDataSegmentStartAddress));
mbed_official 489:119543c9f674 173 /* Protected non volatile data segment length configuration */
mbed_official 489:119543c9f674 174 WRITE_REG(FW->NVDSL, (FW_NVDSL_LENG & fw_init->NonVDataSegmentLength));
mbed_official 489:119543c9f674 175
mbed_official 489:119543c9f674 176 /* Protected volatile data segment start address configuration */
mbed_official 489:119543c9f674 177 WRITE_REG(FW->VDSSA, (FW_VDSSA_ADD & fw_init->VDataSegmentStartAddress));
mbed_official 489:119543c9f674 178 /* Protected volatile data segment length configuration */
mbed_official 489:119543c9f674 179 WRITE_REG(FW->VDSL, (FW_VDSL_LENG & fw_init->VDataSegmentLength));
mbed_official 489:119543c9f674 180
mbed_official 489:119543c9f674 181 /* Set Firewall Configuration Register VDE and VDS bits
mbed_official 489:119543c9f674 182 (volatile data execution and shared configuration) */
mbed_official 489:119543c9f674 183 MODIFY_REG(FW->CR, FW_CR_VDS|FW_CR_VDE, fw_init->VolatileDataExecution|fw_init->VolatileDataShared);
mbed_official 489:119543c9f674 184
mbed_official 489:119543c9f674 185 return HAL_OK;
mbed_official 489:119543c9f674 186 }
mbed_official 489:119543c9f674 187
mbed_official 489:119543c9f674 188 /**
mbed_official 489:119543c9f674 189 * @brief Retrieve the Firewall configuration.
mbed_official 489:119543c9f674 190 * @param fw_config: Firewall configuration, type is same as initialization structure
mbed_official 489:119543c9f674 191 * @note This API can't be executed inside a code area protected by the Firewall
mbed_official 489:119543c9f674 192 * when the Firewall is enabled
mbed_official 489:119543c9f674 193 * @note If NVDSL register is different from 0, that is, if the non volatile data segment
mbed_official 489:119543c9f674 194 * is defined, this API can't be executed when the Firewall is enabled.
mbed_official 489:119543c9f674 195 * @note User should resort to __HAL_FIREWALL_GET_PREARM() macro to retrieve FPA bit status
mbed_official 489:119543c9f674 196 * @retval None
mbed_official 489:119543c9f674 197 */
mbed_official 489:119543c9f674 198 void HAL_FIREWALL_GetConfig(FIREWALL_InitTypeDef * fw_config)
mbed_official 489:119543c9f674 199 {
mbed_official 489:119543c9f674 200
mbed_official 489:119543c9f674 201 /* Enable Firewall clock, in case no Firewall configuration has been carried
mbed_official 489:119543c9f674 202 out up to this point */
mbed_official 489:119543c9f674 203 __HAL_RCC_FIREWALL_CLK_ENABLE();
mbed_official 489:119543c9f674 204
mbed_official 489:119543c9f674 205 /* Retrieve code segment protection setting */
mbed_official 489:119543c9f674 206 fw_config->CodeSegmentStartAddress = (READ_REG(FW->CSSA) & FW_CSSA_ADD);
mbed_official 489:119543c9f674 207 fw_config->CodeSegmentLength = (READ_REG(FW->CSL) & FW_CSL_LENG);
mbed_official 489:119543c9f674 208
mbed_official 489:119543c9f674 209 /* Retrieve non volatile data segment protection setting */
mbed_official 489:119543c9f674 210 fw_config->NonVDataSegmentStartAddress = (READ_REG(FW->NVDSSA) & FW_NVDSSA_ADD);
mbed_official 489:119543c9f674 211 fw_config->NonVDataSegmentLength = (READ_REG(FW->NVDSL) & FW_NVDSL_LENG);
mbed_official 489:119543c9f674 212
mbed_official 489:119543c9f674 213 /* Retrieve volatile data segment protection setting */
mbed_official 489:119543c9f674 214 fw_config->VDataSegmentStartAddress = (READ_REG(FW->VDSSA) & FW_VDSSA_ADD);
mbed_official 489:119543c9f674 215 fw_config->VDataSegmentLength = (READ_REG(FW->VDSL) & FW_VDSL_LENG);
mbed_official 489:119543c9f674 216
mbed_official 489:119543c9f674 217 /* Retrieve volatile data execution setting */
mbed_official 489:119543c9f674 218 fw_config->VolatileDataExecution = (READ_REG(FW->CR) & FW_CR_VDE);
mbed_official 489:119543c9f674 219
mbed_official 489:119543c9f674 220 /* Retrieve volatile data shared setting */
mbed_official 489:119543c9f674 221 fw_config->VolatileDataShared = (READ_REG(FW->CR) & FW_CR_VDS);
mbed_official 489:119543c9f674 222
mbed_official 489:119543c9f674 223 return;
mbed_official 489:119543c9f674 224 }
mbed_official 489:119543c9f674 225
mbed_official 489:119543c9f674 226
mbed_official 489:119543c9f674 227
mbed_official 489:119543c9f674 228 /**
mbed_official 489:119543c9f674 229 * @brief Enable FIREWALL.
mbed_official 489:119543c9f674 230 * @note Firewall is enabled in clearing FWDIS bit of SYSCFG CFGR1 register.
mbed_official 489:119543c9f674 231 * Once enabled, the Firewall cannot be disabled by software. Only a
mbed_official 489:119543c9f674 232 * system reset can set again FWDIS bit.
mbed_official 489:119543c9f674 233 * @retval None
mbed_official 489:119543c9f674 234 */
mbed_official 489:119543c9f674 235 void HAL_FIREWALL_EnableFirewall(void)
mbed_official 489:119543c9f674 236 {
mbed_official 489:119543c9f674 237 /* Clears FWDIS bit of SYSCFG CFGR1 register */
mbed_official 489:119543c9f674 238 CLEAR_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_FWDISEN);
mbed_official 489:119543c9f674 239
mbed_official 489:119543c9f674 240 }
mbed_official 489:119543c9f674 241
mbed_official 489:119543c9f674 242 /**
mbed_official 489:119543c9f674 243 * @brief Enable FIREWALL pre arm.
mbed_official 489:119543c9f674 244 * @note When FPA bit is set, any code executed outside the protected segment
mbed_official 489:119543c9f674 245 * will close the Firewall.
mbed_official 489:119543c9f674 246 * @note This API provides the same service as __HAL_FIREWALL_PREARM_ENABLE() macro
mbed_official 489:119543c9f674 247 * but can't be executed inside a code area protected by the Firewall.
mbed_official 489:119543c9f674 248 * @note -- When the Firewall is disabled, user can resort to
mbed_official 489:119543c9f674 249 * HAL_FIREWALL_EnablePreArmFlag() API any time.
mbed_official 489:119543c9f674 250 * -- When the Firewall is enabled and NVDSL register is equal to 0 (that is,
mbed_official 489:119543c9f674 251 * when the non volatile data segment is not defined),
mbed_official 489:119543c9f674 252 * ** this API can be executed when the Firewall is closed
mbed_official 489:119543c9f674 253 * ** when the Firewall is opened, user should resort to
mbed_official 489:119543c9f674 254 * __HAL_FIREWALL_PREARM_ENABLE() macro instead
mbed_official 489:119543c9f674 255 * -- When the Firewall is enabled and NVDSL register is different from 0
mbed_official 489:119543c9f674 256 * (that is, when the non volatile data segment is defined)
mbed_official 489:119543c9f674 257 * ** FW_CR register can be accessed only when the Firewall is opened:
mbed_official 489:119543c9f674 258 * user should resort to __HAL_FIREWALL_PREARM_ENABLE() macro instead.
mbed_official 489:119543c9f674 259 * @retval None
mbed_official 489:119543c9f674 260 */
mbed_official 489:119543c9f674 261 void HAL_FIREWALL_EnablePreArmFlag(void)
mbed_official 489:119543c9f674 262 {
mbed_official 489:119543c9f674 263 /* Set FPA bit */
mbed_official 489:119543c9f674 264 SET_BIT(FW->CR, FW_CR_FPA);
mbed_official 489:119543c9f674 265 }
mbed_official 489:119543c9f674 266
mbed_official 489:119543c9f674 267
mbed_official 489:119543c9f674 268 /**
mbed_official 489:119543c9f674 269 * @brief Disable FIREWALL pre arm.
mbed_official 489:119543c9f674 270 * @note When FPA bit is reset, any code executed outside the protected segment
mbed_official 489:119543c9f674 271 * when the Firewall is opened will generate a system reset.
mbed_official 489:119543c9f674 272 * @note This API provides the same service as __HAL_FIREWALL_PREARM_DISABLE() macro
mbed_official 489:119543c9f674 273 * but can't be executed inside a code area protected by the Firewall.
mbed_official 489:119543c9f674 274 * @note -- When the Firewall is disabled, user can resort to
mbed_official 489:119543c9f674 275 * HAL_FIREWALL_EnablePreArmFlag() API any time.
mbed_official 489:119543c9f674 276 * -- When the Firewall is enabled and NVDSL register is equal to 0 (that is,
mbed_official 489:119543c9f674 277 * when the non volatile data segment is not defined),
mbed_official 489:119543c9f674 278 * ** this API can be executed when the Firewall is closed
mbed_official 489:119543c9f674 279 * ** when the Firewall is opened, user should resort to
mbed_official 489:119543c9f674 280 * __HAL_FIREWALL_PREARM_DISABLE() macro instead
mbed_official 489:119543c9f674 281 * -- When the Firewall is enabled and NVDSL register is different from 0
mbed_official 489:119543c9f674 282 * (that is, when the non volatile data segment is defined)
mbed_official 489:119543c9f674 283 * ** FW_CR register can be accessed only when the Firewall is opened:
mbed_official 489:119543c9f674 284 * user should resort to __HAL_FIREWALL_PREARM_DISABLE() macro instead.
mbed_official 489:119543c9f674 285
mbed_official 489:119543c9f674 286 * @retval None
mbed_official 489:119543c9f674 287 */
mbed_official 489:119543c9f674 288 void HAL_FIREWALL_DisablePreArmFlag(void)
mbed_official 489:119543c9f674 289 {
mbed_official 489:119543c9f674 290 /* Clear FPA bit */
mbed_official 489:119543c9f674 291 CLEAR_BIT(FW->CR, FW_CR_FPA);
mbed_official 489:119543c9f674 292 }
mbed_official 489:119543c9f674 293
mbed_official 489:119543c9f674 294 /**
mbed_official 489:119543c9f674 295 * @}
mbed_official 489:119543c9f674 296 */
mbed_official 489:119543c9f674 297
mbed_official 489:119543c9f674 298 /**
mbed_official 489:119543c9f674 299 * @}
mbed_official 489:119543c9f674 300 */
mbed_official 489:119543c9f674 301
mbed_official 489:119543c9f674 302 #endif /* HAL_FIREWALL_MODULE_ENABLED */
mbed_official 489:119543c9f674 303 /**
mbed_official 489:119543c9f674 304 * @}
mbed_official 489:119543c9f674 305 */
mbed_official 489:119543c9f674 306
mbed_official 489:119543c9f674 307 /**
mbed_official 489:119543c9f674 308 * @}
mbed_official 489:119543c9f674 309 */
mbed_official 489:119543c9f674 310
mbed_official 489:119543c9f674 311 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/