// SPDX-License-Identifier: MPL-2.0 // SPDX-FileCopyrightText: Copyright 2025 Ian McIntyre #![no_std] #![feature(rustc_private)] extern crate fusible; pub use ral_registers::{Instance, modify_reg, read_reg, write_reg}; pub mod ral { pub use imxrt_drivers_enet as enet; pub use imxrt_drivers_gpio as gpio; } pub mod drivers { pub mod enet; pub mod gpio; /// TODO: remove this, use embedded-hal or something else. pub trait ToggleOutput: Send + 'static { fn toggle(&self); } /// TODO: remove this, use embedded-hal or something else. pub trait BlockingInput: Send + 'static { fn block_on_interrupt(&self); } } /// TODO: A REAL RANDOM NUMBER GENERATOR. /// /// This is needed by NetX Duo for port allocation. /// I'm being very lazy and spoofing the required /// implementation. #[unsafe(no_mangle)] pub extern "C" fn rand() -> core::ffi::c_int { use core::sync::atomic::{AtomicI32, Ordering}; static SOME_RANDOM_NUMBER: AtomicI32 = AtomicI32::new(0); SOME_RANDOM_NUMBER.fetch_add(1, Ordering::Relaxed) }