From 06fa7f990885ec17220df66094cbe6663719a4da Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sat, 29 Oct 2022 12:22:00 -0400 Subject: cirque: remove ref to stm32 clock struct i don't want this driver to be hardware dependent. --- src/cirque.rs | 4 +--- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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 Cirque where C: OutputPin, { - pub fn new(cs_pin: C, spi: &mut S, clocks: Clocks) -> nb::Result + pub fn new(cs_pin: C, spi: &mut S, sysclk_speed: u32) -> nb::Result where S: spi::FullDuplex, { - 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); -- cgit v1.2.3