Robin Mueller 05f85bd209 Rework library structure
Changed:

- Move most library components to new [`vorago-shared-periphs`](https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs)
  which is mostly re-exported in this crate.
- Overhaul and simplification of several HAL APIs. The system configuration and IRQ router
  peripheral instance generally does not need to be passed to HAL API anymore.
- All HAL drivers are now type erased. The constructors will still expect and consume the PAC
  singleton component for resource management purposes, but are not cached anymore.
- Refactoring of GPIO library to be more inline with embassy GPIO API.

Added:

- I2C clock timeout feature support.
2025-04-24 16:41:20 +02:00

29 lines
557 B
Rust

//! Simple blinky example using the HAL
#![no_main]
#![no_std]
// Import panic provider.
use panic_probe as _;
// Import logger.
use defmt_rtt as _;
use cortex_m_rt::entry;
use va416xx_hal::{
gpio::{Output, PinState},
pac,
pins::PinsG,
};
#[entry]
fn main() -> ! {
defmt::println!("VA416xx HAL blinky example");
let dp = pac::Peripherals::take().unwrap();
let portg = PinsG::new(dp.portg);
let mut led = Output::new(portg.pg5, PinState::Low);
loop {
cortex_m::asm::delay(2_000_000);
led.toggle();
}
}