diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-06 09:05:46 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-06 09:05:46 +0100 |
commit | 54936d4997a9a5188a26570c7b61309eb17e69eb (patch) | |
tree | 4b7386debbdee883e67e92605b966d68e7950564 /sw/dart-70 | |
parent | aa999d4c4bdf4ede912f3aa833e7045ccfcca4b1 (diff) | |
download | picardy-54936d4997a9a5188a26570c7b61309eb17e69eb.tar.gz picardy-54936d4997a9a5188a26570c7b61309eb17e69eb.tar.bz2 picardy-54936d4997a9a5188a26570c7b61309eb17e69eb.zip |
Add antenna voltage, separate EN_TX and EN_PA
Diffstat (limited to 'sw/dart-70')
-rw-r--r-- | sw/dart-70/pio.txt | 5 | ||||
-rw-r--r-- | sw/dart-70/src/main.rs | 20 |
2 files changed, 17 insertions, 8 deletions
diff --git a/sw/dart-70/pio.txt b/sw/dart-70/pio.txt index bd8b6a6..4552e12 100644 --- a/sw/dart-70/pio.txt +++ b/sw/dart-70/pio.txt @@ -31,7 +31,8 @@ Microphone switches ## GPIO outputs - * EN_RX PB3 + * EN_PA PB3 + * EN_RX PB4 * EN_TX PB5 * CW_KEYn PA15 * MUTE_SPKR PA2 @@ -43,7 +44,7 @@ To XTAL filter board * GPIO_XTAL PA4 ADC12_IN4 J33 Header -* PB4, PB15 +* PB15 * PA9 USART1_TX * PA10 USART1_RX diff --git a/sw/dart-70/src/main.rs b/sw/dart-70/src/main.rs index 425f1c6..7d6a789 100644 --- a/sw/dart-70/src/main.rs +++ b/sw/dart-70/src/main.rs @@ -64,7 +64,8 @@ struct SharedWithISR { cw_keyer: cw::Keyer, cw_paddle_tip: gpio::gpiob::PB8<gpio::Input<gpio::PullUp>>, cw_paddle_ring: gpio::gpiob::PB9<gpio::Input<gpio::PullUp>>, - en_rx: gpio::gpiob::PB3<gpio::Output<gpio::PushPull>>, + en_pa: gpio::gpiob::PB3<gpio::Output<gpio::PushPull>>, + en_rx: gpio::gpiob::PB4<gpio::Output<gpio::PushPull>>, en_tx: gpio::gpiob::PB5<gpio::Output<gpio::PushPull>>, mute_spkr: gpio::gpioa::PA2<gpio::Output<gpio::PushPull>>, mute_micn: gpio::gpioa::PA1<gpio::Output<gpio::PushPull>>, @@ -135,10 +136,11 @@ fn main() -> ! { let mut led = gpiob.pb14.into_open_drain_output(&mut gpiob.crh); led.set_low(); - let (pa15, pb3, _pb4) = afio.mapr.disable_jtag(gpioa.pa15, gpiob.pb3, gpiob.pb4); + let (pa15, pb3, pb4) = afio.mapr.disable_jtag(gpioa.pa15, gpiob.pb3, gpiob.pb4); let cw_key_n = pa15.into_open_drain_output_with_state(&mut gpioa.crh, PinState::High); - let en_rx = pb3.into_push_pull_output_with_state(&mut gpiob.crl, PinState::Low); + let en_pa = pb3.into_push_pull_output_with_state(&mut gpiob.crl, PinState::Low); + let en_rx = pb4.into_push_pull_output_with_state(&mut gpiob.crl, PinState::Low); let en_tx = gpiob.pb5.into_push_pull_output_with_state(&mut gpiob.crl, PinState::Low); let mute_spkr = gpioa.pa2.into_push_pull_output_with_state(&mut gpioa.crl, PinState::Low); @@ -221,7 +223,7 @@ fn main() -> ! { ui, cw_pwm, cw_keyer : cw::Keyer::new(12, TICKS_PER_SECOND), - cw_paddle_tip, cw_paddle_ring, en_rx, en_tx, mute_spkr, mute_micn, led + cw_paddle_tip, cw_paddle_ring, en_pa, en_rx, en_tx, mute_spkr, mute_micn, led }; si_clock::SiClock::new(i2c_busmanager.acquire_i2c(), shared.state.bfo(), shared.state.vfo()) @@ -391,6 +393,7 @@ fn TIM2() { shared.mute_micn.set_low(); shared.en_rx.set_high(); shared.en_tx.set_low(); + shared.en_pa.set_low(); if button_result.ptt || cw_ptt { SequenceState::MutingSpkr } @@ -403,6 +406,7 @@ fn TIM2() { shared.mute_micn.set_low(); shared.en_rx.set_high(); shared.en_tx.set_low(); + shared.en_pa.set_low(); if button_result.ptt { SequenceState::SwitchingSSB } @@ -416,7 +420,8 @@ fn TIM2() { SequenceState::SwitchingSSB => { shared.mute_spkr.set_high(); shared.en_rx.set_low(); - shared.en_tx.set_low(); + shared.en_tx.set_high(); + shared.en_pa.set_low(); shared.mute_micn.set_high(); if button_result.ptt { @@ -429,7 +434,8 @@ fn TIM2() { SequenceState::SwitchingCW => { shared.mute_spkr.set_high(); shared.en_rx.set_low(); - shared.en_tx.set_low(); + shared.en_tx.set_high(); + shared.en_pa.set_low(); shared.mute_micn.set_low(); if cw_ptt { SequenceState::TxCW @@ -441,6 +447,7 @@ fn TIM2() { SequenceState::TxSSB => { shared.en_rx.set_low(); shared.en_tx.set_high(); + shared.en_pa.set_high(); if button_result.ptt { SequenceState::TxSSB @@ -452,6 +459,7 @@ fn TIM2() { SequenceState::TxCW => { shared.en_rx.set_low(); shared.en_tx.set_high(); + shared.en_pa.set_high(); if cw_ptt { SequenceState::TxCW |