From 54936d4997a9a5188a26570c7b61309eb17e69eb Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 6 Mar 2023 09:05:46 +0100 Subject: Add antenna voltage, separate EN_TX and EN_PA --- sw/dart-70/pio.txt | 5 +++-- sw/dart-70/src/main.rs | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'sw/dart-70') 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>, cw_paddle_ring: gpio::gpiob::PB9>, - en_rx: gpio::gpiob::PB3>, + en_pa: gpio::gpiob::PB3>, + en_rx: gpio::gpiob::PB4>, en_tx: gpio::gpiob::PB5>, mute_spkr: gpio::gpioa::PA2>, mute_micn: gpio::gpioa::PA1>, @@ -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 -- cgit v1.2.3