inky v1.0.2 Inky.InkyIO behaviour View Source

A behaviour for defining how IO is performed on a specific platform.

Link to this section Summary

Link to this section Types

Link to this type

init_opt() View Source
init_opt() :: {:pin_mappings, map()}

Link to this type

io_bit() View Source
io_bit() :: 0 | 1

Link to this type

io_data() View Source
io_data() :: integer() | binary() | [integer() | binary()]

Link to this type

io_state() View Source
io_state() :: any()

Link to this section Callbacks

Link to this callback

handle_command(state, command) View Source
handle_command(state :: io_state(), command :: io_command()) ::
  {:ok, binary()} | {:error, any()}

Link to this callback

handle_command(state, command, data) View Source
handle_command(state :: io_state(), command :: io_command(), data :: io_data()) ::
  {:ok, binary()} | {:error, any()}

Link to this callback

handle_read_busy(state) View Source
handle_read_busy(state :: io_state()) :: io_bit()

Link to this callback

handle_reset(state, value) View Source
handle_reset(state :: io_state(), value :: io_bit()) :: :ok

Link to this callback

handle_sleep(state, sleep_time) View Source
handle_sleep(state :: io_state(), sleep_time :: non_neg_integer()) :: :ok

Link to this callback

init(opts) View Source
init(opts :: [init_opt()]) :: io_state()