pub struct Iom<'a> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<'a> I2CMaster<'a> for Iom<'a>
impl<'a> I2CMaster<'a> for Iom<'a>
fn set_master_client(&self, i2c_master_client: &'a dyn I2CHwMasterClient)
fn enable(&self)
fn disable(&self)
fn write_read( &self, addr: u8, data: &'static mut [u8], write_len: usize, read_len: usize, ) -> Result<(), (Error, &'static mut [u8])>
fn write( &self, addr: u8, data: &'static mut [u8], len: usize, ) -> Result<(), (Error, &'static mut [u8])>
fn read( &self, addr: u8, buffer: &'static mut [u8], len: usize, ) -> Result<(), (Error, &'static mut [u8])>
Source§impl<'a> SMBusMaster<'a> for Iom<'a>
impl<'a> SMBusMaster<'a> for Iom<'a>
Source§fn smbus_write_read(
&self,
addr: u8,
data: &'static mut [u8],
write_len: usize,
read_len: usize,
) -> Result<(), (Error, &'static mut [u8])>
fn smbus_write_read( &self, addr: u8, data: &'static mut [u8], write_len: usize, read_len: usize, ) -> Result<(), (Error, &'static mut [u8])>
Write data then read data via the I2C Master device in an SMBus
compatible way. Read more
Source§impl<'a> SpiMaster<'a> for Iom<'a>
impl<'a> SpiMaster<'a> for Iom<'a>
Source§type ChipSelect = ChipSelectPolar<'a, GpioPin<'a>>
type ChipSelect = ChipSelectPolar<'a, GpioPin<'a>>
Chip select is an associated type because different SPI buses may have
different numbers of chip selects. This allows peripheral
implementations to define their own type.
Source§fn init(&self) -> Result<(), ErrorCode>
fn init(&self) -> Result<(), ErrorCode>
Initialize this SPI interface. Call this once before invoking any other
operations. Read more
Source§fn set_client(&self, client: &'a dyn SpiMasterClient)
fn set_client(&self, client: &'a dyn SpiMasterClient)
Change the callback handler for
SpiMaster::read_write_bytes
calls.Source§fn is_busy(&self) -> bool
fn is_busy(&self) -> bool
Return whether the SPI peripheral is busy with a
SpiMaster::read_write_bytes
operation.Source§fn read_write_bytes(
&self,
write_buffer: SubSliceMut<'static, u8>,
read_buffer: Option<SubSliceMut<'static, u8>>,
) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>, Option<SubSliceMut<'static, u8>>)>
fn read_write_bytes( &self, write_buffer: SubSliceMut<'static, u8>, read_buffer: Option<SubSliceMut<'static, u8>>, ) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>, Option<SubSliceMut<'static, u8>>)>
Perform an asynchronous read/write operation, whose completion is
signaled by invoking
SpiMasterClient
on the client. Write-only
operations may pass None
for read_buffer
, while read-write
operations pass Some
for read_buffer
. Read moreSource§fn write_byte(&self, val: u8) -> Result<(), ErrorCode>
fn write_byte(&self, val: u8) -> Result<(), ErrorCode>
Synchronously write a single byte on the bus. Not for general use
because it is blocking: intended for debugging. Read more
Source§fn read_byte(&self) -> Result<u8, ErrorCode>
fn read_byte(&self) -> Result<u8, ErrorCode>
Synchronously write a 0 and read a single byte from the bus. Not for
general use because it is blocking: intended for debugging. Read more
Source§fn read_write_byte(&self, val: u8) -> Result<u8, ErrorCode>
fn read_write_byte(&self, val: u8) -> Result<u8, ErrorCode>
Synchronously write and read a single byte. Not for general use because
it is blocking: intended for debugging. Read more
Source§fn specify_chip_select(&self, cs: Self::ChipSelect) -> Result<(), ErrorCode>
fn specify_chip_select(&self, cs: Self::ChipSelect) -> Result<(), ErrorCode>
Specify which chip select to use. Configuration settings (rate,
polarity, phase) are chip-select specific and are stored for that chip
select.
Source§fn set_rate(&self, rate: u32) -> Result<u32, ErrorCode>
fn set_rate(&self, rate: u32) -> Result<u32, ErrorCode>
Set the clock/data rate for the current chip select. Read more
Source§fn set_polarity(&self, polarity: ClockPolarity) -> Result<(), ErrorCode>
fn set_polarity(&self, polarity: ClockPolarity) -> Result<(), ErrorCode>
Set the bus polarity (whether idle is high or low) for the
current chip select. Read more
Source§fn get_polarity(&self) -> ClockPolarity
fn get_polarity(&self) -> ClockPolarity
Return the current bus polarity.
Source§fn set_phase(&self, phase: ClockPhase) -> Result<(), ErrorCode>
fn set_phase(&self, phase: ClockPhase) -> Result<(), ErrorCode>
Set the bus phase for the current chip select (whether data is
sent/received on leading or trailing edges). Read more
Source§fn get_phase(&self) -> ClockPhase
fn get_phase(&self) -> ClockPhase
Get the current bus phase for the current chip select.
Source§fn hold_low(&self)
fn hold_low(&self)
Hold the chip select line low after a
SpiMaster::read_write_bytes
completes. This allows a client to make one long SPI read/write with
multiple calls to read_write_bytes
.Source§fn release_low(&self)
fn release_low(&self)
Raise the chip select line after a
SpiMaster::read_write_bytes
completes. This will complete the SPI operation.Auto Trait Implementations§
impl<'a> !Freeze for Iom<'a>
impl<'a> !RefUnwindSafe for Iom<'a>
impl<'a> !Send for Iom<'a>
impl<'a> !Sync for Iom<'a>
impl<'a> Unpin for Iom<'a>
impl<'a> !UnwindSafe for Iom<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more