diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-12-23 15:52:18 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-23 15:52:18 +0100 |
| commit | 89b7245da3ef2ec3eee8ee1631f95137a9040070 (patch) | |
| tree | 4b7b2f4380ad989063ff9b011218d45ccc582ed7 | |
| parent | e5474d8829a1898d2de62606cb3c57e11d63bcab (diff) | |
| parent | 562680cb139fc39d2fbb728c36ea3ce76731ca50 (diff) | |
Merge pull request #2350 from barnabywalters/rp-docs
[embassy-rp] auto-documented feature flags
| -rw-r--r-- | embassy-rp/Cargo.toml | 45 | ||||
| -rw-r--r-- | embassy-rp/src/lib.rs | 3 |
2 files changed, 33 insertions, 15 deletions
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 93dad68ce..669d79f40 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -14,43 +14,57 @@ flavors = [ | |||
| 14 | 14 | ||
| 15 | [features] | 15 | [features] |
| 16 | default = [ "rt" ] | 16 | default = [ "rt" ] |
| 17 | ## Enable the RP runtime. | ||
| 17 | rt = [ "rp-pac/rt" ] | 18 | rt = [ "rp-pac/rt" ] |
| 18 | 19 | ||
| 20 | ## Enable defmt | ||
| 19 | defmt = ["dep:defmt", "embassy-usb-driver/defmt", "embassy-hal-internal/defmt"] | 21 | defmt = ["dep:defmt", "embassy-usb-driver/defmt", "embassy-hal-internal/defmt"] |
| 20 | 22 | ||
| 21 | # critical section that is safe for multicore use | 23 | ## critical section that is safe for multicore use |
| 22 | critical-section-impl = ["critical-section/restore-state-u8"] | 24 | critical-section-impl = ["critical-section/restore-state-u8"] |
| 23 | 25 | ||
| 24 | # Reexport the PAC for the currently enabled chip at `embassy_rp::pac`. | 26 | ## Reexport the PAC for the currently enabled chip at `embassy_rp::pac`. |
| 25 | # This is unstable because semver-minor (non-breaking) releases of embassy-rp may major-bump (breaking) the PAC version. | 27 | ## This is unstable because semver-minor (non-breaking) releases of embassy-rp may major-bump (breaking) the PAC version. |
| 26 | # If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. | 28 | ## If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. |
| 27 | # There are no plans to make this stable. | 29 | ## There are no plans to make this stable. |
| 28 | unstable-pac = [] | 30 | unstable-pac = [] |
| 29 | 31 | ||
| 32 | ## Enable the timer for use with `embassy-time` with a 1MHz tick rate | ||
| 30 | time-driver = [] | 33 | time-driver = [] |
| 31 | 34 | ||
| 35 | ## Enable ROM function cache | ||
| 32 | rom-func-cache = [] | 36 | rom-func-cache = [] |
| 37 | ## Enable intrinsics | ||
| 33 | intrinsics = [] | 38 | intrinsics = [] |
| 39 | ## Enable ROM v2 intrinsics | ||
| 34 | rom-v2-intrinsics = [] | 40 | rom-v2-intrinsics = [] |
| 35 | 41 | ||
| 36 | # boot2 flash chip support. if none of these is enabled we'll default to w25q080 (used on the pico) | 42 | ## Allow using QSPI pins as GPIO pins. This is mostly not what you want (because your flash lives there) |
| 43 | ## and would add both code and memory overhead when enabled needlessly. | ||
| 44 | qspi-as-gpio = [] | ||
| 45 | |||
| 46 | ## Indicate code is running from RAM. | ||
| 47 | ## Set this if all code is in RAM, and the cores never access memory-mapped flash memory through XIP. | ||
| 48 | ## This allows the flash driver to not force pausing execution on both cores when doing flash operations. | ||
| 49 | run-from-ram = [] | ||
| 50 | |||
| 51 | #! ### boot2 flash chip support | ||
| 52 | #! If none of these are enabled, w25q080 is used by default (used on the pico) | ||
| 53 | ## AT25SF128a | ||
| 37 | boot2-at25sf128a = [] | 54 | boot2-at25sf128a = [] |
| 55 | ## GD25Q64cs | ||
| 38 | boot2-gd25q64cs = [] | 56 | boot2-gd25q64cs = [] |
| 57 | ## generic-03h | ||
| 39 | boot2-generic-03h = [] | 58 | boot2-generic-03h = [] |
| 59 | ## IS25LP080 | ||
| 40 | boot2-is25lp080 = [] | 60 | boot2-is25lp080 = [] |
| 61 | ## ram-memcpy | ||
| 41 | boot2-ram-memcpy = [] | 62 | boot2-ram-memcpy = [] |
| 63 | ## W25Q080 | ||
| 42 | boot2-w25q080 = [] | 64 | boot2-w25q080 = [] |
| 65 | ## W25X10cl | ||
| 43 | boot2-w25x10cl = [] | 66 | boot2-w25x10cl = [] |
| 44 | 67 | ||
| 45 | # Allow using QSPI pins as GPIO pins. This is mostly not what you want (because your flash lives there) | ||
| 46 | # and would add both code and memory overhead when enabled needlessly. | ||
| 47 | qspi-as-gpio = [] | ||
| 48 | |||
| 49 | # Indicate code is running from RAM. | ||
| 50 | # Set this if all code is in RAM, and the cores never access memory-mapped flash memory through XIP. | ||
| 51 | # This allows the flash driver to not force pausing execution on both cores when doing flash operations. | ||
| 52 | run-from-ram = [] | ||
| 53 | |||
| 54 | [dependencies] | 68 | [dependencies] |
| 55 | embassy-sync = { version = "0.5.0", path = "../embassy-sync" } | 69 | embassy-sync = { version = "0.5.0", path = "../embassy-sync" } |
| 56 | embassy-time = { version = "0.2", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } | 70 | embassy-time = { version = "0.2", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } |
| @@ -85,6 +99,7 @@ embedded-hal-nb = { version = "=1.0.0-rc.3" } | |||
| 85 | pio-proc = {version= "0.2" } | 99 | pio-proc = {version= "0.2" } |
| 86 | pio = {version= "0.2.1" } | 100 | pio = {version= "0.2.1" } |
| 87 | rp2040-boot2 = "0.3" | 101 | rp2040-boot2 = "0.3" |
| 102 | document-features = "0.2.7" | ||
| 88 | 103 | ||
| 89 | [dev-dependencies] | 104 | [dev-dependencies] |
| 90 | embassy-executor = { version = "0.4.0", path = "../embassy-executor", features = ["arch-std", "executor-thread"] } | 105 | embassy-executor = { version = "0.4.0", path = "../embassy-executor", features = ["arch-std", "executor-thread"] } |
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index fdacf4965..0a3714777 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/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 | // This mod MUST go first, so that the others see its macros. | 9 | // This mod MUST go first, so that the others see its macros. |
| 7 | pub(crate) mod fmt; | 10 | pub(crate) mod fmt; |
| 8 | 11 | ||
