mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
<>
Date:
Fri Sep 02 15:07:44 2016 +0100
Revision:
144:ef7eb2e8f9f7
Parent:
113:b3775bf36a83
This updates the lib to the mbed lib v125

Who changed what in which revision?

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