diff options
author | ceekdee <taigatensor@gmail.com> | 2022-10-08 14:32:22 -0500 |
---|---|---|
committer | ceekdee <taigatensor@gmail.com> | 2022-10-08 14:32:22 -0500 |
commit | f554962f54b9f9e8f85a0dd099635619bd1acd1d (patch) | |
tree | 6a5eb23c04618dd6a333061bdf265ead9e527928 /examples | |
parent | bb84d7a0aeee967a2facdfb0590b03493b703e9f (diff) | |
download | embassy-f554962f54b9f9e8f85a0dd099635619bd1acd1d.zip |
Improve generics and consolidate antenna handling
Diffstat (limited to 'examples')
-rw-r--r-- | examples/nrf/src/bin/lora_p2p_report.rs | 8 | ||||
-rw-r--r-- | examples/nrf/src/bin/lora_p2p_sense.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/examples/nrf/src/bin/lora_p2p_report.rs b/examples/nrf/src/bin/lora_p2p_report.rs index 46cb848b..4ba3d30c 100644 --- a/examples/nrf/src/bin/lora_p2p_report.rs +++ b/examples/nrf/src/bin/lora_p2p_report.rs @@ -24,12 +24,12 @@ async fn main(_spawner: Spawner) { let irq = interrupt::take!(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1); let spim = spim::Spim::new(p.TWISPI1, irq, p.P1_11, p.P1_13, p.P1_12, spi_config); - let cs = Output::new(p.P1_10, Level::High, OutputDrive::Standard); - let reset = Output::new(p.P1_06, Level::High, OutputDrive::Standard); + let cs = Output::new(p.P1_10.degrade(), Level::High, OutputDrive::Standard); + let reset = Output::new(p.P1_06.degrade(), Level::High, OutputDrive::Standard); let dio1 = Input::new(p.P1_15.degrade(), Pull::Down); let busy = Input::new(p.P1_14.degrade(), Pull::Down); - let antenna_rx = Output::new(p.P1_05, Level::Low, OutputDrive::Standard); - let antenna_tx = Output::new(p.P1_07, Level::Low, OutputDrive::Standard); + let antenna_rx = Output::new(p.P1_05.degrade(), Level::Low, OutputDrive::Standard); + let antenna_tx = Output::new(p.P1_07.degrade(), Level::Low, OutputDrive::Standard); match Sx126xRadio::new(spim, cs, reset, antenna_rx, antenna_tx, dio1, busy, false).await { Ok(r) => r, diff --git a/examples/nrf/src/bin/lora_p2p_sense.rs b/examples/nrf/src/bin/lora_p2p_sense.rs index 3c6bb876..405a8403 100644 --- a/examples/nrf/src/bin/lora_p2p_sense.rs +++ b/examples/nrf/src/bin/lora_p2p_sense.rs @@ -97,12 +97,12 @@ async fn main(spawner: Spawner) { let irq = interrupt::take!(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1); let spim = spim::Spim::new(p.TWISPI1, irq, p.P1_11, p.P1_13, p.P1_12, spi_config); - let cs = Output::new(p.P1_10, Level::High, OutputDrive::Standard); - let reset = Output::new(p.P1_06, Level::High, OutputDrive::Standard); + let cs = Output::new(p.P1_10.degrade(), Level::High, OutputDrive::Standard); + let reset = Output::new(p.P1_06.degrade(), Level::High, OutputDrive::Standard); let dio1 = Input::new(p.P1_15.degrade(), Pull::Down); let busy = Input::new(p.P1_14.degrade(), Pull::Down); - let antenna_rx = Output::new(p.P1_05, Level::Low, OutputDrive::Standard); - let antenna_tx = Output::new(p.P1_07, Level::Low, OutputDrive::Standard); + let antenna_rx = Output::new(p.P1_05.degrade(), Level::Low, OutputDrive::Standard); + let antenna_tx = Output::new(p.P1_07.degrade(), Level::Low, OutputDrive::Standard); match Sx126xRadio::new(spim, cs, reset, antenna_rx, antenna_tx, dio1, busy, false).await { Ok(r) => r, |