TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

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