Fix more stm32 SPI examples
This commit is contained in:
parent
4f791799a9
commit
55fb1d5126
@ -43,6 +43,9 @@ fn main() -> ! {
|
||||
config.rcc.pll1.q_ck = Some(mhz(100));
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = mhz(1);
|
||||
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI3,
|
||||
p.PB3,
|
||||
@ -50,8 +53,7 @@ fn main() -> ! {
|
||||
p.PB4,
|
||||
NoDma,
|
||||
NoDma,
|
||||
mhz(1),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let executor = EXECUTOR.init(Executor::new());
|
||||
|
@ -39,6 +39,9 @@ fn main() -> ! {
|
||||
config.rcc.pll1.q_ck = Some(mhz(100));
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = mhz(1);
|
||||
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI3,
|
||||
p.PB3,
|
||||
@ -46,8 +49,7 @@ fn main() -> ! {
|
||||
p.PB4,
|
||||
p.DMA1_CH3,
|
||||
p.DMA1_CH4,
|
||||
mhz(1),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let executor = EXECUTOR.init(Executor::new());
|
||||
|
@ -27,6 +27,9 @@ async fn main(_spawner: Spawner) {
|
||||
config.rcc.enable_hsi48 = true;
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = khz(200);
|
||||
|
||||
// SPI for sx1276
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI1,
|
||||
@ -35,8 +38,7 @@ async fn main(_spawner: Spawner) {
|
||||
p.PA6,
|
||||
p.DMA1_CH3,
|
||||
p.DMA1_CH2,
|
||||
khz(200),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let nss = Output::new(p.PA15.degrade(), Level::High, Speed::Low);
|
||||
|
@ -32,6 +32,9 @@ async fn main(_spawner: Spawner) {
|
||||
config.rcc.enable_hsi48 = true;
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = khz(200);
|
||||
|
||||
// SPI for sx1276
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI1,
|
||||
@ -40,8 +43,7 @@ async fn main(_spawner: Spawner) {
|
||||
p.PA6,
|
||||
p.DMA1_CH3,
|
||||
p.DMA1_CH2,
|
||||
khz(200),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let nss = Output::new(p.PA15.degrade(), Level::High, Speed::Low);
|
||||
|
@ -27,6 +27,9 @@ async fn main(_spawner: Spawner) {
|
||||
config.rcc.enable_hsi48 = true;
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = khz(200);
|
||||
|
||||
// SPI for sx1276
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI1,
|
||||
@ -35,8 +38,7 @@ async fn main(_spawner: Spawner) {
|
||||
p.PA6,
|
||||
p.DMA1_CH3,
|
||||
p.DMA1_CH2,
|
||||
khz(200),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let nss = Output::new(p.PA15.degrade(), Level::High, Speed::Low);
|
||||
|
@ -27,6 +27,9 @@ async fn main(_spawner: Spawner) {
|
||||
config.rcc.enable_hsi48 = true;
|
||||
let p = embassy_stm32::init(config);
|
||||
|
||||
let mut spi_config = spi::Config::default();
|
||||
spi_config.frequency = khz(200);
|
||||
|
||||
// SPI for sx1276
|
||||
let spi = spi::Spi::new(
|
||||
p.SPI1,
|
||||
@ -35,8 +38,7 @@ async fn main(_spawner: Spawner) {
|
||||
p.PA6,
|
||||
p.DMA1_CH3,
|
||||
p.DMA1_CH2,
|
||||
khz(200),
|
||||
spi::Config::default(),
|
||||
spi_config,
|
||||
);
|
||||
|
||||
let nss = Output::new(p.PA15.degrade(), Level::High, Speed::Low);
|
||||
|
@ -42,7 +42,6 @@ async fn main(_spawner: Spawner) {
|
||||
miso, // Arduino D12
|
||||
NoDma,
|
||||
NoDma,
|
||||
Hertz(1_000_000),
|
||||
spi::Config::default(),
|
||||
);
|
||||
|
||||
|
@ -41,7 +41,6 @@ async fn main(_spawner: Spawner) {
|
||||
miso, // Arduino D12
|
||||
tx_dma,
|
||||
rx_dma,
|
||||
Hertz(1_000_000),
|
||||
spi::Config::default(),
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user