Initial commit

Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
This commit is contained in:
Thomas Klaehn
2025-02-12 05:32:06 +01:00
commit 03a3c8732f
19 changed files with 2941 additions and 0 deletions

35
lp-core/src/main.rs Normal file
View File

@@ -0,0 +1,35 @@
//! Counts a 32 bit value at a known point in memory, and blink GPIO1.
//!
//! When using the ESP32-C6's LP core, this address in memory is `0x5000_2000`.
//!
//! Make sure the LP RAM is cleared before loading the code.
#![no_std]
#![no_main]
use embedded_hal::{delay::DelayNs, digital::OutputPin};
use esp_lp_hal::{delay::Delay, gpio::Output, prelude::*};
use panic_halt as _;
const ADDRESS: u32 = 0x5000_2000;
#[entry]
fn main(mut gpio1: Output<1>) -> ! {
let mut i: u32 = 0;
let ptr = ADDRESS as *mut u32;
loop {
i = i.wrapping_add(1u32);
unsafe {
ptr.write_volatile(i);
}
gpio1.set_high().unwrap();
Delay.delay_ms(500);
gpio1.set_low().unwrap();
Delay.delay_ms(500);
}
}