From aa999d4c4bdf4ede912f3aa833e7045ccfcca4b1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 3 Mar 2023 15:07:57 +0100 Subject: Update eval-clock-cw-tx prerequisites --- sw/eval-clock-cw-tx/src/cw.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sw/eval-clock-cw-tx/src/cw.rs') diff --git a/sw/eval-clock-cw-tx/src/cw.rs b/sw/eval-clock-cw-tx/src/cw.rs index 337a3ab..23a74a9 100644 --- a/sw/eval-clock-cw-tx/src/cw.rs +++ b/sw/eval-clock-cw-tx/src/cw.rs @@ -1,25 +1,18 @@ //! CW output using PWM on PA8, TIM1 CH1 use stm32f1xx_hal::{ - prelude::*, timer, pac::TIM1, - gpio::gpioa::*, - gpio::{Alternate, PushPull}, - afio::MAPR, - pwm, }; -const SIDETONE_FREQ : u32 = 1000; +pub const SIDETONE_FREQ : u32 = 1000; pub struct CWPWM { - channel : pwm::PwmChannel, + channel : timer::pwm::PwmChannel, } impl CWPWM { - pub fn new(pa8: PA8>, tim1: timer::Timer, mapr: &mut MAPR) -> Self { - let pwm = tim1.pwm(pa8, mapr, SIDETONE_FREQ.hz()); - let mut channel = pwm.split(); + pub fn new(mut channel: timer::pwm::PwmChannel) -> Self { channel.enable(); channel.set_duty(0); CWPWM { channel } -- cgit v1.2.3