aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eval-clock-cw-tx/src/cw.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sw/eval-clock-cw-tx/src/cw.rs')
-rw-r--r--sw/eval-clock-cw-tx/src/cw.rs13
1 files changed, 3 insertions, 10 deletions
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<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 }