2021-01-26 07:42:43 +11:00
|
|
|
//! HAL for the RP2040 microcontroller
|
|
|
|
//!
|
|
|
|
//! This is an implementation of the [`embedded-hal`] traits for the RP2040 microcontroller
|
|
|
|
//! NOTE This HAL is still under active development. This API will remain volatile until 1.0.0
|
|
|
|
|
2021-07-20 02:58:26 +10:00
|
|
|
#![warn(missing_docs)]
|
2021-01-26 07:42:43 +11:00
|
|
|
#![no_std]
|
|
|
|
|
|
|
|
extern crate cortex_m;
|
|
|
|
extern crate embedded_hal as hal;
|
|
|
|
extern crate nb;
|
2021-05-24 12:08:42 +10:00
|
|
|
pub use paste;
|
2021-04-24 21:38:17 +10:00
|
|
|
|
2021-01-26 07:42:43 +11:00
|
|
|
pub extern crate rp2040_pac as pac;
|
|
|
|
|
2022-02-02 14:56:07 +11:00
|
|
|
#[macro_use]
|
|
|
|
mod intrinsics;
|
|
|
|
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod adc;
|
2021-10-22 23:30:30 +11:00
|
|
|
pub(crate) mod atomic_register_access;
|
2021-05-02 07:18:37 +10:00
|
|
|
pub mod clocks;
|
2021-12-02 00:03:41 +11:00
|
|
|
mod critical_section_impl;
|
2021-11-17 08:45:52 +11:00
|
|
|
pub mod dma;
|
2022-02-02 14:58:37 +11:00
|
|
|
mod float;
|
2021-04-18 09:18:10 +10:00
|
|
|
pub mod gpio;
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod i2c;
|
2021-12-01 23:52:53 +11:00
|
|
|
pub mod multicore;
|
2021-09-16 00:32:00 +10:00
|
|
|
pub mod pio;
|
2021-04-25 18:12:38 +10:00
|
|
|
pub mod pll;
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod prelude;
|
|
|
|
pub mod pwm;
|
2021-05-17 03:42:41 +10:00
|
|
|
pub mod resets;
|
2021-02-02 15:57:32 +11:00
|
|
|
pub mod rom_data;
|
2021-07-08 20:58:48 +10:00
|
|
|
pub mod rosc;
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod rtc;
|
2021-05-10 23:29:59 +10:00
|
|
|
pub mod sio;
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod spi;
|
|
|
|
pub mod ssi;
|
|
|
|
pub mod timer;
|
2021-05-24 12:08:42 +10:00
|
|
|
pub mod typelevel;
|
2021-01-26 07:42:43 +11:00
|
|
|
pub mod uart;
|
|
|
|
pub mod usb;
|
|
|
|
pub mod watchdog;
|
2021-04-24 21:38:17 +10:00
|
|
|
pub mod xosc;
|
2021-12-04 00:04:45 +11:00
|
|
|
|
|
|
|
// Provide access to common datastructures to avoid repeating ourselves
|
|
|
|
pub use adc::Adc;
|
|
|
|
pub use clocks::Clock;
|
|
|
|
pub use i2c::I2C;
|
2022-03-13 12:35:59 +11:00
|
|
|
/// Attribute to declare the entry point of the program
|
|
|
|
///
|
|
|
|
/// This is based on and can be used like the [entry attribute from
|
|
|
|
/// cortex-m-rt](https://docs.rs/cortex-m-rt/latest/cortex_m_rt/attr.entry.html).
|
|
|
|
///
|
|
|
|
/// It extends that macro with code to unlock all spinlocks at the beginning
|
|
|
|
/// of `main`. As spinlocks are not automatically unlocked on software resets,
|
|
|
|
/// this can prevent unexpected deadlocks when running from a debugger.
|
|
|
|
pub use rp2040_hal_macros::entry;
|
2021-12-04 00:04:45 +11:00
|
|
|
pub use sio::Sio;
|
|
|
|
pub use spi::Spi;
|
|
|
|
pub use timer::Timer;
|
2021-12-04 15:38:25 +11:00
|
|
|
pub use watchdog::Watchdog;
|