#![no_std]
pub mod adc;
pub mod chip;
pub mod clocks;
mod deferred_calls;
pub mod gpio;
pub mod i2c;
pub mod interrupts;
pub mod pio;
pub mod pio_pwm;
pub mod pwm;
pub mod resets;
pub mod rtc;
pub mod spi;
pub mod sysinfo;
pub mod test;
pub mod timer;
pub mod uart;
pub mod usb;
pub mod watchdog;
pub mod xosc;
use cortexm0p::{initialize_ram_jump_to_main, unhandled_interrupt, CortexM0P, CortexMVariant};
extern "C" {
fn _estack();
}
#[cfg_attr(
all(target_arch = "arm", target_os = "none"),
link_section = ".vectors"
)]
#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
pub static BASE_VECTORS: [unsafe extern "C" fn(); 16] = [
_estack,
initialize_ram_jump_to_main,
unhandled_interrupt, CortexM0P::HARD_FAULT_HANDLER, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt,
unhandled_interrupt,
unhandled_interrupt,
unhandled_interrupt,
CortexM0P::SVC_HANDLER, unhandled_interrupt, unhandled_interrupt,
unhandled_interrupt, CortexM0P::SYSTICK_HANDLER, ];
#[cfg_attr(all(target_arch = "arm", target_os = "none"), link_section = ".irqs")]
#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
pub static IRQS: [unsafe extern "C" fn(); 32] = [
CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, CortexM0P::GENERIC_ISR, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, ];
extern "C" {
static mut _szero: usize;
static mut _ezero: usize;
static mut _etext: usize;
static mut _srelocate: usize;
static mut _erelocate: usize;
}
pub unsafe fn init() {
cortexm0p::nvic::disable_all();
cortexm0p::nvic::clear_all_pending();
let sio = gpio::SIO::new();
let processor = sio.get_processor();
match processor {
chip::Processor::Processor0 => {}
_ => panic!(
"Kernel should run only using processor 0 (now processor {})",
processor as u8
),
}
}