1#![crate_name = "sam4l"]
10#![crate_type = "rlib"]
11#![no_std]
12
13pub mod acifc;
14pub mod adc;
15pub mod aes;
16pub mod ast;
17pub mod bpm;
18pub mod bscif;
19pub mod chip;
20pub mod crccu;
21pub mod dac;
22pub mod dma;
23pub mod eic;
24pub mod flashcalw;
25pub mod gloc;
26pub mod gpio;
27pub mod i2c;
28pub mod nvic;
29pub mod pm;
30pub mod scif;
31pub mod serial_num;
32pub mod spi;
33pub mod trng;
34pub mod usart;
35pub mod usbc;
36pub mod wdt;
37
38use cortexm4::{initialize_ram_jump_to_main, unhandled_interrupt, CortexM4, CortexMVariant};
39
40extern "C" {
41 fn _estack();
44}
45
46#[cfg_attr(
47 all(target_arch = "arm", target_os = "none"),
48 link_section = ".vectors"
49)]
50#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
52pub static BASE_VECTORS: [unsafe extern "C" fn(); 16] = [
53 _estack,
54 initialize_ram_jump_to_main,
55 unhandled_interrupt, CortexM4::HARD_FAULT_HANDLER, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt, unhandled_interrupt,
61 unhandled_interrupt,
62 unhandled_interrupt,
63 unhandled_interrupt,
64 CortexM4::SVC_HANDLER, unhandled_interrupt, unhandled_interrupt,
67 unhandled_interrupt, CortexM4::SYSTICK_HANDLER, ];
70
71#[cfg_attr(
72 all(target_arch = "arm", target_os = "none"),
73 link_section = ".vectors"
74)]
75#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
77pub static IRQS: [unsafe extern "C" fn(); 80] = [CortexM4::GENERIC_ISR; 80];
78
79pub unsafe fn init() {
80 cortexm4::nvic::disable_all();
81 cortexm4::nvic::clear_all_pending();
82 cortexm4::nvic::enable_all();
83}