Skip to content

Conversation

Wratox
Copy link
Contributor

@Wratox Wratox commented Jan 23, 2025

No description provided.

@usbalbin usbalbin mentioned this pull request Jan 23, 2025
@burrbull
Copy link
Member

Update deps on current nightlies, please. If it is ok, I'll publish staging.

@astapleton
Copy link
Member

Update deps on current nightlies, please. If it is ok, I'll publish staging.

@burrbull I created #40 to just update the PAC. It's currently based on the nightly crate and passing all checks

@Wratox Wratox changed the title WIP: Add h523 support WIP: Add h523/h533 support Jan 27, 2025
Cargo.toml Outdated
@@ -55,7 +57,8 @@ log-semihost = ["log"]

[dependencies]
cortex-m = { version = "^0.7.7", features = ["critical-section-single-core"] }
stm32h5 = { package = "stm32h5-staging", version = "0.17.0" }
#stm32h5 = { package = "stm32h5-staging", version = "0.18.0" }
stm32h5 = { git="https://github.com/stm32-rs/stm32-rs-nightlies" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some more issues which are solved in stm32-rs/stm32-rs#1141

Comment on lines 149 to 152
pub use h523_h533_h56x_h573::*;

#[cfg(feature = "gpio-h56x_h573")]
mod h56x_h573 {
mod h523_h533_h56x_h573 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase this on master to pull in the GPIO definitions for the H56x and H573 chips? And then I think we should have a separate module to bring in the GPIO defs for the H523 & H533 chips as the alternate function assignments are quite different from the H56x and H573 series. You don't need to fill in all the AFs for this PR, but lets at least have the separate module defined with it's set of banks defined (essentially a duplicate of what we have here but only for H523 & H533)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// auto-generated using codegen
// STM32CubeMX DB release: DB.6.0.130

#[cfg(feature = "gpio-h50")]
gpio!(GPIOA, gpioa, PA, 'A', PAn, [
    PA0: (pa0, 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
    PA1: (pa1, 1, [1, 4, 5, 6, 7, 8, 9, 11, 14, 15]),
    PA2: (pa2, 2, [1, 2, 3, 4, 5, 6, 7, 8, 14, 15]),
    PA3: (pa3, 3, [1, 3, 4, 5, 6, 7, 8, 13, 14, 15]),
    PA4: (pa4, 4, [1, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]),
    PA5: (pa5, 5, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15]),
    PA6: (pa6, 6, [1, 2, 5, 15]),
    PA7: (pa7, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15]),
    PA8: (pa8, 8, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
    PA9: (pa9, 9, [0, 1, 3, 4, 5, 7, 10, 13, 15]),
    PA10: (pa10, 10, [1, 3, 4, 7, 15]),
    PA11: (pa11, 11, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15]),
    PA12: (pa12, 12, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15]),
    PA13: (pa13, 13, [0, 1, 2, 7, 8, 9, 12, 14, 15], super::Debugger),
    PA14: (pa14, 14, [0, 1, 2, 3, 4, 7, 8, 9, 14, 15], super::Debugger),
    PA15: (pa15, 15, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15], super::Debugger),
]);

#[cfg(feature = "gpio-h50")]
gpio!(GPIOB, gpiob, PB, 'B', PBn, [
    PB0: (pb0, 0, [1, 2, 4, 9, 14, 15]),
    PB1: (pb1, 1, [1, 2, 3, 5, 6, 9, 12, 14, 15]),
    PB2: (pb2, 2, [0, 1, 2, 4, 5, 6, 7, 9, 14, 15]),
    PB3: (pb3, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15], super::Debugger),
    PB4: (pb4, 4, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15], super::Debugger),
    PB5: (pb5, 5, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15]),
    PB6: (pb6, 6, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15]),
    PB7: (pb7, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15]),
    PB8: (pb8, 8, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
    PB10: (pb10, 10, [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15]),
    PB12: (pb12, 12, [1, 4, 5, 7, 8, 9, 15]),
    PB13: (pb13, 13, [1, 3, 4, 5, 7, 8, 9, 10, 11, 15]),
    PB14: (pb14, 14, [1, 2, 4, 5, 7, 8, 15]),
    PB15: (pb15, 15, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
]);

#[cfg(feature = "gpio-h50")]
gpio!(GPIOC, gpioc, PC, 'C', PCn, [
    PC0: (pc0, 0, [1, 2, 5, 7, 15]),
    PC1: (pc1, 1, [0, 2, 4, 5, 7, 8, 14, 15]),
    PC2: (pc2, 2, [0, 4, 5, 7, 8, 15]),
    PC3: (pc3, 3, [0, 3, 4, 5, 7, 14, 15]),
    PC4: (pc4, 4, [1, 3, 4, 5, 7, 15]),
    PC5: (pc5, 5, [1, 5, 12, 14, 15]),
    PC6: (pc6, 6, [1, 2, 3, 4, 5, 8, 9, 13, 15]),
    PC7: (pc7, 7, [0, 1, 2, 3, 5, 6, 8, 9, 13, 15]),
    PC8: (pc8, 8, [0, 1, 2, 3, 4, 5, 8, 9, 13, 15]),
    PC9: (pc9, 9, [0, 1, 2, 3, 4, 5, 6, 7, 9, 13, 15]),
    PC10: (pc10, 10, [1, 3, 5, 6, 7, 8, 9, 13, 15]),
    PC11: (pc11, 11, [1, 3, 4, 5, 6, 7, 8, 14, 15]),
    PC12: (pc12, 12, [0, 1, 2, 3, 6, 7, 8, 14, 15]),
    PC13: (pc13, 13, [15]),
    PC14: (pc14, 14, [15]),
    PC15: (pc15, 15, [15]),
]);

#[cfg(feature = "gpio-h50")]
gpio!(GPIOD, gpiod, PD, 'D', PDn, [
    PD2: (pd2, 2, [0, 1, 2, 6, 7, 9, 14, 15]),
]);

#[cfg(feature = "gpio-h50")]
gpio!(GPIOH, gpioh, PH, 'H', PHn, [
    PH0: (ph0, 0, [15]),
    PH1: (ph1, 1, [15]),
]);

#[cfg(feature = "gpio-h50")]
gpio!(GPIOI, gpioi, PI, 'I', PIn, [
    PI8: (pi8, 8, []),
]);


#[cfg(feature = "gpio-h52x")]
gpio!(GPIOA, gpioa, PA, 'A', PAn, [
    PA0: (pa0, 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15]),
    PA1: (pa1, 1, [1, 2, 4, 5, 6, 7, 8, 9, 14, 15]),
    PA2: (pa2, 2, [1, 2, 3, 4, 5, 7, 15]),
    PA3: (pa3, 3, [1, 2, 3, 4, 5, 6, 7, 15]),
    PA4: (pa4, 4, [2, 3, 4, 5, 6, 7, 13, 15]),
    PA5: (pa5, 5, [1, 3, 5, 13, 14, 15]),
    PA6: (pa6, 6, [1, 2, 3, 5, 6, 13, 15]),
    PA7: (pa7, 7, [1, 2, 3, 5, 10, 13, 15]),
    PA8: (pa8, 8, [0, 1, 3, 4, 5, 6, 7, 9, 10, 12, 13, 15]),
    PA9: (pa9, 9, [1, 3, 4, 5, 7, 12, 13, 15]),
    PA10: (pa10, 10, [1, 3, 4, 6, 7, 9, 12, 13, 15]),
    PA11: (pa11, 11, [1, 3, 5, 6, 7, 9, 10, 15]),
    PA12: (pa12, 12, [1, 3, 5, 6, 7, 9, 10, 15]),
    PA13: (pa13, 13, [0, 15], super::Debugger),
    PA14: (pa14, 14, [0, 15], super::Debugger),
    PA15: (pa15, 15, [0, 1, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15], super::Debugger),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOB, gpiob, PB, 'B', PBn, [
    PB0: (pb0, 0, [1, 2, 3, 5, 6, 7, 8, 15]),
    PB1: (pb1, 1, [1, 2, 3, 4, 5, 6, 7, 15]),
    PB2: (pb2, 2, [0, 3, 4, 5, 6, 7, 9, 10, 12, 15]),
    PB3: (pb3, 3, [0, 1, 3, 4, 5, 6, 8, 9, 10, 14, 15], super::Debugger),
    PB4: (pb4, 4, [0, 2, 3, 4, 5, 6, 7, 9, 10, 13, 15], super::Debugger),
    PB5: (pb5, 5, [2, 3, 4, 5, 6, 7, 9, 10, 13, 14, 15]),
    PB6: (pb6, 6, [2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15]),
    PB7: (pb7, 7, [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 15]),
    PB8: (pb8, 8, [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 15]),
    PB9: (pb9, 9, [2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 15]),
    PB10: (pb10, 10, [1, 2, 3, 4, 5, 7, 9, 15]),
    PB12: (pb12, 12, [1, 2, 3, 4, 5, 6, 7, 9, 14, 15]),
    PB13: (pb13, 13, [1, 2, 3, 4, 5, 7, 8, 9, 12, 14, 15]),
    PB14: (pb14, 14, [1, 2, 3, 4, 5, 7, 8, 15]),
    PB15: (pb15, 15, [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOC, gpioc, PC, 'C', PCn, [
    PC0: (pc0, 0, [6, 7, 9, 10, 15]),
    PC1: (pc1, 1, [0, 5, 6, 10, 15]),
    PC2: (pc2, 2, [0, 2, 5, 6, 9, 15]),
    PC3: (pc3, 3, [0, 3, 5, 6, 9, 15]),
    PC4: (pc4, 4, [1, 3, 5, 7, 15]),
    PC5: (pc5, 5, [1, 4, 6, 10, 15]),
    PC6: (pc6, 6, [2, 3, 5, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC7: (pc7, 7, [2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC8: (pc8, 8, [0, 2, 3, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC9: (pc9, 9, [0, 2, 3, 4, 5, 8, 9, 11, 12, 13, 15]),
    PC10: (pc10, 10, [3, 6, 7, 8, 9, 12, 13, 15]),
    PC11: (pc11, 11, [3, 6, 7, 8, 9, 12, 13, 15]),
    PC12: (pc12, 12, [0, 2, 3, 6, 7, 8, 12, 13, 15]),
    PC13: (pc13, 13, [15]),
    PC14: (pc14, 14, [15]),
    PC15: (pc15, 15, [15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOD, gpiod, PD, 'D', PDn, [
    PD0: (pd0, 0, [3, 8, 9, 12, 15]),
    PD1: (pd1, 1, [8, 9, 12, 15]),
    PD2: (pd2, 2, [0, 2, 4, 8, 12, 13, 15]),
    PD3: (pd3, 3, [5, 7, 12, 13, 15]),
    PD4: (pd4, 4, [7, 10, 12, 15]),
    PD5: (pd5, 5, [1, 5, 7, 9, 10, 12, 15]),
    PD6: (pd6, 6, [3, 4, 5, 7, 10, 11, 12, 13, 15]),
    PD7: (pd7, 7, [3, 4, 5, 6, 7, 10, 11, 12, 15]),
    PD8: (pd8, 8, [7, 12, 15]),
    PD9: (pd9, 9, [7, 9, 12, 15]),
    PD10: (pd10, 10, [3, 7, 12, 15]),
    PD11: (pd11, 11, [3, 7, 8, 9, 12, 15]),
    PD12: (pd12, 12, [1, 2, 3, 5, 7, 8, 9, 12, 13, 15]),
    PD13: (pd13, 13, [1, 2, 3, 5, 9, 12, 13, 15]),
    PD14: (pd14, 14, [2, 12, 15]),
    PD15: (pd15, 15, [2, 12, 15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOE, gpioe, PE, 'E', PEn, [
    PE0: (pe0, 0, [1, 2, 3, 4, 6, 9, 12, 13, 15]),
    PE2: (pe2, 2, [0, 1, 5, 9, 12, 13, 15]),
    PE3: (pe3, 3, [0, 4, 12, 15]),
    PE4: (pe4, 4, [0, 4, 5, 12, 13, 15]),
    PE5: (pe5, 5, [0, 4, 5, 12, 13, 15]),
    PE6: (pe6, 6, [0, 1, 4, 5, 12, 13, 15]),
    PE7: (pe7, 7, [1, 10, 12, 15]),
    PE8: (pe8, 8, [1, 10, 12, 15]),
    PE9: (pe9, 9, [1, 10, 12, 15]),
    PE10: (pe10, 10, [1, 10, 12, 15]),
    PE11: (pe11, 11, [1, 4, 5, 6, 12, 15]),
    PE12: (pe12, 12, [1, 5, 12, 15]),
    PE13: (pe13, 13, [1, 5, 12, 15]),
    PE14: (pe14, 14, [1, 5, 12, 15]),
    PE15: (pe15, 15, [1, 3, 12, 15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOF, gpiof, PF, 'F', PFn, [
    PF0: (pf0, 0, [3, 4, 12, 15]),
    PF1: (pf1, 1, [3, 4, 12, 15]),
    PF2: (pf2, 2, [4, 12, 15]),
    PF3: (pf3, 3, [12, 15]),
    PF4: (pf4, 4, [12, 15]),
    PF5: (pf5, 5, [5, 12, 15]),
    PF6: (pf6, 6, [10, 15]),
    PF7: (pf7, 7, [10, 15]),
    PF8: (pf8, 8, [10, 15]),
    PF9: (pf9, 9, [10, 15]),
    PF10: (pf10, 10, [4, 9, 13, 15]),
    PF11: (pf11, 11, [9, 13, 15]),
    PF12: (pf12, 12, [12, 15]),
    PF13: (pf13, 13, [12, 15]),
    PF14: (pf14, 14, [12, 15]),
    PF15: (pf15, 15, [5, 12, 15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOG, gpiog, PG, 'G', PGn, [
    PG0: (pg0, 0, [12, 15]),
    PG1: (pg1, 1, [7, 12, 15]),
    PG2: (pg2, 2, [3, 12, 15]),
    PG3: (pg3, 3, [3, 12, 15]),
    PG4: (pg4, 4, [1, 12, 15]),
    PG5: (pg5, 5, [1, 12, 15]),
    PG6: (pg6, 6, [3, 5, 10, 11, 12, 13, 15]),
    PG7: (pg7, 7, [3, 7, 11, 12, 13, 15]),
    PG8: (pg8, 8, [3, 5, 7, 15]),
    PG9: (pg9, 9, [5, 7, 9, 11, 12, 13, 15]),
    PG10: (pg10, 10, [5, 11, 12, 13, 15]),
    PG11: (pg11, 11, [1, 5, 10, 13, 15]),
    PG12: (pg12, 12, [1, 4, 7, 10, 12, 13, 15]),
    PG13: (pg13, 13, [0, 1, 7, 12, 15]),
    PG14: (pg14, 14, [0, 1, 4, 7, 9, 12, 15]),
    PG15: (pg15, 15, [5, 7, 13, 15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOH, gpioh, PH, 'H', PHn, [
    PH0: (ph0, 0, [15]),
    PH1: (ph1, 1, [15]),
]);

#[cfg(feature = "gpio-h52x")]
gpio!(GPIOI, gpioi, PI, 'I', PIn, [
    PI8: (pi8, 8, []),
]);


#[cfg(feature = "gpio-h56x")]
gpio!(GPIOA, gpioa, PA, 'A', PAn, [
    PA0: (pa0, 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15]),
    PA1: (pa1, 1, [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 15]),
    PA2: (pa2, 2, [1, 2, 4, 5, 7, 8, 11, 15]),
    PA3: (pa3, 3, [1, 2, 3, 4, 5, 6, 7, 11, 15]),
    PA4: (pa4, 4, [2, 3, 5, 6, 7, 8, 13, 15]),
    PA5: (pa5, 5, [1, 3, 5, 8, 11, 13, 14, 15]),
    PA6: (pa6, 6, [1, 2, 3, 5, 6, 7, 8, 9, 13, 15]),
    PA7: (pa7, 7, [1, 2, 3, 5, 7, 8, 9, 10, 11, 12, 13, 15]),
    PA8: (pa8, 8, [0, 1, 3, 4, 5, 7, 10, 11, 12, 13, 15]),
    PA9: (pa9, 9, [1, 3, 4, 5, 7, 11, 12, 13, 15]),
    PA10: (pa10, 10, [1, 3, 4, 6, 7, 9, 12, 13, 15]),
    PA11: (pa11, 11, [1, 3, 5, 6, 7, 9, 10, 15]),
    PA12: (pa12, 12, [1, 3, 5, 6, 7, 8, 9, 10, 15]),
    PA13: (pa13, 13, [0, 15], super::Debugger),
    PA14: (pa14, 14, [0, 15], super::Debugger),
    PA15: (pa15, 15, [0, 1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15], super::Debugger),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOB, gpiob, PB, 'B', PBn, [
    PB0: (pb0, 0, [1, 2, 3, 6, 7, 8, 11, 14, 15]),
    PB1: (pb1, 1, [1, 2, 3, 6, 11, 14, 15]),
    PB2: (pb2, 2, [0, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 15]),
    PB3: (pb3, 3, [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15], super::Debugger),
    PB4: (pb4, 4, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15], super::Debugger),
    PB5: (pb5, 5, [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]),
    PB6: (pb6, 6, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15]),
    PB7: (pb7, 7, [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PB8: (pb8, 8, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PB9: (pb9, 9, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PB10: (pb10, 10, [1, 2, 3, 4, 5, 7, 9, 11, 15]),
    PB11: (pb11, 11, [1, 3, 4, 5, 6, 7, 11, 12, 15]),
    PB12: (pb12, 12, [1, 3, 4, 5, 6, 7, 9, 11, 14, 15]),
    PB13: (pb13, 13, [1, 2, 3, 4, 5, 7, 9, 12, 14, 15]),
    PB14: (pb14, 14, [1, 2, 3, 4, 5, 7, 8, 9, 14, 15]),
    PB15: (pb15, 15, [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOC, gpioc, PC, 'C', PCn, [
    PC0: (pc0, 0, [1, 6, 7, 8, 9, 10, 12, 15]),
    PC1: (pc1, 1, [0, 2, 5, 6, 7, 8, 9, 10, 11, 15]),
    PC2: (pc2, 2, [0, 1, 2, 5, 6, 9, 11, 12, 15]),
    PC3: (pc3, 3, [0, 2, 3, 5, 6, 9, 11, 12, 15]),
    PC4: (pc4, 4, [1, 2, 3, 5, 7, 11, 12, 15]),
    PC5: (pc5, 5, [1, 2, 4, 6, 7, 10, 11, 12, 15]),
    PC6: (pc6, 6, [2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC7: (pc7, 7, [0, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC8: (pc8, 8, [0, 2, 3, 7, 8, 9, 10, 11, 12, 13, 15]),
    PC9: (pc9, 9, [0, 2, 3, 4, 5, 8, 9, 11, 12, 13, 15]),
    PC10: (pc10, 10, [2, 6, 7, 8, 9, 11, 12, 13, 15]),
    PC11: (pc11, 11, [2, 6, 7, 8, 9, 12, 13, 15]),
    PC12: (pc12, 12, [0, 2, 5, 6, 7, 8, 12, 13, 15]),
    PC13: (pc13, 13, [15]),
    PC14: (pc14, 14, [15]),
    PC15: (pc15, 15, [15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOD, gpiod, PD, 'D', PDn, [
    PD0: (pd0, 0, [3, 8, 9, 11, 12, 15]),
    PD1: (pd1, 1, [8, 9, 12, 15]),
    PD2: (pd2, 2, [0, 2, 4, 8, 12, 13, 14, 15]),
    PD3: (pd3, 3, [5, 7, 12, 13, 15]),
    PD4: (pd4, 4, [7, 10, 12, 15]),
    PD5: (pd5, 5, [1, 5, 7, 9, 10, 12, 15]),
    PD6: (pd6, 6, [2, 5, 6, 7, 10, 11, 12, 13, 15]),
    PD7: (pd7, 7, [5, 7, 10, 11, 12, 14, 15]),
    PD8: (pd8, 8, [7, 12, 15]),
    PD9: (pd9, 9, [7, 9, 12, 15]),
    PD10: (pd10, 10, [3, 7, 12, 15]),
    PD11: (pd11, 11, [2, 3, 4, 7, 8, 9, 10, 12, 15]),
    PD12: (pd12, 12, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15]),
    PD13: (pd13, 13, [1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, 15]),
    PD14: (pd14, 14, [2, 8, 11, 12, 15]),
    PD15: (pd15, 15, [2, 8, 11, 12, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOE, gpioe, PE, 'E', PEn, [
    PE0: (pe0, 0, [1, 2, 3, 4, 6, 8, 9, 10, 12, 13, 15]),
    PE1: (pe1, 1, [1, 8, 9, 12, 13, 15]),
    PE2: (pe2, 2, [0, 1, 2, 5, 6, 7, 8, 9, 11, 12, 13, 15]),
    PE3: (pe3, 3, [0, 4, 6, 7, 12, 15]),
    PE4: (pe4, 4, [0, 2, 4, 5, 6, 12, 13, 15]),
    PE5: (pe5, 5, [0, 2, 4, 5, 6, 12, 13, 15]),
    PE6: (pe6, 6, [0, 1, 2, 4, 5, 6, 10, 12, 13, 15]),
    PE7: (pe7, 7, [1, 6, 7, 10, 12, 15]),
    PE8: (pe8, 8, [1, 6, 7, 10, 12, 15]),
    PE9: (pe9, 9, [1, 6, 7, 10, 12, 15]),
    PE10: (pe10, 10, [1, 6, 7, 10, 12, 15]),
    PE11: (pe11, 11, [1, 4, 5, 6, 10, 12, 15]),
    PE12: (pe12, 12, [1, 5, 10, 12, 15]),
    PE13: (pe13, 13, [1, 5, 10, 12, 15]),
    PE14: (pe14, 14, [1, 5, 10, 12, 15]),
    PE15: (pe15, 15, [1, 3, 7, 12, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOF, gpiof, PF, 'F', PFn, [
    PF0: (pf0, 0, [4, 12, 13, 15]),
    PF1: (pf1, 1, [4, 12, 13, 15]),
    PF2: (pf2, 2, [2, 3, 4, 6, 7, 12, 13, 15]),
    PF3: (pf3, 3, [2, 7, 12, 13, 15]),
    PF4: (pf4, 4, [2, 7, 12, 15]),
    PF5: (pf5, 5, [2, 4, 5, 6, 7, 12, 14, 15]),
    PF6: (pf6, 6, [1, 5, 6, 7, 10, 13, 15]),
    PF7: (pf7, 7, [1, 5, 6, 7, 10, 13, 15]),
    PF8: (pf8, 8, [1, 5, 6, 7, 9, 10, 13, 15]),
    PF9: (pf9, 9, [1, 5, 6, 7, 9, 10, 13, 15]),
    PF10: (pf10, 10, [1, 2, 4, 9, 13, 15]),
    PF11: (pf11, 11, [5, 9, 10, 12, 13, 14, 15]),
    PF12: (pf12, 12, [12, 14, 15]),
    PF13: (pf13, 13, [4, 12, 14, 15]),
    PF14: (pf14, 14, [12, 14, 15]),
    PF15: (pf15, 15, [4, 5, 12, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOG, gpiog, PG, 'G', PGn, [
    PG0: (pg0, 0, [11, 12, 14, 15]),
    PG1: (pg1, 1, [7, 11, 12, 15]),
    PG2: (pg2, 2, [3, 7, 12, 14, 15]),
    PG3: (pg3, 3, [3, 7, 12, 13, 15]),
    PG4: (pg4, 4, [1, 12, 14, 15]),
    PG5: (pg5, 5, [1, 12, 15]),
    PG6: (pg6, 6, [1, 3, 4, 5, 10, 11, 12, 13, 15]),
    PG7: (pg7, 7, [2, 3, 4, 6, 7, 11, 12, 13, 15]),
    PG8: (pg8, 8, [3, 5, 7, 11, 12, 15]),
    PG9: (pg9, 9, [5, 7, 9, 10, 11, 12, 13, 15]),
    PG10: (pg10, 10, [5, 10, 11, 12, 13, 15]),
    PG11: (pg11, 11, [1, 5, 6, 7, 10, 11, 13, 15]),
    PG12: (pg12, 12, [1, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15]),
    PG13: (pg13, 13, [0, 1, 5, 6, 7, 10, 11, 12, 13, 15]),
    PG14: (pg14, 14, [0, 1, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15]),
    PG15: (pg15, 15, [5, 6, 7, 12, 13, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOH, gpioh, PH, 'H', PHn, [
    PH0: (ph0, 0, [15]),
    PH1: (ph1, 1, [15]),
    PH2: (ph2, 2, [1, 9, 10, 11, 12, 15]),
    PH3: (ph3, 3, [9, 10, 11, 12, 15]),
    PH4: (ph4, 4, [4, 5, 7, 13, 15]),
    PH5: (ph5, 5, [4, 5, 7, 12, 15]),
    PH6: (ph6, 6, [1, 2, 3, 4, 5, 11, 12, 13, 15]),
    PH7: (ph7, 7, [1, 3, 4, 5, 11, 12, 13, 15]),
    PH8: (ph8, 8, [1, 2, 3, 4, 5, 13, 15]),
    PH9: (ph9, 9, [1, 2, 3, 4, 5, 13, 15]),
    PH10: (ph10, 10, [1, 2, 3, 4, 5, 13, 15]),
    PH11: (ph11, 11, [1, 2, 3, 4, 5, 13, 15]),
    PH12: (ph12, 12, [1, 2, 3, 4, 5, 10, 13, 15]),
    PH13: (ph13, 13, [1, 3, 7, 8, 9, 13, 15]),
    PH14: (ph14, 14, [3, 8, 9, 13, 15]),
    PH15: (ph15, 15, [3, 13, 15]),
]);

#[cfg(feature = "gpio-h56x")]
gpio!(GPIOI, gpioi, PI, 'I', PIn, [
    PI0: (pi0, 0, [2, 5, 13, 15]),
    PI1: (pi1, 1, [3, 5, 13, 15]),
    PI2: (pi2, 2, [3, 5, 13, 15]),
    PI3: (pi3, 3, [3, 5, 13, 15]),
    PI4: (pi4, 4, [3, 7, 10, 13, 15]),
    PI5: (pi5, 5, [3, 10, 13, 15]),
    PI6: (pi6, 6, [3, 10, 13, 15]),
    PI7: (pi7, 7, [3, 10, 13, 15]),
    PI8: (pi8, 8, [15]),
    PI9: (pi9, 9, [8, 9, 15]),
    PI10: (pi10, 10, [9, 11, 13, 15]),
    PI11: (pi11, 11, [13, 15]),
]);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, thanks! What did you use to generate these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@Wratox Wratox marked this pull request as ready for review January 28, 2025 12:26
@Wratox
Copy link
Contributor Author

Wratox commented Jan 28, 2025

@burrbull Could you make a release of stm32h5-staging with the changes I made there, so we don't have to depend on nightlies?
Other than that, I think this might be ready for review.

@burrbull
Copy link
Member

Try.

Copy link
Member

@astapleton astapleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the newly added const blocks causing the build to fail and the need to depend on the stm32h5-staging (0.18.1 is published btw), this looks good to me. I'm happy to merge when those are taken care of.

'H' => crate::pac::GPIOH::ptr() as _,
'I' => crate::pac::GPIOI::ptr() as _,
_ => panic!("Unknown GPIO port"),
const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What were the const blocks added for? They're causing the build to fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my bad. Forgot about supporting not-latest-rust.

I figured this could be useful to more or less force compiler to remove the branching and the panic (which the optimizer probably is smart enough to do anyways).

@usbalbin
Copy link
Member

Perhaps H523 and H533 should be added to the CI too?

@astapleton
Copy link
Member

astapleton commented Jan 28, 2025

Perhaps H523 and H533 should be added to the CI too?

Good idea! Hmm, do I have to add them?

@usbalbin
Copy link
Member

Perhaps H523 and H533 should be added to the CI too?

Good idea! Hmm, do I have to add them?

If it is just a matter of adding them to https://github.com/stm32-rs/stm32h5xx-hal/blob/master/.github/workflows/ci.yml#L18 then we will try that tomorrow

@astapleton
Copy link
Member

Perhaps H523 and H533 should be added to the CI too?

Good idea! Hmm, do I have to add them?

If it is just a matter of adding them to https://github.com/stm32-rs/stm32h5xx-hal/blob/master/.github/workflows/ci.yml#L18 then we will try that tomorrow

Ok. I'm just wondering if the need to approve CI runs will cause an issue. I guess we'll find out tomorrow.

@astapleton astapleton merged commit 1bfebd8 into stm32-rs:master Jan 29, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants