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§
type MasterInSlaveOut: Pin
type MasterOutSlaveIn: Pin
type Clock: Pin
type SlaveSelect: Pin
sourcetype ControlRegister: Register<T = u8>
type ControlRegister: Register<T = u8>
The SPI control register.
sourcetype StatusRegister: Register<T = u8>
type StatusRegister: Register<T = u8>
The SPI status register.
sourcetype DataRegister: Register<T = u8>
type DataRegister: Register<T = u8>
The SPI data register.
Provided Methods§
sourcefn setup_master(clock: u32)
fn setup_master(clock: u32)
Sets up the SPI as a master.
sourcefn setup_slave(clock: u32)
fn setup_slave(clock: u32)
Sets up the SPI as a slave.
fn setup_common(clock: u32)
sourcefn enable_interrupt()
fn enable_interrupt()
Enables interrupts for the spi module.
sourcefn disable_interrupt()
fn disable_interrupt()
Disables interrupts for the spi module.
sourcefn set_master()
fn set_master()
Enables master mode.
sourcefn enable_double_speed()
fn enable_double_speed()
Enables double speed mode.
sourcefn disable_double_speed()
fn disable_double_speed()
Disables double speed mode.
sourcefn is_write_collision() -> bool
fn is_write_collision() -> bool
Checks if there is a write collision.
sourcefn receive_byte() -> u8
fn receive_byte() -> u8
Reads a byte from the serial.
sourcefn send_receive(byte: u8) -> u8
fn send_receive(byte: u8) -> u8
Sends and receives a byte.