[][src]Crate lpc55s6x_hal

This HAL takes a layered approach.

  1. raw PAC peripherals
  2. HAL peripheral wrappers (under peripherals)
  3. HAL drivers (under drivers, typically take ownership of one or more peripherals)

The middle layer is quite thin, notably we model pins and the clock tree as drivers.

In as much as possible, it is a goal for this HAL that drivers implement general interfaces (under traits).

The main intended use case of this HAL is in the context of RTFM.

To get started without RTFM, try something like:

let hal = hal::new(); // layer 2
let pins = hal::Pins::take().unwrap(); // layer 3

let mut syscon = hal.syscon;
let mut gpio = hal.gpio.enabled(&mut syscon);
let mut iocon = hal.iocon.enabled(&mut syscon);

let mut red_led = pins.pio1_6
    .into_gpio_pin(&mut iocon, &mut gpio)
    .into_output(Level::High);

loop {
    red.set_low().unwrap();
    hal::wait_at_least(300_000);
    red.set_high().unwrap();
    hal::wait_at_least(300_000);
}

Re-exports

pub extern crate lpc55s6x_pac as raw;
pub use peripherals::anactrl::Anactrl;
pub use peripherals::casper::Casper;
pub use peripherals::flash::Flash;
pub use peripherals::flexcomm::Flexcomm;
pub use peripherals::gpio::Gpio;
pub use peripherals::iocon::Iocon;
pub use peripherals::pmc::Pmc;
pub use peripherals::rng::Rng;
pub use peripherals::syscon::Syscon;
pub use peripherals::usbfs::Usbfs;
pub use peripherals::utick::Utick;
pub use drivers::ClockRequirements;
pub use drivers::I2cMaster;
pub use drivers::SpiMaster;
pub use drivers::Pin;
pub use drivers::Pins;
pub use drivers::UsbBus;

Modules

drivers

Drivers for device functionality.

macros
peripherals

HAL wrappers around raw PAC peripherals.

prelude
time
traits
typestates

Macros

reg
reg_cluster
reg_read
stateful_peripheral_enable_disable
wrap_always_on_peripheral
wrap_stateful_peripheral

Structs

Peripherals

This is the entry point to the HAL API.

Functions

enable_cycle_counter
get_cycle_count
new

This is the main (monolithic) entry point to the HAL for non-RTFM applications. For RTFM, use hal::<Peripheral>::from(<raw_peripheral>) as needed.

wait_at_least

Delay of last resort :-))