Skip to main content

Instance

Trait Instance 

Source
pub trait Instance: Enable + Reset {
Show 13 methods // Required methods fn apply_config(&mut self, config: SpiConfig, wide: bool); fn tbe(&self) -> bool; fn rbne(&self) -> bool; fn write_data(&mut self, word: u16); fn read_data(&mut self) -> u16; fn take_error(&mut self) -> Option<Error>; fn set_rbneie(&mut self, on: bool); fn rbneie(&self) -> bool; fn set_tbeie(&mut self, on: bool); fn tbeie(&self) -> bool; fn set_errie(&mut self, on: bool); fn errie(&self) -> bool; fn shut_down(&mut self);
}
Expand description

A peripheral that Spi can drive.

Required Methods§

Source

fn apply_config(&mut self, config: SpiConfig, wide: bool)

Writes the full master configuration, leaving the peripheral enabled.

wide selects the frame width, and the impl handles what follows from it (on SPI1 the FIFO access size must match, or reception stalls).

Source

fn tbe(&self) -> bool

Transmit buffer empty — ready to accept the next word.

Source

fn rbne(&self) -> bool

Receive buffer not empty — a word has arrived.

Source

fn write_data(&mut self, word: u16)

Writes a word to the data register, which starts the clock in master mode.

Source

fn read_data(&mut self) -> u16

Reads the received word from the data register.

Source

fn take_error(&mut self) -> Option<Error>

Returns the first pending error, if any, clearing it as the manual requires.

Source

fn set_rbneie(&mut self, on: bool)

Enables or disables the receive interrupt (RBNEIE).

Source

fn rbneie(&self) -> bool

Reads back RBNEIE.

Source

fn set_tbeie(&mut self, on: bool)

Enables or disables the transmit interrupt (TBEIE).

Source

fn tbeie(&self) -> bool

Reads back TBEIE.

Source

fn set_errie(&mut self, on: bool)

Enables or disables the error interrupt (ERRIE).

Source

fn errie(&self) -> bool

Reads back ERRIE.

Source

fn shut_down(&mut self)

Waits for the last word to leave the wire, clears SPIEN and drains the receive side, in the order the manual gives for this instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Instance for Spi0

Source§

fn apply_config(&mut self, config: SpiConfig, wide: bool)

Source§

fn tbe(&self) -> bool

Source§

fn rbne(&self) -> bool

Source§

fn write_data(&mut self, word: u16)

Source§

fn read_data(&mut self) -> u16

Source§

fn take_error(&mut self) -> Option<Error>

Source§

fn set_rbneie(&mut self, on: bool)

Source§

fn rbneie(&self) -> bool

Source§

fn set_tbeie(&mut self, on: bool)

Source§

fn tbeie(&self) -> bool

Source§

fn set_errie(&mut self, on: bool)

Source§

fn errie(&self) -> bool

Source§

fn shut_down(&mut self)

Source§

impl Instance for Spi1

Source§

fn apply_config(&mut self, config: SpiConfig, wide: bool)

Source§

fn tbe(&self) -> bool

Source§

fn rbne(&self) -> bool

Source§

fn write_data(&mut self, word: u16)

Source§

fn read_data(&mut self) -> u16

Source§

fn take_error(&mut self) -> Option<Error>

Source§

fn set_rbneie(&mut self, on: bool)

Source§

fn rbneie(&self) -> bool

Source§

fn set_tbeie(&mut self, on: bool)

Source§

fn tbeie(&self) -> bool

Source§

fn set_errie(&mut self, on: bool)

Source§

fn errie(&self) -> bool

Source§

fn shut_down(&mut self)

Implementors§