aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/Cargo.toml55
-rw-r--r--embassy-nrf/src/lib.rs3
2 files changed, 40 insertions, 18 deletions
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml
index 970f62b0c..837a941a9 100644
--- a/embassy-nrf/Cargo.toml
+++ b/embassy-nrf/Cargo.toml
@@ -17,6 +17,7 @@ flavors = [
17 17
18[features] 18[features]
19default = ["rt"] 19default = ["rt"]
20## Cortex-M runtime (enabled by default)
20rt = [ 21rt = [
21 "nrf52805-pac?/rt", 22 "nrf52805-pac?/rt",
22 "nrf52810-pac?/rt", 23 "nrf52810-pac?/rt",
@@ -30,45 +31,62 @@ rt = [
30 "nrf9160-pac?/rt", 31 "nrf9160-pac?/rt",
31] 32]
32 33
34## Enable features requiring `embassy-time`
33time = ["dep:embassy-time"] 35time = ["dep:embassy-time"]
34 36
37## Enable defmt
35defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver/defmt", "embassy-embedded-hal/defmt"] 38defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver/defmt", "embassy-embedded-hal/defmt"]
36 39
37# Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. 40## Reexport the PAC for the currently enabled chip at `embassy_nrf::pac` (unstable)
41unstable-pac = []
38# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. 42# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version.
39# If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. 43# If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC.
40# There are no plans to make this stable. 44# There are no plans to make this stable.
41unstable-pac = []
42 45
46## Enable GPIO tasks and events
47gpiote = []
48
49## Use RTC1 as the time driver for `embassy-time`, with a tick rate of 32.768khz
50time-driver-rtc1 = ["_time-driver"]
51
52## Allow using the NFC pins as regular GPIO pins (P0_09/P0_10 on nRF52, P0_02/P0_03 on nRF53)
53nfc-pins-as-gpio = []
54
55## Allow using the RST pin as a regular GPIO pin.
56## * nRF52805, nRF52810, nRF52811, nRF52832: P0_21
57## * nRF52820, nRF52833, nRF52840: P0_18
58reset-pin-as-gpio = []
59
60## Implements the MultiwriteNorFlash trait for QSPI. Should only be enabled if your external
61## flash supports the semantics described [here](https://docs.rs/embedded-storage/0.3.1/embedded_storage/nor_flash/trait.MultiwriteNorFlash.html)
62qspi-multiwrite-flash = []
63
64#! ### Chip selection features
65## nRF52805
43nrf52805 = ["nrf52805-pac", "_nrf52"] 66nrf52805 = ["nrf52805-pac", "_nrf52"]
67## nRF52810
44nrf52810 = ["nrf52810-pac", "_nrf52"] 68nrf52810 = ["nrf52810-pac", "_nrf52"]
69## nRF52811
45nrf52811 = ["nrf52811-pac", "_nrf52"] 70nrf52811 = ["nrf52811-pac", "_nrf52"]
71## nRF52820
46nrf52820 = ["nrf52820-pac", "_nrf52"] 72nrf52820 = ["nrf52820-pac", "_nrf52"]
73## nRF52832
47nrf52832 = ["nrf52832-pac", "_nrf52", "_nrf52832_anomaly_109"] 74nrf52832 = ["nrf52832-pac", "_nrf52", "_nrf52832_anomaly_109"]
75## nRF52833
48nrf52833 = ["nrf52833-pac", "_nrf52", "_gpio-p1"] 76nrf52833 = ["nrf52833-pac", "_nrf52", "_gpio-p1"]
77## nRF52840
49nrf52840 = ["nrf52840-pac", "_nrf52", "_gpio-p1"] 78nrf52840 = ["nrf52840-pac", "_nrf52", "_gpio-p1"]
79## nRF5340 application core in Secure mode
50nrf5340-app-s = ["_nrf5340-app", "_s"] 80nrf5340-app-s = ["_nrf5340-app", "_s"]
81## nRF5340 application core in Non-Secure mode
51nrf5340-app-ns = ["_nrf5340-app", "_ns"] 82nrf5340-app-ns = ["_nrf5340-app", "_ns"]
83## nRF5340 network core
52nrf5340-net = ["_nrf5340-net"] 84nrf5340-net = ["_nrf5340-net"]
85## nRF9160 in Secure mode
53nrf9160-s = ["_nrf9160", "_s"] 86nrf9160-s = ["_nrf9160", "_s"]
87## nRF9160 in Non-Secure mode
54nrf9160-ns = ["_nrf9160", "_ns"] 88nrf9160-ns = ["_nrf9160", "_ns"]
55 89
56gpiote = []
57time-driver-rtc1 = ["_time-driver"]
58
59# Allow using the NFC pins as regular GPIO pins (P0_09/P0_10 on nRF52, P0_02/P0_03 on nRF53)
60nfc-pins-as-gpio = []
61
62# Allow using the RST pin as a regular GPIO pin.
63# nrf52805, nrf52810, nrf52811, nrf52832: P0_21
64# nrf52820, nrf52833, nrf52840: P0_18
65reset-pin-as-gpio = []
66
67# Implements the MultiwriteNorFlash trait for QSPI. Should only be enabled if your external
68# flash supports the semantics described in
69# https://docs.rs/embedded-storage/0.3.1/embedded_storage/nor_flash/trait.MultiwriteNorFlash.html
70qspi-multiwrite-flash = []
71
72# Features starting with `_` are for internal use only. They're not intended 90# Features starting with `_` are for internal use only. They're not intended
73# to be enabled by other crates, and are not covered by semver guarantees. 91# to be enabled by other crates, and are not covered by semver guarantees.
74 92
@@ -114,6 +132,7 @@ fixed = "1.10.0"
114embedded-storage = "0.3.1" 132embedded-storage = "0.3.1"
115embedded-storage-async = "0.4.0" 133embedded-storage-async = "0.4.0"
116cfg-if = "1.0.0" 134cfg-if = "1.0.0"
135document-features = "0.2.7"
117 136
118nrf52805-pac = { version = "0.12.0", optional = true } 137nrf52805-pac = { version = "0.12.0", optional = true }
119nrf52810-pac = { version = "0.12.0", optional = true } 138nrf52810-pac = { version = "0.12.0", optional = true }
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index e3458e2de..1510b7265 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -3,6 +3,9 @@
3#![doc = include_str!("../README.md")] 3#![doc = include_str!("../README.md")]
4#![warn(missing_docs)] 4#![warn(missing_docs)]
5 5
6//! ## Feature flags
7#![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)]
8
6#[cfg(not(any( 9#[cfg(not(any(
7 feature = "nrf51", 10 feature = "nrf51",
8 feature = "nrf52805", 11 feature = "nrf52805",