#nxp #imxrt

no-std imxrt-ral

Register access layer for all NXP i.MX RT microcontrollers

14 releases

0.6.0 Dec 3, 2024
0.5.3 Aug 21, 2023
0.5.1 Jul 3, 2023
0.5.0 Dec 27, 2022
0.1.0 Feb 11, 2020

#111 in Embedded development

Download history 177/week @ 2024-08-22 173/week @ 2024-08-29 325/week @ 2024-09-05 279/week @ 2024-09-12 408/week @ 2024-09-19 577/week @ 2024-09-26 324/week @ 2024-10-03 466/week @ 2024-10-10 593/week @ 2024-10-17 439/week @ 2024-10-24 828/week @ 2024-10-31 477/week @ 2024-11-07 592/week @ 2024-11-14 756/week @ 2024-11-21 621/week @ 2024-11-28 680/week @ 2024-12-05

2,721 downloads per month
Used in 11 crates (7 directly)

MIT/Apache

23MB
654K SLoC

imxrt-ral

A Rust register access layer (RAL), and SVD patches for NXP i.MX RT processors.

All Checks Crates.io

API Docs (main branch)

Goals

  • Simple but useful register level access. It compiles quickly, and it's intuitive for existing embedded developers.
  • RTIC support.

Getting Started

The imxrt-ral is a lower-level interface for i.MX RT processor registers with useful macros. The imxrt-ral is modeled after the stm32ral crate. It provides direct access to the processor's registers. Use the imxrt-ral if you'd like to create your own hardware abstraction layer, or a custom driver.

The imxrt-ral supports these i.MX RT processors:

  • "imxrt1011"
  • "imxrt1015"
  • "imxrt1021"
  • "imxrt1051"
  • "imxrt1052"
  • "imxrt1061"
  • "imxrt1062"
  • "imxrt1064"
  • "imxrt1176_cm4"
  • "imxrt1176_cm7"

The RAL also requires a feature flag to specify the processor variant. The RAL is on crates.io. The RAL provides the "rt" feature flag, and the interrupt table definition, that's used by the HAL.

Q/A

Why not use svd2rust to generate a crate for register access?

See here and here. svd2rust generates a crate that's nearly 1 million lines of Rust code, and it takes a few minutes to compile. On the other hand, the RAL compiles in a few seconds. Additionally, svd2rust only supports one SVD input, but the RAL auto-generation script accepts multiple SVD inputs, sharing the common peripherals across processor families. This means that we can more easily support all i.MX RT processor variants from a single crate.

Contributing & Development

For contributions and development guidance, see CONTRIBUTING.md

License

Licensed under either of

at your option.

Dependencies