diff options
Diffstat (limited to 'sw/picardy/src/cw.rs')
-rw-r--r-- | sw/picardy/src/cw.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sw/picardy/src/cw.rs b/sw/picardy/src/cw.rs index 508b939..4656f81 100644 --- a/sw/picardy/src/cw.rs +++ b/sw/picardy/src/cw.rs @@ -1,13 +1,8 @@ //! CW output using PWM on PA8, TIM1 CH1 use stm32f1xx_hal::{ - prelude::*, timer, pac::TIM1, - gpio::gpioa::*, - gpio::{Alternate, PushPull}, - afio::MAPR, - pwm, }; const CW_MAPPING : [u8; 50] = [ //{{{ @@ -75,16 +70,14 @@ const CW_MAPPING : [u8; 50] = [ //{{{ const CW_MACRO : &[u8; 28] = b"CQ DE HB9EGM HB9EGM HB9EGM K"; -const SIDETONE_FREQ : u32 = 800; +pub const SIDETONE_FREQ : u32 = 800; pub struct CWPWM { - channel : pwm::PwmChannel<TIM1, pwm::C1>, + channel : timer::pwm::PwmChannel<TIM1, { timer::pwm::C1 }>, } impl CWPWM { - pub fn new(pa8: PA8<Alternate<PushPull>>, tim1: timer::Timer<TIM1>, 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<TIM1, { timer::pwm::C1 }>) -> Self { channel.enable(); channel.set_duty(0); CWPWM { channel } |