xwrust::xwds::spim

Struct Spim

source
#[repr(C)]
pub struct Spim { /* private fields */ }
Expand description

SPI主机模式控制器

Implementations§

source§

impl Spim

source

pub fn buscfg(&self, cfgid: XwId, to: XwTm) -> XwEr

配置总线

§参数说明
  • cfgid: 总线配置ID
  • to: 期望唤醒的时间点
§错误码
source

pub fn xfer( &self, txd: &[u8], rxd: &mut [u8], size: &mut XwSz, to: XwTm, ) -> XwEr

传输SPI消息

§参数说明
  • txd: 发送数据的缓冲区
  • rxd: 接收数据的缓冲区
  • size: 传输的大小
    • (I) 作为输入时,表示缓冲区大小(单位:字节)
    • (O) 作为输出时,返回实际传输的数据大小
  • to: 期望唤醒的时间点
§错误码
source

pub fn abort(&self, to: XwTm) -> XwEr

中止SPI总线传输

§参数说明
  • to: 期望唤醒的时间点
§错误码

Auto Trait Implementations§

§

impl !Freeze for Spim

§

impl !RefUnwindSafe for Spim

§

impl Send for Spim

§

impl !Sync for Spim

§

impl Unpin for Spim

§

impl UnwindSafe for Spim

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.