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