//! STM32F722 initialization and RTIC runtime. mod board; mod clock; mod config; mod data_channel; mod firmware; mod interrupts; mod motor_inhibit; mod notification; mod peripherals; pub mod ports; mod routes; mod sensors; mod serial; mod usb; #[cfg(test)] #[path = "../../../../boards/geprc-f722-v2/src/board.rs"] mod geprc; #[cfg(test)] #[path = "../../../../boards/kakute-f7-mini-v3/src/board.rs"] mod kakute; #[cfg(test)] #[path = "../../tests/support/config_active_state.rs"] mod config_active_state; #[cfg(test)] #[path = "../../tests/support/config_files.rs"] mod config_files; #[cfg(test)] #[path = "../../tests/support/route_variants.rs"] mod route_variants; use kaptan_config::Config; use crate::{BoardError, F7ImmutableConfig}; pub use kaptan_spi::SpiCompletion as F722ImuTransferCompletion; pub use board::{ F722InitResources, F722LidarState, F722MavlinkState, F722ServiceTimer, process_imu, }; pub use config::F722UserConfig; pub use interrupts::F722Interrupts; pub use notification::EventNotification; pub use routes::F722Route; pub use sensors::{Icm42688Imu, ImuEvent, ImuService, Mpu6000Imu}; /// Inhibits motor outputs, validates configuration, then initializes hardware. /// Called after RTIC takes the PAC peripherals. pub fn initialize( core: cortex_m::Peripherals, device: stm32f7::stm32f722::Peripherals, factory: C, immutable: I, ) -> Result, BoardError> where C: Clone + Config, I: F7ImmutableConfig, { let hardware = immutable.f722().hardware; motor_inhibit::inhibit(&device.RCC, &device.GPIOB, hardware.motors); board::validate_board_config::(&factory, &immutable)?; board::initialize::(core, device, factory, immutable, hardware) }