# Spi in k210_hal::spi - Rust
Keywords: rust, rustlang, rust-lang, Spi

# Struct k210_hal::spi::Spi

source · [−]

    pub struct Spi<SPI> { /* private fields */ }

Expand description

## Implementations

source

### impl Spi<SPI0>

source

#### pub fn spi0(
spi: SPI0,
mode: Mode,
frame_format: FrameFormat,
endian: Endian,
clock: &Clocks,
apb0: &mut APB0
) -> Self

source

#### pub fn release(self) -> SPI0

## Trait Implementations

source

### impl FullDuplex<u8> for Spi<SPI0>

#### type Error = Infallible

An enumeration of SPI errors

source

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

Reads the word stored in the shift register

NOTE A word must be sent to the slave before attempting to call this method.

source

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

Sends a word to the slave

## Auto Trait Implementations

### impl<SPI> RefUnwindSafe for Spi<SPI> where
SPI: RefUnwindSafe,

### impl<SPI> Send for Spi<SPI> where
SPI: Send,

### impl<SPI> Sync for Spi<SPI> where
SPI: Sync,

### impl<SPI> Unpin for Spi<SPI> where
SPI: Unpin,

### impl<SPI> UnwindSafe for Spi<SPI> where
SPI: 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,

const: unstable · source

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

source

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

const: unstable · source

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

Mutably borrows from an owned value. Read more

source

### impl<T> From<T> for T

const: unstable · source

#### fn from(t: T) -> T

Returns the argument unchanged.

source

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

const: unstable · 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.

const: unstable · 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.

const: unstable · source

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

Performs the conversion.