Skip to content

Commit d449105

Browse files
committed
make inplace type public
1 parent 4615314 commit d449105

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/spi/dma.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,15 @@ where
233233
}
234234
}
235235

236-
type DuplexInplaceDmaTransfer<'a, SPI, W, TX, RX> =
236+
pub type DuplexInplaceDmaTransfer<'a, SPI, W, TX, RX> =
237237
DuplexDmaTransfer<'a, SPI, W, TX, RX, &'static [W], &'static mut [W]>;
238238

239239
impl<SPI: Instance, W: FrameSize + Word> Spi<SPI, W> {
240-
pub fn write_dma<TX: Channel>(&mut self, channel: TX, data: &'static [W]) -> Result<TxDmaTransfer<SPI, W, TX, &'static [W]>, Error> {
240+
pub fn write_dma<TX: Channel>(
241+
&mut self,
242+
channel: TX,
243+
data: &'static [W],
244+
) -> Result<TxDmaTransfer<SPI, W, TX, &'static [W]>, Error> {
241245
let mut transfer = TxDmaTransfer::new(self, channel, data);
242246
transfer.start()?;
243247
Ok(transfer)
@@ -251,7 +255,9 @@ impl<SPI: Instance, W: FrameSize + Word> Spi<SPI, W> {
251255
) -> Result<DuplexInplaceDmaTransfer<SPI, W, TX, RX>, Error> {
252256
// Note (unsafe): Data will be read from the start of the buffer before data is written
253257
// to those locations just like for blocking non-DMA in-place transfers
254-
let source = unsafe { core::slice::from_raw_parts(buffer.as_ptr(), buffer.len()) };
258+
let source = unsafe {
259+
core::slice::from_raw_parts(buffer.as_ptr(), buffer.len())
260+
};
255261
let mut transfer = DuplexDmaTransfer::new(
256262
self, tx_channel, rx_channel, source, buffer,
257263
);

0 commit comments

Comments
 (0)