Skip to content

Commit f7854aa

Browse files
Merge pull request #190 from jonas-schievink/rm-read
Remove `Spi::read`
2 parents 98beae5 + 579c8a4 commit f7854aa

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

examples/spi-demo/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ fn main() -> ! {
6363

6464
// This will write 8 bytes, then shift out ORC
6565

66-
// Note : spi.read( &mut cs.degrade(), reference_data, &mut readbuf )
67-
// will fail because reference data is in flash, the copy to
68-
// an array will move it to RAM.
66+
// Note: `spi.transfer_split_uneven(&mut cs.degrade(), reference_data, &mut readbuf)`
67+
// will fail because reference data is in flash, the copy to an array
68+
// will move it to RAM.
6969

70-
match spi.read(&mut cs.degrade(), &test_vec1, &mut readbuf) {
70+
match spi.transfer_split_uneven(&mut cs.degrade(), &test_vec1, &mut readbuf) {
7171
Ok(_) => {
7272
for i in 0..test_vec1.len() {
7373
tests_ok &= test_vec1[i] == readbuf[i];

nrf-hal-common/src/spim.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,6 @@ where
220220
Ok(())
221221
}
222222

223-
/// Read from an SPI slave.
224-
///
225-
/// This method is deprecated. Consider using `transfer` or `transfer_split`.
226-
#[inline(always)]
227-
pub fn read(
228-
&mut self,
229-
chip_select: &mut Pin<Output<PushPull>>,
230-
tx_buffer: &[u8],
231-
rx_buffer: &mut [u8],
232-
) -> Result<(), Error> {
233-
self.transfer_split_uneven(chip_select, tx_buffer, rx_buffer)
234-
}
235-
236223
/// Read and write from a SPI slave, using a single buffer.
237224
///
238225
/// This method implements a complete read transaction, which consists of

0 commit comments

Comments
 (0)