diff options
| author | Caleb Jamison <[email protected]> | 2024-08-08 21:54:21 -0400 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-08-08 21:54:21 -0400 |
| commit | 6f03c40516b49104b33a51f6e189a7fc812c1068 (patch) | |
| tree | f5ff626d24e418f0f32bd4b83f1e3e1bc06502cb /examples | |
| parent | b185e02a42ad751ec6c31ffa6a1b87503f15489d (diff) | |
cargo fmt
Diffstat (limited to 'examples')
43 files changed, 44 insertions, 84 deletions
diff --git a/examples/rp23/src/bin/adc.rs b/examples/rp23/src/bin/adc.rs index a1a94ca47..19872607e 100644 --- a/examples/rp23/src/bin/adc.rs +++ b/examples/rp23/src/bin/adc.rs | |||
| @@ -8,10 +8,10 @@ use defmt::*; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; | 9 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; |
| 10 | use embassy_rp::bind_interrupts; | 10 | use embassy_rp::bind_interrupts; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::gpio::Pull; | 12 | use embassy_rp::gpio::Pull; |
| 12 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | bind_interrupts!(struct Irqs { | 30 | bind_interrupts!(struct Irqs { |
| 32 | ADC_IRQ_FIFO => InterruptHandler; | 31 | ADC_IRQ_FIFO => InterruptHandler; |
| 33 | }); | 32 | }); |
diff --git a/examples/rp23/src/bin/adc_dma.rs b/examples/rp23/src/bin/adc_dma.rs index 887c8500a..d538ddaa2 100644 --- a/examples/rp23/src/bin/adc_dma.rs +++ b/examples/rp23/src/bin/adc_dma.rs | |||
| @@ -8,10 +8,10 @@ use defmt::*; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; | 9 | use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler}; |
| 10 | use embassy_rp::bind_interrupts; | 10 | use embassy_rp::bind_interrupts; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::gpio::Pull; | 12 | use embassy_rp::gpio::Pull; |
| 12 | use embassy_time::{Duration, Ticker}; | 13 | use embassy_time::{Duration, Ticker}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | bind_interrupts!(struct Irqs { | 30 | bind_interrupts!(struct Irqs { |
| 32 | ADC_IRQ_FIFO => InterruptHandler; | 31 | ADC_IRQ_FIFO => InterruptHandler; |
| 33 | }); | 32 | }); |
diff --git a/examples/rp23/src/bin/assign_resources.rs b/examples/rp23/src/bin/assign_resources.rs index 8aea2f35d..923c13514 100644 --- a/examples/rp23/src/bin/assign_resources.rs +++ b/examples/rp23/src/bin/assign_resources.rs | |||
| @@ -14,11 +14,11 @@ | |||
| 14 | use assign_resources::assign_resources; | 14 | use assign_resources::assign_resources; |
| 15 | use defmt::*; | 15 | use defmt::*; |
| 16 | use embassy_executor::Spawner; | 16 | use embassy_executor::Spawner; |
| 17 | use embassy_rp::block::ImageDef; | ||
| 17 | use embassy_rp::gpio::{Level, Output}; | 18 | use embassy_rp::gpio::{Level, Output}; |
| 18 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; | 19 | use embassy_rp::peripherals::{self, PIN_20, PIN_21}; |
| 19 | use embassy_time::Timer; | 20 | use embassy_time::Timer; |
| 20 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | use embassy_rp::block::ImageDef; | ||
| 22 | 22 | ||
| 23 | #[link_section = ".start_block"] | 23 | #[link_section = ".start_block"] |
| 24 | #[used] | 24 | #[used] |
| @@ -34,7 +34,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 34 | embassy_rp::binary_info_rp_program_build_attribute!(), | 34 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 35 | ]; | 35 | ]; |
| 36 | 36 | ||
| 37 | |||
| 38 | #[embassy_executor::main] | 37 | #[embassy_executor::main] |
| 39 | async fn main(spawner: Spawner) { | 38 | async fn main(spawner: Spawner) { |
| 40 | // initialize the peripherals | 39 | // initialize the peripherals |
diff --git a/examples/rp23/src/bin/blinky.rs b/examples/rp23/src/bin/blinky.rs index 1e3a52085..02bdf9b3d 100644 --- a/examples/rp23/src/bin/blinky.rs +++ b/examples/rp23/src/bin/blinky.rs | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio; | 11 | use embassy_rp::gpio; |
| 11 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 12 | use gpio::{Level, Output}; | 13 | use gpio::{Level, Output}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
diff --git a/examples/rp23/src/bin/blinky_two_channels.rs b/examples/rp23/src/bin/blinky_two_channels.rs index aae0283cf..4d7dc89fa 100644 --- a/examples/rp23/src/bin/blinky_two_channels.rs +++ b/examples/rp23/src/bin/blinky_two_channels.rs | |||
| @@ -7,13 +7,13 @@ | |||
| 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) | 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) |
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio; | 11 | use embassy_rp::gpio; |
| 11 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 12 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 12 | use embassy_sync::channel::{Channel, Sender}; | 13 | use embassy_sync::channel::{Channel, Sender}; |
| 13 | use embassy_time::{Duration, Ticker}; | 14 | use embassy_time::{Duration, Ticker}; |
| 14 | use gpio::{AnyPin, Level, Output}; | 15 | use gpio::{AnyPin, Level, Output}; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | use embassy_rp::block::ImageDef; | ||
| 17 | 17 | ||
| 18 | #[link_section = ".start_block"] | 18 | #[link_section = ".start_block"] |
| 19 | #[used] | 19 | #[used] |
| @@ -29,7 +29,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 29 | embassy_rp::binary_info_rp_program_build_attribute!(), | 29 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 30 | ]; | 30 | ]; |
| 31 | 31 | ||
| 32 | |||
| 33 | enum LedState { | 32 | enum LedState { |
| 34 | Toggle, | 33 | Toggle, |
| 35 | } | 34 | } |
diff --git a/examples/rp23/src/bin/blinky_two_tasks.rs b/examples/rp23/src/bin/blinky_two_tasks.rs index aeabb238f..24b960242 100644 --- a/examples/rp23/src/bin/blinky_two_tasks.rs +++ b/examples/rp23/src/bin/blinky_two_tasks.rs | |||
| @@ -7,13 +7,13 @@ | |||
| 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) | 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) |
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio; | 11 | use embassy_rp::gpio; |
| 11 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 12 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 12 | use embassy_sync::mutex::Mutex; | 13 | use embassy_sync::mutex::Mutex; |
| 13 | use embassy_time::{Duration, Ticker}; | 14 | use embassy_time::{Duration, Ticker}; |
| 14 | use gpio::{AnyPin, Level, Output}; | 15 | use gpio::{AnyPin, Level, Output}; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | use embassy_rp::block::ImageDef; | ||
| 17 | 17 | ||
| 18 | #[link_section = ".start_block"] | 18 | #[link_section = ".start_block"] |
| 19 | #[used] | 19 | #[used] |
| @@ -29,7 +29,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 29 | embassy_rp::binary_info_rp_program_build_attribute!(), | 29 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 30 | ]; | 30 | ]; |
| 31 | 31 | ||
| 32 | |||
| 33 | type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>; | 32 | type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>; |
| 34 | static LED: LedType = Mutex::new(None); | 33 | static LED: LedType = Mutex::new(None); |
| 35 | 34 | ||
diff --git a/examples/rp23/src/bin/button.rs b/examples/rp23/src/bin/button.rs index 2a78a19db..0a0559397 100644 --- a/examples/rp23/src/bin/button.rs +++ b/examples/rp23/src/bin/button.rs | |||
| @@ -6,9 +6,9 @@ | |||
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | 7 | ||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::block::ImageDef; | ||
| 9 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 10 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 12 | 12 | ||
| 13 | #[link_section = ".start_block"] | 13 | #[link_section = ".start_block"] |
| 14 | #[used] | 14 | #[used] |
| @@ -24,7 +24,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 24 | embassy_rp::binary_info_rp_program_build_attribute!(), | 24 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 25 | ]; | 25 | ]; |
| 26 | 26 | ||
| 27 | |||
| 28 | #[embassy_executor::main] | 27 | #[embassy_executor::main] |
| 29 | async fn main(_spawner: Spawner) { | 28 | async fn main(_spawner: Spawner) { |
| 30 | let p = embassy_rp::init(Default::default()); | 29 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/debounce.rs b/examples/rp23/src/bin/debounce.rs index 0e3b5cb54..e82e71f61 100644 --- a/examples/rp23/src/bin/debounce.rs +++ b/examples/rp23/src/bin/debounce.rs | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | 6 | ||
| 7 | use defmt::info; | 7 | use defmt::info; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::block::ImageDef; | ||
| 9 | use embassy_rp::gpio::{Input, Level, Pull}; | 10 | use embassy_rp::gpio::{Input, Level, Pull}; |
| 10 | use embassy_time::{with_deadline, Duration, Instant, Timer}; | 11 | use embassy_time::{with_deadline, Duration, Instant, Timer}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | pub struct Debouncer<'a> { | 28 | pub struct Debouncer<'a> { |
| 30 | input: Input<'a>, | 29 | input: Input<'a>, |
| 31 | debounce: Duration, | 30 | debounce: Duration, |
diff --git a/examples/rp23/src/bin/flash.rs b/examples/rp23/src/bin/flash.rs index 42620ca93..2917dda0b 100644 --- a/examples/rp23/src/bin/flash.rs +++ b/examples/rp23/src/bin/flash.rs | |||
| @@ -5,11 +5,11 @@ | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::flash::{Async, ERASE_SIZE, FLASH_BASE}; | 9 | use embassy_rp::flash::{Async, ERASE_SIZE, FLASH_BASE}; |
| 9 | use embassy_rp::peripherals::FLASH; | 10 | use embassy_rp::peripherals::FLASH; |
| 10 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | const ADDR_OFFSET: u32 = 0x100000; | 28 | const ADDR_OFFSET: u32 = 0x100000; |
| 30 | const FLASH_SIZE: usize = 2 * 1024 * 1024; | 29 | const FLASH_SIZE: usize = 2 * 1024 * 1024; |
| 31 | 30 | ||
diff --git a/examples/rp23/src/bin/gpio_async.rs b/examples/rp23/src/bin/gpio_async.rs index 360932d62..1618f7c8b 100644 --- a/examples/rp23/src/bin/gpio_async.rs +++ b/examples/rp23/src/bin/gpio_async.rs | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio; | 11 | use embassy_rp::gpio; |
| 11 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 12 | use gpio::{Input, Level, Output, Pull}; | 13 | use gpio::{Input, Level, Output, Pull}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | /// It requires an external signal to be manually triggered on PIN 16. For | 30 | /// It requires an external signal to be manually triggered on PIN 16. For |
| 32 | /// example, this could be accomplished using an external power source with a | 31 | /// example, this could be accomplished using an external power source with a |
| 33 | /// button so that it is possible to toggle the signal from low to high. | 32 | /// button so that it is possible to toggle the signal from low to high. |
diff --git a/examples/rp23/src/bin/gpout.rs b/examples/rp23/src/bin/gpout.rs index 8d1e4d05f..b15963f02 100644 --- a/examples/rp23/src/bin/gpout.rs +++ b/examples/rp23/src/bin/gpout.rs | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::clocks; | 11 | use embassy_rp::clocks; |
| 11 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 14 | 14 | ||
| 15 | #[link_section = ".start_block"] | 15 | #[link_section = ".start_block"] |
| 16 | #[used] | 16 | #[used] |
| @@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 26 | embassy_rp::binary_info_rp_program_build_attribute!(), | 26 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 27 | ]; | 27 | ]; |
| 28 | 28 | ||
| 29 | |||
| 30 | #[embassy_executor::main] | 29 | #[embassy_executor::main] |
| 31 | async fn main(_spawner: Spawner) { | 30 | async fn main(_spawner: Spawner) { |
| 32 | let p = embassy_rp::init(Default::default()); | 31 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/i2c_async.rs b/examples/rp23/src/bin/i2c_async.rs index 64f103849..2528fe1d2 100644 --- a/examples/rp23/src/bin/i2c_async.rs +++ b/examples/rp23/src/bin/i2c_async.rs | |||
| @@ -9,12 +9,12 @@ | |||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::bind_interrupts; | 11 | use embassy_rp::bind_interrupts; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 12 | use embassy_rp::i2c::{self, Config, InterruptHandler}; | 13 | use embassy_rp::i2c::{self, Config, InterruptHandler}; |
| 13 | use embassy_rp::peripherals::I2C1; | 14 | use embassy_rp::peripherals::I2C1; |
| 14 | use embassy_time::Timer; | 15 | use embassy_time::Timer; |
| 15 | use embedded_hal_async::i2c::I2c; | 16 | use embedded_hal_async::i2c::I2c; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | use embassy_rp::block::ImageDef; | ||
| 18 | 18 | ||
| 19 | #[link_section = ".start_block"] | 19 | #[link_section = ".start_block"] |
| 20 | #[used] | 20 | #[used] |
| @@ -30,7 +30,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 30 | embassy_rp::binary_info_rp_program_build_attribute!(), | 30 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 31 | ]; | 31 | ]; |
| 32 | 32 | ||
| 33 | |||
| 34 | bind_interrupts!(struct Irqs { | 33 | bind_interrupts!(struct Irqs { |
| 35 | I2C1_IRQ => InterruptHandler<I2C1>; | 34 | I2C1_IRQ => InterruptHandler<I2C1>; |
| 36 | }); | 35 | }); |
diff --git a/examples/rp23/src/bin/i2c_async_embassy.rs b/examples/rp23/src/bin/i2c_async_embassy.rs index 4b14ec6f6..461b1d171 100644 --- a/examples/rp23/src/bin/i2c_async_embassy.rs +++ b/examples/rp23/src/bin/i2c_async_embassy.rs | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | #![no_main] | 7 | #![no_main] |
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::i2c::InterruptHandler; | 11 | use embassy_rp::i2c::InterruptHandler; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | // Our anonymous hypotetical temperature sensor could be: | 28 | // Our anonymous hypotetical temperature sensor could be: |
| 30 | // a 12-bit sensor, with 100ms startup time, range of -40*C - 125*C, and precision 0.25*C | 29 | // a 12-bit sensor, with 100ms startup time, range of -40*C - 125*C, and precision 0.25*C |
| 31 | // It requires no configuration or calibration, works with all i2c bus speeds, | 30 | // It requires no configuration or calibration, works with all i2c bus speeds, |
diff --git a/examples/rp23/src/bin/i2c_blocking.rs b/examples/rp23/src/bin/i2c_blocking.rs index d2cccf09b..6d36d1890 100644 --- a/examples/rp23/src/bin/i2c_blocking.rs +++ b/examples/rp23/src/bin/i2c_blocking.rs | |||
| @@ -8,11 +8,11 @@ | |||
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::i2c::{self, Config}; | 12 | use embassy_rp::i2c::{self, Config}; |
| 12 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 13 | use embedded_hal_1::i2c::I2c; | 14 | use embedded_hal_1::i2c::I2c; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | use embassy_rp::block::ImageDef; | ||
| 16 | 16 | ||
| 17 | #[link_section = ".start_block"] | 17 | #[link_section = ".start_block"] |
| 18 | #[used] | 18 | #[used] |
| @@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 28 | embassy_rp::binary_info_rp_program_build_attribute!(), | 28 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 29 | ]; | 29 | ]; |
| 30 | 30 | ||
| 31 | |||
| 32 | #[allow(dead_code)] | 31 | #[allow(dead_code)] |
| 33 | mod mcp23017 { | 32 | mod mcp23017 { |
| 34 | pub const ADDR: u8 = 0x20; // default addr | 33 | pub const ADDR: u8 = 0x20; // default addr |
diff --git a/examples/rp23/src/bin/i2c_slave.rs b/examples/rp23/src/bin/i2c_slave.rs index 4bf407bcc..1f3408cf3 100644 --- a/examples/rp23/src/bin/i2c_slave.rs +++ b/examples/rp23/src/bin/i2c_slave.rs | |||
| @@ -4,12 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_rp::block::ImageDef; | ||
| 7 | use embassy_rp::peripherals::{I2C0, I2C1}; | 8 | use embassy_rp::peripherals::{I2C0, I2C1}; |
| 8 | use embassy_rp::{bind_interrupts, i2c, i2c_slave}; | 9 | use embassy_rp::{bind_interrupts, i2c, i2c_slave}; |
| 9 | use embassy_time::Timer; | 10 | use embassy_time::Timer; |
| 10 | use embedded_hal_async::i2c::I2c; | 11 | use embedded_hal_async::i2c::I2c; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::{block::ImageDef}; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
diff --git a/examples/rp23/src/bin/interrupt.rs b/examples/rp23/src/bin/interrupt.rs index f46117f95..6184b1bd7 100644 --- a/examples/rp23/src/bin/interrupt.rs +++ b/examples/rp23/src/bin/interrupt.rs | |||
| @@ -13,6 +13,7 @@ use core::cell::{Cell, RefCell}; | |||
| 13 | use defmt::*; | 13 | use defmt::*; |
| 14 | use embassy_executor::Spawner; | 14 | use embassy_executor::Spawner; |
| 15 | use embassy_rp::adc::{self, Adc, Blocking}; | 15 | use embassy_rp::adc::{self, Adc, Blocking}; |
| 16 | use embassy_rp::block::ImageDef; | ||
| 16 | use embassy_rp::gpio::Pull; | 17 | use embassy_rp::gpio::Pull; |
| 17 | use embassy_rp::interrupt; | 18 | use embassy_rp::interrupt; |
| 18 | use embassy_rp::pwm::{Config, Pwm}; | 19 | use embassy_rp::pwm::{Config, Pwm}; |
| @@ -23,7 +24,6 @@ use embassy_time::{Duration, Ticker}; | |||
| 23 | use portable_atomic::{AtomicU32, Ordering}; | 24 | use portable_atomic::{AtomicU32, Ordering}; |
| 24 | use static_cell::StaticCell; | 25 | use static_cell::StaticCell; |
| 25 | use {defmt_rtt as _, panic_probe as _}; | 26 | use {defmt_rtt as _, panic_probe as _}; |
| 26 | use embassy_rp::block::ImageDef; | ||
| 27 | 27 | ||
| 28 | #[link_section = ".start_block"] | 28 | #[link_section = ".start_block"] |
| 29 | #[used] | 29 | #[used] |
| @@ -39,7 +39,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 39 | embassy_rp::binary_info_rp_program_build_attribute!(), | 39 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 40 | ]; | 40 | ]; |
| 41 | 41 | ||
| 42 | |||
| 43 | static COUNTER: AtomicU32 = AtomicU32::new(0); | 42 | static COUNTER: AtomicU32 = AtomicU32::new(0); |
| 44 | static PWM: Mutex<CriticalSectionRawMutex, RefCell<Option<Pwm>>> = Mutex::new(RefCell::new(None)); | 43 | static PWM: Mutex<CriticalSectionRawMutex, RefCell<Option<Pwm>>> = Mutex::new(RefCell::new(None)); |
| 45 | static ADC: Mutex<CriticalSectionRawMutex, RefCell<Option<(Adc<Blocking>, adc::Channel)>>> = | 44 | static ADC: Mutex<CriticalSectionRawMutex, RefCell<Option<(Adc<Blocking>, adc::Channel)>>> = |
diff --git a/examples/rp23/src/bin/multicore.rs b/examples/rp23/src/bin/multicore.rs index 0b20ecaae..8649143e1 100644 --- a/examples/rp23/src/bin/multicore.rs +++ b/examples/rp23/src/bin/multicore.rs | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio::{Level, Output}; | 11 | use embassy_rp::gpio::{Level, Output}; |
| 11 | use embassy_rp::multicore::{spawn_core1, Stack}; | 12 | use embassy_rp::multicore::{spawn_core1, Stack}; |
| 12 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 13 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| @@ -14,7 +15,6 @@ use embassy_sync::channel::Channel; | |||
| 14 | use embassy_time::Timer; | 15 | use embassy_time::Timer; |
| 15 | use static_cell::StaticCell; | 16 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | use embassy_rp::block::ImageDef; | ||
| 18 | 18 | ||
| 19 | #[link_section = ".start_block"] | 19 | #[link_section = ".start_block"] |
| 20 | #[used] | 20 | #[used] |
| @@ -30,7 +30,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 30 | embassy_rp::binary_info_rp_program_build_attribute!(), | 30 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 31 | ]; | 31 | ]; |
| 32 | 32 | ||
| 33 | |||
| 34 | static mut CORE1_STACK: Stack<4096> = Stack::new(); | 33 | static mut CORE1_STACK: Stack<4096> = Stack::new(); |
| 35 | static EXECUTOR0: StaticCell<Executor> = StaticCell::new(); | 34 | static EXECUTOR0: StaticCell<Executor> = StaticCell::new(); |
| 36 | static EXECUTOR1: StaticCell<Executor> = StaticCell::new(); | 35 | static EXECUTOR1: StaticCell<Executor> = StaticCell::new(); |
diff --git a/examples/rp23/src/bin/multiprio.rs b/examples/rp23/src/bin/multiprio.rs index 52c801973..7590fb431 100644 --- a/examples/rp23/src/bin/multiprio.rs +++ b/examples/rp23/src/bin/multiprio.rs | |||
| @@ -59,12 +59,12 @@ | |||
| 59 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 60 | use defmt::{info, unwrap}; | 60 | use defmt::{info, unwrap}; |
| 61 | use embassy_executor::{Executor, InterruptExecutor}; | 61 | use embassy_executor::{Executor, InterruptExecutor}; |
| 62 | use embassy_rp::block::ImageDef; | ||
| 62 | use embassy_rp::interrupt; | 63 | use embassy_rp::interrupt; |
| 63 | use embassy_rp::interrupt::{InterruptExt, Priority}; | 64 | use embassy_rp::interrupt::{InterruptExt, Priority}; |
| 64 | use embassy_time::{Instant, Timer, TICK_HZ}; | 65 | use embassy_time::{Instant, Timer, TICK_HZ}; |
| 65 | use static_cell::StaticCell; | 66 | use static_cell::StaticCell; |
| 66 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| 67 | use embassy_rp::block::ImageDef; | ||
| 68 | 68 | ||
| 69 | #[link_section = ".start_block"] | 69 | #[link_section = ".start_block"] |
| 70 | #[used] | 70 | #[used] |
| @@ -80,7 +80,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 80 | embassy_rp::binary_info_rp_program_build_attribute!(), | 80 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 81 | ]; | 81 | ]; |
| 82 | 82 | ||
| 83 | |||
| 84 | #[embassy_executor::task] | 83 | #[embassy_executor::task] |
| 85 | async fn run_high() { | 84 | async fn run_high() { |
| 86 | loop { | 85 | loop { |
diff --git a/examples/rp23/src/bin/pio_async.rs b/examples/rp23/src/bin/pio_async.rs index f3a48bbce..005708bc2 100644 --- a/examples/rp23/src/bin/pio_async.rs +++ b/examples/rp23/src/bin/pio_async.rs | |||
| @@ -5,12 +5,12 @@ | |||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_rp::bind_interrupts; | 7 | use embassy_rp::bind_interrupts; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::peripherals::PIO0; | 9 | use embassy_rp::peripherals::PIO0; |
| 9 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; | 10 | use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine}; |
| 10 | use fixed::traits::ToFixed; | 11 | use fixed::traits::ToFixed; |
| 11 | use fixed_macro::types::U56F8; | 12 | use fixed_macro::types::U56F8; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 14 | 14 | ||
| 15 | #[link_section = ".start_block"] | 15 | #[link_section = ".start_block"] |
| 16 | #[used] | 16 | #[used] |
| @@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 26 | embassy_rp::binary_info_rp_program_build_attribute!(), | 26 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 27 | ]; | 27 | ]; |
| 28 | 28 | ||
| 29 | |||
| 30 | bind_interrupts!(struct Irqs { | 29 | bind_interrupts!(struct Irqs { |
| 31 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 30 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 32 | }); | 31 | }); |
diff --git a/examples/rp23/src/bin/pio_dma.rs b/examples/rp23/src/bin/pio_dma.rs index d5a831d09..48fd9123f 100644 --- a/examples/rp23/src/bin/pio_dma.rs +++ b/examples/rp23/src/bin/pio_dma.rs | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::peripherals::PIO0; | 9 | use embassy_rp::peripherals::PIO0; |
| 9 | use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; | 10 | use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; |
| 10 | use embassy_rp::{bind_interrupts, Peripheral}; | 11 | use embassy_rp::{bind_interrupts, Peripheral}; |
| 11 | use fixed::traits::ToFixed; | 12 | use fixed::traits::ToFixed; |
| 12 | use fixed_macro::types::U56F8; | 13 | use fixed_macro::types::U56F8; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | bind_interrupts!(struct Irqs { | 30 | bind_interrupts!(struct Irqs { |
| 32 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 31 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 33 | }); | 32 | }); |
diff --git a/examples/rp23/src/bin/pio_hd44780.rs b/examples/rp23/src/bin/pio_hd44780.rs index f601bbc66..fc658267d 100644 --- a/examples/rp23/src/bin/pio_hd44780.rs +++ b/examples/rp23/src/bin/pio_hd44780.rs | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | use core::fmt::Write; | 7 | use core::fmt::Write; |
| 8 | 8 | ||
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::dma::{AnyChannel, Channel}; | 11 | use embassy_rp::dma::{AnyChannel, Channel}; |
| 11 | use embassy_rp::peripherals::PIO0; | 12 | use embassy_rp::peripherals::PIO0; |
| 12 | use embassy_rp::pio::{ | 13 | use embassy_rp::pio::{ |
| @@ -16,7 +17,6 @@ use embassy_rp::pwm::{self, Pwm}; | |||
| 16 | use embassy_rp::{bind_interrupts, into_ref, Peripheral, PeripheralRef}; | 17 | use embassy_rp::{bind_interrupts, into_ref, Peripheral, PeripheralRef}; |
| 17 | use embassy_time::{Instant, Timer}; | 18 | use embassy_time::{Instant, Timer}; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | use embassy_rp::block::ImageDef; | ||
| 20 | 20 | ||
| 21 | #[link_section = ".start_block"] | 21 | #[link_section = ".start_block"] |
| 22 | #[used] | 22 | #[used] |
| @@ -32,7 +32,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 32 | embassy_rp::binary_info_rp_program_build_attribute!(), | 32 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 33 | ]; | 33 | ]; |
| 34 | 34 | ||
| 35 | |||
| 36 | bind_interrupts!(pub struct Irqs { | 35 | bind_interrupts!(pub struct Irqs { |
| 37 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 36 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 38 | }); | 37 | }); |
diff --git a/examples/rp23/src/bin/pio_i2s.rs b/examples/rp23/src/bin/pio_i2s.rs index b12b050e6..5a3bde759 100644 --- a/examples/rp23/src/bin/pio_i2s.rs +++ b/examples/rp23/src/bin/pio_i2s.rs | |||
| @@ -13,13 +13,13 @@ | |||
| 13 | use core::mem; | 13 | use core::mem; |
| 14 | 14 | ||
| 15 | use embassy_executor::Spawner; | 15 | use embassy_executor::Spawner; |
| 16 | use embassy_rp::block::ImageDef; | ||
| 16 | use embassy_rp::peripherals::PIO0; | 17 | use embassy_rp::peripherals::PIO0; |
| 17 | use embassy_rp::pio::{Config, FifoJoin, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; | 18 | use embassy_rp::pio::{Config, FifoJoin, InterruptHandler, Pio, ShiftConfig, ShiftDirection}; |
| 18 | use embassy_rp::{bind_interrupts, Peripheral}; | 19 | use embassy_rp::{bind_interrupts, Peripheral}; |
| 19 | use fixed::traits::ToFixed; | 20 | use fixed::traits::ToFixed; |
| 20 | use static_cell::StaticCell; | 21 | use static_cell::StaticCell; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | use embassy_rp::block::ImageDef; | ||
| 23 | 23 | ||
| 24 | #[link_section = ".start_block"] | 24 | #[link_section = ".start_block"] |
| 25 | #[used] | 25 | #[used] |
| @@ -35,7 +35,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 35 | embassy_rp::binary_info_rp_program_build_attribute!(), | 35 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 36 | ]; | 36 | ]; |
| 37 | 37 | ||
| 38 | |||
| 39 | bind_interrupts!(struct Irqs { | 38 | bind_interrupts!(struct Irqs { |
| 40 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 39 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 41 | }); | 40 | }); |
diff --git a/examples/rp23/src/bin/pio_pwm.rs b/examples/rp23/src/bin/pio_pwm.rs index c8e834eae..7c5eefc45 100644 --- a/examples/rp23/src/bin/pio_pwm.rs +++ b/examples/rp23/src/bin/pio_pwm.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | use core::time::Duration; | 5 | use core::time::Duration; |
| 6 | 6 | ||
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::gpio::Level; | 9 | use embassy_rp::gpio::Level; |
| 9 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 10 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine}; | 11 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine}; |
| @@ -12,7 +13,6 @@ use embassy_rp::{bind_interrupts, clocks}; | |||
| 12 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 13 | use pio::InstructionOperands; | 14 | use pio::InstructionOperands; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | use embassy_rp::block::ImageDef; | ||
| 16 | 16 | ||
| 17 | #[link_section = ".start_block"] | 17 | #[link_section = ".start_block"] |
| 18 | #[used] | 18 | #[used] |
| @@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 28 | embassy_rp::binary_info_rp_program_build_attribute!(), | 28 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 29 | ]; | 29 | ]; |
| 30 | 30 | ||
| 31 | |||
| 32 | const REFRESH_INTERVAL: u64 = 20000; | 31 | const REFRESH_INTERVAL: u64 = 20000; |
| 33 | 32 | ||
| 34 | bind_interrupts!(struct Irqs { | 33 | bind_interrupts!(struct Irqs { |
diff --git a/examples/rp23/src/bin/pio_rotary_encoder.rs b/examples/rp23/src/bin/pio_rotary_encoder.rs index 971b55c9e..287992a83 100644 --- a/examples/rp23/src/bin/pio_rotary_encoder.rs +++ b/examples/rp23/src/bin/pio_rotary_encoder.rs | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | 5 | ||
| 6 | use defmt::info; | 6 | use defmt::info; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::gpio::Pull; | 9 | use embassy_rp::gpio::Pull; |
| 9 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 10 | use embassy_rp::{bind_interrupts, pio}; | 11 | use embassy_rp::{bind_interrupts, pio}; |
| 11 | use fixed::traits::ToFixed; | 12 | use fixed::traits::ToFixed; |
| 12 | use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine}; | 13 | use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | bind_interrupts!(struct Irqs { | 30 | bind_interrupts!(struct Irqs { |
| 32 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 31 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 33 | }); | 32 | }); |
diff --git a/examples/rp23/src/bin/pio_servo.rs b/examples/rp23/src/bin/pio_servo.rs index 67e52019a..1dec86927 100644 --- a/examples/rp23/src/bin/pio_servo.rs +++ b/examples/rp23/src/bin/pio_servo.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | use core::time::Duration; | 5 | use core::time::Duration; |
| 6 | 6 | ||
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::gpio::Level; | 9 | use embassy_rp::gpio::Level; |
| 9 | use embassy_rp::peripherals::PIO0; | 10 | use embassy_rp::peripherals::PIO0; |
| 10 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine}; | 11 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine}; |
| @@ -12,7 +13,6 @@ use embassy_rp::{bind_interrupts, clocks}; | |||
| 12 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 13 | use pio::InstructionOperands; | 14 | use pio::InstructionOperands; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | use embassy_rp::block::ImageDef; | ||
| 16 | 16 | ||
| 17 | #[link_section = ".start_block"] | 17 | #[link_section = ".start_block"] |
| 18 | #[used] | 18 | #[used] |
| @@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 28 | embassy_rp::binary_info_rp_program_build_attribute!(), | 28 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 29 | ]; | 29 | ]; |
| 30 | 30 | ||
| 31 | |||
| 32 | const DEFAULT_MIN_PULSE_WIDTH: u64 = 1000; // uncalibrated default, the shortest duty cycle sent to a servo | 31 | const DEFAULT_MIN_PULSE_WIDTH: u64 = 1000; // uncalibrated default, the shortest duty cycle sent to a servo |
| 33 | const DEFAULT_MAX_PULSE_WIDTH: u64 = 2000; // uncalibrated default, the longest duty cycle sent to a servo | 32 | const DEFAULT_MAX_PULSE_WIDTH: u64 = 2000; // uncalibrated default, the longest duty cycle sent to a servo |
| 34 | const DEFAULT_MAX_DEGREE_ROTATION: u64 = 160; // 160 degrees is typical | 33 | const DEFAULT_MAX_DEGREE_ROTATION: u64 = 160; // 160 degrees is typical |
diff --git a/examples/rp23/src/bin/pio_stepper.rs b/examples/rp23/src/bin/pio_stepper.rs index 9cbf0bd92..8b52dc37a 100644 --- a/examples/rp23/src/bin/pio_stepper.rs +++ b/examples/rp23/src/bin/pio_stepper.rs | |||
| @@ -8,6 +8,7 @@ use core::mem::{self, MaybeUninit}; | |||
| 8 | use defmt::info; | 8 | use defmt::info; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::bind_interrupts; | 10 | use embassy_rp::bind_interrupts; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::peripherals::PIO0; | 12 | use embassy_rp::peripherals::PIO0; |
| 12 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Irq, Pio, PioPin, StateMachine}; | 13 | use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Irq, Pio, PioPin, StateMachine}; |
| 13 | use embassy_time::{with_timeout, Duration, Timer}; | 14 | use embassy_time::{with_timeout, Duration, Timer}; |
| @@ -15,7 +16,6 @@ use fixed::traits::ToFixed; | |||
| 15 | use fixed::types::extra::U8; | 16 | use fixed::types::extra::U8; |
| 16 | use fixed::FixedU32; | 17 | use fixed::FixedU32; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | use embassy_rp::block::ImageDef; | ||
| 19 | 19 | ||
| 20 | #[link_section = ".start_block"] | 20 | #[link_section = ".start_block"] |
| 21 | #[used] | 21 | #[used] |
| @@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 31 | embassy_rp::binary_info_rp_program_build_attribute!(), | 31 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 32 | ]; | 32 | ]; |
| 33 | 33 | ||
| 34 | |||
| 35 | bind_interrupts!(struct Irqs { | 34 | bind_interrupts!(struct Irqs { |
| 36 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 35 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 37 | }); | 36 | }); |
diff --git a/examples/rp23/src/bin/pio_ws2812.rs b/examples/rp23/src/bin/pio_ws2812.rs index 2e62a3d97..99d9cf7e6 100644 --- a/examples/rp23/src/bin/pio_ws2812.rs +++ b/examples/rp23/src/bin/pio_ws2812.rs | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::block::ImageDef; | ||
| 9 | use embassy_rp::dma::{AnyChannel, Channel}; | 10 | use embassy_rp::dma::{AnyChannel, Channel}; |
| 10 | use embassy_rp::peripherals::PIO0; | 11 | use embassy_rp::peripherals::PIO0; |
| 11 | use embassy_rp::pio::{ | 12 | use embassy_rp::pio::{ |
| @@ -17,7 +18,6 @@ use fixed::types::U24F8; | |||
| 17 | use fixed_macro::fixed; | 18 | use fixed_macro::fixed; |
| 18 | use smart_leds::RGB8; | 19 | use smart_leds::RGB8; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | use embassy_rp::block::ImageDef; | ||
| 21 | 21 | ||
| 22 | #[link_section = ".start_block"] | 22 | #[link_section = ".start_block"] |
| 23 | #[used] | 23 | #[used] |
| @@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 33 | embassy_rp::binary_info_rp_program_build_attribute!(), | 33 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 34 | ]; | 34 | ]; |
| 35 | 35 | ||
| 36 | |||
| 37 | bind_interrupts!(struct Irqs { | 36 | bind_interrupts!(struct Irqs { |
| 38 | PIO0_IRQ_0 => InterruptHandler<PIO0>; | 37 | PIO0_IRQ_0 => InterruptHandler<PIO0>; |
| 39 | }); | 38 | }); |
diff --git a/examples/rp23/src/bin/pwm.rs b/examples/rp23/src/bin/pwm.rs index ab38a03bb..4cd3b3eb4 100644 --- a/examples/rp23/src/bin/pwm.rs +++ b/examples/rp23/src/bin/pwm.rs | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::pwm::{Config, Pwm}; | 11 | use embassy_rp::pwm::{Config, Pwm}; |
| 11 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 14 | 14 | ||
| 15 | #[link_section = ".start_block"] | 15 | #[link_section = ".start_block"] |
| 16 | #[used] | 16 | #[used] |
| @@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 26 | embassy_rp::binary_info_rp_program_build_attribute!(), | 26 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 27 | ]; | 27 | ]; |
| 28 | 28 | ||
| 29 | |||
| 30 | #[embassy_executor::main] | 29 | #[embassy_executor::main] |
| 31 | async fn main(_spawner: Spawner) { | 30 | async fn main(_spawner: Spawner) { |
| 32 | let p = embassy_rp::init(Default::default()); | 31 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/pwm_input.rs b/examples/rp23/src/bin/pwm_input.rs index fcb561cfd..b75d04963 100644 --- a/examples/rp23/src/bin/pwm_input.rs +++ b/examples/rp23/src/bin/pwm_input.rs | |||
| @@ -5,11 +5,11 @@ | |||
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::block::ImageDef; | ||
| 8 | use embassy_rp::gpio::Pull; | 9 | use embassy_rp::gpio::Pull; |
| 9 | use embassy_rp::pwm::{Config, InputMode, Pwm}; | 10 | use embassy_rp::pwm::{Config, InputMode, Pwm}; |
| 10 | use embassy_time::{Duration, Ticker}; | 11 | use embassy_time::{Duration, Ticker}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | #[embassy_executor::main] | 28 | #[embassy_executor::main] |
| 30 | async fn main(_spawner: Spawner) { | 29 | async fn main(_spawner: Spawner) { |
| 31 | let p = embassy_rp::init(Default::default()); | 30 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/rosc.rs b/examples/rp23/src/bin/rosc.rs index 051b4710f..28c778f51 100644 --- a/examples/rp23/src/bin/rosc.rs +++ b/examples/rp23/src/bin/rosc.rs | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::{clocks, gpio}; | 11 | use embassy_rp::{clocks, gpio}; |
| 11 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 12 | use gpio::{Level, Output}; | 13 | use gpio::{Level, Output}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | #[embassy_executor::main] | 30 | #[embassy_executor::main] |
| 32 | async fn main(_spawner: Spawner) { | 31 | async fn main(_spawner: Spawner) { |
| 33 | let mut config = embassy_rp::config::Config::default(); | 32 | let mut config = embassy_rp::config::Config::default(); |
diff --git a/examples/rp23/src/bin/shared_bus.rs b/examples/rp23/src/bin/shared_bus.rs index e3213cd91..00e65f80d 100644 --- a/examples/rp23/src/bin/shared_bus.rs +++ b/examples/rp23/src/bin/shared_bus.rs | |||
| @@ -8,6 +8,7 @@ use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice; | |||
| 8 | use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice; | 8 | use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::bind_interrupts; | 10 | use embassy_rp::bind_interrupts; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::gpio::{AnyPin, Level, Output}; | 12 | use embassy_rp::gpio::{AnyPin, Level, Output}; |
| 12 | use embassy_rp::i2c::{self, I2c, InterruptHandler}; | 13 | use embassy_rp::i2c::{self, I2c, InterruptHandler}; |
| 13 | use embassy_rp::peripherals::{I2C1, SPI1}; | 14 | use embassy_rp::peripherals::{I2C1, SPI1}; |
| @@ -17,7 +18,6 @@ use embassy_sync::mutex::Mutex; | |||
| 17 | use embassy_time::Timer; | 18 | use embassy_time::Timer; |
| 18 | use static_cell::StaticCell; | 19 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | use embassy_rp::block::ImageDef; | ||
| 21 | 21 | ||
| 22 | #[link_section = ".start_block"] | 22 | #[link_section = ".start_block"] |
| 23 | #[used] | 23 | #[used] |
| @@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 33 | embassy_rp::binary_info_rp_program_build_attribute!(), | 33 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 34 | ]; | 34 | ]; |
| 35 | 35 | ||
| 36 | |||
| 37 | type Spi1Bus = Mutex<NoopRawMutex, Spi<'static, SPI1, spi::Async>>; | 36 | type Spi1Bus = Mutex<NoopRawMutex, Spi<'static, SPI1, spi::Async>>; |
| 38 | type I2c1Bus = Mutex<NoopRawMutex, I2c<'static, I2C1, i2c::Async>>; | 37 | type I2c1Bus = Mutex<NoopRawMutex, I2c<'static, I2C1, i2c::Async>>; |
| 39 | 38 | ||
diff --git a/examples/rp23/src/bin/sharing.rs b/examples/rp23/src/bin/sharing.rs index 10f064947..b5ef08147 100644 --- a/examples/rp23/src/bin/sharing.rs +++ b/examples/rp23/src/bin/sharing.rs | |||
| @@ -19,8 +19,9 @@ use core::sync::atomic::{AtomicU32, Ordering}; | |||
| 19 | use cortex_m_rt::entry; | 19 | use cortex_m_rt::entry; |
| 20 | use defmt::info; | 20 | use defmt::info; |
| 21 | use embassy_executor::{Executor, InterruptExecutor}; | 21 | use embassy_executor::{Executor, InterruptExecutor}; |
| 22 | use embassy_rp::block::ImageDef; | ||
| 22 | use embassy_rp::clocks::RoscRng; | 23 | use embassy_rp::clocks::RoscRng; |
| 23 | use embassy_rp::interrupt::{Priority, InterruptExt}; | 24 | use embassy_rp::interrupt::{InterruptExt, Priority}; |
| 24 | use embassy_rp::peripherals::UART0; | 25 | use embassy_rp::peripherals::UART0; |
| 25 | use embassy_rp::uart::{self, InterruptHandler, UartTx}; | 26 | use embassy_rp::uart::{self, InterruptHandler, UartTx}; |
| 26 | use embassy_rp::{bind_interrupts, interrupt}; | 27 | use embassy_rp::{bind_interrupts, interrupt}; |
| @@ -30,7 +31,6 @@ use embassy_time::{Duration, Ticker}; | |||
| 30 | use rand::RngCore; | 31 | use rand::RngCore; |
| 31 | use static_cell::{ConstStaticCell, StaticCell}; | 32 | use static_cell::{ConstStaticCell, StaticCell}; |
| 32 | use {defmt_rtt as _, panic_probe as _}; | 33 | use {defmt_rtt as _, panic_probe as _}; |
| 33 | use embassy_rp::block::ImageDef; | ||
| 34 | 34 | ||
| 35 | #[link_section = ".start_block"] | 35 | #[link_section = ".start_block"] |
| 36 | #[used] | 36 | #[used] |
| @@ -46,7 +46,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 46 | embassy_rp::binary_info_rp_program_build_attribute!(), | 46 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 47 | ]; | 47 | ]; |
| 48 | 48 | ||
| 49 | |||
| 50 | type UartAsyncMutex = mutex::Mutex<CriticalSectionRawMutex, UartTx<'static, UART0, uart::Async>>; | 49 | type UartAsyncMutex = mutex::Mutex<CriticalSectionRawMutex, UartTx<'static, UART0, uart::Async>>; |
| 51 | 50 | ||
| 52 | struct MyType { | 51 | struct MyType { |
diff --git a/examples/rp23/src/bin/spi.rs b/examples/rp23/src/bin/spi.rs index bcf356188..98aa7622c 100644 --- a/examples/rp23/src/bin/spi.rs +++ b/examples/rp23/src/bin/spi.rs | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::spi::Spi; | 11 | use embassy_rp::spi::Spi; |
| 11 | use embassy_rp::{gpio, spi}; | 12 | use embassy_rp::{gpio, spi}; |
| 12 | use gpio::{Level, Output}; | 13 | use gpio::{Level, Output}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 15 | 15 | ||
| 16 | #[link_section = ".start_block"] | 16 | #[link_section = ".start_block"] |
| 17 | #[used] | 17 | #[used] |
| @@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 27 | embassy_rp::binary_info_rp_program_build_attribute!(), | 27 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 28 | ]; | 28 | ]; |
| 29 | 29 | ||
| 30 | |||
| 31 | #[embassy_executor::main] | 30 | #[embassy_executor::main] |
| 32 | async fn main(_spawner: Spawner) { | 31 | async fn main(_spawner: Spawner) { |
| 33 | let p = embassy_rp::init(Default::default()); | 32 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/spi_async.rs b/examples/rp23/src/bin/spi_async.rs index 7a43995d2..71eaa5c05 100644 --- a/examples/rp23/src/bin/spi_async.rs +++ b/examples/rp23/src/bin/spi_async.rs | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_rp::block::ImageDef; | ||
| 9 | use embassy_rp::spi::{Config, Spi}; | 10 | use embassy_rp::spi::{Config, Spi}; |
| 10 | use embassy_time::Timer; | 11 | use embassy_time::Timer; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | #[embassy_executor::main] | 28 | #[embassy_executor::main] |
| 30 | async fn main(_spawner: Spawner) { | 29 | async fn main(_spawner: Spawner) { |
| 31 | let p = embassy_rp::init(Default::default()); | 30 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/spi_display.rs b/examples/rp23/src/bin/spi_display.rs index 25368bb94..2441b1186 100644 --- a/examples/rp23/src/bin/spi_display.rs +++ b/examples/rp23/src/bin/spi_display.rs | |||
| @@ -11,6 +11,7 @@ use core::cell::RefCell; | |||
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_embedded_hal::shared_bus::blocking::spi::SpiDeviceWithConfig; | 12 | use embassy_embedded_hal::shared_bus::blocking::spi::SpiDeviceWithConfig; |
| 13 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 14 | use embassy_rp::gpio::{Level, Output}; | 15 | use embassy_rp::gpio::{Level, Output}; |
| 15 | use embassy_rp::spi; | 16 | use embassy_rp::spi; |
| 16 | use embassy_rp::spi::{Blocking, Spi}; | 17 | use embassy_rp::spi::{Blocking, Spi}; |
| @@ -26,7 +27,6 @@ use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; | |||
| 26 | use embedded_graphics::text::Text; | 27 | use embedded_graphics::text::Text; |
| 27 | use st7789::{Orientation, ST7789}; | 28 | use st7789::{Orientation, ST7789}; |
| 28 | use {defmt_rtt as _, panic_probe as _}; | 29 | use {defmt_rtt as _, panic_probe as _}; |
| 29 | use embassy_rp::block::ImageDef; | ||
| 30 | 30 | ||
| 31 | #[link_section = ".start_block"] | 31 | #[link_section = ".start_block"] |
| 32 | #[used] | 32 | #[used] |
| @@ -42,7 +42,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 42 | embassy_rp::binary_info_rp_program_build_attribute!(), | 42 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 43 | ]; | 43 | ]; |
| 44 | 44 | ||
| 45 | |||
| 46 | use crate::my_display_interface::SPIDeviceInterface; | 45 | use crate::my_display_interface::SPIDeviceInterface; |
| 47 | use crate::touch::Touch; | 46 | use crate::touch::Touch; |
| 48 | 47 | ||
diff --git a/examples/rp23/src/bin/spi_sdmmc.rs b/examples/rp23/src/bin/spi_sdmmc.rs index 992215b0d..d7af77a30 100644 --- a/examples/rp23/src/bin/spi_sdmmc.rs +++ b/examples/rp23/src/bin/spi_sdmmc.rs | |||
| @@ -9,13 +9,13 @@ | |||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_embedded_hal::SetConfig; | 10 | use embassy_embedded_hal::SetConfig; |
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 12 | use embassy_rp::spi::Spi; | 13 | use embassy_rp::spi::Spi; |
| 13 | use embassy_rp::{gpio, spi}; | 14 | use embassy_rp::{gpio, spi}; |
| 14 | use embedded_hal_bus::spi::ExclusiveDevice; | 15 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 15 | use embedded_sdmmc::sdcard::{DummyCsPin, SdCard}; | 16 | use embedded_sdmmc::sdcard::{DummyCsPin, SdCard}; |
| 16 | use gpio::{Level, Output}; | 17 | use gpio::{Level, Output}; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | use embassy_rp::block::ImageDef; | ||
| 19 | 19 | ||
| 20 | #[link_section = ".start_block"] | 20 | #[link_section = ".start_block"] |
| 21 | #[used] | 21 | #[used] |
| @@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 31 | embassy_rp::binary_info_rp_program_build_attribute!(), | 31 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 32 | ]; | 32 | ]; |
| 33 | 33 | ||
| 34 | |||
| 35 | struct DummyTimesource(); | 34 | struct DummyTimesource(); |
| 36 | 35 | ||
| 37 | impl embedded_sdmmc::TimeSource for DummyTimesource { | 36 | impl embedded_sdmmc::TimeSource for DummyTimesource { |
diff --git a/examples/rp23/src/bin/uart.rs b/examples/rp23/src/bin/uart.rs index 7b82fa350..ae00f36dc 100644 --- a/examples/rp23/src/bin/uart.rs +++ b/examples/rp23/src/bin/uart.rs | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | #![no_main] | 8 | #![no_main] |
| 9 | 9 | ||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::block::ImageDef; | ||
| 11 | use embassy_rp::uart; | 12 | use embassy_rp::uart; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 14 | 14 | ||
| 15 | #[link_section = ".start_block"] | 15 | #[link_section = ".start_block"] |
| 16 | #[used] | 16 | #[used] |
diff --git a/examples/rp23/src/bin/uart_buffered_split.rs b/examples/rp23/src/bin/uart_buffered_split.rs index f7acdade9..2b14520d5 100644 --- a/examples/rp23/src/bin/uart_buffered_split.rs +++ b/examples/rp23/src/bin/uart_buffered_split.rs | |||
| @@ -10,13 +10,13 @@ | |||
| 10 | use defmt::*; | 10 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 12 | use embassy_rp::bind_interrupts; | 12 | use embassy_rp::bind_interrupts; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 13 | use embassy_rp::peripherals::UART0; | 14 | use embassy_rp::peripherals::UART0; |
| 14 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config}; | 15 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config}; |
| 15 | use embassy_time::Timer; | 16 | use embassy_time::Timer; |
| 16 | use embedded_io_async::{Read, Write}; | 17 | use embedded_io_async::{Read, Write}; |
| 17 | use static_cell::StaticCell; | 18 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | use embassy_rp::block::ImageDef; | ||
| 20 | 20 | ||
| 21 | #[link_section = ".start_block"] | 21 | #[link_section = ".start_block"] |
| 22 | #[used] | 22 | #[used] |
| @@ -32,7 +32,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 32 | embassy_rp::binary_info_rp_program_build_attribute!(), | 32 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 33 | ]; | 33 | ]; |
| 34 | 34 | ||
| 35 | |||
| 36 | bind_interrupts!(struct Irqs { | 35 | bind_interrupts!(struct Irqs { |
| 37 | UART0_IRQ => BufferedInterruptHandler<UART0>; | 36 | UART0_IRQ => BufferedInterruptHandler<UART0>; |
| 38 | }); | 37 | }); |
diff --git a/examples/rp23/src/bin/uart_r503.rs b/examples/rp23/src/bin/uart_r503.rs index 69f6dbbff..39a17d305 100644 --- a/examples/rp23/src/bin/uart_r503.rs +++ b/examples/rp23/src/bin/uart_r503.rs | |||
| @@ -4,12 +4,12 @@ | |||
| 4 | use defmt::{debug, error, info}; | 4 | use defmt::{debug, error, info}; |
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_rp::bind_interrupts; | 6 | use embassy_rp::bind_interrupts; |
| 7 | use embassy_rp::block::ImageDef; | ||
| 7 | use embassy_rp::peripherals::UART0; | 8 | use embassy_rp::peripherals::UART0; |
| 8 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; | 9 | use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart}; |
| 9 | use embassy_time::{with_timeout, Duration, Timer}; | 10 | use embassy_time::{with_timeout, Duration, Timer}; |
| 10 | use heapless::Vec; | 11 | use heapless::Vec; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | use embassy_rp::block::ImageDef; | ||
| 13 | 13 | ||
| 14 | #[link_section = ".start_block"] | 14 | #[link_section = ".start_block"] |
| 15 | #[used] | 15 | #[used] |
| @@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 25 | embassy_rp::binary_info_rp_program_build_attribute!(), | 25 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 26 | ]; | 26 | ]; |
| 27 | 27 | ||
| 28 | |||
| 29 | bind_interrupts!(pub struct Irqs { | 28 | bind_interrupts!(pub struct Irqs { |
| 30 | UART0_IRQ => UARTInterruptHandler<UART0>; | 29 | UART0_IRQ => UARTInterruptHandler<UART0>; |
| 31 | }); | 30 | }); |
diff --git a/examples/rp23/src/bin/uart_unidir.rs b/examples/rp23/src/bin/uart_unidir.rs index 4d3163285..38210a8d0 100644 --- a/examples/rp23/src/bin/uart_unidir.rs +++ b/examples/rp23/src/bin/uart_unidir.rs | |||
| @@ -11,11 +11,11 @@ | |||
| 11 | use defmt::*; | 11 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_rp::bind_interrupts; | 13 | use embassy_rp::bind_interrupts; |
| 14 | use embassy_rp::block::ImageDef; | ||
| 14 | use embassy_rp::peripherals::UART1; | 15 | use embassy_rp::peripherals::UART1; |
| 15 | use embassy_rp::uart::{Async, Config, InterruptHandler, UartRx, UartTx}; | 16 | use embassy_rp::uart::{Async, Config, InterruptHandler, UartRx, UartTx}; |
| 16 | use embassy_time::Timer; | 17 | use embassy_time::Timer; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | use embassy_rp::block::ImageDef; | ||
| 19 | 19 | ||
| 20 | #[link_section = ".start_block"] | 20 | #[link_section = ".start_block"] |
| 21 | #[used] | 21 | #[used] |
| @@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 31 | embassy_rp::binary_info_rp_program_build_attribute!(), | 31 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 32 | ]; | 32 | ]; |
| 33 | 33 | ||
| 34 | |||
| 35 | bind_interrupts!(struct Irqs { | 34 | bind_interrupts!(struct Irqs { |
| 36 | UART1_IRQ => InterruptHandler<UART1>; | 35 | UART1_IRQ => InterruptHandler<UART1>; |
| 37 | }); | 36 | }); |
diff --git a/examples/rp23/src/bin/usb_webusb.rs b/examples/rp23/src/bin/usb_webusb.rs index c9cab45c1..f4ecde30e 100644 --- a/examples/rp23/src/bin/usb_webusb.rs +++ b/examples/rp23/src/bin/usb_webusb.rs | |||
| @@ -21,6 +21,7 @@ use defmt::info; | |||
| 21 | use embassy_executor::Spawner; | 21 | use embassy_executor::Spawner; |
| 22 | use embassy_futures::join::join; | 22 | use embassy_futures::join::join; |
| 23 | use embassy_rp::bind_interrupts; | 23 | use embassy_rp::bind_interrupts; |
| 24 | use embassy_rp::block::ImageDef; | ||
| 24 | use embassy_rp::peripherals::USB; | 25 | use embassy_rp::peripherals::USB; |
| 25 | use embassy_rp::usb::{Driver as UsbDriver, InterruptHandler}; | 26 | use embassy_rp::usb::{Driver as UsbDriver, InterruptHandler}; |
| 26 | use embassy_usb::class::web_usb::{Config as WebUsbConfig, State, Url, WebUsb}; | 27 | use embassy_usb::class::web_usb::{Config as WebUsbConfig, State, Url, WebUsb}; |
| @@ -28,7 +29,6 @@ use embassy_usb::driver::{Driver, Endpoint, EndpointIn, EndpointOut}; | |||
| 28 | use embassy_usb::msos::{self, windows_version}; | 29 | use embassy_usb::msos::{self, windows_version}; |
| 29 | use embassy_usb::{Builder, Config}; | 30 | use embassy_usb::{Builder, Config}; |
| 30 | use {defmt_rtt as _, panic_probe as _}; | 31 | use {defmt_rtt as _, panic_probe as _}; |
| 31 | use embassy_rp::block::ImageDef; | ||
| 32 | 32 | ||
| 33 | #[link_section = ".start_block"] | 33 | #[link_section = ".start_block"] |
| 34 | #[used] | 34 | #[used] |
| @@ -44,7 +44,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 44 | embassy_rp::binary_info_rp_program_build_attribute!(), | 44 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 45 | ]; | 45 | ]; |
| 46 | 46 | ||
| 47 | |||
| 48 | bind_interrupts!(struct Irqs { | 47 | bind_interrupts!(struct Irqs { |
| 49 | USBCTRL_IRQ => InterruptHandler<USB>; | 48 | USBCTRL_IRQ => InterruptHandler<USB>; |
| 50 | }); | 49 | }); |
diff --git a/examples/rp23/src/bin/watchdog.rs b/examples/rp23/src/bin/watchdog.rs index 8cc723150..3ac457219 100644 --- a/examples/rp23/src/bin/watchdog.rs +++ b/examples/rp23/src/bin/watchdog.rs | |||
| @@ -7,12 +7,12 @@ | |||
| 7 | 7 | ||
| 8 | use defmt::info; | 8 | use defmt::info; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::block::ImageDef; | ||
| 10 | use embassy_rp::gpio; | 11 | use embassy_rp::gpio; |
| 11 | use embassy_rp::watchdog::*; | 12 | use embassy_rp::watchdog::*; |
| 12 | use embassy_time::{Duration, Timer}; | 13 | use embassy_time::{Duration, Timer}; |
| 13 | use gpio::{Level, Output}; | 14 | use gpio::{Level, Output}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | use embassy_rp::block::ImageDef; | ||
| 16 | 16 | ||
| 17 | #[link_section = ".start_block"] | 17 | #[link_section = ".start_block"] |
| 18 | #[used] | 18 | #[used] |
| @@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 28 | embassy_rp::binary_info_rp_program_build_attribute!(), | 28 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 29 | ]; | 29 | ]; |
| 30 | 30 | ||
| 31 | |||
| 32 | #[embassy_executor::main] | 31 | #[embassy_executor::main] |
| 33 | async fn main(_spawner: Spawner) { | 32 | async fn main(_spawner: Spawner) { |
| 34 | let p = embassy_rp::init(Default::default()); | 33 | let p = embassy_rp::init(Default::default()); |
diff --git a/examples/rp23/src/bin/zerocopy.rs b/examples/rp23/src/bin/zerocopy.rs index e379d9c00..d04e1bf2a 100644 --- a/examples/rp23/src/bin/zerocopy.rs +++ b/examples/rp23/src/bin/zerocopy.rs | |||
| @@ -10,6 +10,7 @@ use defmt::*; | |||
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; | 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; |
| 12 | use embassy_rp::bind_interrupts; | 12 | use embassy_rp::bind_interrupts; |
| 13 | use embassy_rp::block::ImageDef; | ||
| 13 | use embassy_rp::gpio::Pull; | 14 | use embassy_rp::gpio::Pull; |
| 14 | use embassy_rp::peripherals::DMA_CH0; | 15 | use embassy_rp::peripherals::DMA_CH0; |
| 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | 16 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| @@ -17,7 +18,6 @@ use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; | |||
| 17 | use embassy_time::{Duration, Ticker, Timer}; | 18 | use embassy_time::{Duration, Ticker, Timer}; |
| 18 | use static_cell::StaticCell; | 19 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | use embassy_rp::block::ImageDef; | ||
| 21 | 21 | ||
| 22 | #[link_section = ".start_block"] | 22 | #[link_section = ".start_block"] |
| 23 | #[used] | 23 | #[used] |
| @@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ | |||
| 33 | embassy_rp::binary_info_rp_program_build_attribute!(), | 33 | embassy_rp::binary_info_rp_program_build_attribute!(), |
| 34 | ]; | 34 | ]; |
| 35 | 35 | ||
| 36 | |||
| 37 | type SampleBuffer = [u16; 512]; | 36 | type SampleBuffer = [u16; 512]; |
| 38 | 37 | ||
| 39 | bind_interrupts!(struct Irqs { | 38 | bind_interrupts!(struct Irqs { |
