diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d22d3d92..34982fe25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed + +- Use `u8` as default SPI as Serial Word type + ### Added - Added `Can` Controller Area Network traits. - `Error` traits for SPI, I2C and Serial traits. The error types used in those must diff --git a/src/serial/blocking.rs b/src/serial/blocking.rs index 84bc632be..7b9c8a9d2 100644 --- a/src/serial/blocking.rs +++ b/src/serial/blocking.rs @@ -1,7 +1,7 @@ //! Blocking serial API /// Write half of a serial interface (blocking variant) -pub trait Write { +pub trait Write { /// The type of error that can occur when writing type Error: crate::serial::Error; diff --git a/src/serial/nb.rs b/src/serial/nb.rs index 13a845d10..bb0467d66 100644 --- a/src/serial/nb.rs +++ b/src/serial/nb.rs @@ -4,7 +4,7 @@ /// /// Some serial interfaces support different data sizes (8 bits, 9 bits, etc.); /// This can be encoded in this trait via the `Word` type parameter. -pub trait Read { +pub trait Read { /// Read error type Error: crate::serial::Error; @@ -21,7 +21,7 @@ impl, Word> Read for &mut T { } /// Write half of a serial interface -pub trait Write { +pub trait Write { /// Write error type Error: crate::serial::Error; diff --git a/src/spi/blocking.rs b/src/spi/blocking.rs index d2d916aae..1f8f1e8fd 100644 --- a/src/spi/blocking.rs +++ b/src/spi/blocking.rs @@ -1,7 +1,7 @@ //! Blocking SPI API /// Blocking transfer -pub trait Transfer { +pub trait Transfer { /// Error type type Error: crate::spi::Error; @@ -20,7 +20,7 @@ impl, W> Transfer for &mut T { } /// Blocking write -pub trait Write { +pub trait Write { /// Error type type Error: crate::spi::Error; @@ -37,7 +37,7 @@ impl, W> Write for &mut T { } /// Blocking write (iterator version) -pub trait WriteIter { +pub trait WriteIter { /// Error type type Error: crate::spi::Error; @@ -62,7 +62,7 @@ impl, W> WriteIter for &mut T { /// /// This allows composition of SPI operations into a single bus transaction #[derive(Debug, PartialEq)] -pub enum Operation<'a, W: 'static> { +pub enum Operation<'a, W: 'static = u8> { /// Write data from the provided buffer, discarding read data Write(&'a [W]), /// Write data out while reading data into the provided buffer @@ -71,7 +71,7 @@ pub enum Operation<'a, W: 'static> { /// Transactional trait allows multiple actions to be executed /// as part of a single SPI transaction -pub trait Transactional { +pub trait Transactional { /// Associated error type type Error: crate::spi::Error; diff --git a/src/spi/nb.rs b/src/spi/nb.rs index c7d377ef9..6d540a762 100644 --- a/src/spi/nb.rs +++ b/src/spi/nb.rs @@ -16,7 +16,7 @@ /// /// - Some SPIs can work with 8-bit *and* 16-bit words. You can overload this trait with different /// `Word` types to allow operation in both modes. -pub trait FullDuplex { +pub trait FullDuplex { /// An enumeration of SPI errors type Error: crate::spi::Error;