A hardware abstraction layer (HAL) for i.MX RT MCUs.
imxrt-hal contains a collection of hardware drivers for various i.MX RT
MCUs. A default build of
imxrt-hal provides drivers that are portable
across all i.MX RT chips. When your specific chip is known,
provides additional, chip-specific APIs. Most drivers implement their
embedded-hal traits, or they can be adapted to use
embedded-hal traits in user code.
imxrt-hal requires that you, or something in your dependency graph, enable
a chip-specific feature from
imxrt-ral, the i.MX RT register access layer
(RAL). Without this, the HAL does not build. Since the HAL uses the RAL in
its public API, you’re expected to depend on both packages.
Here’s an example of a project that builds the
imxrt-hal for an i.MX RT
[dependencies.imxrt-hal] # There's no required feature here... version = # ... [dependencies.imxrt-ral] version = # ... features = ["imxrt1062"] # ...but this feature is required.
Once you’ve enabled a RAL feature, the HAL builds without any additional features. All APIs exposed in this build are portable across all supported i.MX RT chips.
See each module’s documentation for examples. Note that documentation examples may assume a specific chip and chip family, so you may need to adapt the example for your hardware.
imxrt-hal repository maintains examples that run on various i.MX RT
development boards. See the project documentation for more information.
Use these optional features to control the HAL build.
|Enable features for the 1010 chips.|
|Enable features for the 1020 chips.|
|Enable features for the 1060 chips.|
|Enable features for the 1064 chips.|
|Enable features for the 1170 chips.|
|Enable implementations for embedded-hal 0.2 |
|Allows the TRNG to be used with the |
The APIs exposed by the various
"imxrt[...]" features are chip specific.
The HAL does not support building with more than one of these features at a
When enabling a HAL chip feature, make sure that it pairs properly with your
RAL chip selection. You are responsible for making sure that your RAL chip
feature is appropriate for the HAL chip feature. For instance, mixing the
imxrt1062 feature with the HAL’s
imxrt1010 feature is not
[dependencies.imxrt-hal] version = # ... #Bad: doesn't support RAL feature. #features = ["imxrt1010"] #Good: supports RAL feature features = ["imxrt1060"] [dependencies.imxrt-ral] version = # ... features = ["imxrt1062"] # Informs the HAL chip feature
"eh02-unproven" feature will not build without the corresponding
"unproven" feature enabled in embedded-hal 0.2.
- Analog to digital converters.
- Clock control module.
- Synchronous buck mode converter.
- Direct memory access.
- Pulse width modulation.
- General purpose I/O.
- General purpose timer.
- Pad muxing and configurations.
- Low-power inter-integrated circuit.
- Low-power serial peripheral interface.
- Low-power universal asynchronous receiver / transmitter.
- Periodic interrupt timers.
- Secure non-volatile storage.
- Temperature monitor.
- General timer APIs.
- True random number generator.
- USB device.