AHT20.Transport behaviour (aht20 v0.2.1) 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

bus_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, bus_address, integer)

View Source

Specs

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

write(reference, bus_address, data)

View Source

Specs

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

write_read(reference, bus_address, data, integer)

View Source

Specs

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