Wafer.Driver.Circuits.SPI (wafer v1.1.1)

View Source

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

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

Summary

Functions

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

Types

driver_option()

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

option()

@type option() :: {:bus_name, binary()}

options()

@type options() :: [option() | driver_option()]

t()

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

Functions

acquire(opts)

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

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