Struct apollo3::iom::Iom

source ·
pub struct Iom<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Iom<'_>

source

pub fn new0() -> Iom<'a>

source

pub fn new1() -> Iom<'a>

source

pub fn new2() -> Iom<'a>

source

pub fn new3() -> Iom<'a>

source

pub fn new4() -> Iom<'a>

source

pub fn new5() -> Iom<'a>

source

pub fn handle_interrupt(&self)

Trait Implementations§

source§

impl<'a> I2CMaster<'a> for Iom<'a>

source§

fn set_master_client(&self, i2c_master_client: &'a dyn I2CHwMasterClient)

source§

fn enable(&self)

source§

fn disable(&self)

source§

fn write_read( &self, addr: u8, data: &'static mut [u8], write_len: usize, read_len: usize ) -> Result<(), (Error, &'static mut [u8])>

source§

fn write( &self, addr: u8, data: &'static mut [u8], len: usize ) -> Result<(), (Error, &'static mut [u8])>

source§

fn read( &self, addr: u8, buffer: &'static mut [u8], len: usize ) -> Result<(), (Error, &'static mut [u8])>

source§

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])>

Write data then read data via the I2C Master device in an SMBus compatible way. Read more
source§

fn smbus_write( &self, addr: u8, data: &'static mut [u8], len: usize ) -> Result<(), (Error, &'static mut [u8])>

Write data via the I2C Master device in an SMBus compatible way. Read more
source§

fn smbus_read( &self, addr: u8, buffer: &'static mut [u8], len: usize ) -> Result<(), (Error, &'static mut [u8])>

Read data via the I2C Master device in an SMBus compatible way. Read more
source§

impl<'a> SpiMaster<'a> for Iom<'a>

§

type ChipSelect = &'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>

Initialize this SPI interface. Call this once before invoking any other operations. Return values are: Read more
source§

fn set_client(&self, client: &'a dyn SpiMasterClient)

Change the callback handler for read_write_bytes calls.
source§

fn is_busy(&self) -> bool

Return whether the SPI peripheral is busy with read_write_bytes call.
source§

fn read_write_bytes( &self, write_buffer: &'static mut [u8], read_buffer: Option<&'static mut [u8]>, len: usize ) -> Result<(), (ErrorCode, &'static mut [u8], Option<&'static mut [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 more
source§

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. Return values: Read more
source§

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. Return values: Read more
source§

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. Return values: Read more
source§

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>

Set the clock/data rate for the current chip select. Return values: Read more
source§

fn get_rate(&self) -> u32

Return the current chip select’s clock rate.
source§

fn set_polarity(&self, polarity: ClockPolarity) -> Result<(), ErrorCode>

Set the bus polarity (whether idle is high or low) for the current chip select. Return values: Read more
source§

fn get_polarity(&self) -> ClockPolarity

Return the current bus polarity.
source§

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

Get the current bus phase for the current chip select.
source§

fn hold_low(&self)

Hold the chip select line low after a 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)

Raise the chip select line after a 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> 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> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
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.