wafer v0.1.0 Wafer.Driver.Circuits.SPI

A connection to a chip via Circuits's SPI driver.

Implements the Wafer.Conn behaviour as well as the Wafer.SPI protocol.

Link to this section Summary

Functions

Acquire a connection to a peripheral using the Circuits' SPI driver on the specified bus and address.

Link to this section Types

Link to this type

driver_option()

driver_option() ::
  {:mode, 0..3}
  | {:bits_per_word, 0..16}
  | {:speed_hz, pos_integer()}
  | {:delay_us, non_neg_integer()}
Link to this type

option()

option() :: {:bus_name, binary()}
Link to this type

options()

options() :: [option() | driver_option()]
Link to this type

t()

t() :: %Wafer.Driver.Circuits.SPI{bus: binary(), ref: reference()}

Link to this section Functions

Link to this function

acquire(opts)

acquire(options()) :: {:ok, t()} | {:error, reason :: any()}

Acquire a connection to a peripheral using the Circuits' SPI driver on the specified bus and address.