Trait rp6::avr::modules::spi::HardwareSpi

source ·
pub trait HardwareSpi {
    type MasterInSlaveOut: Pin;
    type MasterOutSlaveIn: Pin;
    type Clock: Pin;
    type SlaveSelect: Pin;
    type ControlRegister: Register<T = u8>;
    type StatusRegister: Register<T = u8>;
    type DataRegister: Register<T = u8>;

Show 18 methods // Provided methods fn setup_master(clock: u32) { ... } fn setup_slave(clock: u32) { ... } fn setup_common(clock: u32) { ... } fn set_clock(clock: u32) { ... } fn enable_interrupt() { ... } fn disable_interrupt() { ... } fn enable() { ... } fn disable() { ... } fn set_lsb() { ... } fn set_msb() { ... } fn set_master() { ... } fn set_slave() { ... } fn enable_double_speed() { ... } fn disable_double_speed() { ... } fn is_write_collision() -> bool { ... } fn send_byte(byte: u8) { ... } fn receive_byte() -> u8 { ... } fn send_receive(byte: u8) -> u8 { ... }
}
Expand description

An SPI module.

Information at maxembedded.com.

Required Associated Types§

source

type MasterInSlaveOut: Pin

source

type MasterOutSlaveIn: Pin

source

type Clock: Pin

source

type SlaveSelect: Pin

source

type ControlRegister: Register<T = u8>

The SPI control register.

source

type StatusRegister: Register<T = u8>

The SPI status register.

source

type DataRegister: Register<T = u8>

The SPI data register.

Provided Methods§

source

fn setup_master(clock: u32)

Sets up the SPI as a master.

source

fn setup_slave(clock: u32)

Sets up the SPI as a slave.

source

fn setup_common(clock: u32)

source

fn set_clock(clock: u32)

Sets the clock speed.

source

fn enable_interrupt()

Enables interrupts for the spi module.

source

fn disable_interrupt()

Disables interrupts for the spi module.

source

fn enable()

Enables the SPI.

source

fn disable()

Disables the SPI.

source

fn set_lsb()

Enables least-significant-bit first.

source

fn set_msb()

Enables most-significant-bit first.

source

fn set_master()

Enables master mode.

source

fn set_slave()

Enables slave mode.

source

fn enable_double_speed()

Enables double speed mode.

source

fn disable_double_speed()

Disables double speed mode.

source

fn is_write_collision() -> bool

Checks if there is a write collision.

source

fn send_byte(byte: u8)

Sends a byte through the serial.

source

fn receive_byte() -> u8

Reads a byte from the serial.

source

fn send_receive(byte: u8) -> u8

Sends and receives a byte.

Implementors§