diff --git a/ci.sh b/ci.sh index 2693c1be..04294d5c 100755 --- a/ci.sh +++ b/ci.sh @@ -91,6 +91,7 @@ cargo batch \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wle5jb,defmt,exti,time-driver-any,unstable-traits \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32g474pe,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f107vc,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f103re,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f100c4,defmt,exti,time-driver-any,unstable-traits \ diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 9b3caefd..30d4d7b0 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs @@ -597,6 +597,8 @@ fn main() { (("hrtim", "CHD2"), quote!(crate::hrtim::ChannelDComplementaryPin)), (("hrtim", "CHE1"), quote!(crate::hrtim::ChannelEPin)), (("hrtim", "CHE2"), quote!(crate::hrtim::ChannelEComplementaryPin)), + (("hrtim", "CHF1"), quote!(crate::hrtim::ChannelFPin)), + (("hrtim", "CHF2"), quote!(crate::hrtim::ChannelFComplementaryPin)), (("sdmmc", "CK"), quote!(crate::sdmmc::CkPin)), (("sdmmc", "CMD"), quote!(crate::sdmmc::CmdPin)), (("sdmmc", "D0"), quote!(crate::sdmmc::D0Pin)), diff --git a/embassy-stm32/src/hrtim/mod.rs b/embassy-stm32/src/hrtim/mod.rs index a930ff73..31c48814 100644 --- a/embassy-stm32/src/hrtim/mod.rs +++ b/embassy-stm32/src/hrtim/mod.rs @@ -18,6 +18,8 @@ pub enum Source { ChC, ChD, ChE, + #[cfg(hrtim_v2)] + ChF, } pub struct BurstController { @@ -41,6 +43,10 @@ pub struct ChD { pub struct ChE { phantom: PhantomData, } +#[cfg(hrtim_v2)] +pub struct ChF { + phantom: PhantomData, +} mod sealed { use super::Instance; @@ -110,6 +116,8 @@ advanced_channel_impl!(new_chb, ChB, 1, ChannelBPin, ChannelBComplementaryPin); advanced_channel_impl!(new_chc, ChC, 2, ChannelCPin, ChannelCComplementaryPin); advanced_channel_impl!(new_chd, ChD, 3, ChannelDPin, ChannelDComplementaryPin); advanced_channel_impl!(new_che, ChE, 4, ChannelEPin, ChannelEComplementaryPin); +#[cfg(hrtim_v2)] +advanced_channel_impl!(new_chf, ChF, 5, ChannelFPin, ChannelFComplementaryPin); /// Struct used to divide a high resolution timer into multiple channels pub struct AdvancedPwm<'d, T: Instance> { @@ -121,6 +129,8 @@ pub struct AdvancedPwm<'d, T: Instance> { pub ch_c: ChC, pub ch_d: ChD, pub ch_e: ChE, + #[cfg(hrtim_v2)] + pub ch_f: ChF, } impl<'d, T: Instance> AdvancedPwm<'d, T> { @@ -136,6 +146,8 @@ impl<'d, T: Instance> AdvancedPwm<'d, T> { _chdn: Option>>, _che: Option>>, _chen: Option>>, + #[cfg(hrtim_v2)] _chf: Option>>, + #[cfg(hrtim_v2)] _chfn: Option>>, ) -> Self { Self::new_inner(tim) } @@ -167,6 +179,8 @@ impl<'d, T: Instance> AdvancedPwm<'d, T> { ch_c: ChC { phantom: PhantomData }, ch_d: ChD { phantom: PhantomData }, ch_e: ChE { phantom: PhantomData }, + #[cfg(hrtim_v2)] + ch_f: ChF { phantom: PhantomData }, } } } @@ -407,3 +421,7 @@ pin_trait!(ChannelDPin, Instance); pin_trait!(ChannelDComplementaryPin, Instance); pin_trait!(ChannelEPin, Instance); pin_trait!(ChannelEComplementaryPin, Instance); +#[cfg(hrtim_v2)] +pin_trait!(ChannelFPin, Instance); +#[cfg(hrtim_v2)] +pin_trait!(ChannelFComplementaryPin, Instance); diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 34220fbf..fb0279dc 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -39,7 +39,7 @@ pub mod exti; pub mod flash; #[cfg(fmc)] pub mod fmc; -#[cfg(hrtim_v1)] +#[cfg(hrtim)] pub mod hrtim; #[cfg(i2c)] pub mod i2c;