diff options
| -rwxr-xr-x | ci.sh | 1 | ||||
| -rw-r--r-- | embassy-stm32/build.rs | 14 | ||||
| -rw-r--r-- | embassy-stm32/src/ospi/mod.rs | 2 |
3 files changed, 11 insertions, 6 deletions
| @@ -166,6 +166,7 @@ cargo batch \ | |||
| 166 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h562ag,defmt,exti,time-driver-any,time \ | 166 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h562ag,defmt,exti,time-driver-any,time \ |
| 167 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \ | 167 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \ |
| 168 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \ | 168 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \ |
| 169 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5f9zj,defmt,exti,time-driver-any,time \ | ||
| 169 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \ | 170 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \ |
| 170 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \ | 171 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \ |
| 171 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u031r8,defmt,exti,time-driver-any,time \ | 172 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u031r8,defmt,exti,time-driver-any,time \ |
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 966dce121..71bfb3747 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -55,7 +55,7 @@ fn main() { | |||
| 55 | let mut singletons: Vec<String> = Vec::new(); | 55 | let mut singletons: Vec<String> = Vec::new(); |
| 56 | for p in METADATA.peripherals { | 56 | for p in METADATA.peripherals { |
| 57 | if let Some(r) = &p.registers { | 57 | if let Some(r) = &p.registers { |
| 58 | if r.kind == "adccommon" || r.kind == "sai" || r.kind == "ucpd" || r.kind == "otg" { | 58 | if r.kind == "adccommon" || r.kind == "sai" || r.kind == "ucpd" || r.kind == "otg" || r.kind == "octospi" { |
| 59 | // TODO: should we emit this for all peripherals? if so, we will need a list of all | 59 | // TODO: should we emit this for all peripherals? if so, we will need a list of all |
| 60 | // possible peripherals across all chips, so that we can declare the configs | 60 | // possible peripherals across all chips, so that we can declare the configs |
| 61 | // (replacing the hard-coded list of `peri_*` cfgs below) | 61 | // (replacing the hard-coded list of `peri_*` cfgs below) |
| @@ -113,6 +113,7 @@ fn main() { | |||
| 113 | "peri_ucpd2", | 113 | "peri_ucpd2", |
| 114 | "peri_usb_otg_fs", | 114 | "peri_usb_otg_fs", |
| 115 | "peri_usb_otg_hs", | 115 | "peri_usb_otg_hs", |
| 116 | "peri_octospi2", | ||
| 116 | ]); | 117 | ]); |
| 117 | cfgs.declare_all(&["mco", "mco1", "mco2"]); | 118 | cfgs.declare_all(&["mco", "mco1", "mco2"]); |
| 118 | 119 | ||
| @@ -1137,11 +1138,14 @@ fn main() { | |||
| 1137 | 1138 | ||
| 1138 | // OCTOSPIM is special | 1139 | // OCTOSPIM is special |
| 1139 | if p.name == "OCTOSPIM" { | 1140 | if p.name == "OCTOSPIM" { |
| 1141 | // Some chips have OCTOSPIM but not OCTOSPI2. | ||
| 1142 | if METADATA.peripherals.iter().any(|p| p.name == "OCTOSPI2") { | ||
| 1143 | peri = format_ident!("{}", "OCTOSPI2"); | ||
| 1144 | g.extend(quote! { | ||
| 1145 | pin_trait_impl!(#tr, #peri, #pin_name, #af); | ||
| 1146 | }); | ||
| 1147 | } | ||
| 1140 | peri = format_ident!("{}", "OCTOSPI1"); | 1148 | peri = format_ident!("{}", "OCTOSPI1"); |
| 1141 | g.extend(quote! { | ||
| 1142 | pin_trait_impl!(#tr, #peri, #pin_name, #af); | ||
| 1143 | }); | ||
| 1144 | peri = format_ident!("{}", "OCTOSPI2"); | ||
| 1145 | } | 1149 | } |
| 1146 | 1150 | ||
| 1147 | g.extend(quote! { | 1151 | g.extend(quote! { |
diff --git a/embassy-stm32/src/ospi/mod.rs b/embassy-stm32/src/ospi/mod.rs index 48a1ea5e6..e4adc4b09 100644 --- a/embassy-stm32/src/ospi/mod.rs +++ b/embassy-stm32/src/ospi/mod.rs | |||
| @@ -1178,7 +1178,7 @@ impl SealedOctospimInstance for peripherals::OCTOSPI1 { | |||
| 1178 | const OCTOSPI_IDX: u8 = 1; | 1178 | const OCTOSPI_IDX: u8 = 1; |
| 1179 | } | 1179 | } |
| 1180 | 1180 | ||
| 1181 | #[cfg(octospim_v1)] | 1181 | #[cfg(all(octospim_v1, peri_octospi2))] |
| 1182 | impl SealedOctospimInstance for peripherals::OCTOSPI2 { | 1182 | impl SealedOctospimInstance for peripherals::OCTOSPI2 { |
| 1183 | const OCTOSPIM_REGS: Octospim = crate::pac::OCTOSPIM; | 1183 | const OCTOSPIM_REGS: Octospim = crate::pac::OCTOSPIM; |
| 1184 | const OCTOSPI_IDX: u8 = 2; | 1184 | const OCTOSPI_IDX: u8 = 2; |
