Trait attiny_hal::spi::SpiOps

source ·
pub trait SpiOps<H, SCLK, MOSI, MISO, CS> {
    // Required methods
    fn raw_setup(&mut self, settings: &Settings);
    fn raw_release(&mut self);
    fn raw_check_iflag(&self) -> bool;
    fn raw_read(&self) -> u8;
    fn raw_write(&mut self, byte: u8);
    fn raw_transaction(&mut self, byte: u8) -> u8;
}
Expand description

Internal trait for low-level SPI peripherals

This trait defines the common interface for all SPI peripheral variants. It is used as an intermediate abstraction ontop of which the Spi API is built. Prefer using the Spi API instead of this trait.

Required Methods§

source

fn raw_setup(&mut self, settings: &Settings)

Sets up the control/status registers with the right settings for this secondary device

source

fn raw_release(&mut self)

Disable the peripheral

source

fn raw_check_iflag(&self) -> bool

Check the interrupt flag to see if the write has completed

Returns true if the bus is idle

source

fn raw_read(&self) -> u8

Read a byte from the data register

source

fn raw_write(&mut self, byte: u8)

Write a byte to the data register, which begins transmission automatically.

source

fn raw_transaction(&mut self, byte: u8) -> u8

Perform a transaction of a single byte

Implementors§