fix LPC812 PWM

Dependents:   IR_LED_Send

Fork of mbed-dev by mbed official

Committer:
mbed_official
Date:
Tue Apr 19 11:15:15 2016 +0100
Revision:
113:b3775bf36a83
Parent:
0:9b334a45a8ff
Synchronized with git revision 896981126b34b6d9441e3eea77881c67a1ae3dbd

Full URL: https://github.com/mbedmicro/mbed/commit/896981126b34b6d9441e3eea77881c67a1ae3dbd/

Exporter tool addition for e2 studio

Who changed what in which revision?

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