47 #ifdef HAL_MODULE_ENABLED 54 #define STM32L4XX_HAL_VERSION_MAIN (0x01U) 55 #define STM32L4XX_HAL_VERSION_SUB1 (0x0AU) 56 #define STM32L4XX_HAL_VERSION_SUB2 (0x00U) 57 #define STM32L4XX_HAL_VERSION_RC (0x00U) 58 #define STM32L4XX_HAL_VERSION ((STM32L4XX_HAL_VERSION_MAIN << 24U)\ 59 |(STM32L4XX_HAL_VERSION_SUB1 << 16U)\ 60 |(STM32L4XX_HAL_VERSION_SUB2 << 8U)\ 61 |(STM32L4XX_HAL_VERSION_RC)) 64 #define VREFBUF_TIMEOUT_VALUE 10U 68 #define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE) 71 #define MEMRMP_OFFSET SYSCFG_OFFSET 72 #define FB_MODE_BitNumber 8U 73 #define FB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32U) + (FB_MODE_BitNumber * 4U)) 77 #define SCSR_OFFSET (SYSCFG_OFFSET + 0x18U) 78 #define BRER_BitNumber 0U 79 #define SCSR_SRAM2ER_BB (PERIPH_BB_BASE + (SCSR_OFFSET * 32U) + (BRER_BitNumber * 4U)) 154 HAL_StatusTypeDef status =
HAL_OK;
161 #if (INSTRUCTION_CACHE_ENABLE == 0) 162 __HAL_FLASH_INSTRUCTION_CACHE_DISABLE();
165 #if (DATA_CACHE_ENABLE == 0) 166 __HAL_FLASH_DATA_CACHE_DISABLE();
169 #if (PREFETCH_ENABLE != 0) 170 __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
199 __HAL_RCC_APB1_FORCE_RESET();
200 __HAL_RCC_APB1_RELEASE_RESET();
202 __HAL_RCC_APB2_FORCE_RESET();
203 __HAL_RCC_APB2_RELEASE_RESET();
205 __HAL_RCC_AHB1_FORCE_RESET();
206 __HAL_RCC_AHB1_RELEASE_RESET();
208 __HAL_RCC_AHB2_FORCE_RESET();
209 __HAL_RCC_AHB2_RELEASE_RESET();
211 __HAL_RCC_AHB3_FORCE_RESET();
212 __HAL_RCC_AHB3_RELEASE_RESET();
261 HAL_StatusTypeDef status =
HAL_OK;
269 if (TickPriority < (1UL << __NVIC_PRIO_BITS))
358 HAL_StatusTypeDef status =
HAL_OK;
397 uint32_t wait = Delay;
400 if (wait < HAL_MAX_DELAY)
423 SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;
439 SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
448 return STM32L4XX_HAL_VERSION;
457 return((DBGMCU->IDCODE & DBGMCU_IDCODE_REV_ID) >> 16);
466 return(DBGMCU->IDCODE & DBGMCU_IDCODE_DEV_ID);
475 return(READ_REG(*((uint32_t *)UID_BASE)));
484 return(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
493 return(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
522 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
531 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
540 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
549 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
558 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
567 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
604 *(__IO uint32_t *) SCSR_SRAM2ER_BB = 0x00000001UL;
619 *(__IO uint32_t *)FB_MODE_BB = 0x00000001UL;
635 *(__IO uint32_t *)FB_MODE_BB = 0x00000000UL;
652 assert_param(IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(VoltageScaling));
654 MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_VRS, VoltageScaling);
670 MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_HIZ, Mode);
680 assert_param(IS_SYSCFG_VREFBUF_TRIMMING(TrimmingValue));
682 MODIFY_REG(VREFBUF->CCR, VREFBUF_CCR_TRIM, TrimmingValue);
693 SET_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
699 while(READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRR) == 0U)
701 if((
HAL_GetTick() - tickstart) > VREFBUF_TIMEOUT_VALUE)
717 CLEAR_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
728 SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
738 CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
uint32_t HAL_GetTickPrio(void)
This function returns a tick priority.
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling)
Configure the internal voltage reference buffer voltage scale.
void HAL_DBGMCU_DisableDBGSleepMode(void)
Disable the Debug Module during SLEEP mode.
void HAL_DBGMCU_DisableDBGStopMode(void)
Disable the Debug Module during STOP0/STOP1/STOP2 modes.
void HAL_SYSCFG_DisableMemorySwappingBank(void)
Disable the Internal FLASH Bank Swapping.
void HAL_DBGMCU_EnableDBGStopMode(void)
Enable the Debug Module during STOP0/STOP1/STOP2 modes.
void HAL_SuspendTick(void)
Suspend Tick increment.
void HAL_SYSCFG_EnableIOAnalogSwitchBooster(void)
Enable the I/O analog switch voltage booster.
void HAL_MspDeInit(void)
DeInitialize the MSP.
This file contains all the functions prototypes for the HAL module driver.
HAL_StatusTypeDef HAL_DeInit(void)
De-initialize common part of the HAL and stop the source of time base.
void HAL_DBGMCU_DisableDBGStandbyMode(void)
Disable the Debug Module during STANDBY mode.
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode)
Configure the internal voltage reference buffer high impedance mode.
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
Initialize the System Timer with interrupt enabled and start the System Tick Timer (SysTick): Counter...
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
void HAL_DBGMCU_EnableDBGStandbyMode(void)
Enable the Debug Module during STANDBY mode.
HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq)
Set new tick Freq.
void HAL_DBGMCU_EnableDBGSleepMode(void)
Enable the Debug Module during SLEEP mode.
uint32_t HAL_GetHalVersion(void)
Return the HAL revision.
void HAL_IncTick(void)
This function is called to increment a global variable "uwTick" used as application time base...
uint32_t HAL_GetUIDw2(void)
Return the third word of the unique device identifier (UID based on 96 bits)
uint32_t HAL_GetREVID(void)
Return the device revision identifier.
uint32_t HAL_GetDEVID(void)
Return the device identifier.
void HAL_MspInit(void)
Initialize the MSP.
void HAL_SYSCFG_DisableVREFBUF(void)
Disable the Internal Voltage Reference buffer (VREFBUF).
HAL_StatusTypeDef HAL_Init(void)
Configure the Flash prefetch, the Instruction and Data caches, the time base source, NVIC and any required global low level hardware by calling the HAL_MspInit() callback function to be optionally defined in user file stm32l4xx_hal_msp.c.
uint32_t HAL_GetUIDw0(void)
Return the first word of the unique device identifier (UID based on 96 bits)
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
This function configures the source of the time base: The time source is configured to have 1ms time ...
void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue)
Tune the Internal Voltage Reference buffer (VREFBUF).
uint32_t HAL_GetUIDw1(void)
Return the second word of the unique device identifier (UID based on 96 bits)
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
Set the priority of an interrupt.
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void)
Enable the Internal Voltage Reference buffer (VREFBUF).
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
void HAL_SYSCFG_DisableIOAnalogSwitchBooster(void)
Disable the I/O analog switch voltage booster.
void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
Set the priority grouping field (pre-emption priority and subpriority) using the required unlock sequ...
void HAL_SYSCFG_SRAM2Erase(void)
Start a hardware SRAM2 erase operation.
void HAL_ResumeTick(void)
Resume Tick increment.
uint32_t HAL_GetTickFreq(void)
Return tick frequency.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
void HAL_SYSCFG_EnableMemorySwappingBank(void)
Enable the Internal FLASH Bank Swapping.