1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
//! # HAL for the BL702 microcontroller
//!
//! This is a Rust HAL for the BL702 microcontroller.
//!
//! It implements the [`embedded-hal`] traits for peripherals, where such traits exist.
//!
//! [`embedded-hal`]: https://crates.io/crates/embedded-hal
//!
//! # Usage
//!
//!
//! ## Commonly used setup
//!
//! ```rust
//! // Get access to the device specific peripherals from the peripheral access crate
//! let dp = pac::Peripherals::take().unwrap();
//! let mut parts = dp.GLB.split();
//!
//! ```
//!
//!
//! To avoid the linker to complain about missing symbols please add `hal_defaults.x` to `.cargo/config` like this
//! ```toml
//! rustflags = [
//! "-C", "link-arg=-Tmemory.x",
//! "-C", "link-arg=-Tlink.x",
//! "-C", "link-arg=-Thal_defaults.x",
//! ]
//! ```
//!
#![no_std]
pub use bl702_pac as pac;
pub mod clock;
pub mod delay;
pub mod gpio;
pub mod prelude {
pub use crate::gpio::GlbExt as _bl702_hal_gpio_GlbExt;
pub use embedded_time::rate::Extensions;
}
pub mod system;
/// System frequency (constant since we don't have clocks yet)
pub const SYSFREQ: u32 = 144_000_000;