diff options
| author | Bailey Townsend <[email protected]> | 2024-12-27 12:29:17 -0600 |
|---|---|---|
| committer | Bailey Townsend <[email protected]> | 2024-12-27 12:29:17 -0600 |
| commit | 56f9296581800dca70474459debf4a429b312e50 (patch) | |
| tree | 7cfb7baab84eabe7afdf7718e2dfc3de826322c7 | |
| parent | b71696c8f54edba664e9bfe77a1d86d09d88f52c (diff) | |
Added a new rm2 feature flag
| -rw-r--r-- | cyw43-pio/Cargo.toml | 2 | ||||
| -rw-r--r-- | cyw43-pio/src/lib.rs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/cyw43-pio/Cargo.toml b/cyw43-pio/Cargo.toml index 4e21c255f..794bf2479 100644 --- a/cyw43-pio/Cargo.toml +++ b/cyw43-pio/Cargo.toml | |||
| @@ -13,6 +13,8 @@ documentation = "https://docs.embassy.dev/cyw43-pio" | |||
| 13 | # If disabled, SPI runs at 31.25MHz | 13 | # If disabled, SPI runs at 31.25MHz |
| 14 | # If enabled, SPI runs at 62.5MHz, which is 25% higher than 50Mhz which is the maximum according to the CYW43439 datasheet. | 14 | # If enabled, SPI runs at 62.5MHz, which is 25% higher than 50Mhz which is the maximum according to the CYW43439 datasheet. |
| 15 | overclock = [] | 15 | overclock = [] |
| 16 | # If enabled the PIO runs at a speed that works with the rm2 module | ||
| 17 | rm2 = [] | ||
| 16 | 18 | ||
| 17 | [dependencies] | 19 | [dependencies] |
| 18 | cyw43 = { version = "0.2.0", path = "../cyw43" } | 20 | cyw43 = { version = "0.2.0", path = "../cyw43" } |
diff --git a/cyw43-pio/src/lib.rs b/cyw43-pio/src/lib.rs index 40cf63a17..1280e2059 100644 --- a/cyw43-pio/src/lib.rs +++ b/cyw43-pio/src/lib.rs | |||
| @@ -120,7 +120,7 @@ where | |||
| 120 | cfg.clock_divider = FixedU32::from_bits(0x0100); | 120 | cfg.clock_divider = FixedU32::from_bits(0x0100); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | #[cfg(not(feature = "overclock"))] | 123 | #[cfg(not(any(feature = "overclock", feature = "rm2")))] |
| 124 | { | 124 | { |
| 125 | // same speed as pico-sdk, 62.5Mhz | 125 | // same speed as pico-sdk, 62.5Mhz |
| 126 | // This is actually the fastest we can go without overclocking. | 126 | // This is actually the fastest we can go without overclocking. |
| @@ -132,6 +132,12 @@ where | |||
| 132 | cfg.clock_divider = FixedU32::from_bits(0x0200); | 132 | cfg.clock_divider = FixedU32::from_bits(0x0200); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | #[cfg(feature = "rm2")] | ||
| 136 | { | ||
| 137 | // This is found to work better with the RM2 module which is found on the Pimoroni Pico Plus 2 W | ||
| 138 | cfg.clock_divider = FixedU32::from_bits(0x0300); | ||
| 139 | } | ||
| 140 | |||
| 135 | sm.set_config(&cfg); | 141 | sm.set_config(&cfg); |
| 136 | 142 | ||
| 137 | sm.set_pin_dirs(Direction::Out, &[&pin_clk, &pin_io]); | 143 | sm.set_pin_dirs(Direction::Out, &[&pin_clk, &pin_io]); |
