psoc62xa/
lib.rs

1// Licensed under the Apache License, Version 2.0 or the MIT License.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// Copyright OxidOS Automotive 2025 SRL.
4
5#![no_std]
6// `registers/rv_plic_regs` has many register definitions in `register_structs()!`
7// and requires a deeper recursion limit than the default to fully expand.
8#![recursion_limit = "512"]
9
10use cortexm0p::{initialize_ram_jump_to_main, unhandled_interrupt, CortexM0P, CortexMVariant};
11
12extern "C" {
13    // _estack is not really a function, but it makes the types work
14    // You should never actually invoke it!!
15    fn _estack();
16}
17
18#[cfg_attr(
19    all(target_arch = "arm", target_os = "none"),
20    link_section = ".vectors"
21)]
22// used Ensures that the symbol is kept until the final binary
23#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
24pub static BASE_VECTORS: [unsafe extern "C" fn(); 16] = [
25    _estack,
26    initialize_ram_jump_to_main,
27    unhandled_interrupt,           // NMI
28    CortexM0P::HARD_FAULT_HANDLER, // Hard Fault
29    unhandled_interrupt,           // MemManage
30    unhandled_interrupt,           // BusFault
31    unhandled_interrupt,           // UsageFault
32    unhandled_interrupt,
33    unhandled_interrupt,
34    unhandled_interrupt,
35    unhandled_interrupt,
36    CortexM0P::SVC_HANDLER, // SVC
37    unhandled_interrupt,    // DebugMon
38    unhandled_interrupt,
39    unhandled_interrupt,        // PendSV
40    CortexM0P::SYSTICK_HANDLER, // SysTick
41];
42
43#[cfg_attr(
44    all(target_arch = "arm", target_os = "none"),
45    link_section = ".vectors"
46)]
47// used Ensures that the symbol is kept until the final binary
48#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
49pub static IRQS: [unsafe extern "C" fn(); 8] = [CortexM0P::GENERIC_ISR; 8];
50
51pub mod chip;
52pub mod cpuss;
53pub mod gpio;
54pub mod hsiom;
55pub mod peri;
56pub mod scb;
57pub mod srss;
58pub mod tcpwm;