diff options
author | Brian Cully <bjc@kublai.com> | 2022-10-29 12:22:00 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2022-10-29 12:22:00 -0400 |
commit | 06fa7f990885ec17220df66094cbe6663719a4da (patch) | |
tree | 122c0bb91686b0c70c7e14a3d8fc9e74e1bf45cf /src | |
parent | a9808211aeb98545d431a18e4a2fa8e3b2bd8218 (diff) | |
download | luchie-06fa7f990885ec17220df66094cbe6663719a4da.tar.gz luchie-06fa7f990885ec17220df66094cbe6663719a4da.zip |
cirque: remove ref to stm32 clock struct
i don't want this driver to be hardware dependent.
Diffstat (limited to 'src')
-rw-r--r-- | src/cirque.rs | 4 | ||||
-rwxr-xr-x | src/main.rs | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/cirque.rs b/src/cirque.rs index b19b1f4..23df15b 100644 --- a/src/cirque.rs +++ b/src/cirque.rs @@ -2,7 +2,6 @@ use core::cmp::{max, min}; use embedded_hal::{digital::v2::OutputPin, spi}; use nb; -use stm32f1xx_hal::rcc::Clocks; /// Default I²C address. #[allow(unused)] @@ -141,11 +140,10 @@ impl<C> Cirque<C> where C: OutputPin, { - pub fn new<S>(cs_pin: C, spi: &mut S, clocks: Clocks) -> nb::Result<Self, S::Error> + pub fn new<S>(cs_pin: C, spi: &mut S, sysclk_speed: u32) -> nb::Result<Self, S::Error> where S: spi::FullDuplex<u8>, { - let sysclk_speed = clocks.sysclk().raw(); let mut res = Self { cs_pin, sysclk_speed, diff --git a/src/main.rs b/src/main.rs index 8c2bac1..fdeb257 100755 --- a/src/main.rs +++ b/src/main.rs @@ -89,7 +89,7 @@ fn main() -> ! { 1_000_000.Hz(), // pinnacle supports up to 13mhz clocks, ); - let mut cirque = match Cirque::new(cs_pin, &mut spi, clocks) { + let mut cirque = match Cirque::new(cs_pin, &mut spi, clocks.sysclk().raw()) { Ok(c) => c, Err(e) => { logln!("err: {:?}", e); |