|
1 | 1 | //! D1-H, D1s, F133, F133A/B chip platforms. |
2 | 2 |
|
| 3 | +mod clock; |
| 4 | + |
| 5 | +pub use clock::{Clocks, UartClock}; |
| 6 | + |
3 | 7 | use allwinner_hal::{gpio::PadExt, uart::UartExt}; |
4 | 8 | use core::num::NonZeroU32; |
5 | | -use embedded_time::rate::{Extensions, Hertz}; |
| 9 | +use embedded_time::rate::Extensions; |
6 | 10 |
|
7 | 11 | /// ROM runtime peripheral ownership and configurations. |
8 | 12 | pub struct Peripherals { |
@@ -288,44 +292,6 @@ impl_spi_pads! { |
288 | 292 | // ('C', 7, 3): smhc::Data<3>; |
289 | 293 | // } |
290 | 294 |
|
291 | | -/// ROM clock configuration on current SoC. |
292 | | -#[derive(Debug)] |
293 | | -pub struct Clocks { |
294 | | - /// PSI clock frequency. |
295 | | - pub psi: Hertz, |
296 | | - /// Advanced Peripheral Bus 1 clock frequency. |
297 | | - pub apb1: Hertz, |
298 | | -} |
299 | | - |
300 | | -impl allwinner_hal::uart::Clock for Clocks { |
301 | | - #[inline] |
302 | | - fn uart_clock(&self) -> embedded_time::rate::Hertz { |
303 | | - self.apb1 |
304 | | - } |
305 | | -} |
306 | | - |
307 | | -impl<'a> allwinner_hal::uart::Clock for &'a Clocks { |
308 | | - #[inline] |
309 | | - fn uart_clock(&self) -> embedded_time::rate::Hertz { |
310 | | - self.apb1 |
311 | | - } |
312 | | -} |
313 | | - |
314 | | -impl allwinner_hal::spi::Clock for Clocks { |
315 | | - #[inline] |
316 | | - fn spi_clock(&self) -> embedded_time::rate::Hertz { |
317 | | - // TODO calculate from more clock parameters |
318 | | - self.psi |
319 | | - } |
320 | | -} |
321 | | - |
322 | | -impl allwinner_hal::smhc::Clock for Clocks { |
323 | | - #[inline] |
324 | | - fn smhc_clock(&self) -> embedded_time::rate::Hertz { |
325 | | - self.psi |
326 | | - } |
327 | | -} |
328 | | - |
329 | 295 | #[doc(hidden)] |
330 | 296 | #[inline] |
331 | 297 | pub fn __rom_init_params() -> (Peripherals, Clocks) { |
|
0 commit comments