diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-02-01 23:47:30 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-02-01 23:47:30 +0100 |
| commit | e05c8e2f44d3b210affa10a6e7fc7e9a3c991683 (patch) | |
| tree | 3e52cbfa257d2838dba62d632b60eececc886aa2 /embassy-stm32/src/dac/mod.rs | |
| parent | e7d1119750dff876e76adbb04f57ac274e913772 (diff) | |
stm32/dac: use autogenerated RCC impls.
Diffstat (limited to 'embassy-stm32/src/dac/mod.rs')
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 23 |
1 files changed, 0 insertions, 23 deletions
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 |
