L4 HAL Drivers

Committer:
EricLew
Date:
Mon Nov 02 19:37:23 2015 +0000
Revision:
0:80ee8f3b695e
Errors are with definitions of LCD and QSPI functions. I believe all .h and .c files are  uploaded, but there may need to be certain functions called.

Who changed what in which revision?

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