blink on lpc1114

This commit is contained in:
Artemis Tosini 2024-03-25 00:04:24 +00:00
parent dcb76386d1
commit 7b2e550bed
Signed by: artemist
GPG key ID: EE5227935FE3FF18

View file

@ -1,12 +1,25 @@
#![no_main]
#![no_std]
// Halt on panic
use panic_semihosting as _;
use cortex_m_rt::entry;
#[entry]
fn main() -> ! {
loop {}
let cp = cortex_m::Peripherals::take().unwrap();
// SAFETY: yes... ha ha ha... YES
let gpio0 = unsafe { &(*lpc11xx::GPIO0::ptr()) };
gpio0.dir.write(|w| w.dir7().output());
let mut delay = cortex_m::delay::Delay::new(cp.SYST, 12_000_000);
loop {
gpio0.data.write(|w| w.data7().high());
delay.delay_ms(500);
gpio0.data.write(|w| w.data7().low());
delay.delay_ms(500);
}
}