Cargo Features

nRF-HAL has no features set by default.

[dependencies]
nrf-hal = { version = "0.1.1", features = ["52810-rt", "52811-rt", "52832-rt", "52833-rt", "52840-rt", "5340-rt", "usb", "embedded_hal", "52810", "52811", "52832", "52833", "52840", "5340", "52", "53"] }

Compile with one of these "runtime" features if the program will be directly flashed to an MCU; ie not a library.

52810-rt

Enables rt of nrf52810-pac ^0.10.1

Peripheral Access Crates

52811-rt

Enables rt of nrf52811-pac ^0.10.1

52832-rt

Enables rt of nrf52832-pac ^0.10.1

52833-rt

Enables rt of nrf52833-pac ^0.10.1

52840-rt

Enables rt of nrf52840-pac ^0.10.1

5340-rt

Enables rt of nrf5340-app-pac ^0.10.1 and nrf5340-net-pac ^0.10.1

usb = nrf-usbd

todo: 91 support.

Affects nrf-hal::usb

embedded_hal = embedded-hal
52810 = 52, nrf52810-pac

Features defined here are those taken from the SVD-generated nrf PACs.
The "52" etc designator at the end lets us group by family when feature-gating.

Affects nrf-hal::target_constants.EASY_DMA_SIZE, nrf-hal::target_constants.FORCE_COPY_BUFFER_SIZE

52811 = 52, nrf52811-pac

Affects nrf-hal::target_constants.EASY_DMA_SIZE

52832 = 52, nrf52832-pac

Affects nrf-hal::target_constants.EASY_DMA_SIZE, nrf-hal::target_constants.FORCE_COPY_BUFFER_SIZE

52833 = 52, nrf52833-pac

Affects nrf-hal::target_constants.EASY_DMA_SIZE

52840 = 52, nrf52840-pac

Affects nrf-hal::target_constants.EASY_DMA_SIZE

5340 = 53, nrf5340-app-pac, nrf5340-net-pac

Affects nrf-hal::target_constants.EASY_DMA_SIZE

52 52810? 52811? 52832? 52833? 52840?

These features are used to featured gate sections of code that apply to an entire family.

53 5340?

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

nrf52810-pac 52810? 52810-rt?

Enables nrf52810-pac ^0.10.1

nrf52811-pac 52811? 52811-rt?

Enables nrf52811-pac ^0.10.1

nrf52832-pac 52832? 52832-rt?

Enables nrf52832-pac ^0.10.1

nrf52833-pac 52833? 52833-rt?

Enables nrf52833-pac ^0.10.1

nrf52840-pac 52840? 52840-rt?

Enables nrf52840-pac ^0.10.1

nrf5340-app-pac 5340? 5340-rt?

Enables nrf5340-app-pac ^0.10.1

nrf5340-net-pac 5340? 5340-rt?

Enables nrf5340-net-pac ^0.10.1

embedded-hal embedded_hal?

Enables embedded-hal ^0.2.5

Embedded traits. Featured-gated with embedded-hal.

nrf-usbd usb?

Enables nrf-usbd ^0.1.0