hk32-partial-hal 0.3.1

HK32 partial HAL
#![no_std]

mod chip;
pub mod flash;
pub mod gpio;
pub mod spi;
pub mod sys;

pub use chip::interrupt;
pub use chip::pac;
pub use chip::peripherals; // peripherals define
pub use chip::Peripherals; // peripherals struct
pub use embassy_hal_internal::{Peri, PeripheralType};

#[derive(Default)]
pub struct Config {
    vect_tab_offset: u32,
}

pub fn init(config: Option<Config>) -> Peripherals {
    if let Some(cfg) = config {
        sys::sys_init(cfg.vect_tab_offset);
        sys::rcc_ahb_clock_all(true);
    }

    Peripherals::take()
}