mbed library sources. Supersedes mbed-src.

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

Committer:
Kojto
Date:
Tue Feb 14 14:44:10 2017 +0000
Revision:
158:b23ee177fd68
Child:
186:707f6e361f3e
This updates the lib to the mbed lib v136

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 158:b23ee177fd68 1 /**
Kojto 158:b23ee177fd68 2 ******************************************************************************
Kojto 158:b23ee177fd68 3 * @file stm32l0xx_ll_system.h
Kojto 158:b23ee177fd68 4 * @author MCD Application Team
Kojto 158:b23ee177fd68 5 * @version V1.7.0
Kojto 158:b23ee177fd68 6 * @date 31-May-2016
Kojto 158:b23ee177fd68 7 * @brief Header file of SYSTEM LL module.
Kojto 158:b23ee177fd68 8 @verbatim
Kojto 158:b23ee177fd68 9 ==============================================================================
Kojto 158:b23ee177fd68 10 ##### How to use this driver #####
Kojto 158:b23ee177fd68 11 ==============================================================================
Kojto 158:b23ee177fd68 12 [..]
Kojto 158:b23ee177fd68 13 The LL SYSTEM driver contains a set of generic APIs that can be
Kojto 158:b23ee177fd68 14 used by user:
Kojto 158:b23ee177fd68 15 (+) Some of the FLASH features need to be handled in the SYSTEM file.
Kojto 158:b23ee177fd68 16 (+) Access to DBGCMU registers
Kojto 158:b23ee177fd68 17 (+) Access to SYSCFG registers
Kojto 158:b23ee177fd68 18
Kojto 158:b23ee177fd68 19 @endverbatim
Kojto 158:b23ee177fd68 20 ******************************************************************************
Kojto 158:b23ee177fd68 21 * @attention
Kojto 158:b23ee177fd68 22 *
Kojto 158:b23ee177fd68 23 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 158:b23ee177fd68 24 *
Kojto 158:b23ee177fd68 25 * Redistribution and use in source and binary forms, with or without modification,
Kojto 158:b23ee177fd68 26 * are permitted provided that the following conditions are met:
Kojto 158:b23ee177fd68 27 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 158:b23ee177fd68 28 * this list of conditions and the following disclaimer.
Kojto 158:b23ee177fd68 29 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 158:b23ee177fd68 30 * this list of conditions and the following disclaimer in the documentation
Kojto 158:b23ee177fd68 31 * and/or other materials provided with the distribution.
Kojto 158:b23ee177fd68 32 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 158:b23ee177fd68 33 * may be used to endorse or promote products derived from this software
Kojto 158:b23ee177fd68 34 * without specific prior written permission.
Kojto 158:b23ee177fd68 35 *
Kojto 158:b23ee177fd68 36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 158:b23ee177fd68 37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 158:b23ee177fd68 38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 158:b23ee177fd68 39 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 158:b23ee177fd68 40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 158:b23ee177fd68 41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 158:b23ee177fd68 42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 158:b23ee177fd68 43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 158:b23ee177fd68 44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 158:b23ee177fd68 45 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 158:b23ee177fd68 46 *
Kojto 158:b23ee177fd68 47 ******************************************************************************
Kojto 158:b23ee177fd68 48 */
Kojto 158:b23ee177fd68 49
Kojto 158:b23ee177fd68 50 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 158:b23ee177fd68 51 #ifndef __STM32L0xx_LL_SYSTEM_H
Kojto 158:b23ee177fd68 52 #define __STM32L0xx_LL_SYSTEM_H
Kojto 158:b23ee177fd68 53
Kojto 158:b23ee177fd68 54 #ifdef __cplusplus
Kojto 158:b23ee177fd68 55 extern "C" {
Kojto 158:b23ee177fd68 56 #endif
Kojto 158:b23ee177fd68 57
Kojto 158:b23ee177fd68 58 /* Includes ------------------------------------------------------------------*/
Kojto 158:b23ee177fd68 59 #include "stm32l0xx.h"
Kojto 158:b23ee177fd68 60
Kojto 158:b23ee177fd68 61 /** @addtogroup STM32L0xx_LL_Driver
Kojto 158:b23ee177fd68 62 * @{
Kojto 158:b23ee177fd68 63 */
Kojto 158:b23ee177fd68 64
Kojto 158:b23ee177fd68 65 #if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU)
Kojto 158:b23ee177fd68 66
Kojto 158:b23ee177fd68 67 /** @defgroup SYSTEM_LL SYSTEM
Kojto 158:b23ee177fd68 68 * @{
Kojto 158:b23ee177fd68 69 */
Kojto 158:b23ee177fd68 70
Kojto 158:b23ee177fd68 71 /* Private types -------------------------------------------------------------*/
Kojto 158:b23ee177fd68 72 /* Private variables ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 73
Kojto 158:b23ee177fd68 74 /* Private constants ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 75 /** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants
Kojto 158:b23ee177fd68 76 * @{
Kojto 158:b23ee177fd68 77 */
Kojto 158:b23ee177fd68 78
Kojto 158:b23ee177fd68 79 /* Defines used for position in the register */
Kojto 158:b23ee177fd68 80 #define DBGMCU_REVID_POSITION (uint32_t)16U
Kojto 158:b23ee177fd68 81
Kojto 158:b23ee177fd68 82 /**
Kojto 158:b23ee177fd68 83 * @brief Power-down in Run mode Flash key
Kojto 158:b23ee177fd68 84 */
Kojto 158:b23ee177fd68 85 #define FLASH_PDKEY1 ((uint32_t)0x04152637U) /*!< Flash power down key1 */
Kojto 158:b23ee177fd68 86 #define FLASH_PDKEY2 ((uint32_t)0xFAFBFCFDU) /*!< Flash power down key2: used with FLASH_PDKEY1
Kojto 158:b23ee177fd68 87 to unlock the RUN_PD bit in FLASH_ACR */
Kojto 158:b23ee177fd68 88
Kojto 158:b23ee177fd68 89 /**
Kojto 158:b23ee177fd68 90 * @}
Kojto 158:b23ee177fd68 91 */
Kojto 158:b23ee177fd68 92
Kojto 158:b23ee177fd68 93 /* Private macros ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 94
Kojto 158:b23ee177fd68 95 /* Exported types ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 96 /* Exported constants --------------------------------------------------------*/
Kojto 158:b23ee177fd68 97 /** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants
Kojto 158:b23ee177fd68 98 * @{
Kojto 158:b23ee177fd68 99 */
Kojto 158:b23ee177fd68 100
Kojto 158:b23ee177fd68 101 /** @defgroup SYSTEM_LL_EC_REMAP SYSCFG Memory Remap
Kojto 158:b23ee177fd68 102 * @{
Kojto 158:b23ee177fd68 103 */
Kojto 158:b23ee177fd68 104 #define LL_SYSCFG_REMAP_FLASH (uint32_t)0x00000000U /*!< Main Flash memory mapped at 0x00000000 */
Kojto 158:b23ee177fd68 105 #define LL_SYSCFG_REMAP_SYSTEMFLASH SYSCFG_CFGR1_MEM_MODE_0 /*!< System Flash memory mapped at 0x00000000 */
Kojto 158:b23ee177fd68 106 #define LL_SYSCFG_REMAP_SRAM (SYSCFG_CFGR1_MEM_MODE_1 | SYSCFG_CFGR1_MEM_MODE_0) /*!< SRAM mapped at 0x00000000 */
Kojto 158:b23ee177fd68 107
Kojto 158:b23ee177fd68 108 /**
Kojto 158:b23ee177fd68 109 * @}
Kojto 158:b23ee177fd68 110 */
Kojto 158:b23ee177fd68 111
Kojto 158:b23ee177fd68 112 #if defined(SYSCFG_CFGR1_UFB)
Kojto 158:b23ee177fd68 113 /** @defgroup SYSTEM_LL_EC_BANKMODE SYSCFG Bank Mode
Kojto 158:b23ee177fd68 114 * @{
Kojto 158:b23ee177fd68 115 */
Kojto 158:b23ee177fd68 116 #define LL_SYSCFG_BANKMODE_BANK1 (uint32_t)0x00000000U /*!< Flash Bank1 mapped at 0x08000000 (and aliased at 0x00000000),
Kojto 158:b23ee177fd68 117 Flash Bank2 mapped at 0x08018000 (and aliased at 0x00018000),
Kojto 158:b23ee177fd68 118 Data EEPROM Bank1 mapped at 0x08080000 (and aliased at 0x00080000),
Kojto 158:b23ee177fd68 119 Data EEPROM Bank2 mapped at 0x08080C00 (and aliased at 0x00080C00) */
Kojto 158:b23ee177fd68 120 #define LL_SYSCFG_BANKMODE_BANK2 SYSCFG_CFGR1_UFB /*!< Flash Bank2 mapped at 0x08000000 (and aliased at 0x00000000),
Kojto 158:b23ee177fd68 121 Flash Bank1 mapped at 0x08018000 (and aliased at 0x00018000),
Kojto 158:b23ee177fd68 122 Data EEPROM Bank2 mapped at 0x08080000 (and aliased at 0x00080000),
Kojto 158:b23ee177fd68 123 Data EEPROM Bank1 mapped at 0x08080C00 (and aliased at 0x00080C00) */
Kojto 158:b23ee177fd68 124 /**
Kojto 158:b23ee177fd68 125 * @}
Kojto 158:b23ee177fd68 126 */
Kojto 158:b23ee177fd68 127
Kojto 158:b23ee177fd68 128 #endif /* SYSCFG_CFGR1_UFB */
Kojto 158:b23ee177fd68 129
Kojto 158:b23ee177fd68 130 /** @defgroup SYSTEM_LL_EC_BOOTMODE SYSCFG Boot Mode
Kojto 158:b23ee177fd68 131 * @{
Kojto 158:b23ee177fd68 132 */
Kojto 158:b23ee177fd68 133 #define LL_SYSCFG_BOOTMODE_FLASH (uint32_t)0x00000000U /*!< Main Flash memory boot mode */
Kojto 158:b23ee177fd68 134 #define LL_SYSCFG_BOOTMODE_SYSTEMFLASH SYSCFG_CFGR1_BOOT_MODE_0 /*!< System Flash memory boot mode */
Kojto 158:b23ee177fd68 135 #define LL_SYSCFG_BOOTMODE_SRAM (SYSCFG_CFGR1_BOOT_MODE_1 | SYSCFG_CFGR1_BOOT_MODE_0) /*!< SRAM boot mode */
Kojto 158:b23ee177fd68 136
Kojto 158:b23ee177fd68 137 /**
Kojto 158:b23ee177fd68 138 * @}
Kojto 158:b23ee177fd68 139 */
Kojto 158:b23ee177fd68 140
Kojto 158:b23ee177fd68 141 #if defined(SYSCFG_CFGR2_CAPA)
Kojto 158:b23ee177fd68 142 /** @defgroup SYSTEM_LL_EC_CFGR2 SYSCFG VLCD Rail Connection
Kojto 158:b23ee177fd68 143 * @{
Kojto 158:b23ee177fd68 144 */
Kojto 158:b23ee177fd68 145
Kojto 158:b23ee177fd68 146 #define LL_SYSCFG_CAPA_VLCD2_PB2 SYSCFG_CFGR2_CAPA_0 /*!< Connect PB2 pin to LCD_VLCD2 rails supply voltage */
Kojto 158:b23ee177fd68 147 #define LL_SYSCFG_CAPA_VLCD1_PB12 SYSCFG_CFGR2_CAPA_1 /*!< Connect PB12 pin to LCD_VLCD1 rails supply voltage */
Kojto 158:b23ee177fd68 148 #define LL_SYSCFG_CAPA_VLCD3_PB0 SYSCFG_CFGR2_CAPA_2 /*!< Connect PB0 pin to LCD_VLCD3 rails supply voltage */
Kojto 158:b23ee177fd68 149 #if defined (SYSCFG_CFGR2_CAPA_3)
Kojto 158:b23ee177fd68 150 #define LL_SYSCFG_CAPA_VLCD1_PE11 SYSCFG_CFGR2_CAPA_3 /*!< Connect PE11 pin to LCD_VLCD1 rails supply voltage */
Kojto 158:b23ee177fd68 151 #endif /* SYSCFG_CFGR2_CAPA_3 */
Kojto 158:b23ee177fd68 152 #if defined (SYSCFG_CFGR2_CAPA_4)
Kojto 158:b23ee177fd68 153 #define LL_SYSCFG_CAPA_VLCD3_PE12 SYSCFG_CFGR2_CAPA_4 /*!< Connect PE12 pin to LCD_VLCD3 rails supply voltage */
Kojto 158:b23ee177fd68 154 #endif /* SYSCFG_CFGR2_CAPA_4 */
Kojto 158:b23ee177fd68 155 /**
Kojto 158:b23ee177fd68 156 * @}
Kojto 158:b23ee177fd68 157 */
Kojto 158:b23ee177fd68 158 #endif /* SYSCFG_CFGR2_CAPA */
Kojto 158:b23ee177fd68 159
Kojto 158:b23ee177fd68 160 /** @defgroup SYSTEM_LL_EC_I2C_FASTMODEPLUS SYSCFG I2C FASTMODEPLUS
Kojto 158:b23ee177fd68 161 * @{
Kojto 158:b23ee177fd68 162 */
Kojto 158:b23ee177fd68 163 #define LL_SYSCFG_I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR2_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */
Kojto 158:b23ee177fd68 164 #define LL_SYSCFG_I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR2_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */
Kojto 158:b23ee177fd68 165 #define LL_SYSCFG_I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR2_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */
Kojto 158:b23ee177fd68 166 #define LL_SYSCFG_I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR2_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */
Kojto 158:b23ee177fd68 167 #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR2_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */
Kojto 158:b23ee177fd68 168 #if defined(SYSCFG_CFGR2_I2C2_FMP)
Kojto 158:b23ee177fd68 169 #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR2_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */
Kojto 158:b23ee177fd68 170 #endif /* SYSCFG_CFGR2_I2C2_FMP */
Kojto 158:b23ee177fd68 171 #if defined(SYSCFG_CFGR2_I2C3_FMP)
Kojto 158:b23ee177fd68 172 #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR2_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */
Kojto 158:b23ee177fd68 173 #endif /* SYSCFG_CFGR2_I2C3_FMP */
Kojto 158:b23ee177fd68 174 /**
Kojto 158:b23ee177fd68 175 * @}
Kojto 158:b23ee177fd68 176 */
Kojto 158:b23ee177fd68 177
Kojto 158:b23ee177fd68 178 /** @defgroup SYSTEM_LL_VREFINT_CONTROL SYSCFG VREFINT Control
Kojto 158:b23ee177fd68 179 * @{
Kojto 158:b23ee177fd68 180 */
Kojto 158:b23ee177fd68 181 #define LL_SYSCFG_VREFINT_CONNECT_NONE (uint32_t)0x00000000U /*!< No pad connected to VREFINT_ADC */
Kojto 158:b23ee177fd68 182 #define LL_SYSCFG_VREFINT_CONNECT_IO1 SYSCFG_CFGR3_VREF_OUT_0 /*!< PB0 connected to VREFINT_ADC */
Kojto 158:b23ee177fd68 183 #define LL_SYSCFG_VREFINT_CONNECT_IO2 SYSCFG_CFGR3_VREF_OUT_1 /*!< PB1 connected to VREFINT_ADC */
Kojto 158:b23ee177fd68 184 #define LL_SYSCFG_VREFINT_CONNECT_IO1_IO2 (SYSCFG_CFGR3_VREF_OUT_0 | SYSCFG_CFGR3_VREF_OUT_1) /*!< PB0 and PB1 connected to VREFINT_ADC */
Kojto 158:b23ee177fd68 185 /**
Kojto 158:b23ee177fd68 186 * @}
Kojto 158:b23ee177fd68 187 */
Kojto 158:b23ee177fd68 188
Kojto 158:b23ee177fd68 189 /** @defgroup SYSTEM_LL_EC_EXTI_PORT SYSCFG EXTI Port
Kojto 158:b23ee177fd68 190 * @{
Kojto 158:b23ee177fd68 191 */
Kojto 158:b23ee177fd68 192 #define LL_SYSCFG_EXTI_PORTA (uint32_t)0U /*!< EXTI PORT A */
Kojto 158:b23ee177fd68 193 #define LL_SYSCFG_EXTI_PORTB (uint32_t)1U /*!< EXTI PORT B */
Kojto 158:b23ee177fd68 194 #define LL_SYSCFG_EXTI_PORTC (uint32_t)2U /*!< EXTI PORT C */
Kojto 158:b23ee177fd68 195 #if defined(GPIOD_BASE)
Kojto 158:b23ee177fd68 196 #define LL_SYSCFG_EXTI_PORTD (uint32_t)3U /*!< EXTI PORT D */
Kojto 158:b23ee177fd68 197 #endif /*GPIOD_BASE*/
Kojto 158:b23ee177fd68 198 #if defined(GPIOE_BASE)
Kojto 158:b23ee177fd68 199 #define LL_SYSCFG_EXTI_PORTE (uint32_t)4U /*!< EXTI PORT E */
Kojto 158:b23ee177fd68 200 #endif /*GPIOE_BASE*/
Kojto 158:b23ee177fd68 201 #if defined(GPIOH_BASE)
Kojto 158:b23ee177fd68 202 #define LL_SYSCFG_EXTI_PORTH (uint32_t)5U /*!< EXTI PORT H */
Kojto 158:b23ee177fd68 203 #endif /*GPIOH_BASE*/
Kojto 158:b23ee177fd68 204 /**
Kojto 158:b23ee177fd68 205 * @}
Kojto 158:b23ee177fd68 206 */
Kojto 158:b23ee177fd68 207
Kojto 158:b23ee177fd68 208 /** @defgroup SYSTEM_LL_EC_EXTI_LINE SYSCFG EXTI Line
Kojto 158:b23ee177fd68 209 * @{
Kojto 158:b23ee177fd68 210 */
Kojto 158:b23ee177fd68 211 #define LL_SYSCFG_EXTI_LINE0 (uint32_t)(0U << 16U | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
Kojto 158:b23ee177fd68 212 #define LL_SYSCFG_EXTI_LINE1 (uint32_t)(4U << 16U | 0U) /*!< EXTI_POSITION_4 | EXTICR[0] */
Kojto 158:b23ee177fd68 213 #define LL_SYSCFG_EXTI_LINE2 (uint32_t)(8U << 16U | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
Kojto 158:b23ee177fd68 214 #define LL_SYSCFG_EXTI_LINE3 (uint32_t)(12U << 16U | 0U) /*!< EXTI_POSITION_12 | EXTICR[0] */
Kojto 158:b23ee177fd68 215 #define LL_SYSCFG_EXTI_LINE4 (uint32_t)(0U << 16U | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
Kojto 158:b23ee177fd68 216 #define LL_SYSCFG_EXTI_LINE5 (uint32_t)(4U << 16U | 1U) /*!< EXTI_POSITION_4 | EXTICR[1] */
Kojto 158:b23ee177fd68 217 #define LL_SYSCFG_EXTI_LINE6 (uint32_t)(8U << 16U | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
Kojto 158:b23ee177fd68 218 #define LL_SYSCFG_EXTI_LINE7 (uint32_t)(12U << 16U | 1U) /*!< EXTI_POSITION_12 | EXTICR[1] */
Kojto 158:b23ee177fd68 219 #define LL_SYSCFG_EXTI_LINE8 (uint32_t)(0U << 16U | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
Kojto 158:b23ee177fd68 220 #define LL_SYSCFG_EXTI_LINE9 (uint32_t)(4U << 16U | 2U) /*!< EXTI_POSITION_4 | EXTICR[2] */
Kojto 158:b23ee177fd68 221 #define LL_SYSCFG_EXTI_LINE10 (uint32_t)(8U << 16U | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
Kojto 158:b23ee177fd68 222 #define LL_SYSCFG_EXTI_LINE11 (uint32_t)(12U << 16U | 2U) /*!< EXTI_POSITION_12 | EXTICR[2] */
Kojto 158:b23ee177fd68 223 #define LL_SYSCFG_EXTI_LINE12 (uint32_t)(0U << 16U | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
Kojto 158:b23ee177fd68 224 #define LL_SYSCFG_EXTI_LINE13 (uint32_t)(4U << 16U | 3U) /*!< EXTI_POSITION_4 | EXTICR[3] */
Kojto 158:b23ee177fd68 225 #define LL_SYSCFG_EXTI_LINE14 (uint32_t)(8U << 16U | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
Kojto 158:b23ee177fd68 226 #define LL_SYSCFG_EXTI_LINE15 (uint32_t)(12U << 16U | 3U) /*!< EXTI_POSITION_12 | EXTICR[3] */
Kojto 158:b23ee177fd68 227 /**
Kojto 158:b23ee177fd68 228 * @}
Kojto 158:b23ee177fd68 229 */
Kojto 158:b23ee177fd68 230
Kojto 158:b23ee177fd68 231
Kojto 158:b23ee177fd68 232
Kojto 158:b23ee177fd68 233 /** @defgroup SYSTEM_LL_EC_ABP1_GRP1_STOP_IP DBGMCU ABP1 GRP1 STOP IP
Kojto 158:b23ee177fd68 234 * @{
Kojto 158:b23ee177fd68 235 */
Kojto 158:b23ee177fd68 236 #define LL_DBGMCU_ABP1_GRP1_TIM2_STOP DBGMCU_APB1_FZ_DBG_TIM2_STOP /*!< TIM2 counter stopped when core is halted */
Kojto 158:b23ee177fd68 237 #if defined(TIM3)
Kojto 158:b23ee177fd68 238 #define LL_DBGMCU_ABP1_GRP1_TIM3_STOP DBGMCU_APB1_FZ_DBG_TIM3_STOP /*!< TIM3 counter stopped when core is halted */
Kojto 158:b23ee177fd68 239 #endif /*TIM3*/
Kojto 158:b23ee177fd68 240 #if defined(TIM6)
Kojto 158:b23ee177fd68 241 #define LL_DBGMCU_ABP1_GRP1_TIM6_STOP DBGMCU_APB1_FZ_DBG_TIM6_STOP /*!< TIM6 counter stopped when core is halted */
Kojto 158:b23ee177fd68 242 #endif /*TIM6*/
Kojto 158:b23ee177fd68 243 #if defined(TIM7)
Kojto 158:b23ee177fd68 244 #define LL_DBGMCU_ABP1_GRP1_TIM7_STOP DBGMCU_APB1_FZ_DBG_TIM7_STOP /*!< TIM7 counter stopped when core is halted */
Kojto 158:b23ee177fd68 245 #endif /*TIM7*/
Kojto 158:b23ee177fd68 246 #define LL_DBGMCU_ABP1_GRP1_RTC_STOP DBGMCU_APB1_FZ_DBG_RTC_STOP /*!< RTC Calendar frozen when core is halted */
Kojto 158:b23ee177fd68 247 #define LL_DBGMCU_ABP1_GRP1_WWDG_STOP DBGMCU_APB1_FZ_DBG_WWDG_STOP /*!< Debug Window Watchdog stopped when Core is halted */
Kojto 158:b23ee177fd68 248 #define LL_DBGMCU_ABP1_GRP1_IWDG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP /*!< Debug Independent Watchdog stopped when Core is halted */
Kojto 158:b23ee177fd68 249 #define LL_DBGMCU_ABP1_GRP1_I2C1_STOP DBGMCU_APB1_FZ_DBG_I2C1_STOP /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
Kojto 158:b23ee177fd68 250 #if defined(I2C2)
Kojto 158:b23ee177fd68 251 #define LL_DBGMCU_ABP1_GRP1_I2C2_STOP DBGMCU_APB1_FZ_DBG_I2C2_STOP /*!< I2C2 SMBUS timeout mode stopped when Core is halted */
Kojto 158:b23ee177fd68 252 #endif /*I2C2*/
Kojto 158:b23ee177fd68 253 #if defined(I2C3)
Kojto 158:b23ee177fd68 254 #define LL_DBGMCU_ABP1_GRP1_I2C3_STOP DBGMCU_APB1_FZ_DBG_I2C3_STOP /*!< I2C3 SMBUS timeout mode stopped when Core is halted */
Kojto 158:b23ee177fd68 255 #endif /*I2C3*/
Kojto 158:b23ee177fd68 256 #define LL_DBGMCU_ABP1_GRP1_LPTIM1_STOP DBGMCU_APB1_FZ_DBG_LPTIMER_STOP /*!< LPTIM1 counter stopped when core is halted */
Kojto 158:b23ee177fd68 257 /**
Kojto 158:b23ee177fd68 258 * @}
Kojto 158:b23ee177fd68 259 */
Kojto 158:b23ee177fd68 260
Kojto 158:b23ee177fd68 261 /** @defgroup SYSTEM_LL_EC_ABP2_GRP1_STOP_IP DBGMCU ABP2 GRP1 STOP IP
Kojto 158:b23ee177fd68 262 * @{
Kojto 158:b23ee177fd68 263 */
Kojto 158:b23ee177fd68 264 #if defined(TIM22)
Kojto 158:b23ee177fd68 265 #define LL_DBGMCU_ABP2_GRP1_TIM22_STOP DBGMCU_APB2_FZ_DBG_TIM22_STOP /*!< TIM22 counter stopped when core is halted */
Kojto 158:b23ee177fd68 266 #endif /*TIM22*/
Kojto 158:b23ee177fd68 267 #define LL_DBGMCU_ABP2_GRP1_TIM21_STOP DBGMCU_APB2_FZ_DBG_TIM21_STOP /*!< TIM21 counter stopped when core is halted */
Kojto 158:b23ee177fd68 268 /**
Kojto 158:b23ee177fd68 269 * @}
Kojto 158:b23ee177fd68 270 */
Kojto 158:b23ee177fd68 271
Kojto 158:b23ee177fd68 272 /** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY
Kojto 158:b23ee177fd68 273 * @{
Kojto 158:b23ee177fd68 274 */
Kojto 158:b23ee177fd68 275 #define LL_FLASH_LATENCY_0 ((uint32_t)0x00000000U) /*!< FLASH Zero Latency cycle */
Kojto 158:b23ee177fd68 276 #define LL_FLASH_LATENCY_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */
Kojto 158:b23ee177fd68 277 /**
Kojto 158:b23ee177fd68 278 * @}
Kojto 158:b23ee177fd68 279 */
Kojto 158:b23ee177fd68 280
Kojto 158:b23ee177fd68 281 /**
Kojto 158:b23ee177fd68 282 * @}
Kojto 158:b23ee177fd68 283 */
Kojto 158:b23ee177fd68 284
Kojto 158:b23ee177fd68 285 /* Exported macro ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 286
Kojto 158:b23ee177fd68 287 /* Exported functions --------------------------------------------------------*/
Kojto 158:b23ee177fd68 288 /** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions
Kojto 158:b23ee177fd68 289 * @{
Kojto 158:b23ee177fd68 290 */
Kojto 158:b23ee177fd68 291
Kojto 158:b23ee177fd68 292 /** @defgroup SYSTEM_LL_EF_SYSCFG SYSCFG
Kojto 158:b23ee177fd68 293 * @{
Kojto 158:b23ee177fd68 294 */
Kojto 158:b23ee177fd68 295
Kojto 158:b23ee177fd68 296 /**
Kojto 158:b23ee177fd68 297 * @brief Set memory mapping at address 0x00000000
Kojto 158:b23ee177fd68 298 * @rmtoll SYSCFG_CFGR1 MEM_MODE LL_SYSCFG_SetRemapMemory
Kojto 158:b23ee177fd68 299 * @param Memory This parameter can be one of the following values:
Kojto 158:b23ee177fd68 300 * @arg @ref LL_SYSCFG_REMAP_FLASH
Kojto 158:b23ee177fd68 301 * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
Kojto 158:b23ee177fd68 302 * @arg @ref LL_SYSCFG_REMAP_SRAM
Kojto 158:b23ee177fd68 303 * @retval None
Kojto 158:b23ee177fd68 304 */
Kojto 158:b23ee177fd68 305 __STATIC_INLINE void LL_SYSCFG_SetRemapMemory(uint32_t Memory)
Kojto 158:b23ee177fd68 306 {
Kojto 158:b23ee177fd68 307 MODIFY_REG(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE, Memory);
Kojto 158:b23ee177fd68 308 }
Kojto 158:b23ee177fd68 309
Kojto 158:b23ee177fd68 310 /**
Kojto 158:b23ee177fd68 311 * @brief Get memory mapping at address 0x00000000
Kojto 158:b23ee177fd68 312 * @rmtoll SYSCFG_CFGR1 MEM_MODE LL_SYSCFG_GetRemapMemory
Kojto 158:b23ee177fd68 313 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 314 * @arg @ref LL_SYSCFG_REMAP_FLASH
Kojto 158:b23ee177fd68 315 * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
Kojto 158:b23ee177fd68 316 * @arg @ref LL_SYSCFG_REMAP_SRAM
Kojto 158:b23ee177fd68 317 */
Kojto 158:b23ee177fd68 318 __STATIC_INLINE uint32_t LL_SYSCFG_GetRemapMemory(void)
Kojto 158:b23ee177fd68 319 {
Kojto 158:b23ee177fd68 320 return (uint32_t)(READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE));
Kojto 158:b23ee177fd68 321 }
Kojto 158:b23ee177fd68 322
Kojto 158:b23ee177fd68 323 #if defined(SYSCFG_CFGR1_UFB)
Kojto 158:b23ee177fd68 324 /**
Kojto 158:b23ee177fd68 325 * @brief Select Flash bank mode (Bank flashed at 0x08000000)
Kojto 158:b23ee177fd68 326 * @rmtoll SYSCFG_CFGR1 UFB LL_SYSCFG_SetFlashBankMode
Kojto 158:b23ee177fd68 327 * @param Bank This parameter can be one of the following values:
Kojto 158:b23ee177fd68 328 * @arg @ref LL_SYSCFG_BANKMODE_BANK1
Kojto 158:b23ee177fd68 329 * @arg @ref LL_SYSCFG_BANKMODE_BANK2
Kojto 158:b23ee177fd68 330 * @retval None
Kojto 158:b23ee177fd68 331 */
Kojto 158:b23ee177fd68 332 __STATIC_INLINE void LL_SYSCFG_SetFlashBankMode(uint32_t Bank)
Kojto 158:b23ee177fd68 333 {
Kojto 158:b23ee177fd68 334 MODIFY_REG(SYSCFG->CFGR1, SYSCFG_CFGR1_UFB, Bank);
Kojto 158:b23ee177fd68 335 }
Kojto 158:b23ee177fd68 336
Kojto 158:b23ee177fd68 337 /**
Kojto 158:b23ee177fd68 338 * @brief Get Flash bank mode (Bank flashed at 0x08000000)
Kojto 158:b23ee177fd68 339 * @rmtoll SYSCFG_CFGR1 UFB LL_SYSCFG_GetFlashBankMode
Kojto 158:b23ee177fd68 340 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 341 * @arg @ref LL_SYSCFG_BANKMODE_BANK1
Kojto 158:b23ee177fd68 342 * @arg @ref LL_SYSCFG_BANKMODE_BANK2
Kojto 158:b23ee177fd68 343 */
Kojto 158:b23ee177fd68 344 __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashBankMode(void)
Kojto 158:b23ee177fd68 345 {
Kojto 158:b23ee177fd68 346 return (uint32_t)(READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_UFB));
Kojto 158:b23ee177fd68 347 }
Kojto 158:b23ee177fd68 348 #endif /* SYSCFG_CFGR1_UFB */
Kojto 158:b23ee177fd68 349
Kojto 158:b23ee177fd68 350 /**
Kojto 158:b23ee177fd68 351 * @brief Get Boot mode selected by the boot pins status bits
Kojto 158:b23ee177fd68 352 * @note It indicates the boot mode selected by the boot pins. Bit 9
Kojto 158:b23ee177fd68 353 * corresponds to the complement of nBOOT1 bit in the FLASH_OPTR register.
Kojto 158:b23ee177fd68 354 * Its value is defined in the option bytes. Bit 8 corresponds to the
Kojto 158:b23ee177fd68 355 * value sampled on the BOOT0 pin.
Kojto 158:b23ee177fd68 356 * @rmtoll SYSCFG_CFGR1 BOOT_MODE LL_SYSCFG_GetBootMode
Kojto 158:b23ee177fd68 357 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 358 * @arg @ref LL_SYSCFG_BOOTMODE_FLASH
Kojto 158:b23ee177fd68 359 * @arg @ref LL_SYSCFG_BOOTMODE_SYSTEMFLASH
Kojto 158:b23ee177fd68 360 * @arg @ref LL_SYSCFG_BOOTMODE_SRAM
Kojto 158:b23ee177fd68 361 */
Kojto 158:b23ee177fd68 362 __STATIC_INLINE uint32_t LL_SYSCFG_GetBootMode(void)
Kojto 158:b23ee177fd68 363 {
Kojto 158:b23ee177fd68 364 return (uint32_t)(READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOT_MODE));
Kojto 158:b23ee177fd68 365 }
Kojto 158:b23ee177fd68 366
Kojto 158:b23ee177fd68 367 /**
Kojto 158:b23ee177fd68 368 * @brief Firewall protection enabled
Kojto 158:b23ee177fd68 369 * @rmtoll SYSCFG_CFGR2 FWDIS LL_SYSCFG_EnableFirewall
Kojto 158:b23ee177fd68 370 * @retval None
Kojto 158:b23ee177fd68 371 */
Kojto 158:b23ee177fd68 372 __STATIC_INLINE void LL_SYSCFG_EnableFirewall(void)
Kojto 158:b23ee177fd68 373 {
Kojto 158:b23ee177fd68 374 CLEAR_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_FWDISEN);
Kojto 158:b23ee177fd68 375 }
Kojto 158:b23ee177fd68 376
Kojto 158:b23ee177fd68 377 /**
Kojto 158:b23ee177fd68 378 * @brief Check if Firewall protection is enabled or not
Kojto 158:b23ee177fd68 379 * @rmtoll SYSCFG_CFGR2 FWDIS LL_SYSCFG_IsEnabledFirewall
Kojto 158:b23ee177fd68 380 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 381 */
Kojto 158:b23ee177fd68 382 __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledFirewall(void)
Kojto 158:b23ee177fd68 383 {
Kojto 158:b23ee177fd68 384 return !(READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_FWDISEN) == SYSCFG_CFGR2_FWDISEN);
Kojto 158:b23ee177fd68 385 }
Kojto 158:b23ee177fd68 386
Kojto 158:b23ee177fd68 387 #if defined(SYSCFG_CFGR2_CAPA)
Kojto 158:b23ee177fd68 388 /**
Kojto 158:b23ee177fd68 389 * @brief Set VLCD rail connection to optional external capacitor
Kojto 158:b23ee177fd68 390 * @note One to three external capacitors can be connected to pads to do
Kojto 158:b23ee177fd68 391 * VLCD biasing.
Kojto 158:b23ee177fd68 392 * - LCD_VLCD1 rail can be connected to PB12 or PE11(*),
Kojto 158:b23ee177fd68 393 * - LCD_VLCD2 rail can be connected to PB2,
Kojto 158:b23ee177fd68 394 * - LCD_VLCD3 rail can be connected to PB0 or PE12(*)
Kojto 158:b23ee177fd68 395 * @rmtoll SYSCFG_CFGR2 CAPA LL_SYSCFG_SetVLCDRailConnection
Kojto 158:b23ee177fd68 396 * @param IoPinConnect This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 397 * @arg @ref LL_SYSCFG_CAPA_VLCD1_PB12
Kojto 158:b23ee177fd68 398 * @arg @ref LL_SYSCFG_CAPA_VLCD1_PE11(*)
Kojto 158:b23ee177fd68 399 * @arg @ref LL_SYSCFG_CAPA_VLCD2_PB2
Kojto 158:b23ee177fd68 400 * @arg @ref LL_SYSCFG_CAPA_VLCD3_PB0
Kojto 158:b23ee177fd68 401 * @arg @ref LL_SYSCFG_CAPA_VLCD3_PE12(*)
Kojto 158:b23ee177fd68 402 *
Kojto 158:b23ee177fd68 403 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 404 * @retval None
Kojto 158:b23ee177fd68 405 */
Kojto 158:b23ee177fd68 406 __STATIC_INLINE void LL_SYSCFG_SetVLCDRailConnection(uint32_t IoPinConnect)
Kojto 158:b23ee177fd68 407 {
Kojto 158:b23ee177fd68 408 MODIFY_REG(SYSCFG->CFGR2, SYSCFG_CFGR2_CAPA, IoPinConnect);
Kojto 158:b23ee177fd68 409 }
Kojto 158:b23ee177fd68 410
Kojto 158:b23ee177fd68 411
Kojto 158:b23ee177fd68 412 /**
Kojto 158:b23ee177fd68 413 * @brief Get VLCD rail connection configuration
Kojto 158:b23ee177fd68 414 * @note One to three external capacitors can be connected to pads to do
Kojto 158:b23ee177fd68 415 * VLCD biasing.
Kojto 158:b23ee177fd68 416 * - LCD_VLCD1 rail can be connected to PB12 or PE11(*),
Kojto 158:b23ee177fd68 417 * - LCD_VLCD2 rail can be connected to PB2,
Kojto 158:b23ee177fd68 418 * - LCD_VLCD3 rail can be connected to PB0 or PE12(*)
Kojto 158:b23ee177fd68 419 * @rmtoll SYSCFG_CFGR2 CAPA LL_SYSCFG_GetVLCDRailConnection
Kojto 158:b23ee177fd68 420 * @retval Returned value can be a combination of the following values:
Kojto 158:b23ee177fd68 421 * @arg @ref LL_SYSCFG_CAPA_VLCD1_PB12
Kojto 158:b23ee177fd68 422 * @arg @ref LL_SYSCFG_CAPA_VLCD1_PE11(*)
Kojto 158:b23ee177fd68 423 * @arg @ref LL_SYSCFG_CAPA_VLCD2_PB2
Kojto 158:b23ee177fd68 424 * @arg @ref LL_SYSCFG_CAPA_VLCD3_PB0
Kojto 158:b23ee177fd68 425 * @arg @ref LL_SYSCFG_CAPA_VLCD3_PE12(*)
Kojto 158:b23ee177fd68 426 *
Kojto 158:b23ee177fd68 427 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 428 */
Kojto 158:b23ee177fd68 429 __STATIC_INLINE uint32_t LL_SYSCFG_GetVLCDRailConnection(void)
Kojto 158:b23ee177fd68 430 {
Kojto 158:b23ee177fd68 431 return (uint32_t)(READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_CAPA));
Kojto 158:b23ee177fd68 432 }
Kojto 158:b23ee177fd68 433 #endif
Kojto 158:b23ee177fd68 434
Kojto 158:b23ee177fd68 435 /**
Kojto 158:b23ee177fd68 436 * @brief Enable the I2C fast mode plus driving capability.
Kojto 158:b23ee177fd68 437 * @rmtoll SYSCFG_CFGR2 I2C_PBx_FMP LL_SYSCFG_EnableFastModePlus\n
Kojto 158:b23ee177fd68 438 * SYSCFG_CFGR2 I2Cx_FMP LL_SYSCFG_EnableFastModePlus
Kojto 158:b23ee177fd68 439 * @param ConfigFastModePlus This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 440 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
Kojto 158:b23ee177fd68 441 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
Kojto 158:b23ee177fd68 442 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8
Kojto 158:b23ee177fd68 443 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9
Kojto 158:b23ee177fd68 444 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
Kojto 158:b23ee177fd68 445 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
Kojto 158:b23ee177fd68 446 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 (*)
Kojto 158:b23ee177fd68 447 *
Kojto 158:b23ee177fd68 448 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 449 * @retval None
Kojto 158:b23ee177fd68 450 */
Kojto 158:b23ee177fd68 451 __STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus)
Kojto 158:b23ee177fd68 452 {
Kojto 158:b23ee177fd68 453 SET_BIT(SYSCFG->CFGR2, ConfigFastModePlus);
Kojto 158:b23ee177fd68 454 }
Kojto 158:b23ee177fd68 455
Kojto 158:b23ee177fd68 456 /**
Kojto 158:b23ee177fd68 457 * @brief Disable the I2C fast mode plus driving capability.
Kojto 158:b23ee177fd68 458 * @rmtoll SYSCFG_CFGR2 I2C_PBx_FMP LL_SYSCFG_DisableFastModePlus\n
Kojto 158:b23ee177fd68 459 * SYSCFG_CFGR2 I2Cx_FMP LL_SYSCFG_DisableFastModePlus
Kojto 158:b23ee177fd68 460 * @param ConfigFastModePlus This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 461 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
Kojto 158:b23ee177fd68 462 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
Kojto 158:b23ee177fd68 463 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8
Kojto 158:b23ee177fd68 464 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9
Kojto 158:b23ee177fd68 465 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
Kojto 158:b23ee177fd68 466 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
Kojto 158:b23ee177fd68 467 * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 (*)
Kojto 158:b23ee177fd68 468 *
Kojto 158:b23ee177fd68 469 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 470 * @retval None
Kojto 158:b23ee177fd68 471 */
Kojto 158:b23ee177fd68 472 __STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus)
Kojto 158:b23ee177fd68 473 {
Kojto 158:b23ee177fd68 474 CLEAR_BIT(SYSCFG->CFGR2, ConfigFastModePlus);
Kojto 158:b23ee177fd68 475 }
Kojto 158:b23ee177fd68 476
Kojto 158:b23ee177fd68 477 /**
Kojto 158:b23ee177fd68 478 * @brief Select which pad is connected to VREFINT_ADC
Kojto 158:b23ee177fd68 479 * @rmtoll SYSCFG_CFGR3 SEL_VREF_OUT LL_SYSCFG_VREFINT_SetConnection
Kojto 158:b23ee177fd68 480 * @param IoPinConnect This parameter can be one of the following values:
Kojto 158:b23ee177fd68 481 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_NONE
Kojto 158:b23ee177fd68 482 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO1
Kojto 158:b23ee177fd68 483 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO2
Kojto 158:b23ee177fd68 484 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO1_IO2
Kojto 158:b23ee177fd68 485 * @retval None
Kojto 158:b23ee177fd68 486 */
Kojto 158:b23ee177fd68 487 __STATIC_INLINE void LL_SYSCFG_VREFINT_SetConnection(uint32_t IoPinConnect)
Kojto 158:b23ee177fd68 488 {
Kojto 158:b23ee177fd68 489 MODIFY_REG(SYSCFG->CFGR3, SYSCFG_CFGR3_VREF_OUT, IoPinConnect);
Kojto 158:b23ee177fd68 490 }
Kojto 158:b23ee177fd68 491
Kojto 158:b23ee177fd68 492 /**
Kojto 158:b23ee177fd68 493 * @brief Get pad connection to VREFINT_ADC
Kojto 158:b23ee177fd68 494 * @rmtoll SYSCFG_CFGR3 SEL_VREF_OUT LL_SYSCFG_VREFINT_GetConnection
Kojto 158:b23ee177fd68 495 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 496 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_NONE
Kojto 158:b23ee177fd68 497 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO1
Kojto 158:b23ee177fd68 498 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO2
Kojto 158:b23ee177fd68 499 * @arg @ref LL_SYSCFG_VREFINT_CONNECT_IO1_IO2
Kojto 158:b23ee177fd68 500 */
Kojto 158:b23ee177fd68 501 __STATIC_INLINE uint32_t LL_SYSCFG_VREFINT_GetConnection(void)
Kojto 158:b23ee177fd68 502 {
Kojto 158:b23ee177fd68 503 return (uint32_t)(READ_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_VREF_OUT));
Kojto 158:b23ee177fd68 504 }
Kojto 158:b23ee177fd68 505
Kojto 158:b23ee177fd68 506 /**
Kojto 158:b23ee177fd68 507 * @brief Buffer used to generate VREFINT reference for ADC enable
Kojto 158:b23ee177fd68 508 * @note The VrefInit buffer to ADC through internal path is also
Kojto 158:b23ee177fd68 509 * enabled using function LL_ADC_SetCommonPathInternalCh()
Kojto 158:b23ee177fd68 510 * with parameter LL_ADC_PATH_INTERNAL_VREFINT
Kojto 158:b23ee177fd68 511 * @rmtoll SYSCFG_CFGR3 ENBUF_VREFINT_ADC LL_SYSCFG_VREFINT_EnableADC
Kojto 158:b23ee177fd68 512 * @retval None
Kojto 158:b23ee177fd68 513 */
Kojto 158:b23ee177fd68 514 __STATIC_INLINE void LL_SYSCFG_VREFINT_EnableADC(void)
Kojto 158:b23ee177fd68 515 {
Kojto 158:b23ee177fd68 516 SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUF_VREFINT_ADC);
Kojto 158:b23ee177fd68 517 }
Kojto 158:b23ee177fd68 518
Kojto 158:b23ee177fd68 519 /**
Kojto 158:b23ee177fd68 520 * @brief Buffer used to generate VREFINT reference for ADC disable
Kojto 158:b23ee177fd68 521 * @rmtoll SYSCFG_CFGR3 ENBUF_VREFINT_ADC LL_SYSCFG_VREFINT_DisableADC
Kojto 158:b23ee177fd68 522 * @retval None
Kojto 158:b23ee177fd68 523 */
Kojto 158:b23ee177fd68 524 __STATIC_INLINE void LL_SYSCFG_VREFINT_DisableADC(void)
Kojto 158:b23ee177fd68 525 {
Kojto 158:b23ee177fd68 526 CLEAR_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUF_VREFINT_ADC);
Kojto 158:b23ee177fd68 527 }
Kojto 158:b23ee177fd68 528
Kojto 158:b23ee177fd68 529 /**
Kojto 158:b23ee177fd68 530 * @brief Buffer used to generate temperature sensor reference for ADC enable
Kojto 158:b23ee177fd68 531 * @rmtoll SYSCFG_CFGR3 ENBUF_SENSOR_ADC LL_SYSCFG_TEMPSENSOR_Enable
Kojto 158:b23ee177fd68 532 * @retval None
Kojto 158:b23ee177fd68 533 */
Kojto 158:b23ee177fd68 534 __STATIC_INLINE void LL_SYSCFG_TEMPSENSOR_Enable(void)
Kojto 158:b23ee177fd68 535 {
Kojto 158:b23ee177fd68 536 SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUF_SENSOR_ADC);
Kojto 158:b23ee177fd68 537 }
Kojto 158:b23ee177fd68 538
Kojto 158:b23ee177fd68 539 /**
Kojto 158:b23ee177fd68 540 * @brief Buffer used to generate temperature sensor reference for ADC disable
Kojto 158:b23ee177fd68 541 * @rmtoll SYSCFG_CFGR3 ENBUF_SENSOR_ADC LL_SYSCFG_TEMPSENSOR_Disable
Kojto 158:b23ee177fd68 542 * @retval None
Kojto 158:b23ee177fd68 543 */
Kojto 158:b23ee177fd68 544 __STATIC_INLINE void LL_SYSCFG_TEMPSENSOR_Disable(void)
Kojto 158:b23ee177fd68 545 {
Kojto 158:b23ee177fd68 546 CLEAR_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUF_SENSOR_ADC);
Kojto 158:b23ee177fd68 547 }
Kojto 158:b23ee177fd68 548
Kojto 158:b23ee177fd68 549 /**
Kojto 158:b23ee177fd68 550 * @brief Buffer used to generate VREFINT reference for comparator enable
Kojto 158:b23ee177fd68 551 * @rmtoll SYSCFG_CFGR3 ENBUF_VREFINT_COMP LL_SYSCFG_VREFINT_EnableCOMP
Kojto 158:b23ee177fd68 552 * @retval None
Kojto 158:b23ee177fd68 553 */
Kojto 158:b23ee177fd68 554 __STATIC_INLINE void LL_SYSCFG_VREFINT_EnableCOMP(void)
Kojto 158:b23ee177fd68 555 {
Kojto 158:b23ee177fd68 556 SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUFLP_VREFINT_COMP);
Kojto 158:b23ee177fd68 557 }
Kojto 158:b23ee177fd68 558
Kojto 158:b23ee177fd68 559 /**
Kojto 158:b23ee177fd68 560 * @brief Buffer used to generate VREFINT reference for comparator disable
Kojto 158:b23ee177fd68 561 * @rmtoll SYSCFG_CFGR3 ENBUF_VREFINT_COMP LL_SYSCFG_VREFINT_DisableCOMP
Kojto 158:b23ee177fd68 562 * @retval None
Kojto 158:b23ee177fd68 563 */
Kojto 158:b23ee177fd68 564 __STATIC_INLINE void LL_SYSCFG_VREFINT_DisableCOMP(void)
Kojto 158:b23ee177fd68 565 {
Kojto 158:b23ee177fd68 566 CLEAR_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENBUFLP_VREFINT_COMP);
Kojto 158:b23ee177fd68 567 }
Kojto 158:b23ee177fd68 568
Kojto 158:b23ee177fd68 569 #if defined (RCC_HSI48_SUPPORT)
Kojto 158:b23ee177fd68 570 /**
Kojto 158:b23ee177fd68 571 * @brief Buffer used to generate VREFINT reference for HSI48 oscillator enable
Kojto 158:b23ee177fd68 572 * @rmtoll SYSCFG_CFGR3 ENREF_HSI48 LL_SYSCFG_VREFINT_EnableHSI48
Kojto 158:b23ee177fd68 573 * @retval None
Kojto 158:b23ee177fd68 574 */
Kojto 158:b23ee177fd68 575 __STATIC_INLINE void LL_SYSCFG_VREFINT_EnableHSI48(void)
Kojto 158:b23ee177fd68 576 {
Kojto 158:b23ee177fd68 577 SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENREF_HSI48);
Kojto 158:b23ee177fd68 578 }
Kojto 158:b23ee177fd68 579
Kojto 158:b23ee177fd68 580 /**
Kojto 158:b23ee177fd68 581 * @brief Buffer used to generate VREFINT reference for HSI48 oscillator disable
Kojto 158:b23ee177fd68 582 * @rmtoll SYSCFG_CFGR3 ENREF_HSI48 LL_SYSCFG_VREFINT_DisableHSI48
Kojto 158:b23ee177fd68 583 * @retval None
Kojto 158:b23ee177fd68 584 */
Kojto 158:b23ee177fd68 585 __STATIC_INLINE void LL_SYSCFG_VREFINT_DisableHSI48(void)
Kojto 158:b23ee177fd68 586 {
Kojto 158:b23ee177fd68 587 CLEAR_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_ENREF_HSI48);
Kojto 158:b23ee177fd68 588 }
Kojto 158:b23ee177fd68 589 #endif
Kojto 158:b23ee177fd68 590
Kojto 158:b23ee177fd68 591 /**
Kojto 158:b23ee177fd68 592 * @brief Check if VREFINT is ready or not
Kojto 158:b23ee177fd68 593 * @note When set, it indicates that VREFINT is available for BOR, PVD and LCD
Kojto 158:b23ee177fd68 594 * @rmtoll SYSCFG_CFGR3 VREFINT_RDYF LL_SYSCFG_VREFINT_IsReady
Kojto 158:b23ee177fd68 595 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 596 */
Kojto 158:b23ee177fd68 597 __STATIC_INLINE uint32_t LL_SYSCFG_VREFINT_IsReady(void)
Kojto 158:b23ee177fd68 598 {
Kojto 158:b23ee177fd68 599 return (READ_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_VREFINT_RDYF) == SYSCFG_CFGR3_VREFINT_RDYF);
Kojto 158:b23ee177fd68 600 }
Kojto 158:b23ee177fd68 601
Kojto 158:b23ee177fd68 602 /**
Kojto 158:b23ee177fd68 603 * @brief Lock the whole content of SYSCFG_CFGR3 register
Kojto 158:b23ee177fd68 604 * @note After SYSCFG_CFGR3 register lock, only read access available.
Kojto 158:b23ee177fd68 605 * Only system hardware reset unlocks SYSCFG_CFGR3 register.
Kojto 158:b23ee177fd68 606 * @rmtoll SYSCFG_CFGR3 REF_LOCK LL_SYSCFG_VREFINT_Lock
Kojto 158:b23ee177fd68 607 * @retval None
Kojto 158:b23ee177fd68 608 */
Kojto 158:b23ee177fd68 609 __STATIC_INLINE void LL_SYSCFG_VREFINT_Lock(void)
Kojto 158:b23ee177fd68 610 {
Kojto 158:b23ee177fd68 611 SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_REF_LOCK);
Kojto 158:b23ee177fd68 612 }
Kojto 158:b23ee177fd68 613
Kojto 158:b23ee177fd68 614 /**
Kojto 158:b23ee177fd68 615 * @brief Check if SYSCFG_CFGR3 register is locked (only read access) or not
Kojto 158:b23ee177fd68 616 * @note When set, it indicates that SYSCFG_CFGR3 register is locked, only read access available
Kojto 158:b23ee177fd68 617 * @rmtoll SYSCFG_CFGR3 REF_LOCK LL_SYSCFG_VREFINT_IsLocked
Kojto 158:b23ee177fd68 618 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 619 */
Kojto 158:b23ee177fd68 620 __STATIC_INLINE uint32_t LL_SYSCFG_VREFINT_IsLocked(void)
Kojto 158:b23ee177fd68 621 {
Kojto 158:b23ee177fd68 622 return (READ_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_REF_LOCK) == SYSCFG_CFGR3_REF_LOCK);
Kojto 158:b23ee177fd68 623 }
Kojto 158:b23ee177fd68 624
Kojto 158:b23ee177fd68 625 /**
Kojto 158:b23ee177fd68 626 * @brief Configure source input for the EXTI external interrupt.
Kojto 158:b23ee177fd68 627 * @rmtoll SYSCFG_EXTICR1 EXTI0 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 628 * SYSCFG_EXTICR1 EXTI1 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 629 * SYSCFG_EXTICR1 EXTI2 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 630 * SYSCFG_EXTICR1 EXTI3 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 631 * SYSCFG_EXTICR2 EXTI4 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 632 * SYSCFG_EXTICR2 EXTI5 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 633 * SYSCFG_EXTICR2 EXTI6 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 634 * SYSCFG_EXTICR2 EXTI7 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 635 * SYSCFG_EXTICR3 EXTI8 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 636 * SYSCFG_EXTICR3 EXTI9 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 637 * SYSCFG_EXTICR3 EXTI10 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 638 * SYSCFG_EXTICR3 EXTI11 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 639 * SYSCFG_EXTICR4 EXTI12 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 640 * SYSCFG_EXTICR4 EXTI13 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 641 * SYSCFG_EXTICR4 EXTI14 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 642 * SYSCFG_EXTICR4 EXTI15 LL_SYSCFG_SetEXTISource
Kojto 158:b23ee177fd68 643 * @param Port This parameter can be one of the following values:
Kojto 158:b23ee177fd68 644 * @arg @ref LL_SYSCFG_EXTI_PORTA
Kojto 158:b23ee177fd68 645 * @arg @ref LL_SYSCFG_EXTI_PORTB
Kojto 158:b23ee177fd68 646 * @arg @ref LL_SYSCFG_EXTI_PORTC
Kojto 158:b23ee177fd68 647 * @arg @ref LL_SYSCFG_EXTI_PORTD (*)
Kojto 158:b23ee177fd68 648 * @arg @ref LL_SYSCFG_EXTI_PORTE (*)
Kojto 158:b23ee177fd68 649 * @arg @ref LL_SYSCFG_EXTI_PORTH (*)
Kojto 158:b23ee177fd68 650 *
Kojto 158:b23ee177fd68 651 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 652 * @param Line This parameter can be one of the following values:
Kojto 158:b23ee177fd68 653 * @arg @ref LL_SYSCFG_EXTI_LINE0
Kojto 158:b23ee177fd68 654 * @arg @ref LL_SYSCFG_EXTI_LINE1
Kojto 158:b23ee177fd68 655 * @arg @ref LL_SYSCFG_EXTI_LINE2
Kojto 158:b23ee177fd68 656 * @arg @ref LL_SYSCFG_EXTI_LINE3
Kojto 158:b23ee177fd68 657 * @arg @ref LL_SYSCFG_EXTI_LINE4
Kojto 158:b23ee177fd68 658 * @arg @ref LL_SYSCFG_EXTI_LINE5
Kojto 158:b23ee177fd68 659 * @arg @ref LL_SYSCFG_EXTI_LINE6
Kojto 158:b23ee177fd68 660 * @arg @ref LL_SYSCFG_EXTI_LINE7
Kojto 158:b23ee177fd68 661 * @arg @ref LL_SYSCFG_EXTI_LINE8
Kojto 158:b23ee177fd68 662 * @arg @ref LL_SYSCFG_EXTI_LINE9
Kojto 158:b23ee177fd68 663 * @arg @ref LL_SYSCFG_EXTI_LINE10
Kojto 158:b23ee177fd68 664 * @arg @ref LL_SYSCFG_EXTI_LINE11
Kojto 158:b23ee177fd68 665 * @arg @ref LL_SYSCFG_EXTI_LINE12
Kojto 158:b23ee177fd68 666 * @arg @ref LL_SYSCFG_EXTI_LINE13
Kojto 158:b23ee177fd68 667 * @arg @ref LL_SYSCFG_EXTI_LINE14
Kojto 158:b23ee177fd68 668 * @arg @ref LL_SYSCFG_EXTI_LINE15
Kojto 158:b23ee177fd68 669 * @retval None
Kojto 158:b23ee177fd68 670 */
Kojto 158:b23ee177fd68 671 __STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line)
Kojto 158:b23ee177fd68 672 {
Kojto 158:b23ee177fd68 673 MODIFY_REG(SYSCFG->EXTICR[Line & 0xFFU], SYSCFG_EXTICR1_EXTI0 << (Line >> 16U), Port << (Line >> 16U));
Kojto 158:b23ee177fd68 674 }
Kojto 158:b23ee177fd68 675
Kojto 158:b23ee177fd68 676 /**
Kojto 158:b23ee177fd68 677 * @brief Get the configured defined for specific EXTI Line
Kojto 158:b23ee177fd68 678 * @rmtoll SYSCFG_EXTICR1 EXTI0 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 679 * SYSCFG_EXTICR1 EXTI1 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 680 * SYSCFG_EXTICR1 EXTI2 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 681 * SYSCFG_EXTICR1 EXTI3 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 682 * SYSCFG_EXTICR2 EXTI4 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 683 * SYSCFG_EXTICR2 EXTI5 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 684 * SYSCFG_EXTICR2 EXTI6 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 685 * SYSCFG_EXTICR2 EXTI7 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 686 * SYSCFG_EXTICR3 EXTI8 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 687 * SYSCFG_EXTICR3 EXTI9 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 688 * SYSCFG_EXTICR3 EXTI10 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 689 * SYSCFG_EXTICR3 EXTI11 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 690 * SYSCFG_EXTICR4 EXTI12 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 691 * SYSCFG_EXTICR4 EXTI13 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 692 * SYSCFG_EXTICR4 EXTI14 LL_SYSCFG_SetEXTISource\n
Kojto 158:b23ee177fd68 693 * SYSCFG_EXTICR4 EXTI15 LL_SYSCFG_SetEXTISource
Kojto 158:b23ee177fd68 694 * @param Line This parameter can be one of the following values:
Kojto 158:b23ee177fd68 695 * @arg @ref LL_SYSCFG_EXTI_LINE0
Kojto 158:b23ee177fd68 696 * @arg @ref LL_SYSCFG_EXTI_LINE1
Kojto 158:b23ee177fd68 697 * @arg @ref LL_SYSCFG_EXTI_LINE2
Kojto 158:b23ee177fd68 698 * @arg @ref LL_SYSCFG_EXTI_LINE3
Kojto 158:b23ee177fd68 699 * @arg @ref LL_SYSCFG_EXTI_LINE4
Kojto 158:b23ee177fd68 700 * @arg @ref LL_SYSCFG_EXTI_LINE5
Kojto 158:b23ee177fd68 701 * @arg @ref LL_SYSCFG_EXTI_LINE6
Kojto 158:b23ee177fd68 702 * @arg @ref LL_SYSCFG_EXTI_LINE7
Kojto 158:b23ee177fd68 703 * @arg @ref LL_SYSCFG_EXTI_LINE8
Kojto 158:b23ee177fd68 704 * @arg @ref LL_SYSCFG_EXTI_LINE9
Kojto 158:b23ee177fd68 705 * @arg @ref LL_SYSCFG_EXTI_LINE10
Kojto 158:b23ee177fd68 706 * @arg @ref LL_SYSCFG_EXTI_LINE11
Kojto 158:b23ee177fd68 707 * @arg @ref LL_SYSCFG_EXTI_LINE12
Kojto 158:b23ee177fd68 708 * @arg @ref LL_SYSCFG_EXTI_LINE13
Kojto 158:b23ee177fd68 709 * @arg @ref LL_SYSCFG_EXTI_LINE14
Kojto 158:b23ee177fd68 710 * @arg @ref LL_SYSCFG_EXTI_LINE15
Kojto 158:b23ee177fd68 711 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 712 * @arg @ref LL_SYSCFG_EXTI_PORTA
Kojto 158:b23ee177fd68 713 * @arg @ref LL_SYSCFG_EXTI_PORTB
Kojto 158:b23ee177fd68 714 * @arg @ref LL_SYSCFG_EXTI_PORTC
Kojto 158:b23ee177fd68 715 * @arg @ref LL_SYSCFG_EXTI_PORTD (*)
Kojto 158:b23ee177fd68 716 * @arg @ref LL_SYSCFG_EXTI_PORTE (*)
Kojto 158:b23ee177fd68 717 * @arg @ref LL_SYSCFG_EXTI_PORTH (*)
Kojto 158:b23ee177fd68 718 *
Kojto 158:b23ee177fd68 719 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 720 */
Kojto 158:b23ee177fd68 721 __STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line)
Kojto 158:b23ee177fd68 722 {
Kojto 158:b23ee177fd68 723 return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0xFFU], (SYSCFG_EXTICR1_EXTI0 << (Line >> 16U))) >> (Line >> 16U));
Kojto 158:b23ee177fd68 724 }
Kojto 158:b23ee177fd68 725
Kojto 158:b23ee177fd68 726
Kojto 158:b23ee177fd68 727 /**
Kojto 158:b23ee177fd68 728 * @}
Kojto 158:b23ee177fd68 729 */
Kojto 158:b23ee177fd68 730
Kojto 158:b23ee177fd68 731
Kojto 158:b23ee177fd68 732 /** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU
Kojto 158:b23ee177fd68 733 * @{
Kojto 158:b23ee177fd68 734 */
Kojto 158:b23ee177fd68 735
Kojto 158:b23ee177fd68 736 /**
Kojto 158:b23ee177fd68 737 * @brief Return the device identifier
Kojto 158:b23ee177fd68 738 * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID
Kojto 158:b23ee177fd68 739 * @retval Values between Min_Data=0x00 and Max_Data=0x7FF (ex: L053 -> 0x417, L073 -> 0x447)
Kojto 158:b23ee177fd68 740 */
Kojto 158:b23ee177fd68 741 __STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)
Kojto 158:b23ee177fd68 742 {
Kojto 158:b23ee177fd68 743 return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));
Kojto 158:b23ee177fd68 744 }
Kojto 158:b23ee177fd68 745
Kojto 158:b23ee177fd68 746 /**
Kojto 158:b23ee177fd68 747 * @brief Return the device revision identifier
Kojto 158:b23ee177fd68 748 * @note This field indicates the revision of the device.
Kojto 158:b23ee177fd68 749 * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID
Kojto 158:b23ee177fd68 750 * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
Kojto 158:b23ee177fd68 751 */
Kojto 158:b23ee177fd68 752 __STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)
Kojto 158:b23ee177fd68 753 {
Kojto 158:b23ee177fd68 754 return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_REVID_POSITION);
Kojto 158:b23ee177fd68 755 }
Kojto 158:b23ee177fd68 756
Kojto 158:b23ee177fd68 757 /**
Kojto 158:b23ee177fd68 758 * @brief Enable the Debug Module during SLEEP mode
Kojto 158:b23ee177fd68 759 * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_EnableDBGSleepMode
Kojto 158:b23ee177fd68 760 * @retval None
Kojto 158:b23ee177fd68 761 */
Kojto 158:b23ee177fd68 762 __STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void)
Kojto 158:b23ee177fd68 763 {
Kojto 158:b23ee177fd68 764 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
Kojto 158:b23ee177fd68 765 }
Kojto 158:b23ee177fd68 766
Kojto 158:b23ee177fd68 767 /**
Kojto 158:b23ee177fd68 768 * @brief Disable the Debug Module during SLEEP mode
Kojto 158:b23ee177fd68 769 * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_DisableDBGSleepMode
Kojto 158:b23ee177fd68 770 * @retval None
Kojto 158:b23ee177fd68 771 */
Kojto 158:b23ee177fd68 772 __STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void)
Kojto 158:b23ee177fd68 773 {
Kojto 158:b23ee177fd68 774 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
Kojto 158:b23ee177fd68 775 }
Kojto 158:b23ee177fd68 776
Kojto 158:b23ee177fd68 777 /**
Kojto 158:b23ee177fd68 778 * @brief Enable the Debug Module during STOP mode
Kojto 158:b23ee177fd68 779 * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_EnableDBGStopMode
Kojto 158:b23ee177fd68 780 * @retval None
Kojto 158:b23ee177fd68 781 */
Kojto 158:b23ee177fd68 782 __STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void)
Kojto 158:b23ee177fd68 783 {
Kojto 158:b23ee177fd68 784 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
Kojto 158:b23ee177fd68 785 }
Kojto 158:b23ee177fd68 786
Kojto 158:b23ee177fd68 787 /**
Kojto 158:b23ee177fd68 788 * @brief Disable the Debug Module during STOP mode
Kojto 158:b23ee177fd68 789 * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_DisableDBGStopMode
Kojto 158:b23ee177fd68 790 * @retval None
Kojto 158:b23ee177fd68 791 */
Kojto 158:b23ee177fd68 792 __STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void)
Kojto 158:b23ee177fd68 793 {
Kojto 158:b23ee177fd68 794 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
Kojto 158:b23ee177fd68 795 }
Kojto 158:b23ee177fd68 796
Kojto 158:b23ee177fd68 797 /**
Kojto 158:b23ee177fd68 798 * @brief Enable the Debug Module during STANDBY mode
Kojto 158:b23ee177fd68 799 * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_EnableDBGStandbyMode
Kojto 158:b23ee177fd68 800 * @retval None
Kojto 158:b23ee177fd68 801 */
Kojto 158:b23ee177fd68 802 __STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void)
Kojto 158:b23ee177fd68 803 {
Kojto 158:b23ee177fd68 804 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
Kojto 158:b23ee177fd68 805 }
Kojto 158:b23ee177fd68 806
Kojto 158:b23ee177fd68 807 /**
Kojto 158:b23ee177fd68 808 * @brief Disable the Debug Module during STANDBY mode
Kojto 158:b23ee177fd68 809 * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_DisableDBGStandbyMode
Kojto 158:b23ee177fd68 810 * @retval None
Kojto 158:b23ee177fd68 811 */
Kojto 158:b23ee177fd68 812 __STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void)
Kojto 158:b23ee177fd68 813 {
Kojto 158:b23ee177fd68 814 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
Kojto 158:b23ee177fd68 815 }
Kojto 158:b23ee177fd68 816
Kojto 158:b23ee177fd68 817 /**
Kojto 158:b23ee177fd68 818 * @brief Freeze APB1 peripherals (group1 peripherals)
Kojto 158:b23ee177fd68 819 * @rmtoll APB1FZ DBG_TIM2_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 820 * APB1FZ DBG_TIM3_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 821 * APB1FZ DBG_TIM6_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 822 * APB1FZ DBG_TIM7_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 823 * APB1FZ DBG_RTC_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 824 * APB1FZ DBG_WWDG_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 825 * APB1FZ DBG_IWDG_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 826 * APB1FZ DBG_I2C1_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 827 * APB1FZ DBG_I2C2_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 828 * APB1FZ DBG_I2C3_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 829 * APB1FZ DBG_LPTIMER_STOP LL_DBGMCU_ABP1_GRP1_FreezePeriph
Kojto 158:b23ee177fd68 830 * @param Periphs This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 831 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM2_STOP
Kojto 158:b23ee177fd68 832 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM3_STOP (*)
Kojto 158:b23ee177fd68 833 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM6_STOP (*)
Kojto 158:b23ee177fd68 834 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM7_STOP (*)
Kojto 158:b23ee177fd68 835 * @arg @ref LL_DBGMCU_ABP1_GRP1_RTC_STOP
Kojto 158:b23ee177fd68 836 * @arg @ref LL_DBGMCU_ABP1_GRP1_WWDG_STOP
Kojto 158:b23ee177fd68 837 * @arg @ref LL_DBGMCU_ABP1_GRP1_IWDG_STOP
Kojto 158:b23ee177fd68 838 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C1_STOP
Kojto 158:b23ee177fd68 839 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C2_STOP (*)
Kojto 158:b23ee177fd68 840 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C3_STOP (*)
Kojto 158:b23ee177fd68 841 * @arg @ref LL_DBGMCU_ABP1_GRP1_LPTIM1_STOP
Kojto 158:b23ee177fd68 842 *
Kojto 158:b23ee177fd68 843 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 844 * @retval None
Kojto 158:b23ee177fd68 845 */
Kojto 158:b23ee177fd68 846 __STATIC_INLINE void LL_DBGMCU_ABP1_GRP1_FreezePeriph(uint32_t Periphs)
Kojto 158:b23ee177fd68 847 {
Kojto 158:b23ee177fd68 848 SET_BIT(DBGMCU->APB1FZ, Periphs);
Kojto 158:b23ee177fd68 849 }
Kojto 158:b23ee177fd68 850
Kojto 158:b23ee177fd68 851 /**
Kojto 158:b23ee177fd68 852 * @brief Unfreeze APB1 peripherals (group1 peripherals)
Kojto 158:b23ee177fd68 853 * @rmtoll APB1FZ DBG_TIM2_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 854 * APB1FZ DBG_TIM3_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 855 * APB1FZ DBG_TIM6_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 856 * APB1FZ DBG_TIM7_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 857 * APB1FZ DBG_RTC_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 858 * APB1FZ DBG_WWDG_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 859 * APB1FZ DBG_IWDG_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 860 * APB1FZ DBG_I2C1_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 861 * APB1FZ DBG_I2C2_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 862 * APB1FZ DBG_I2C3_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 863 * APB1FZ DBG_LPTIMER_STOP LL_DBGMCU_ABP1_GRP1_UnFreezePeriph
Kojto 158:b23ee177fd68 864 * @param Periphs This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 865 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM2_STOP
Kojto 158:b23ee177fd68 866 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM3_STOP (*)
Kojto 158:b23ee177fd68 867 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM6_STOP (*)
Kojto 158:b23ee177fd68 868 * @arg @ref LL_DBGMCU_ABP1_GRP1_TIM7_STOP (*)
Kojto 158:b23ee177fd68 869 * @arg @ref LL_DBGMCU_ABP1_GRP1_RTC_STOP
Kojto 158:b23ee177fd68 870 * @arg @ref LL_DBGMCU_ABP1_GRP1_WWDG_STOP
Kojto 158:b23ee177fd68 871 * @arg @ref LL_DBGMCU_ABP1_GRP1_IWDG_STOP
Kojto 158:b23ee177fd68 872 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C1_STOP
Kojto 158:b23ee177fd68 873 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C2_STOP (*)
Kojto 158:b23ee177fd68 874 * @arg @ref LL_DBGMCU_ABP1_GRP1_I2C3_STOP (*)
Kojto 158:b23ee177fd68 875 * @arg @ref LL_DBGMCU_ABP1_GRP1_LPTIM1_STOP
Kojto 158:b23ee177fd68 876 *
Kojto 158:b23ee177fd68 877 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 878 * @retval None
Kojto 158:b23ee177fd68 879 */
Kojto 158:b23ee177fd68 880 __STATIC_INLINE void LL_DBGMCU_ABP1_GRP1_UnFreezePeriph(uint32_t Periphs)
Kojto 158:b23ee177fd68 881 {
Kojto 158:b23ee177fd68 882 CLEAR_BIT(DBGMCU->APB1FZ, Periphs);
Kojto 158:b23ee177fd68 883 }
Kojto 158:b23ee177fd68 884
Kojto 158:b23ee177fd68 885 /**
Kojto 158:b23ee177fd68 886 * @brief Freeze APB2 peripherals
Kojto 158:b23ee177fd68 887 * @rmtoll APB2FZ DBG_TIM22_STOP LL_DBGMCU_ABP2_GRP1_FreezePeriph\n
Kojto 158:b23ee177fd68 888 * APB2FZ DBG_TIM21_STOP LL_DBGMCU_ABP2_GRP1_FreezePeriph
Kojto 158:b23ee177fd68 889 * @param Periphs This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 890 * @arg @ref LL_DBGMCU_ABP2_GRP1_TIM22_STOP (*)
Kojto 158:b23ee177fd68 891 * @arg @ref LL_DBGMCU_ABP2_GRP1_TIM21_STOP
Kojto 158:b23ee177fd68 892 *
Kojto 158:b23ee177fd68 893 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 894 * @retval None
Kojto 158:b23ee177fd68 895 */
Kojto 158:b23ee177fd68 896 __STATIC_INLINE void LL_DBGMCU_ABP2_GRP1_FreezePeriph(uint32_t Periphs)
Kojto 158:b23ee177fd68 897 {
Kojto 158:b23ee177fd68 898 SET_BIT(DBGMCU->APB2FZ, Periphs);
Kojto 158:b23ee177fd68 899 }
Kojto 158:b23ee177fd68 900
Kojto 158:b23ee177fd68 901 /**
Kojto 158:b23ee177fd68 902 * @brief Unfreeze APB2 peripherals
Kojto 158:b23ee177fd68 903 * @rmtoll APB2FZ DBG_TIM22_STOP LL_DBGMCU_ABP2_GRP1_UnFreezePeriph\n
Kojto 158:b23ee177fd68 904 * APB2FZ DBG_TIM21_STOP LL_DBGMCU_ABP2_GRP1_UnFreezePeriph
Kojto 158:b23ee177fd68 905 * @param Periphs This parameter can be a combination of the following values:
Kojto 158:b23ee177fd68 906 * @arg @ref LL_DBGMCU_ABP2_GRP1_TIM22_STOP (*)
Kojto 158:b23ee177fd68 907 * @arg @ref LL_DBGMCU_ABP2_GRP1_TIM21_STOP
Kojto 158:b23ee177fd68 908 *
Kojto 158:b23ee177fd68 909 * (*) value not defined in all devices
Kojto 158:b23ee177fd68 910 * @retval None
Kojto 158:b23ee177fd68 911 */
Kojto 158:b23ee177fd68 912 __STATIC_INLINE void LL_DBGMCU_ABP2_GRP1_UnFreezePeriph(uint32_t Periphs)
Kojto 158:b23ee177fd68 913 {
Kojto 158:b23ee177fd68 914 CLEAR_BIT(DBGMCU->APB2FZ, Periphs);
Kojto 158:b23ee177fd68 915 }
Kojto 158:b23ee177fd68 916
Kojto 158:b23ee177fd68 917 /**
Kojto 158:b23ee177fd68 918 * @}
Kojto 158:b23ee177fd68 919 */
Kojto 158:b23ee177fd68 920
Kojto 158:b23ee177fd68 921 /** @defgroup SYSTEM_LL_EF_FLASH FLASH
Kojto 158:b23ee177fd68 922 * @{
Kojto 158:b23ee177fd68 923 */
Kojto 158:b23ee177fd68 924
Kojto 158:b23ee177fd68 925 /**
Kojto 158:b23ee177fd68 926 * @brief Set FLASH Latency
Kojto 158:b23ee177fd68 927 * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency
Kojto 158:b23ee177fd68 928 * @param Latency This parameter can be one of the following values:
Kojto 158:b23ee177fd68 929 * @arg @ref LL_FLASH_LATENCY_0
Kojto 158:b23ee177fd68 930 * @arg @ref LL_FLASH_LATENCY_1
Kojto 158:b23ee177fd68 931 * @retval None
Kojto 158:b23ee177fd68 932 */
Kojto 158:b23ee177fd68 933 __STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)
Kojto 158:b23ee177fd68 934 {
Kojto 158:b23ee177fd68 935 MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);
Kojto 158:b23ee177fd68 936 }
Kojto 158:b23ee177fd68 937
Kojto 158:b23ee177fd68 938 /**
Kojto 158:b23ee177fd68 939 * @brief Get FLASH Latency
Kojto 158:b23ee177fd68 940 * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency
Kojto 158:b23ee177fd68 941 * @retval Returned value can be one of the following values:
Kojto 158:b23ee177fd68 942 * @arg @ref LL_FLASH_LATENCY_0
Kojto 158:b23ee177fd68 943 * @arg @ref LL_FLASH_LATENCY_1
Kojto 158:b23ee177fd68 944 */
Kojto 158:b23ee177fd68 945 __STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)
Kojto 158:b23ee177fd68 946 {
Kojto 158:b23ee177fd68 947 return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));
Kojto 158:b23ee177fd68 948 }
Kojto 158:b23ee177fd68 949
Kojto 158:b23ee177fd68 950 /**
Kojto 158:b23ee177fd68 951 * @brief Enable Prefetch
Kojto 158:b23ee177fd68 952 * @rmtoll FLASH_ACR PRFTEN LL_FLASH_EnablePrefetch
Kojto 158:b23ee177fd68 953 * @retval None
Kojto 158:b23ee177fd68 954 */
Kojto 158:b23ee177fd68 955 __STATIC_INLINE void LL_FLASH_EnablePrefetch(void)
Kojto 158:b23ee177fd68 956 {
Kojto 158:b23ee177fd68 957 SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
Kojto 158:b23ee177fd68 958 }
Kojto 158:b23ee177fd68 959
Kojto 158:b23ee177fd68 960 /**
Kojto 158:b23ee177fd68 961 * @brief Disable Prefetch
Kojto 158:b23ee177fd68 962 * @rmtoll FLASH_ACR PRFTEN LL_FLASH_DisablePrefetch
Kojto 158:b23ee177fd68 963 * @retval None
Kojto 158:b23ee177fd68 964 */
Kojto 158:b23ee177fd68 965 __STATIC_INLINE void LL_FLASH_DisablePrefetch(void)
Kojto 158:b23ee177fd68 966 {
Kojto 158:b23ee177fd68 967 CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
Kojto 158:b23ee177fd68 968 }
Kojto 158:b23ee177fd68 969
Kojto 158:b23ee177fd68 970 /**
Kojto 158:b23ee177fd68 971 * @brief Check if Prefetch buffer is enabled
Kojto 158:b23ee177fd68 972 * @rmtoll FLASH_ACR PRFTEN LL_FLASH_IsPrefetchEnabled
Kojto 158:b23ee177fd68 973 * @retval State of bit (1 or 0).
Kojto 158:b23ee177fd68 974 */
Kojto 158:b23ee177fd68 975 __STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void)
Kojto 158:b23ee177fd68 976 {
Kojto 158:b23ee177fd68 977 return (READ_BIT(FLASH->ACR, FLASH_ACR_PRFTEN) == (FLASH_ACR_PRFTEN));
Kojto 158:b23ee177fd68 978 }
Kojto 158:b23ee177fd68 979
Kojto 158:b23ee177fd68 980
Kojto 158:b23ee177fd68 981 /**
Kojto 158:b23ee177fd68 982 * @brief Enable Flash Power-down mode during run mode or Low-power run mode
Kojto 158:b23ee177fd68 983 * @note Flash memory can be put in power-down mode only when the code is executed
Kojto 158:b23ee177fd68 984 * from RAM
Kojto 158:b23ee177fd68 985 * @note Flash must not be accessed when power down is enabled
Kojto 158:b23ee177fd68 986 * @note Flash must not be put in power-down while a program or an erase operation
Kojto 158:b23ee177fd68 987 * is on-going
Kojto 158:b23ee177fd68 988 * @rmtoll FLASH_ACR RUN_PD LL_FLASH_EnableRunPowerDown\n
Kojto 158:b23ee177fd68 989 * FLASH_PDKEYR PDKEY1 LL_FLASH_EnableRunPowerDown\n
Kojto 158:b23ee177fd68 990 * FLASH_PDKEYR PDKEY2 LL_FLASH_EnableRunPowerDown
Kojto 158:b23ee177fd68 991 * @retval None
Kojto 158:b23ee177fd68 992 */
Kojto 158:b23ee177fd68 993 __STATIC_INLINE void LL_FLASH_EnableRunPowerDown(void)
Kojto 158:b23ee177fd68 994 {
Kojto 158:b23ee177fd68 995 /* Following values must be written consecutively to unlock the RUN_PD bit in
Kojto 158:b23ee177fd68 996 FLASH_ACR */
Kojto 158:b23ee177fd68 997 WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY1);
Kojto 158:b23ee177fd68 998 WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY2);
Kojto 158:b23ee177fd68 999 SET_BIT(FLASH->ACR, FLASH_ACR_RUN_PD);
Kojto 158:b23ee177fd68 1000 }
Kojto 158:b23ee177fd68 1001
Kojto 158:b23ee177fd68 1002 /**
Kojto 158:b23ee177fd68 1003 * @brief Disable Flash Power-down mode during run mode or Low-power run mode
Kojto 158:b23ee177fd68 1004 * @rmtoll FLASH_ACR RUN_PD LL_FLASH_DisableRunPowerDown\n
Kojto 158:b23ee177fd68 1005 * FLASH_PDKEYR PDKEY1 LL_FLASH_DisableRunPowerDown\n
Kojto 158:b23ee177fd68 1006 * FLASH_PDKEYR PDKEY2 LL_FLASH_DisableRunPowerDown
Kojto 158:b23ee177fd68 1007 * @retval None
Kojto 158:b23ee177fd68 1008 */
Kojto 158:b23ee177fd68 1009 __STATIC_INLINE void LL_FLASH_DisableRunPowerDown(void)
Kojto 158:b23ee177fd68 1010 {
Kojto 158:b23ee177fd68 1011 /* Following values must be written consecutively to unlock the RUN_PD bit in
Kojto 158:b23ee177fd68 1012 FLASH_ACR */
Kojto 158:b23ee177fd68 1013 WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY1);
Kojto 158:b23ee177fd68 1014 WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY2);
Kojto 158:b23ee177fd68 1015 CLEAR_BIT(FLASH->ACR, FLASH_ACR_RUN_PD);
Kojto 158:b23ee177fd68 1016 }
Kojto 158:b23ee177fd68 1017
Kojto 158:b23ee177fd68 1018 /**
Kojto 158:b23ee177fd68 1019 * @brief Enable Flash Power-down mode during Sleep or Low-power sleep mode
Kojto 158:b23ee177fd68 1020 * @note Flash must not be put in power-down while a program or an erase operation
Kojto 158:b23ee177fd68 1021 * is on-going
Kojto 158:b23ee177fd68 1022 * @rmtoll FLASH_ACR SLEEP_PD LL_FLASH_EnableSleepPowerDown
Kojto 158:b23ee177fd68 1023 * @retval None
Kojto 158:b23ee177fd68 1024 */
Kojto 158:b23ee177fd68 1025 __STATIC_INLINE void LL_FLASH_EnableSleepPowerDown(void)
Kojto 158:b23ee177fd68 1026 {
Kojto 158:b23ee177fd68 1027 SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD);
Kojto 158:b23ee177fd68 1028 }
Kojto 158:b23ee177fd68 1029
Kojto 158:b23ee177fd68 1030 /**
Kojto 158:b23ee177fd68 1031 * @brief Disable Flash Power-down mode during Sleep or Low-power sleep mode
Kojto 158:b23ee177fd68 1032 * @rmtoll FLASH_ACR SLEEP_PD LL_FLASH_DisableSleepPowerDown
Kojto 158:b23ee177fd68 1033 * @retval None
Kojto 158:b23ee177fd68 1034 */
Kojto 158:b23ee177fd68 1035 __STATIC_INLINE void LL_FLASH_DisableSleepPowerDown(void)
Kojto 158:b23ee177fd68 1036 {
Kojto 158:b23ee177fd68 1037 CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD);
Kojto 158:b23ee177fd68 1038 }
Kojto 158:b23ee177fd68 1039
Kojto 158:b23ee177fd68 1040 /**
Kojto 158:b23ee177fd68 1041 * @brief Enable buffers used as a cache during read access
Kojto 158:b23ee177fd68 1042 * @rmtoll FLASH_ACR DISAB_BUF LL_FLASH_EnableBuffers
Kojto 158:b23ee177fd68 1043 * @retval None
Kojto 158:b23ee177fd68 1044 */
Kojto 158:b23ee177fd68 1045 __STATIC_INLINE void LL_FLASH_EnableBuffers(void)
Kojto 158:b23ee177fd68 1046 {
Kojto 158:b23ee177fd68 1047 CLEAR_BIT(FLASH->ACR, FLASH_ACR_DISAB_BUF);
Kojto 158:b23ee177fd68 1048 }
Kojto 158:b23ee177fd68 1049
Kojto 158:b23ee177fd68 1050 /**
Kojto 158:b23ee177fd68 1051 * @brief Disable buffers used as a cache during read access
Kojto 158:b23ee177fd68 1052 * @note When disabled, every read will access the NVM even for
Kojto 158:b23ee177fd68 1053 * an address already read (for example, the previous address).
Kojto 158:b23ee177fd68 1054 * @rmtoll FLASH_ACR DISAB_BUF LL_FLASH_DisableBuffers
Kojto 158:b23ee177fd68 1055 * @retval None
Kojto 158:b23ee177fd68 1056 */
Kojto 158:b23ee177fd68 1057 __STATIC_INLINE void LL_FLASH_DisableBuffers(void)
Kojto 158:b23ee177fd68 1058 {
Kojto 158:b23ee177fd68 1059 SET_BIT(FLASH->ACR, FLASH_ACR_DISAB_BUF);
Kojto 158:b23ee177fd68 1060 }
Kojto 158:b23ee177fd68 1061
Kojto 158:b23ee177fd68 1062 /**
Kojto 158:b23ee177fd68 1063 * @brief Enable pre-read
Kojto 158:b23ee177fd68 1064 * @note When enabled, the memory interface stores the last address
Kojto 158:b23ee177fd68 1065 * read as data and tries to read the next one when no other
Kojto 158:b23ee177fd68 1066 * read or write or prefetch operation is ongoing.
Kojto 158:b23ee177fd68 1067 * It is automatically disabled every time the buffers are disabled.
Kojto 158:b23ee177fd68 1068 * @rmtoll FLASH_ACR PRE_READ LL_FLASH_EnablePreRead
Kojto 158:b23ee177fd68 1069 * @retval None
Kojto 158:b23ee177fd68 1070 */
Kojto 158:b23ee177fd68 1071 __STATIC_INLINE void LL_FLASH_EnablePreRead(void)
Kojto 158:b23ee177fd68 1072 {
Kojto 158:b23ee177fd68 1073 SET_BIT(FLASH->ACR, FLASH_ACR_PRE_READ);
Kojto 158:b23ee177fd68 1074 }
Kojto 158:b23ee177fd68 1075
Kojto 158:b23ee177fd68 1076 /**
Kojto 158:b23ee177fd68 1077 * @brief Disable pre-read
Kojto 158:b23ee177fd68 1078 * @rmtoll FLASH_ACR PRE_READ LL_FLASH_DisablePreRead
Kojto 158:b23ee177fd68 1079 * @retval None
Kojto 158:b23ee177fd68 1080 */
Kojto 158:b23ee177fd68 1081 __STATIC_INLINE void LL_FLASH_DisablePreRead(void)
Kojto 158:b23ee177fd68 1082 {
Kojto 158:b23ee177fd68 1083 CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRE_READ);
Kojto 158:b23ee177fd68 1084 }
Kojto 158:b23ee177fd68 1085
Kojto 158:b23ee177fd68 1086 /**
Kojto 158:b23ee177fd68 1087 * @}
Kojto 158:b23ee177fd68 1088 */
Kojto 158:b23ee177fd68 1089
Kojto 158:b23ee177fd68 1090 /**
Kojto 158:b23ee177fd68 1091 * @}
Kojto 158:b23ee177fd68 1092 */
Kojto 158:b23ee177fd68 1093
Kojto 158:b23ee177fd68 1094 /**
Kojto 158:b23ee177fd68 1095 * @}
Kojto 158:b23ee177fd68 1096 */
Kojto 158:b23ee177fd68 1097
Kojto 158:b23ee177fd68 1098 #endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) */
Kojto 158:b23ee177fd68 1099
Kojto 158:b23ee177fd68 1100 /**
Kojto 158:b23ee177fd68 1101 * @}
Kojto 158:b23ee177fd68 1102 */
Kojto 158:b23ee177fd68 1103
Kojto 158:b23ee177fd68 1104 #ifdef __cplusplus
Kojto 158:b23ee177fd68 1105 }
Kojto 158:b23ee177fd68 1106 #endif
Kojto 158:b23ee177fd68 1107
Kojto 158:b23ee177fd68 1108 #endif /* __STM32L0xx_LL_SYSTEM_H */
Kojto 158:b23ee177fd68 1109
Kojto 158:b23ee177fd68 1110 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/