52#define __STM32H7xx_HAL_VERSION_MAIN (0x01UL)
53#define __STM32H7xx_HAL_VERSION_SUB1 (0x0BUL)
54#define __STM32H7xx_HAL_VERSION_SUB2 (0x06UL)
55#define __STM32H7xx_HAL_VERSION_RC (0x00UL)
56#define __STM32H7xx_HAL_VERSION ((__STM32H7xx_HAL_VERSION_MAIN << 24)\
57 |(__STM32H7xx_HAL_VERSION_SUB1 << 16)\
58 |(__STM32H7xx_HAL_VERSION_SUB2 << 8 )\
59 |(__STM32H7xx_HAL_VERSION_RC))
61#define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF)
62#define VREFBUF_TIMEOUT_VALUE (uint32_t)10
137uint32_t common_system_clock;
139#if defined(DUAL_CORE) && defined(CORE_CM4)
141 __HAL_RCC_ART_CLK_ENABLE();
142 __HAL_ART_CONFIG_BASE_ADDRESS(0x08100000UL);
150#if defined(RCC_D1CFGR_D1CPRE)
157#if defined(RCC_D1CFGR_HPRE)
163#if defined(DUAL_CORE) && defined(CORE_CM4)
408 uint32_t wait = Delay;
468 return((
DBGMCU->IDCODE) >> 16);
592#if defined(SYSCFG_PMCR_EPIS_SEL)
601void HAL_SYSCFG_ETHInterfaceSelect(uint32_t SYSCFG_ETHInterface)
637 MODIFY_REG(
SYSCFG->PMCR, (uint32_t) SYSCFG_AnalogSwitch, (uint32_t)(SYSCFG_SwitchState));
640#if defined(SYSCFG_PMCR_BOOSTEN)
649void HAL_SYSCFG_EnableBOOST(
void)
661void HAL_SYSCFG_DisableBOOST(
void)
667#if defined (SYSCFG_UR2_BOOT_ADD0) || defined (SYSCFG_UR2_BCM7_ADD0)
677void HAL_SYSCFG_CM7BootAddConfig(uint32_t BootRegister, uint32_t BootAddress)
685#if defined(DUAL_CORE)
686 MODIFY_REG(
SYSCFG->UR2, SYSCFG_UR2_BCM7_ADD0, ((BootAddress >> 16) << SYSCFG_UR2_BCM7_ADD0_Pos));
694#if defined(DUAL_CORE)
703#if defined(DUAL_CORE)
713void HAL_SYSCFG_CM4BootAddConfig(uint32_t BootRegister, uint32_t BootAddress)
722 MODIFY_REG(
SYSCFG->UR3, SYSCFG_UR3_BCM4_ADD0, ((BootAddress >> 16)<< SYSCFG_UR3_BCM4_ADD0_Pos));
736void HAL_SYSCFG_EnableCM7BOOT(
void)
746void HAL_SYSCFG_DisableCM7BOOT(
void)
755void HAL_SYSCFG_EnableCM4BOOT(
void)
765void HAL_SYSCFG_DisableCM4BOOT(
void)
802#if defined(SYSCFG_CCCSR_HSLV)
805 SET_BIT(
SYSCFG->CCCSR, (SYSCFG_CCCSR_HSLV0| SYSCFG_CCCSR_HSLV1 | SYSCFG_CCCSR_HSLV2 | SYSCFG_CCCSR_HSLV3));
818#if defined(SYSCFG_CCCSR_HSLV)
821 CLEAR_BIT(
SYSCFG->CCCSR, (SYSCFG_CCCSR_HSLV0| SYSCFG_CCCSR_HSLV1 | SYSCFG_CCCSR_HSLV2 | SYSCFG_CCCSR_HSLV3));
858#if defined(SYSCFG_CCCR_NCC_MMC)
869void HAL_SYSCFG_VDDMMC_CompensationCodeConfig(uint32_t SYSCFG_PMOSCode, uint32_t SYSCFG_NMOSCode )
874 MODIFY_REG(
SYSCFG->CCCR, (SYSCFG_CCCR_NCC_MMC | SYSCFG_CCCR_PCC_MMC), (((uint32_t)(SYSCFG_PMOSCode)<< 4)|(uint32_t)(SYSCFG_NMOSCode)) );
878#if defined(SYSCFG_ADC2ALT_ADC2_ROUT0)
884void HAL_SYSCFG_ADC2ALT_Rout0Config(uint32_t Adc2AltRout0)
893#if defined(SYSCFG_ADC2ALT_ADC2_ROUT1)
899void HAL_SYSCFG_ADC2ALT_Rout1Config(uint32_t Adc2AltRout1)
963#if defined(DUAL_CORE)
968void HAL_EnableDomain2DBGSleepMode(
void)
977void HAL_DisableDomain2DBGSleepMode(
void)
986void HAL_EnableDomain2DBGStopMode(
void)
995void HAL_DisableDomain2DBGStopMode(
void)
1004void HAL_EnableDomain2DBGStandbyMode(
void)
1013void HAL_DisableDomain2DBGStandbyMode(
void)
1019#if defined(DBGMCU_CR_DBG_STOPD3)
1024void HAL_EnableDomain3DBGStopMode(
void)
1033void HAL_DisableDomain3DBGStopMode(
void)
1039#if defined(DBGMCU_CR_DBG_STANDBYD3)
1044void HAL_EnableDomain3DBGStandbyMode(
void)
1053void HAL_DisableDomain3DBGStandbyMode(
void)
1101 CLEAR_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI->FTSR1)) + ((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1102 CLEAR_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI->RTSR1)) + ((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1106 SET_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI->RTSR1)) + ((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1110 SET_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI->FTSR1)) + ((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1125 SET_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI->SWIER1)) + ((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1139 WRITE_REG(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D1->PR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1143#if defined(DUAL_CORE)
1150void HAL_EXTI_D2_ClearFlag(uint32_t EXTI_Line)
1154 WRITE_REG(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D2->PR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1178 if( EXTI_LineCmd == 0UL)
1181 CLEAR_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D1->IMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)),(uint32_t)(1UL << (EXTI_Line & 0x1FUL)) );
1185 SET_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D1->IMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1191 if( EXTI_LineCmd == 0UL)
1194 CLEAR_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI_D1->EMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1198 SET_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI_D1->EMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1203#if defined(DUAL_CORE)
1216void HAL_EXTI_D2_EventInputConfig(uint32_t EXTI_Line , uint32_t EXTI_Mode, uint32_t EXTI_LineCmd )
1224 if( EXTI_LineCmd == 0UL)
1227 CLEAR_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D2->IMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)),(uint32_t)(1UL << (EXTI_Line & 0x1FUL)) );
1231 SET_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI_D2->IMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1237 if( EXTI_LineCmd == 0UL)
1240 CLEAR_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI_D2->EMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1244 SET_BIT( *(
__IO uint32_t *) (((uint32_t) &(
EXTI_D2->EMR1)) + ((EXTI_Line >> 5 ) * 0x10UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1266 __IO uint32_t *pRegv;
1272 if( EXTI_LineCmd == 0UL)
1275 CLEAR_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI->D3PMR1)) + ((EXTI_Line >> 5 ) * 0x20UL)),(uint32_t)(1UL << (EXTI_Line & 0x1FUL)) );
1279 SET_BIT(*(
__IO uint32_t *) (((uint32_t) &(
EXTI->D3PMR1)) +((EXTI_Line >> 5 ) * 0x20UL)), (uint32_t)(1UL << (EXTI_Line & 0x1FUL)));
1282 if(((EXTI_Line>>4)%2UL) == 0UL)
1284 pRegv = (
__IO uint32_t *) (((uint32_t) &(
EXTI->D3PCR1L)) + ((EXTI_Line >> 5 ) * 0x20UL));
1288 pRegv = (
__IO uint32_t *) (((uint32_t) &(
EXTI->D3PCR1H)) + ((EXTI_Line >> 5 ) * 0x20UL));
1290 MODIFY_REG(*pRegv, (uint32_t)(3UL << ((EXTI_Line*2UL) & 0x1FUL)), (uint32_t)(EXTI_ClearSrc << ((EXTI_Line*2UL) & 0x1FUL)));
#define __IO
Defines 'read / write' permissions.
#define SysTick_CTRL_TICKINT_Msk
SysTick CTRL: TICKINT Mask.
#define SysTick
SysTick configuration struct.
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
#define NVIC_PRIORITYGROUP_4
4 bits for pre-emption priority 0 bits for subpriority
#define __NVIC_PRIO_BITS
CM7 uses 4 Bits for the Priority Levels.
#define CLEAR_BIT(REG, BIT)
#define SET_BIT(REG, BIT)
#define WRITE_REG(REG, VAL)
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
#define READ_BIT(REG, BIT)
#define IS_FMC_SWAPBMAP_MODE(__MODE__)
HAL_TickFreqTypeDef uwTickFreq
HAL_StatusTypeDef HAL_DeInit(void)
This function de-Initializes common part of the HAL and stops the systick.
void HAL_MspDeInit(void)
DeInitializes the MSP.
HAL_StatusTypeDef HAL_Init(void)
This function is used to initialize the HAL Library; it must be the first instruction to be executed ...
void HAL_EXTI_D3_EventInputConfig(uint32_t EXTI_Line, uint32_t EXTI_LineCmd, uint32_t EXTI_ClearSrc)
Configure the EXTI input event line for Domain D3.
void HAL_SYSCFG_CompensationCodeSelect(uint32_t SYSCFG_CompCode)
Code selection for the I/O Compensation cell.
void HAL_EnableCompensationCell(void)
Enables the I/O Compensation Cell.
void HAL_SYSCFG_DisableVREFBUF(void)
Disable the Internal Voltage Reference buffer (VREFBUF).
void HAL_DBGMCU_EnableDBGStandbyMode(void)
Enable the Debug Module during Domain1/CDomain STANDBY mode.
void HAL_SetFMCMemorySwappingConfig(uint32_t BankMapConfig)
Set the FMC Memory Mapping Swapping config.
void HAL_DBGMCU_DisableDBGStopMode(void)
Disable the Debug Module during Domain1/CDomain STOP mode.
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void)
Enable the Internal Voltage Reference buffer (VREFBUF).
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq)
Set new tick Freq.
uint32_t HAL_GetUIDw1(void)
Return the second word of the unique device identifier (UID based on 96 bits).
uint32_t HAL_GetUIDw2(void)
Return the third word of the unique device identifier (UID based on 96 bits).
void HAL_DisableCompensationCell(void)
Power-down the I/O Compensation Cell.
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling)
Configure the internal voltage reference buffer voltage scale.
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode)
Configure the internal voltage reference buffer high impedance mode.
void HAL_SYSCFG_DisableIOSpeedOptimize(void)
To Disable optimize the I/O speed when the product voltage is low.
void HAL_DBGMCU_DisableDBGStandbyMode(void)
Disable the Debug Module during Domain1/CDomain STANDBY mode.
HAL_TickFreqTypeDef HAL_GetTickFreq(void)
Return tick frequency.
__weak void HAL_SuspendTick(void)
Suspend Tick increment.
void HAL_EXTI_D1_ClearFlag(uint32_t EXTI_Line)
Clears the EXTI's line pending flags for Domain D1.
void HAL_EXTI_GenerateSWInterrupt(uint32_t EXTI_Line)
Generates a Software interrupt on selected EXTI line.
__weak void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
__weak void HAL_IncTick(void)
This function is called to increment a global variable "uwTick" used as application time base.
void HAL_EXTI_EdgeConfig(uint32_t EXTI_Line, uint32_t EXTI_Edge)
Configure the EXTI input event line edge.
uint32_t HAL_GetFMCMemorySwappingConfig(void)
Get FMC Bank mapping mode.
__weak void HAL_ResumeTick(void)
Resume Tick increment.
void HAL_DBGMCU_DisableDBGSleepMode(void)
Disable the Debug Module during Domain1/CDomain SLEEP mode.
__weak uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
uint32_t HAL_GetTickPrio(void)
This function returns a tick priority.
void HAL_SYSCFG_CompensationCodeConfig(uint32_t SYSCFG_PMOSCode, uint32_t SYSCFG_NMOSCode)
Code selection for the I/O Compensation cell.
void HAL_DBGMCU_EnableDBGStopMode(void)
Enable the Debug Module during Domain1/CDomain STOP mode.
void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue)
Tune the Internal Voltage Reference buffer (VREFBUF).
uint32_t HAL_GetREVID(void)
Returns the device revision identifier.
void HAL_DBGMCU_EnableDBGSleepMode(void)
Enable the Debug Module during Domain1/CDomain SLEEP mode.
void HAL_SYSCFG_AnalogSwitchConfig(uint32_t SYSCFG_AnalogSwitch, uint32_t SYSCFG_SwitchState)
Analog Switch control for dual analog pads.
void HAL_SYSCFG_EnableIOSpeedOptimize(void)
To Enable optimize the I/O speed when the product voltage is low.
uint32_t HAL_GetUIDw0(void)
Return the first word of the unique device identifier (UID based on 96 bits).
uint32_t HAL_GetHalVersion(void)
Returns the HAL revision.
void HAL_EXTI_D1_EventInputConfig(uint32_t EXTI_Line, uint32_t EXTI_Mode, uint32_t EXTI_LineCmd)
Configure the EXTI input event line for Domain D1.
uint32_t HAL_GetDEVID(void)
Returns the device identifier.
#define IS_TICKFREQ(FREQ)
#define VREFBUF_TIMEOUT_VALUE
#define __STM32H7xx_HAL_VERSION
#define IDCODE_DEVID_MASK
#define SYSCFG_ADC2ALT_ADC2_ROUT0
VBAT/4 connected to ADC2 V_INP[16].
#define SYSCFG_CCCSR_HSLV
High-speed at low-voltage.
#define VREFBUF_CSR_HIZ
High impedance mode.
#define SYSCFG_PMCR_BOOSTEN
I/O analog switch voltage booster enable.
#define VREFBUF_CSR_ENVR
Voltage reference buffer enable.
#define SYSCFG_CCCSR_EN
I/O compensation cell enable.
#define VREFBUF_CCR_TRIM
TRIM[5:0] bits (Trimming code).
#define RCC_D1CFGR_D1CPRE
D1CPRE[2:0] bits (Domain 1 Core prescaler).
#define DBGMCU_CR_DBG_STOPD1
#define DBGMCU_CR_DBG_SLEEPD1
#define SYSCFG_CCCSR_CS
I/O compensation cell code selection.
#define DBGMCU_CR_DBG_STANDBYD3
#define SYSCFG_UR2_BOOT_ADD0
Core Boot Address 0.
#define SYSCFG_UR2_BOOT_ADD0_Pos
#define SYSCFG_PMCR_EPIS_SEL
Ethernet PHY Interface Selection.
#define SYSCFG_CCCR_NCC
NMOS compensation code.
#define RCC_D1CFGR_HPRE
HPRE[3:0] bits (AHB3 prescaler).
#define SYSCFG_CCCR_PCC
PMOS compensation code.
#define SYSCFG_ADC2ALT_ADC2_ROUT1
Internal reference voltage (V_REFINT) connected to ADC2 V_INP[17].
#define SYSCFG_UR3_BOOT_ADD1
Core Boot Address 1.
#define FMC_BCR1_BMAP
BMAP[1:0] FMC bank mapping.
#define DBGMCU_CR_DBG_STOPD3
#define VREFBUF_CSR_VRS
Voltage reference scale.
#define DBGMCU_CR_DBG_STANDBYD1
#define RCC_D1CFGR_D1CPRE_Pos
#define VREFBUF_CSR_VRR
Voltage reference buffer ready.
#define RCC_D1CFGR_HPRE_Pos
< D1HPRE configuration
@ SysTick_IRQn
15 Cortex-M System Tick Interrupt
#define UID_BASE
Unique device ID register base address.
uint32_t HAL_RCC_GetSysClockFreq(void)
#define __HAL_RCC_APB1H_FORCE_RESET()
#define __HAL_RCC_AHB3_RELEASE_RESET()
#define __HAL_RCC_AHB3_FORCE_RESET()
Enable or disable the AHB3 peripheral reset.
#define __HAL_RCC_AHB1_RELEASE_RESET()
#define __HAL_RCC_APB3_FORCE_RESET()
Force or release the APB3 peripheral reset.
#define __HAL_RCC_APB1L_RELEASE_RESET()
#define __HAL_RCC_APB2_FORCE_RESET()
Force or release the APB2 peripheral reset.
#define __HAL_RCC_AHB1_FORCE_RESET()
Force or release the AHB1 peripheral reset.
#define __HAL_RCC_AHB4_FORCE_RESET()
Force or release the AHB4 peripheral reset.
#define __HAL_RCC_APB1L_FORCE_RESET()
Force or release the APB1 peripheral reset.
#define __HAL_RCC_APB4_FORCE_RESET()
Force or release the APB4 peripheral reset.
#define __HAL_RCC_APB1H_RELEASE_RESET()
#define __HAL_RCC_APB3_RELEASE_RESET()
#define __HAL_RCC_APB4_RELEASE_RESET()
#define __HAL_RCC_APB2_RELEASE_RESET()
#define __HAL_RCC_AHB2_RELEASE_RESET()
#define __HAL_RCC_AHB2_FORCE_RESET()
Force or release the AHB2 peripheral reset.
#define __HAL_RCC_AHB4_RELEASE_RESET()
uint32_t SystemD2Clock
System Domain2 Clock Frequency.
uint32_t SystemCoreClock
System Domain1 Clock Frequency.
const uint8_t D1CorePrescTable[16]
D1CorePrescTable prescalers table values.
#define IS_SYSCFG_BOOT_REGISTER(REGISTER)
#define IS_SYSCFG_BOOT_ADDRESS(ADDRESS)
#define SYSCFG_BOOT_ADDR0
Select Boot address0.
#define IS_SYSCFG_ETHERNET_CONFIG(CONFIG)
#define IS_SYSCFG_SWITCH_STATE(STATE)
#define IS_SYSCFG_ANALOG_SWITCH(SWITCH)
#define IS_SYSCFG_CODE_SELECT(SELECT)
#define IS_SYSCFG_CODE_CONFIG(CONFIG)
#define IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE(__VALUE__)
#define IS_SYSCFG_VREFBUF_TRIMMING(__VALUE__)
#define IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(__SCALE__)
This file contains all the functions prototypes for the HAL module driver.
#define assert_param(expr)
Uncomment the line below to expanse the "assert_param" macro in the HAL drivers code.
#define TICK_INT_PRIORITY
tick interrupt priority
HAL_StatusTypeDef
HAL Status structures definition.
void HAL_MspInit(void)
Initializes the Global MSP.
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
This function configures the TIM6 as a time base source.