aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authordstric-aqueduct <[email protected]>2024-10-15 11:48:54 -0400
committerDario Nieuwenhuis <[email protected]>2024-12-03 00:14:24 +0100
commitdcf228e4487982b2aef577eb914d80fcb2ecbdc3 (patch)
tree9b8f5d733823a3973b50d33957c873b0e8ff1958 /examples
parent333284588a4c2639913df47099220d2dece50834 (diff)
Add `set_config` method to RP SPI driver
Add a `set_config` method to `Spi` to allow reconfiguring SPI mode after creation. The existing implementation of the `embassy-embedded-hal` trait `SetConfig` is changed to use the new method. Existing uses of `SetConfig` trait may need to explicitly call the trait method to maintain current return type.
Diffstat (limited to 'examples')
-rw-r--r--examples/rp23/src/bin/spi_sdmmc.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/rp23/src/bin/spi_sdmmc.rs b/examples/rp23/src/bin/spi_sdmmc.rs
index aa6b44ffa..cfc38dfd9 100644
--- a/examples/rp23/src/bin/spi_sdmmc.rs
+++ b/examples/rp23/src/bin/spi_sdmmc.rs
@@ -56,7 +56,7 @@ async fn main(_spawner: Spawner) {
56 // Now that the card is initialized, the SPI clock can go faster 56 // Now that the card is initialized, the SPI clock can go faster
57 let mut config = spi::Config::default(); 57 let mut config = spi::Config::default();
58 config.frequency = 16_000_000; 58 config.frequency = 16_000_000;
59 sdcard.spi(|dev| dev.bus_mut().set_config(&config)).ok(); 59 sdcard.spi(|dev| SetConfig::set_config(dev.bus_mut(), &config)).ok();
60 60
61 // Now let's look for volumes (also known as partitions) on our block device. 61 // Now let's look for volumes (also known as partitions) on our block device.
62 // To do this we need a Volume Manager. It will take ownership of the block device. 62 // To do this we need a Volume Manager. It will take ownership of the block device.