Merge pull request #3600 from embassy-rs/patch-1
Add set_config method to RP SPI driver (rebased #3419)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#![no_main]
|
||||
|
||||
use defmt::*;
|
||||
use embassy_embedded_hal::SetConfig;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
@@ -51,7 +50,7 @@ async fn main(_spawner: Spawner) {
|
||||
// Now that the card is initialized, the SPI clock can go faster
|
||||
let mut config = spi::Config::default();
|
||||
config.frequency = 16_000_000;
|
||||
sdcard.spi(|dev| dev.bus_mut().set_config(&config)).ok();
|
||||
sdcard.spi(|dev| dev.bus_mut().set_config(&config));
|
||||
|
||||
// Now let's look for volumes (also known as partitions) on our block device.
|
||||
// To do this we need a Volume Manager. It will take ownership of the block device.
|
||||
|
||||
@@ -56,7 +56,7 @@ async fn main(_spawner: Spawner) {
|
||||
// Now that the card is initialized, the SPI clock can go faster
|
||||
let mut config = spi::Config::default();
|
||||
config.frequency = 16_000_000;
|
||||
sdcard.spi(|dev| dev.bus_mut().set_config(&config)).ok();
|
||||
sdcard.spi(|dev| SetConfig::set_config(dev.bus_mut(), &config)).ok();
|
||||
|
||||
// Now let's look for volumes (also known as partitions) on our block device.
|
||||
// To do this we need a Volume Manager. It will take ownership of the block device.
|
||||
|
||||
Reference in New Issue
Block a user