Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / STM32F4 / Drivers / STM32F4xx_StdPeriph_Driver / src / stm32f4xx_flash_ramfunc.c
blob5ff1e80706df5f631a396e75683db1356425ba61
1 /**
2 ******************************************************************************
3 * @file stm32f4xx_flash_ramfunc.c
4 * @author MCD Application Team
5 * @version V1.7.1
6 * @date 20-May-2016
7 * @brief FLASH RAMFUNC module driver.
8 * This file provides a FLASH firmware functions which should be
9 * executed from internal SRAM
10 * + Stop/Start the flash interface while System Run
11 * + Enable/Disable the flash sleep while System Run
13 @verbatim
14 ==============================================================================
15 ##### APIs executed from Internal RAM #####
16 ==============================================================================
17 [..]
18 *** ARM Compiler ***
19 --------------------
20 [..] RAM functions are defined using the toolchain options.
21 Functions that are be executed in RAM should reside in a separate
22 source module. Using the 'Options for File' dialog you can simply change
23 the 'Code / Const' area of a module to a memory space in physical RAM.
24 Available memory areas are declared in the 'Target' tab of the
25 Options for Target' dialog.
27 *** ICCARM Compiler ***
28 -----------------------
29 [..] RAM functions are defined using a specific toolchain keyword "__ramfunc".
31 *** GNU Compiler ***
32 --------------------
33 [..] RAM functions are defined using a specific toolchain attribute
34 "__attribute__((section(".RamFunc")))".
36 @endverbatim
37 ******************************************************************************
38 * @attention
40 * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
42 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
43 * You may not use this file except in compliance with the License.
44 * You may obtain a copy of the License at:
46 * http://www.st.com/software_license_agreement_liberty_v2
48 * Unless required by applicable law or agreed to in writing, software
49 * distributed under the License is distributed on an "AS IS" BASIS,
50 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51 * See the License for the specific language governing permissions and
52 * limitations under the License.
54 ******************************************************************************
57 /* Includes ------------------------------------------------------------------*/
58 #include "stm32f4xx_flash_ramfunc.h"
60 /** @addtogroup STM32F4xx_StdPeriph_Driver
61 * @{
64 /** @defgroup FLASH RAMFUNC
65 * @brief FLASH RAMFUNC driver modules
66 * @{
67 */
69 /* Private typedef -----------------------------------------------------------*/
70 /* Private define ------------------------------------------------------------*/
71 /* Private macro -------------------------------------------------------------*/
72 /* Private variables ---------------------------------------------------------*/
73 /* Private function prototypes -----------------------------------------------*/
74 /* Private functions ---------------------------------------------------------*/
76 /** @defgroup FLASH_RAMFUNC_Private_Functions
77 * @{
80 /** @defgroup FLASH_RAMFUNC_Group1 Peripheral features functions executed from internal RAM
81 * @brief Peripheral Extended features functions
83 @verbatim
85 ===============================================================================
86 ##### ramfunc functions #####
87 ===============================================================================
88 [..]
89 This subsection provides a set of functions that should be executed from RAM
90 transfers.
92 @endverbatim
93 * @{
96 /**
97 * @brief Start/Stop the flash interface while System Run
98 * @note This mode is only available for STM32F411xx devices.
99 * @note This mode could n't be set while executing with the flash itself.
100 * It should be done with specific routine executed from RAM.
101 * @param NewState: new state of the Smart Card mode.
102 * This parameter can be: ENABLE or DISABLE.
103 * @retval None
105 __RAM_FUNC FLASH_FlashInterfaceCmd(FunctionalState NewState)
107 if (NewState != DISABLE)
109 /* Start the flash interface while System Run */
110 CLEAR_BIT(PWR->CR, PWR_CR_FISSR);
112 else
114 /* Stop the flash interface while System Run */
115 SET_BIT(PWR->CR, PWR_CR_FISSR);
120 * @brief Enable/Disable the flash sleep while System Run
121 * @note This mode is only available for STM32F411xx devices.
122 * @note This mode could n't be set while executing with the flash itself.
123 * It should be done with specific routine executed from RAM.
124 * @param NewState: new state of the Smart Card mode.
125 * This parameter can be: ENABLE or DISABLE.
126 * @retval None
128 __RAM_FUNC FLASH_FlashSleepModeCmd(FunctionalState NewState)
130 if (NewState != DISABLE)
132 /* Enable the flash sleep while System Run */
133 SET_BIT(PWR->CR, PWR_CR_FMSSR);
135 else
137 /* Disable the flash sleep while System Run */
138 CLEAR_BIT(PWR->CR, PWR_CR_FMSSR);
143 * @}
147 * @}
151 * @}
155 * @}
158 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/