diff options
| author | Jan Špaček <[email protected]> | 2024-05-24 22:04:04 +0200 |
|---|---|---|
| committer | Jan Špaček <[email protected]> | 2024-05-25 18:44:55 +0200 |
| commit | 081afca3f065dfd91e157d7c9a9477e2d914c99d (patch) | |
| tree | 574b29636674d3e5a9e3763d00f709635856403e /embassy-stm32/src/fmc.rs | |
| parent | 01c1cb2764300625f80b24e70052f250de27d814 (diff) | |
stm32/rcc: replace generated enable/disable code with runtime info
Diffstat (limited to 'embassy-stm32/src/fmc.rs')
| -rw-r--r-- | embassy-stm32/src/fmc.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-stm32/src/fmc.rs b/embassy-stm32/src/fmc.rs index aced69878..0df64f711 100644 --- a/embassy-stm32/src/fmc.rs +++ b/embassy-stm32/src/fmc.rs | |||
| @@ -4,7 +4,7 @@ use core::marker::PhantomData; | |||
| 4 | use embassy_hal_internal::into_ref; | 4 | use embassy_hal_internal::into_ref; |
| 5 | 5 | ||
| 6 | use crate::gpio::{AFType, Pull, Speed}; | 6 | use crate::gpio::{AFType, Pull, Speed}; |
| 7 | use crate::Peripheral; | 7 | use crate::{rcc, Peripheral}; |
| 8 | 8 | ||
| 9 | /// FMC driver | 9 | /// FMC driver |
| 10 | pub struct Fmc<'d, T: Instance> { | 10 | pub struct Fmc<'d, T: Instance> { |
| @@ -27,7 +27,7 @@ where | |||
| 27 | 27 | ||
| 28 | /// Enable the FMC peripheral and reset it. | 28 | /// Enable the FMC peripheral and reset it. |
| 29 | pub fn enable(&mut self) { | 29 | pub fn enable(&mut self) { |
| 30 | T::enable_and_reset(); | 30 | rcc::enable_and_reset::<T>(); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | /// Enable the memory controller on applicable chips. | 33 | /// Enable the memory controller on applicable chips. |
| @@ -54,7 +54,7 @@ where | |||
| 54 | const REGISTERS: *const () = T::REGS.as_ptr() as *const _; | 54 | const REGISTERS: *const () = T::REGS.as_ptr() as *const _; |
| 55 | 55 | ||
| 56 | fn enable(&mut self) { | 56 | fn enable(&mut self) { |
| 57 | T::enable_and_reset(); | 57 | rcc::enable_and_reset::<T>(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | fn memory_controller_enable(&mut self) { | 60 | fn memory_controller_enable(&mut self) { |
| @@ -200,7 +200,7 @@ impl<'d, T: Instance> Fmc<'d, T> { | |||
| 200 | )); | 200 | )); |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | trait SealedInstance: crate::rcc::SealedRccPeripheral { | 203 | trait SealedInstance: crate::rcc::RccPeripheral { |
| 204 | const REGS: crate::pac::fmc::Fmc; | 204 | const REGS: crate::pac::fmc::Fmc; |
| 205 | } | 205 | } |
| 206 | 206 | ||
