kea_hal/
lib.rs

1#![doc = include_str!("../README.md")]
2#![no_std]
3#![warn(missing_docs)]
4
5pub extern crate SKEAZN642 as pac;
6pub extern crate cortex_m;
7#[cfg(feature = "rt-selected")]
8pub extern crate cortex_m_rt;
9pub extern crate embedded_hal as hal;
10pub extern crate embedded_hal_alpha as hal_alpha;
11pub extern crate embedded_time;
12pub extern crate nb;
13pub extern crate void;
14
15pub use pac::CorePeripherals;
16
17pub mod adc;
18pub mod clocks;
19pub mod gpio;
20pub mod port;
21pub mod prelude;
22pub mod spi;
23pub mod system;
24
25/// State of Peripheral
26pub mod init_state {
27    /// Indicates peripheral is enabled
28    pub struct Enabled<T = ()>(pub T);
29
30    /// Indicates Disabled.
31    pub struct Disabled;
32}
33
34mod private {
35    pub trait Sealed {}
36}
37
38/// This trait implements split method onto PAC peripheral structs.
39pub trait HALExt {
40    /// The HAL interface struct
41    type T;
42
43    /// Consume the PAC struct, split it into reasonable parts, and return them
44    /// in an interface struct.
45    ///
46    /// Each HAL module implements user friendly interface methods onto the
47    /// the returned struct(s). See the documentation for the HAL module of
48    /// interest for more details about the interface.
49    fn split(self) -> Self::T;
50}