AHT20.I2C.Behaviour behaviour (aht20 v0.1.2) View Source

Defines a behaviour required for I2C device. Based on Circuits I2C's API.

Link to this section Summary

Link to this section Types

Specs

address() :: 0..127

Specs

bus_name() :: String.t()

Specs

data() :: binary()

Specs

opts() :: [{:retries, non_neg_integer()}]

Link to this section Callbacks

Specs

open(bus_name()) :: {:ok, reference()} | {:error, any()}
Link to this callback

read(reference, address, integer, opts)

View Source

Specs

read(reference(), address(), integer(), opts()) ::
  {:ok, binary()} | {:error, any()}
Link to this callback

write(reference, address, data, opts)

View Source

Specs

write(reference(), address(), data(), opts()) :: :ok | {:error, any()}
Link to this callback

write_read(reference, address, data, integer, opts)

View Source

Specs

write_read(reference(), address(), data(), integer(), opts()) ::
  {:ok, binary()} | {:error, any()}