pub struct Spi<SPI, PINS, TRANSFER_MODE = TransferModeNormal, OPERATION = Master> { /* private fields */ }

Implementations

Enable/disable spi

Enable interrupts for the given event:

  • Received data ready to be read (RXNE)
  • Transmit data register empty (TXE)
  • Transfer error

Disable interrupts for the given event:

  • Received data ready to be read (RXNE)
  • Transmit data register empty (TXE)
  • Transfer error

Return true if the TXE flag is set, i.e. new data to transmit can be written to the SPI.

Return true if the RXNE flag is set, i.e. new data has been received and can be read from the SPI.

Return true if the MODF flag is set, i.e. the SPI has experienced a Master Mode Fault. (see chapter 28.3.10 of the STM32F4 Reference Manual)

Return true if the OVR flag is set, i.e. new data has been received while the receive data register was already filled.

Trait Implementations

Formats the value using the given formatter. Read more

Error type

An enumeration of SPI errors

Reads the word stored in the shift register Read more

Sends a word to the slave

An enumeration of SPI errors

Reads the word stored in the shift register Read more

Sends a word to the slave

Reads the word stored in the shift register Read more

Writes a word to the slave

Reads the word stored in the shift register Read more

Writes a word to the slave

Reads words from the slave. Read more

Associated error type

Execute the provided transactions

Execute the provided transactions

Writes and reads simultaneously. write is written to the slave on MOSI and words received on MISO are stored in read. Read more

Error type

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

Writes and reads simultaneously. The contents of words are written to the slave, and the received words are stored into the same words buffer, overwriting it. Read more

Writes words to the slave, ignoring all the incoming words

Writes words to the slave, ignoring all the incoming words

Error type

Sends words to the slave, ignoring all the incoming words

Error type

Sends words to the slave, ignoring all the incoming words

Writes words to the slave, ignoring all the incoming words

Writes words to the slave, ignoring all the incoming words

Error type

Sends words to the slave, ignoring all the incoming words

Error type

Sends words to the slave, ignoring all the incoming words

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.