lpc-rs / lpc-pac

Peripheral Access Crates for LPC microcontrollers
9 stars 9 forks source link
lpc11uxx lpc176x5x lpc82x lpc84x nxp rust svd

lpc-pac-rs

crates.io crates.io crates.io crates.io crates.io

This repository provides Rust device support crates for some LPC microcontrollers, providing an API to that device's peripherals using svd2rust and the SVD files from NXP. These crates are commonly known as peripheral access crates or "PACs".

Not every register of each device will have been tested on hardware, and so errors or omissions may remain. Please report any bugs you find, or open a PR!

Using Device Crates In Your Own Project

In your own project's Cargo.toml:

[dependencies.lpc546xx-pac]
version = "x.y.z"
features = ["lpc54608", "rt"] 

The rt feature is optional but helpful. see svd2rust for details.

Then, in your code:

use lpc54606_pac as pac;

let mut peripherals = pac::Peripherals::take().unwrap();

Refer to svd2rust documentation for further usage.

Replace lpc54606_pac with your own device; see the individual crate READMEs for the complete list of supported devices.

Generating PACs:

Generating lpc11uxx, lpc845 and lpc82x:

Adding New Devices

Updating Existing Devices/Peripherals