diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-12-23 15:48:59 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-23 15:48:59 +0100 |
| commit | e5474d8829a1898d2de62606cb3c57e11d63bcab (patch) | |
| tree | 834ebf4e0927d2e02895afe59598f9bed62f72ee | |
| parent | b8c60fb9a8d228a4c52ad1991feee4f548ce9757 (diff) | |
| parent | c46b076d5b40ddbe74ddeb7f9296b394c078538f (diff) | |
Merge pull request #2349 from barnabywalters/nrf-docs
[embassy-nrf] auto-documented features
| -rw-r--r-- | embassy-nrf/Cargo.toml | 55 | ||||
| -rw-r--r-- | embassy-nrf/src/lib.rs | 3 |
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] |
| 19 | default = ["rt"] | 19 | default = ["rt"] |
| 20 | ## Cortex-M runtime (enabled by default) | ||
| 20 | rt = [ | 21 | rt = [ |
| 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` | ||
| 33 | time = ["dep:embassy-time"] | 35 | time = ["dep:embassy-time"] |
| 34 | 36 | ||
| 37 | ## Enable defmt | ||
| 35 | defmt = ["dep:defmt", "embassy-hal-internal/defmt", "embassy-sync/defmt", "embassy-usb-driver/defmt", "embassy-embedded-hal/defmt"] | 38 | defmt = ["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) |
| 41 | unstable-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. |
| 41 | unstable-pac = [] | ||
| 42 | 45 | ||
| 46 | ## Enable GPIO tasks and events | ||
| 47 | gpiote = [] | ||
| 48 | |||
| 49 | ## Use RTC1 as the time driver for `embassy-time`, with a tick rate of 32.768khz | ||
| 50 | time-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) | ||
| 53 | nfc-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 | ||
| 58 | reset-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) | ||
| 62 | qspi-multiwrite-flash = [] | ||
| 63 | |||
| 64 | #! ### Chip selection features | ||
| 65 | ## nRF52805 | ||
| 43 | nrf52805 = ["nrf52805-pac", "_nrf52"] | 66 | nrf52805 = ["nrf52805-pac", "_nrf52"] |
| 67 | ## nRF52810 | ||
| 44 | nrf52810 = ["nrf52810-pac", "_nrf52"] | 68 | nrf52810 = ["nrf52810-pac", "_nrf52"] |
| 69 | ## nRF52811 | ||
| 45 | nrf52811 = ["nrf52811-pac", "_nrf52"] | 70 | nrf52811 = ["nrf52811-pac", "_nrf52"] |
| 71 | ## nRF52820 | ||
| 46 | nrf52820 = ["nrf52820-pac", "_nrf52"] | 72 | nrf52820 = ["nrf52820-pac", "_nrf52"] |
| 73 | ## nRF52832 | ||
| 47 | nrf52832 = ["nrf52832-pac", "_nrf52", "_nrf52832_anomaly_109"] | 74 | nrf52832 = ["nrf52832-pac", "_nrf52", "_nrf52832_anomaly_109"] |
| 75 | ## nRF52833 | ||
| 48 | nrf52833 = ["nrf52833-pac", "_nrf52", "_gpio-p1"] | 76 | nrf52833 = ["nrf52833-pac", "_nrf52", "_gpio-p1"] |
| 77 | ## nRF52840 | ||
| 49 | nrf52840 = ["nrf52840-pac", "_nrf52", "_gpio-p1"] | 78 | nrf52840 = ["nrf52840-pac", "_nrf52", "_gpio-p1"] |
| 79 | ## nRF5340 application core in Secure mode | ||
| 50 | nrf5340-app-s = ["_nrf5340-app", "_s"] | 80 | nrf5340-app-s = ["_nrf5340-app", "_s"] |
| 81 | ## nRF5340 application core in Non-Secure mode | ||
| 51 | nrf5340-app-ns = ["_nrf5340-app", "_ns"] | 82 | nrf5340-app-ns = ["_nrf5340-app", "_ns"] |
| 83 | ## nRF5340 network core | ||
| 52 | nrf5340-net = ["_nrf5340-net"] | 84 | nrf5340-net = ["_nrf5340-net"] |
| 85 | ## nRF9160 in Secure mode | ||
| 53 | nrf9160-s = ["_nrf9160", "_s"] | 86 | nrf9160-s = ["_nrf9160", "_s"] |
| 87 | ## nRF9160 in Non-Secure mode | ||
| 54 | nrf9160-ns = ["_nrf9160", "_ns"] | 88 | nrf9160-ns = ["_nrf9160", "_ns"] |
| 55 | 89 | ||
| 56 | gpiote = [] | ||
| 57 | time-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) | ||
| 60 | nfc-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 | ||
| 65 | reset-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 | ||
| 70 | qspi-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" | |||
| 114 | embedded-storage = "0.3.1" | 132 | embedded-storage = "0.3.1" |
| 115 | embedded-storage-async = "0.4.0" | 133 | embedded-storage-async = "0.4.0" |
| 116 | cfg-if = "1.0.0" | 134 | cfg-if = "1.0.0" |
| 135 | document-features = "0.2.7" | ||
| 117 | 136 | ||
| 118 | nrf52805-pac = { version = "0.12.0", optional = true } | 137 | nrf52805-pac = { version = "0.12.0", optional = true } |
| 119 | nrf52810-pac = { version = "0.12.0", optional = true } | 138 | nrf52810-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", |
