diff --git a/src/blocking/i2c.rs b/src/blocking/i2c.rs index db9f278c1..48ddf255f 100644 --- a/src/blocking/i2c.rs +++ b/src/blocking/i2c.rs @@ -143,7 +143,7 @@ pub trait Write { /// Error type type Error; - /// Sends bytes to slave with address `address` + /// Writes bytes to slave with address `address` /// /// # I2C Events (contract) /// @@ -167,7 +167,7 @@ pub trait WriteIter { /// Error type type Error; - /// Sends bytes to slave with address `address` + /// Writes bytes to slave with address `address` /// /// # I2C Events (contract) /// @@ -182,7 +182,7 @@ pub trait WriteRead { /// Error type type Error; - /// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a + /// Writes bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a /// single transaction* /// /// # I2C Events (contract) @@ -217,7 +217,7 @@ pub trait WriteIterRead { /// Error type type Error; - /// Sends bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a + /// Writes bytes to slave with address `address` and then reads enough bytes to fill `buffer` *in a /// single transaction* /// /// # I2C Events (contract) diff --git a/src/blocking/spi.rs b/src/blocking/spi.rs index 2e6a8f8ee..571f7b32a 100644 --- a/src/blocking/spi.rs +++ b/src/blocking/spi.rs @@ -5,7 +5,7 @@ pub trait Transfer { /// Error type type Error; - /// Sends `words` to the slave. Returns the `words` received from the slave + /// Writes `words` to the slave. Returns the `words` received from the slave fn transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], Self::Error>; } @@ -14,7 +14,7 @@ pub trait Write { /// Error type type Error; - /// Sends `words` to the slave, ignoring all the incoming words + /// Writes `words` to the slave, ignoring all the incoming words fn write(&mut self, words: &[W]) -> Result<(), Self::Error>; } @@ -23,7 +23,7 @@ pub trait WriteIter { /// Error type type Error; - /// Sends `words` to the slave, ignoring all the incoming words + /// Writes `words` to the slave, ignoring all the incoming words fn write_iter(&mut self, words: WI) -> Result<(), Self::Error> where WI: IntoIterator; @@ -44,7 +44,7 @@ pub mod transfer { fn transfer<'w>(&mut self, words: &'w mut [W]) -> Result<&'w [W], S::Error> { for word in words.iter_mut() { - nb::block!(self.send(word.clone()))?; + nb::block!(self.write(word.clone()))?; *word = nb::block!(self.read())?; } @@ -68,7 +68,7 @@ pub mod write { fn write(&mut self, words: &[W]) -> Result<(), S::Error> { for word in words { - nb::block!(self.send(word.clone()))?; + nb::block!(self.write(word.clone()))?; nb::block!(self.read())?; } @@ -95,7 +95,7 @@ pub mod write_iter { WI: IntoIterator, { for word in words.into_iter() { - nb::block!(self.send(word.clone()))?; + nb::block!(self.write(word.clone()))?; nb::block!(self.read())?; } diff --git a/src/lib.rs b/src/lib.rs index 8522caaa5..2ce5b13a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -193,7 +193,7 @@ //! //! ### Blocking mode //! -//! An example of sending a string over the serial interface in a blocking +//! An example of writing a string over the serial interface in a blocking //! fashion: //! //! ``` diff --git a/src/nb/spi.rs b/src/nb/spi.rs index dee4ebc7b..6eb7fc233 100644 --- a/src/nb/spi.rs +++ b/src/nb/spi.rs @@ -6,9 +6,9 @@ /// /// - It's the task of the user of this interface to manage the slave select lines /// -/// - Due to how full duplex SPI works each `read` call must be preceded by a `send` call. +/// - Due to how full duplex SPI works each `read` call must be preceded by a `write` call. /// -/// - `read` calls only return the data received with the last `send` call. +/// - `read` calls only return the data received with the last `write` call. /// Previously received data is discarded /// /// - Data is only guaranteed to be clocked out when the `read` call succeeds. @@ -26,8 +26,8 @@ pub trait FullDuplex { /// method. fn read(&mut self) -> nb::Result; - /// Sends a word to the slave - fn send(&mut self, word: Word) -> nb::Result<(), Self::Error>; + /// Writes a word to the slave + fn write(&mut self, word: Word) -> nb::Result<(), Self::Error>; } /// Clock polarity