Skip to content

Commit 5fd6d10

Browse files
kalkyljamesmunns
authored andcommitted
Remove rx & tx functions
1 parent 0595f11 commit 5fd6d10

File tree

1 file changed

+0
-59
lines changed

1 file changed

+0
-59
lines changed

nrf-hal-common/src/spis.rs

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -297,34 +297,6 @@ where
297297
&self.0.tasks_release
298298
}
299299

300-
/// Receives data into the given `buffer` until it's filled.
301-
/// Buffer must be located in RAM.
302-
/// Returns a value that represents the in-progress DMA transfer.
303-
#[allow(unused_mut)]
304-
pub fn rx<W, B>(mut self, mut buffer: B) -> Result<Transfer<T, B>, Error>
305-
where
306-
B: WriteBuffer<Word = W>,
307-
{
308-
let (ptr, len) = unsafe { buffer.write_buffer() };
309-
let maxcnt = len * core::mem::size_of::<W>();
310-
if maxcnt > EASY_DMA_SIZE {
311-
return Err(Error::BufferTooLong);
312-
}
313-
self.0
314-
.rxd
315-
.ptr
316-
.write(|w| unsafe { w.ptr().bits(ptr as u32) });
317-
self.0
318-
.rxd
319-
.maxcnt
320-
.write(|w| unsafe { w.bits(maxcnt as u32) });
321-
322-
self.release();
323-
Ok(Transfer {
324-
inner: Some(Inner { buffer, spis: self }),
325-
})
326-
}
327-
328300
/// Full duplex DMA transfer.
329301
/// Transmits the given buffer while simultaneously receiving data into the same buffer until it is filled.
330302
/// Buffer must be located in RAM.
@@ -415,37 +387,6 @@ where
415387
})
416388
}
417389

418-
/// Transmits the given `tx_buffer`. Buffer must be located in RAM.
419-
/// Returns a value that represents the in-progress DMA transfer.
420-
#[allow(unused_mut)]
421-
pub fn tx<W, B>(mut self, buffer: B) -> Result<Transfer<T, B>, Error>
422-
where
423-
B: ReadBuffer<Word = W>,
424-
{
425-
let (ptr, len) = unsafe { buffer.read_buffer() };
426-
let maxcnt = len * core::mem::size_of::<W>();
427-
if maxcnt > EASY_DMA_SIZE {
428-
return Err(Error::BufferTooLong);
429-
}
430-
if (ptr as usize) < SRAM_LOWER || (ptr as usize) > SRAM_UPPER {
431-
return Err(Error::DMABufferNotInDataMemory);
432-
}
433-
434-
self.0
435-
.txd
436-
.ptr
437-
.write(|w| unsafe { w.ptr().bits(ptr as u32) });
438-
self.0
439-
.txd
440-
.maxcnt
441-
.write(|w| unsafe { w.bits(maxcnt as u32) });
442-
443-
self.release();
444-
Ok(Transfer {
445-
inner: Some(Inner { buffer, spis: self }),
446-
})
447-
}
448-
449390
/// Returns the raw interface to the underlying SPIS peripheral.
450391
pub fn free(self) -> T {
451392
self.0

0 commit comments

Comments
 (0)