mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-27 12:20:37 +00:00
Remove ImageDef from rp23 examples
This commit is contained in:
parent
4cc5ab9474
commit
6b1706434d
@ -8,15 +8,10 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
ADC_IRQ_FIFO => InterruptHandler;
|
||||
});
|
||||
|
@ -8,15 +8,10 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
ADC_IRQ_FIFO => InterruptHandler;
|
||||
});
|
||||
|
@ -14,16 +14,11 @@
|
||||
use assign_resources::assign_resources;
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::peripherals::{self, PIN_20, PIN_21};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
// initialize the peripherals
|
||||
|
@ -7,16 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
// Program metadata for `picotool info`.
|
||||
// This isn't needed, but it's recomended to have these minimal entries.
|
||||
#[link_section = ".bi_entries"]
|
||||
|
@ -7,7 +7,6 @@
|
||||
/// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats)
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::channel::{Channel, Sender};
|
||||
@ -15,10 +14,6 @@ use embassy_time::{Duration, Ticker};
|
||||
use gpio::{AnyPin, Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
enum LedState {
|
||||
Toggle,
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
/// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats)
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::mutex::Mutex;
|
||||
@ -15,10 +14,6 @@ use embassy_time::{Duration, Ticker};
|
||||
use gpio::{AnyPin, Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>;
|
||||
static LED: LedType = Mutex::new(None);
|
||||
|
||||
|
@ -6,14 +6,9 @@
|
||||
#![no_main]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Level, Output, Pull};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -6,15 +6,10 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Level, Pull};
|
||||
use embassy_time::{with_deadline, Duration, Instant, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
pub struct Debouncer<'a> {
|
||||
input: Input<'a>,
|
||||
debounce: Duration,
|
||||
|
@ -5,16 +5,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::flash::{Async, ERASE_SIZE, FLASH_BASE};
|
||||
use embassy_rp::peripherals::FLASH;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
const ADDR_OFFSET: u32 = 0x100000;
|
||||
const FLASH_SIZE: usize = 2 * 1024 * 1024;
|
||||
|
||||
|
@ -7,16 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Input, Level, Output, Pull};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
/// It requires an external signal to be manually triggered on PIN 16. For
|
||||
/// example, this could be accomplished using an external power source with a
|
||||
/// button so that it is possible to toggle the signal from low to high.
|
||||
|
@ -7,15 +7,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::clocks;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -9,17 +9,12 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::{self, Config, InterruptHandler};
|
||||
use embassy_rp::peripherals::I2C1;
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_async::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
I2C1_IRQ => InterruptHandler<I2C1>;
|
||||
});
|
||||
|
@ -7,14 +7,9 @@
|
||||
#![no_main]
|
||||
|
||||
use defmt::*;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::InterruptHandler;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
// Our anonymous hypotetical temperature sensor could be:
|
||||
// a 12-bit sensor, with 100ms startup time, range of -40*C - 125*C, and precision 0.25*C
|
||||
// It requires no configuration or calibration, works with all i2c bus speeds,
|
||||
|
@ -8,16 +8,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::{self, Config};
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_1::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[allow(dead_code)]
|
||||
mod mcp23017 {
|
||||
pub const ADDR: u8 = 0x20; // default addr
|
||||
|
@ -4,17 +4,12 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::{I2C0, I2C1};
|
||||
use embassy_rp::{bind_interrupts, i2c, i2c_slave};
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_async::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
I2C0_IRQ => i2c::InterruptHandler<I2C0>;
|
||||
I2C1_IRQ => i2c::InterruptHandler<I2C1>;
|
||||
|
@ -13,7 +13,6 @@ use core::cell::{Cell, RefCell};
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{self, Adc, Blocking};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::interrupt;
|
||||
use embassy_rp::pwm::{Config, Pwm};
|
||||
@ -25,10 +24,6 @@ use portable_atomic::{AtomicU32, Ordering};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
static COUNTER: AtomicU32 = AtomicU32::new(0);
|
||||
static PWM: Mutex<CriticalSectionRawMutex, RefCell<Option<Pwm>>> = Mutex::new(RefCell::new(None));
|
||||
static ADC: Mutex<CriticalSectionRawMutex, RefCell<Option<(Adc<Blocking>, adc::Channel)>>> =
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Executor;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::multicore::{spawn_core1, Stack};
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
@ -16,10 +15,6 @@ use embassy_time::Timer;
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
static mut CORE1_STACK: Stack<4096> = Stack::new();
|
||||
static EXECUTOR0: StaticCell<Executor> = StaticCell::new();
|
||||
static EXECUTOR1: StaticCell<Executor> = StaticCell::new();
|
||||
|
@ -59,17 +59,12 @@
|
||||
use cortex_m_rt::entry;
|
||||
use defmt::{info, unwrap};
|
||||
use embassy_executor::{Executor, InterruptExecutor};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::interrupt;
|
||||
use embassy_rp::interrupt::{InterruptExt, Priority};
|
||||
use embassy_time::{Instant, Timer, TICK_HZ};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn run_high() {
|
||||
loop {
|
||||
|
@ -5,15 +5,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::otp;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let _ = embassy_rp::init(Default::default());
|
||||
|
@ -5,17 +5,12 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine};
|
||||
use fixed::traits::ToFixed;
|
||||
use fixed_macro::types::U56F8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -5,7 +5,6 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection};
|
||||
use embassy_rp::{bind_interrupts, Peripheral};
|
||||
@ -13,10 +12,6 @@ use fixed::traits::ToFixed;
|
||||
use fixed_macro::types::U56F8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -8,7 +8,6 @@ use core::fmt::Write;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::hd44780::{PioHD44780, PioHD44780CommandSequenceProgram, PioHD44780CommandWordProgram};
|
||||
@ -16,10 +15,6 @@ use embassy_rp::pwm::{self, Pwm};
|
||||
use embassy_time::{Instant, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(pub struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -14,7 +14,6 @@ use core::mem;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Pull};
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
@ -22,10 +21,6 @@ use embassy_rp::pio_programs::i2s::{PioI2sOut, PioI2sOutProgram};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -5,17 +5,12 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{self, InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::onewire::{PioOneWire, PioOneWireProgram};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -6,17 +6,12 @@ use core::time::Duration;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::pwm::{PioPwm, PioPwmProgram};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
const REFRESH_INTERVAL: u64 = 20000;
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
|
@ -6,16 +6,11 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::rotary_encoder::{Direction, PioEncoder, PioEncoderProgram};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::{bind_interrupts, pio};
|
||||
@ -15,10 +14,6 @@ use fixed::traits::ToFixed;
|
||||
use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
// Program metadata for `picotool info`
|
||||
#[link_section = ".bi_entries"]
|
||||
#[used]
|
||||
|
@ -6,17 +6,12 @@ use core::time::Duration;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Instance, InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::pwm::{PioPwm, PioPwmProgram};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
const DEFAULT_MIN_PULSE_WIDTH: u64 = 1000; // uncalibrated default, the shortest duty cycle sent to a servo
|
||||
const DEFAULT_MAX_PULSE_WIDTH: u64 = 2000; // uncalibrated default, the longest duty cycle sent to a servo
|
||||
const DEFAULT_MAX_DEGREE_ROTATION: u64 = 160; // 160 degrees is typical
|
||||
|
@ -7,17 +7,12 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::stepper::{PioStepper, PioStepperProgram};
|
||||
use embassy_time::{with_timeout, Duration, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -13,7 +13,6 @@
|
||||
use defmt::{info, panic, trace};
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::{join, join3};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::{PIO0, USB};
|
||||
use embassy_rp::pio_programs::uart::{PioUartRx, PioUartRxProgram, PioUartTx, PioUartTxProgram};
|
||||
use embassy_rp::usb::{Driver, Instance, InterruptHandler};
|
||||
@ -26,10 +25,6 @@ use embassy_usb::{Builder, Config};
|
||||
use embedded_io_async::{Read, Write};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
USBCTRL_IRQ => InterruptHandler<USB>;
|
||||
PIO0_IRQ_0 => pio::InterruptHandler<PIO0>;
|
||||
|
@ -7,7 +7,6 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::pio_programs::ws2812::{PioWs2812, PioWs2812Program};
|
||||
@ -15,10 +14,6 @@ use embassy_time::{Duration, Ticker};
|
||||
use smart_leds::RGB8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -9,16 +9,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::{PIN_25, PIN_4, PWM_SLICE2, PWM_SLICE4};
|
||||
use embassy_rp::pwm::{Config, Pwm, SetDutyCycle};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -5,16 +5,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::pwm::{Config, InputMode, Pwm};
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -8,7 +8,6 @@
|
||||
use assign_resources::assign_resources;
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::config::Config;
|
||||
use embassy_rp::gpio::Output;
|
||||
use embassy_rp::{gpio, peripherals, pwm};
|
||||
@ -16,10 +15,6 @@ use embassy_time::{Duration, Timer};
|
||||
use tb6612fng::{DriveCommand, Motor, Tb6612fng};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
assign_resources! {
|
||||
motor: MotorResources {
|
||||
standby_pin: PIN_22,
|
||||
|
@ -7,16 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::{clocks, gpio};
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let mut config = embassy_rp::config::Config::default();
|
||||
|
@ -8,7 +8,6 @@ use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice;
|
||||
use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{AnyPin, Level, Output};
|
||||
use embassy_rp::i2c::{self, I2c, InterruptHandler};
|
||||
use embassy_rp::peripherals::{I2C1, SPI1};
|
||||
@ -19,10 +18,6 @@ use embassy_time::Timer;
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
type Spi1Bus = Mutex<NoopRawMutex, Spi<'static, SPI1, spi::Async>>;
|
||||
type I2c1Bus = Mutex<NoopRawMutex, I2c<'static, I2C1, i2c::Async>>;
|
||||
|
||||
|
@ -19,7 +19,6 @@ use core::sync::atomic::{AtomicU32, Ordering};
|
||||
use cortex_m_rt::entry;
|
||||
use defmt::info;
|
||||
use embassy_executor::{Executor, InterruptExecutor};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::clocks::RoscRng;
|
||||
use embassy_rp::interrupt::{InterruptExt, Priority};
|
||||
use embassy_rp::peripherals::UART0;
|
||||
@ -32,10 +31,6 @@ use rand::RngCore;
|
||||
use static_cell::{ConstStaticCell, StaticCell};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
type UartAsyncMutex = mutex::Mutex<CriticalSectionRawMutex, UartTx<'static, UART0, uart::Async>>;
|
||||
|
||||
struct MyType {
|
||||
|
@ -7,16 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -6,15 +6,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::{Config, Spi};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -12,7 +12,6 @@ use defmt::*;
|
||||
use display_interface_spi::SPIInterface;
|
||||
use embassy_embedded_hal::shared_bus::blocking::spi::SpiDeviceWithConfig;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::spi;
|
||||
use embassy_rp::spi::{Blocking, Spi};
|
||||
@ -31,10 +30,6 @@ use mipidsi::options::{Orientation, Rotation};
|
||||
use mipidsi::Builder;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
use crate::touch::Touch;
|
||||
|
||||
const DISPLAY_FREQ: u32 = 64_000_000;
|
||||
|
@ -9,7 +9,6 @@
|
||||
use defmt::*;
|
||||
use embassy_embedded_hal::SetConfig;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||
@ -17,10 +16,6 @@ use embedded_sdmmc::sdcard::{DummyCsPin, SdCard};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
struct DummyTimesource();
|
||||
|
||||
impl embedded_sdmmc::TimeSource for DummyTimesource {
|
||||
|
@ -6,7 +6,6 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::peripherals::TRNG;
|
||||
use embassy_rp::trng::Trng;
|
||||
@ -14,10 +13,6 @@ use embassy_time::Timer;
|
||||
use rand::RngCore;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
TRNG_IRQ => embassy_rp::trng::InterruptHandler<TRNG>;
|
||||
});
|
||||
|
@ -8,14 +8,9 @@
|
||||
#![no_main]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::uart;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -10,7 +10,6 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART0;
|
||||
use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config};
|
||||
use embassy_time::Timer;
|
||||
@ -18,10 +17,6 @@ use embedded_io_async::{Read, Write};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
UART0_IRQ => BufferedInterruptHandler<UART0>;
|
||||
});
|
||||
|
@ -4,17 +4,12 @@
|
||||
use defmt::{debug, error, info};
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART0;
|
||||
use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart};
|
||||
use embassy_time::{with_timeout, Duration, Timer};
|
||||
use heapless::Vec;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(pub struct Irqs {
|
||||
UART0_IRQ => UARTInterruptHandler<UART0>;
|
||||
});
|
||||
|
@ -11,16 +11,11 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART1;
|
||||
use embassy_rp::uart::{Async, Config, InterruptHandler, UartRx, UartTx};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
UART1_IRQ => InterruptHandler<UART1>;
|
||||
});
|
||||
|
@ -7,7 +7,6 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Pull};
|
||||
use embassy_rp::peripherals::USB;
|
||||
use embassy_rp::usb::{Driver as UsbDriver, InterruptHandler};
|
||||
@ -17,10 +16,6 @@ use embassy_usb::{Builder, Config, Handler};
|
||||
use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
USBCTRL_IRQ => InterruptHandler<USB>;
|
||||
});
|
||||
|
@ -21,7 +21,6 @@ use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::USB;
|
||||
use embassy_rp::usb::{Driver as UsbDriver, InterruptHandler};
|
||||
use embassy_usb::class::web_usb::{Config as WebUsbConfig, State, Url, WebUsb};
|
||||
@ -30,10 +29,6 @@ use embassy_usb::msos::{self, windows_version};
|
||||
use embassy_usb::{Builder, Config};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
USBCTRL_IRQ => InterruptHandler<USB>;
|
||||
});
|
||||
|
@ -7,17 +7,12 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_rp::watchdog::*;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -8,7 +8,6 @@
|
||||
use cyw43_pio::{PioSpi, RM2_CLOCK_DIVIDER};
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::{DMA_CH0, PIO0};
|
||||
use embassy_rp::pio::{InterruptHandler, Pio};
|
||||
use embassy_rp::{bind_interrupts, gpio};
|
||||
@ -17,10 +16,6 @@ use gpio::{Level, Output};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
// Program metadata for `picotool info`.
|
||||
// This isn't needed, but it's recomended to have these minimal entries.
|
||||
#[link_section = ".bi_entries"]
|
||||
|
@ -10,7 +10,6 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::peripherals::DMA_CH0;
|
||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
@ -19,10 +18,6 @@ use embassy_time::{Duration, Ticker, Timer};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();
|
||||
|
||||
type SampleBuffer = [u16; 512];
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
|
Loading…
x
Reference in New Issue
Block a user