Skip to content

Commit

Permalink
Merge pull request #190 from jonas-schievink/rm-read
Browse files Browse the repository at this point in the history
Remove `Spi::read`
  • Loading branch information
jonas-schievink authored Aug 28, 2020
2 parents 98beae5 + 579c8a4 commit f7854aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
8 changes: 4 additions & 4 deletions examples/spi-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ fn main() -> ! {

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

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

match spi.read(&mut cs.degrade(), &test_vec1, &mut readbuf) {
match spi.transfer_split_uneven(&mut cs.degrade(), &test_vec1, &mut readbuf) {
Ok(_) => {
for i in 0..test_vec1.len() {
tests_ok &= test_vec1[i] == readbuf[i];
Expand Down
13 changes: 0 additions & 13 deletions nrf-hal-common/src/spim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,6 @@ where
Ok(())
}

/// Read from an SPI slave.
///
/// This method is deprecated. Consider using `transfer` or `transfer_split`.
#[inline(always)]
pub fn read(
&mut self,
chip_select: &mut Pin<Output<PushPull>>,
tx_buffer: &[u8],
rx_buffer: &mut [u8],
) -> Result<(), Error> {
self.transfer_split_uneven(chip_select, tx_buffer, rx_buffer)
}

/// Read and write from a SPI slave, using a single buffer.
///
/// This method implements a complete read transaction, which consists of
Expand Down

0 comments on commit f7854aa

Please sign in to comment.