stm32/spi: add support for all word sizes.

Co-Authored-By: anton smeenk <asmeenk@planet.nl>
This commit is contained in:
Dario Nieuwenhuis
2023-04-18 20:56:23 +02:00
parent a673b9aa29
commit 2080d8bb6d
6 changed files with 197 additions and 140 deletions

View File

@ -9,7 +9,8 @@ use embassy_hal_common::{into_ref, Peripheral, PeripheralRef};
use embassy_sync::waitqueue::AtomicWaker;
use pac::dma::regs;
use super::{Dir, Word, WordSize};
use super::word::{Word, WordSize};
use super::Dir;
use crate::_generated::DMA_CHANNEL_COUNT;
use crate::interrupt::{Interrupt, InterruptExt};
use crate::pac::dma::vals;
@ -246,7 +247,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
ptr as *mut u32,
len,
true,
W::bits(),
W::size(),
options,
)
}
@ -281,7 +282,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
ptr as *mut u32,
len,
true,
W::bits(),
W::size(),
options,
)
}
@ -304,7 +305,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
repeated as *const W as *mut u32,
count,
false,
W::bits(),
W::size(),
options,
)
}
@ -464,7 +465,7 @@ impl<'a, C: Channel, W: Word> DoubleBuffered<'a, C, W> {
assert!(len > 0 && len <= 0xFFFF);
let dir = Dir::PeripheralToMemory;
let data_size = W::bits();
let data_size = W::size();
let channel_number = channel.num();
let dma = channel.regs();