diff options
| -rw-r--r-- | embassy-stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 23 |
2 files changed, 2 insertions, 25 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 698febf71..aed9f7a46 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -68,7 +68,7 @@ rand_core = "0.6.3" | |||
| 68 | sdio-host = "0.5.0" | 68 | sdio-host = "0.5.0" |
| 69 | critical-section = "1.1" | 69 | critical-section = "1.1" |
| 70 | #stm32-metapac = { version = "15" } | 70 | #stm32-metapac = { version = "15" } |
| 71 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15" } | 71 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-768b3e8e3199e03de0acd0d4590d06f51eebb7dd" } |
| 72 | vcell = "0.1.3" | 72 | vcell = "0.1.3" |
| 73 | bxcan = "0.7.0" | 73 | bxcan = "0.7.0" |
| 74 | nb = "1.0.0" | 74 | nb = "1.0.0" |
| @@ -89,7 +89,7 @@ critical-section = { version = "1.1", features = ["std"] } | |||
| 89 | proc-macro2 = "1.0.36" | 89 | proc-macro2 = "1.0.36" |
| 90 | quote = "1.0.15" | 90 | quote = "1.0.15" |
| 91 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} | 91 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} |
| 92 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15", default-features = false, features = ["metadata"]} | 92 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-768b3e8e3199e03de0acd0d4590d06f51eebb7dd", default-features = false, features = ["metadata"]} |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | [features] | 95 | [features] |
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index 31dedf06e..60f9404c2 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -504,29 +504,6 @@ pub trait DacPin<T: Instance, const C: u8>: crate::gpio::Pin + 'static {} | |||
| 504 | 504 | ||
| 505 | foreach_peripheral!( | 505 | foreach_peripheral!( |
| 506 | (dac, $inst:ident) => { | 506 | (dac, $inst:ident) => { |
| 507 | // H7 uses single bit for both DAC1 and DAC2, this is a hack until a proper fix is implemented | ||
| 508 | #[cfg(any(rcc_h7, rcc_h7rm0433))] | ||
| 509 | impl crate::rcc::sealed::RccPeripheral for peripherals::$inst { | ||
| 510 | fn frequency() -> crate::time::Hertz { | ||
| 511 | critical_section::with(|_| unsafe { crate::rcc::get_freqs().pclk1 }) | ||
| 512 | } | ||
| 513 | |||
| 514 | fn enable_and_reset_with_cs(_cs: critical_section::CriticalSection) { | ||
| 515 | // TODO: Increment refcount? | ||
| 516 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(true)); | ||
| 517 | crate::pac::RCC.apb1lrstr().modify(|w| w.set_dac12rst(false)); | ||
| 518 | crate::pac::RCC.apb1lenr().modify(|w| w.set_dac12en(true)); | ||
| 519 | } | ||
| 520 | |||
| 521 | fn disable_with_cs(_cs: critical_section::CriticalSection) { | ||
| 522 | // TODO: Decrement refcount? | ||
| 523 | crate::pac::RCC.apb1lenr().modify(|w| w.set_dac12en(false)) | ||
| 524 | } | ||
| 525 | } | ||
| 526 | |||
| 527 | #[cfg(any(rcc_h7, rcc_h7rm0433))] | ||
| 528 | impl crate::rcc::RccPeripheral for peripherals::$inst {} | ||
| 529 | |||
| 530 | impl crate::dac::sealed::Instance for peripherals::$inst { | 507 | impl crate::dac::sealed::Instance for peripherals::$inst { |
| 531 | fn regs() -> &'static crate::pac::dac::Dac { | 508 | fn regs() -> &'static crate::pac::dac::Dac { |
| 532 | &crate::pac::$inst | 509 | &crate::pac::$inst |
