aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eval-clock-cw-tx/src/cw.rs
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-03-03 15:07:57 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-03-03 15:07:57 +0100
commitaa999d4c4bdf4ede912f3aa833e7045ccfcca4b1 (patch)
tree76b114d14cbdec0cb8f74b06e17a0cc662b74fff /sw/eval-clock-cw-tx/src/cw.rs
parent9684038c8ed57e11177e9b786f38bdfcb8fa4c93 (diff)
downloadpicardy-aa999d4c4bdf4ede912f3aa833e7045ccfcca4b1.tar.gz
picardy-aa999d4c4bdf4ede912f3aa833e7045ccfcca4b1.tar.bz2
picardy-aa999d4c4bdf4ede912f3aa833e7045ccfcca4b1.zip
Update eval-clock-cw-tx prerequisites
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 }