@@ -307,6 +307,13 @@ struct ResetAndClockControl final {
307307 static_assert (sizeof (ClockRecoveryCalibrationControl) == 4UL , " Must be this exact size" );
308308 // / RCC Clock Configuration Register (CFGR)
309309 struct Configuration final {
310+ // / System clock switch (SW)
311+ enum class SystemClockSwitch : uint32_t {
312+ HighSpeedInternalClock = 0b00 , // /< (HSI_CLOCK)
313+ CalibratedSiliconInternalClock = 0b01 , // /< (CSI_CLOCK)
314+ HighSpeedExternalClock = 0b10 , // /< (HSE_CLOCK)
315+ PhaseLockLoopClock = 0b11 , // /< (PLL_CLOCK)
316+ };
310317 // / Default Constructor
311318 Configuration ()
312319 : whole{0u } {}
@@ -330,29 +337,29 @@ struct ResetAndClockControl final {
330337 // / The internal bitfield for the register
331338 struct Fields final {
332339 // / System clock switch (SW)
333- uint32_t system_clock_switch : 3 ; // bits 0:2
340+ SystemClockSwitch system_clock_switch : 3 ; // bits 0:2
334341 // / System clock switch status (SWS)
335- uint32_t system_clock_switch_status : 3 ; // bits 3:5
342+ SystemClockSwitch system_clock_switch_status : 3 ; // bits 3:5
336343 // / System clock selection after a wake up from system Stop (STOPWUCK)
337- uint32_t stop_wakeup_clock : 1 ; // bit 6
344+ uint32_t stop_wakeup_clock : 1 ; // bit 6
338345 // / Kernel clock selection after a wake up from system Stop (STOPKERWUCK)
339- uint32_t stop_kernel_wakeup_clock : 1 ; // bit 7
346+ uint32_t stop_kernel_wakeup_clock : 1 ; // bit 7
340347 // / HSE division factor for RTC clock (RTCPRE)
341- uint32_t real_time_clock_prescaler : 6 ; // bits 8:13
348+ uint32_t real_time_clock_prescaler : 6 ; // bits 8:13
342349 // / High Resolution Timer clock prescaler selection (HRTIMSEL)
343- uint32_t high_resolution_timer_select : 1 ; // bit 14
350+ uint32_t high_resolution_timer_select : 1 ; // bit 14
344351 // / Timers clocks prescaler selection (TIMPRE)
345- uint32_t timers_clock_prescaler : 1 ; // bit 15
352+ uint32_t timers_clock_prescaler : 1 ; // bit 15
346353 // / (reserved)
347- uint32_t : 2 ; // bits 16:17
354+ uint32_t : 2 ; // bits 16:17
348355 // / MCO1 prescaler (MCO1PRE)
349- uint32_t mco1_prescaler : 4 ; // bits 18:21
356+ uint32_t mco1_prescaler : 4 ; // bits 18:21
350357 // / Micro-controller clock output 1 (MCO1SEL)
351- uint32_t mco1_selection : 3 ; // bits 22:24
358+ uint32_t mco1_selection : 3 ; // bits 22:24
352359 // / MCO2 prescaler (MCO2PRE)
353- uint32_t mco2_prescaler : 4 ; // bits 25:28
360+ uint32_t mco2_prescaler : 4 ; // bits 25:28
354361 // / Micro-controller clock output 2 (MCO2SEL)
355- uint32_t mco2_selection : 3 ; // bits 29:31
362+ uint32_t mco2_selection : 3 ; // bits 29:31
356363 };
357364 // +=MEMORY======================================+
358365 union {
@@ -5970,11 +5977,11 @@ struct ResetAndClockControl final {
59705977
59715978 // +=MEMORY======================================+
59725979 // / clock control register (CR)
5973- Control control; // offset 0x0UL
5980+ Control control; // offset 0x0UL
59745981#if defined(STM32H7_REV_Y)
5975- InternalClockSourcesCalibration internalclocksourcescalibration ; // offset 0x4UL
5982+ InternalClockSourcesCalibration internal_clock_sources_calibration ; // offset 0x4UL
59765983#elif defined(STM32H7_REV_V)
5977- HighSpeedInternalConfiguration highspeedinternalconfiguration ; // offset 0x4UL
5984+ HighSpeedInternalConfiguration high_speed_internal_configuration ; // offset 0x4UL
59785985#endif
59795986 // / RCC Clock Recovery RC Register (CRRCR)
59805987 ClockRecoveryCalibrationControl clock_recovery_calibration_control; // offset 0x8UL
@@ -6016,12 +6023,12 @@ struct ResetAndClockControl final {
60166023 Domain3PeripheralClockSelection domain3_peripheral_clock_selection; // offset 0x58UL
60176024 uint32_t : 32 ; // offset 0x5cUL
60186025 // / RCC Clock Source Interrupt Enable Register (CIER)
6019- ClockInterruptEnable clockinterruptenable ; // offset 0x60UL
6026+ ClockInterruptEnable clock_interrupt_enable ; // offset 0x60UL
60206027 // / RCC Clock Source Interrupt Flag Register (CIFR)
6021- ClockInterruptFlags clockinterruptflags ; // offset 0x64UL
6028+ ClockInterruptFlags clock_interrupt_flags ; // offset 0x64UL
60226029 // / RCC Clock Source Interrupt Clear Register (CICR)
6023- ClockInterruptClear clockinterruptclear ; // offset 0x68UL
6024- uint32_t : 32 ; // offset 0x6cUL
6030+ ClockInterruptClear clock_interrupt_clear ; // offset 0x68UL
6031+ uint32_t : 32 ; // offset 0x6cUL
60256032 // / RCC Backup Domain Control Register (BDCR)
60266033 BackupDomainControl backup_domain_control; // offset 0x70UL
60276034 // / RCC Clock Control and Status Register (CSR)
@@ -6324,9 +6331,9 @@ static_assert(offsetof(ResetAndClockControl, domain1_peripheral_clock_selection)
63246331static_assert (offsetof(ResetAndClockControl, domain2_peripheral_clock_selection1) == 0x50UL , " Must be located at this offset" );
63256332static_assert (offsetof(ResetAndClockControl, domain2_peripheral_clock_selection2) == 0x54UL , " Must be located at this offset" );
63266333static_assert (offsetof(ResetAndClockControl, domain3_peripheral_clock_selection) == 0x58UL , " Must be located at this offset" );
6327- static_assert (offsetof(ResetAndClockControl, clockinterruptenable ) == 0x60UL , " Must be located at this offset" );
6328- static_assert (offsetof(ResetAndClockControl, clockinterruptflags ) == 0x64UL , " Must be located at this offset" );
6329- static_assert (offsetof(ResetAndClockControl, clockinterruptclear ) == 0x68UL , " Must be located at this offset" );
6334+ static_assert (offsetof(ResetAndClockControl, clock_interrupt_enable ) == 0x60UL , " Must be located at this offset" );
6335+ static_assert (offsetof(ResetAndClockControl, clock_interrupt_flags ) == 0x64UL , " Must be located at this offset" );
6336+ static_assert (offsetof(ResetAndClockControl, clock_interrupt_clear ) == 0x68UL , " Must be located at this offset" );
63306337static_assert (offsetof(ResetAndClockControl, backup_domain_control) == 0x70UL , " Must be located at this offset" );
63316338static_assert (offsetof(ResetAndClockControl, clock_control_status) == 0x74UL , " Must be located at this offset" );
63326339static_assert (offsetof(ResetAndClockControl, ahb3_peripheral_reset) == 0x7cUL , " Must be located at this offset" );
0 commit comments