diff options
Diffstat (limited to 'examples/rp/src')
| -rw-r--r-- | examples/rp/src/bin/blinky.rs | 4 | ||||
| -rw-r--r-- | examples/rp/src/bin/button.rs | 4 | ||||
| -rw-r--r-- | examples/rp/src/bin/spi.rs | 7 | ||||
| -rw-r--r-- | examples/rp/src/bin/spi_display.rs | 12 | ||||
| -rw-r--r-- | examples/rp/src/bin/uart.rs | 4 |
5 files changed, 9 insertions, 22 deletions
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs index 6f199d07e..35612a4cf 100644 --- a/examples/rp/src/bin/blinky.rs +++ b/examples/rp/src/bin/blinky.rs | |||
| @@ -7,9 +7,7 @@ use embassy::executor::Spawner; | |||
| 7 | use embassy::time::{Duration, Timer}; | 7 | use embassy::time::{Duration, Timer}; |
| 8 | use embassy_rp::{gpio, Peripherals}; | 8 | use embassy_rp::{gpio, Peripherals}; |
| 9 | use gpio::{Level, Output}; | 9 | use gpio::{Level, Output}; |
| 10 | 10 | use {defmt_rtt as _, panic_probe as _}; | |
| 11 | use defmt_rtt as _; // global logger | ||
| 12 | use panic_probe as _; | ||
| 13 | 11 | ||
| 14 | #[embassy::main] | 12 | #[embassy::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs index 2418ad012..980e54ea1 100644 --- a/examples/rp/src/bin/button.rs +++ b/examples/rp/src/bin/button.rs | |||
| @@ -5,9 +5,7 @@ | |||
| 5 | use embassy::executor::Spawner; | 5 | use embassy::executor::Spawner; |
| 6 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 6 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 7 | use embassy_rp::Peripherals; | 7 | use embassy_rp::Peripherals; |
| 8 | 8 | use {defmt_rtt as _, panic_probe as _}; | |
| 9 | use defmt_rtt as _; // global logger | ||
| 10 | use panic_probe as _; | ||
| 11 | 9 | ||
| 12 | #[embassy::main] | 10 | #[embassy::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 11 | async fn main(_spawner: Spawner, p: Peripherals) { |
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs index b38424363..d97aa94b3 100644 --- a/examples/rp/src/bin/spi.rs +++ b/examples/rp/src/bin/spi.rs | |||
| @@ -4,13 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy::executor::Spawner; |
| 7 | use embassy_rp::spi; | ||
| 8 | use embassy_rp::spi::Spi; | 7 | use embassy_rp::spi::Spi; |
| 9 | use embassy_rp::{gpio, Peripherals}; | 8 | use embassy_rp::{gpio, spi, Peripherals}; |
| 10 | use gpio::{Level, Output}; | 9 | use gpio::{Level, Output}; |
| 11 | 10 | use {defmt_rtt as _, panic_probe as _}; | |
| 12 | use defmt_rtt as _; // global logger | ||
| 13 | use panic_probe as _; | ||
| 14 | 11 | ||
| 15 | #[embassy::main] | 12 | #[embassy::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index 5c3c4c4c5..f4a411ba6 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use core::cell::RefCell; | 5 | use core::cell::RefCell; |
| 6 | |||
| 6 | use defmt::*; | 7 | use defmt::*; |
| 7 | use embassy::executor::Spawner; | 8 | use embassy::executor::Spawner; |
| 8 | use embassy::time::Delay; | 9 | use embassy::time::Delay; |
| 9 | use embassy_rp::gpio::{Level, Output}; | 10 | use embassy_rp::gpio::{Level, Output}; |
| 10 | use embassy_rp::spi; | ||
| 11 | use embassy_rp::spi::Spi; | 11 | use embassy_rp::spi::Spi; |
| 12 | use embassy_rp::Peripherals; | 12 | use embassy_rp::{spi, Peripherals}; |
| 13 | use embedded_graphics::image::{Image, ImageRawLE}; | 13 | use embedded_graphics::image::{Image, ImageRawLE}; |
| 14 | use embedded_graphics::mono_font::ascii::FONT_10X20; | 14 | use embedded_graphics::mono_font::ascii::FONT_10X20; |
| 15 | use embedded_graphics::mono_font::MonoTextStyle; | 15 | use embedded_graphics::mono_font::MonoTextStyle; |
| @@ -18,14 +18,12 @@ use embedded_graphics::prelude::*; | |||
| 18 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; | 18 | use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle}; |
| 19 | use embedded_graphics::text::Text; | 19 | use embedded_graphics::text::Text; |
| 20 | use st7789::{Orientation, ST7789}; | 20 | use st7789::{Orientation, ST7789}; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | ||
| 21 | 22 | ||
| 22 | use crate::my_display_interface::SPIDeviceInterface; | 23 | use crate::my_display_interface::SPIDeviceInterface; |
| 23 | use crate::shared_spi::SpiDeviceWithCs; | 24 | use crate::shared_spi::SpiDeviceWithCs; |
| 24 | use crate::touch::Touch; | 25 | use crate::touch::Touch; |
| 25 | 26 | ||
| 26 | use defmt_rtt as _; // global logger | ||
| 27 | use panic_probe as _; | ||
| 28 | |||
| 29 | //const DISPLAY_FREQ: u32 = 64_000_000; | 27 | //const DISPLAY_FREQ: u32 = 64_000_000; |
| 30 | const TOUCH_FREQ: u32 = 200_000; | 28 | const TOUCH_FREQ: u32 = 200_000; |
| 31 | 29 | ||
| @@ -94,9 +92,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 94 | 92 | ||
| 95 | loop { | 93 | loop { |
| 96 | if let Some((x, y)) = touch.read() { | 94 | if let Some((x, y)) = touch.read() { |
| 97 | let style = PrimitiveStyleBuilder::new() | 95 | let style = PrimitiveStyleBuilder::new().fill_color(Rgb565::BLUE).build(); |
| 98 | .fill_color(Rgb565::BLUE) | ||
| 99 | .build(); | ||
| 100 | 96 | ||
| 101 | Rectangle::new(Point::new(x - 1, y - 1), Size::new(3, 3)) | 97 | Rectangle::new(Point::new(x - 1, y - 1), Size::new(3, 3)) |
| 102 | .into_styled(style) | 98 | .into_styled(style) |
diff --git a/examples/rp/src/bin/uart.rs b/examples/rp/src/bin/uart.rs index bc941dd8b..99072253a 100644 --- a/examples/rp/src/bin/uart.rs +++ b/examples/rp/src/bin/uart.rs | |||
| @@ -4,9 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy::executor::Spawner; |
| 6 | use embassy_rp::{uart, Peripherals}; | 6 | use embassy_rp::{uart, Peripherals}; |
| 7 | 7 | use {defmt_rtt as _, panic_probe as _}; | |
| 8 | use defmt_rtt as _; // global logger | ||
| 9 | use panic_probe as _; | ||
| 10 | 8 | ||
| 11 | #[embassy::main] | 9 | #[embassy::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 10 | async fn main(_spawner: Spawner, p: Peripherals) { |
