Skip to main content

axplat_aarch64_phytium_pi/
lib.rs

1#![no_std]
2
3#[macro_use]
4extern crate log;
5#[macro_use]
6extern crate axplat;
7
8pub mod config {
9    //! Platform configuration module.
10    //!
11    //! If the `AX_CONFIG_PATH` environment variable is set, it will load the configuration from the specified path.
12    //! Otherwise, it will fall back to the `axconfig.toml` file in the current directory and generate the default configuration.
13    //!
14    //! If the `PACKAGE` field in the configuration does not match the package name, it will panic with an error message.
15    axconfig_macros::include_configs!(path_env = "AX_CONFIG_PATH", fallback = "axconfig.toml");
16    assert_str_eq!(
17        PACKAGE,
18        env!("CARGO_PKG_NAME"),
19        "`PACKAGE` field in the configuration does not match the Package name. Please check your configuration file."
20    );
21}
22
23mod boot;
24mod init;
25mod mem;
26mod power;
27
28axplat_arm_peripherals::console_if_impl!(ConsoleIfImpl);
29axplat_arm_peripherals::time_if_impl!(TimeIfImpl);
30
31#[cfg(feature = "irq")]
32axplat_arm_peripherals::irq_if_impl!(IrqIfImpl);