1#![allow(incomplete_features)]
2#![feature(adt_const_params)]
3#![feature(never_type)]
4#![cfg_attr(not(test), no_std)]
5
6extern crate cortex_m;
7
8pub extern crate embedded_hal as hal;
9pub extern crate ambiq_apollo3_pac2 as pac;
10
11#[cfg(feature = "rt")]
12#[cortex_m_rt::pre_init]
13unsafe fn pre_init() {
14 (*cortex_m::peripheral::SCB::PTR).vtor.write(0x10000);
30}
31
32
33#[cfg(feature = "ambiq-sdk")]
34pub extern crate ambiq_hal_sys as halc;
35
36pub mod clock;
37pub mod rtc;
38pub mod time;
39pub mod delay;
40pub mod gpio;
41pub mod adc;
42pub mod watchdog;
43
44#[cfg(feature = "ambiq-sdk")]
45pub mod uart;
46
47#[cfg(feature = "ambiq-sdk")]
48pub mod iom;
49#[cfg(feature = "ambiq-sdk")]
50pub use iom::{i2c, spi};
51
52pub mod prelude {
53 pub use hal::prelude::*;
54 pub use hal::digital::v2::{InputPin, OutputPin, ToggleableOutputPin};
55
56 #[cfg(feature = "ambiq-sdk")]
57 pub use halc;
58
59 #[cfg(feature = "ambiq-sdk")]
60 pub use halc::c_types::*;
61}
62
63#[cfg(test)]
64mod tests {
65 #[test]
66 fn it_works() {
67 assert_eq!(2 + 2, 4);
68 }
69}