Struct shared_bus_rtic::CommonBus

source ·
pub struct CommonBus<BUS> { /* private fields */ }

Implementations§

source§

impl<BUS> CommonBus<BUS>

source

pub fn new(bus: BUS) -> Self

source

pub fn acquire(&self) -> &Self

Trait Implementations§

source§

impl<BUS: Read> Read for &CommonBus<BUS>

§

type Error = <BUS as Read>::Error

Error type
source§

fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>

Reads enough bytes from slave with address to fill buffer Read more
source§

impl<BUS: Write> Write for &CommonBus<BUS>

§

type Error = <BUS as Write>::Error

Error type
source§

fn write(&mut self, address: u8, buffer: &[u8]) -> Result<(), Self::Error>

Writes bytes to slave with address address Read more
source§

impl<BUS: WriteRead> WriteRead for &CommonBus<BUS>

§

type Error = <BUS as WriteRead>::Error

Error type
source§

fn write_read( &mut self, address: u8, bytes: &[u8], buffer: &mut [u8], ) -> Result<(), Self::Error>

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction Read more
source§

impl<BUS: Transfer<u16>> Transfer<u16> for &CommonBus<BUS>

§

type Error = <BUS as Transfer<u16>>::Error

Error type
source§

fn transfer<'w>( &mut self, words: &'w mut [u16], ) -> Result<&'w [u16], Self::Error>

Sends words to the slave. Returns the words received from the slave
source§

impl<BUS: Transfer<u32>> Transfer<u32> for &CommonBus<BUS>

§

type Error = <BUS as Transfer<u32>>::Error

Error type
source§

fn transfer<'w>( &mut self, words: &'w mut [u32], ) -> Result<&'w [u32], Self::Error>

Sends words to the slave. Returns the words received from the slave
source§

impl<BUS: Transfer<u64>> Transfer<u64> for &CommonBus<BUS>

§

type Error = <BUS as Transfer<u64>>::Error

Error type
source§

fn transfer<'w>( &mut self, words: &'w mut [u64], ) -> Result<&'w [u64], Self::Error>

Sends words to the slave. Returns the words received from the slave
source§

impl<BUS: Transfer<u8>> Transfer<u8> for &CommonBus<BUS>

§

type Error = <BUS as Transfer<u8>>::Error

Error type
source§

fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error>

Sends words to the slave. Returns the words received from the slave
source§

impl<BUS: Write<u16>> Write<u16> for &CommonBus<BUS>

§

type Error = <BUS as Write<u16>>::Error

Error type
source§

fn write(&mut self, words: &[u16]) -> Result<(), Self::Error>

Sends words to the slave, ignoring all the incoming words
source§

impl<BUS: Write<u32>> Write<u32> for &CommonBus<BUS>

§

type Error = <BUS as Write<u32>>::Error

Error type
source§

fn write(&mut self, words: &[u32]) -> Result<(), Self::Error>

Sends words to the slave, ignoring all the incoming words
source§

impl<BUS: Write<u64>> Write<u64> for &CommonBus<BUS>

§

type Error = <BUS as Write<u64>>::Error

Error type
source§

fn write(&mut self, words: &[u64]) -> Result<(), Self::Error>

Sends words to the slave, ignoring all the incoming words
source§

impl<BUS: Write<u8>> Write<u8> for &CommonBus<BUS>

§

type Error = <BUS as Write<u8>>::Error

Error type
source§

fn write(&mut self, words: &[u8]) -> Result<(), Self::Error>

Sends words to the slave, ignoring all the incoming words
source§

impl<BUS: FullDuplex<u16>> FullDuplex<u16> for &CommonBus<BUS>

§

type Error = <BUS as FullDuplex<u16>>::Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u16, Self::Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, word: u16) -> Result<(), Self::Error>

Sends a word to the slave
source§

impl<BUS: FullDuplex<u32>> FullDuplex<u32> for &CommonBus<BUS>

§

type Error = <BUS as FullDuplex<u32>>::Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u32, Self::Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, word: u32) -> Result<(), Self::Error>

Sends a word to the slave
source§

impl<BUS: FullDuplex<u64>> FullDuplex<u64> for &CommonBus<BUS>

§

type Error = <BUS as FullDuplex<u64>>::Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u64, Self::Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, word: u64) -> Result<(), Self::Error>

Sends a word to the slave
source§

impl<BUS: FullDuplex<u8>> FullDuplex<u8> for &CommonBus<BUS>

§

type Error = <BUS as FullDuplex<u8>>::Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u8, Self::Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, word: u8) -> Result<(), Self::Error>

Sends a word to the slave
source§

impl<BUS> Sync for CommonBus<BUS>

Auto Trait Implementations§

§

impl<BUS> !Freeze for CommonBus<BUS>

§

impl<BUS> !RefUnwindSafe for CommonBus<BUS>

§

impl<BUS> Send for CommonBus<BUS>
where BUS: Send,

§

impl<BUS> Unpin for CommonBus<BUS>
where BUS: Unpin,

§

impl<BUS> UnwindSafe for CommonBus<BUS>
where BUS: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.