View Source HTS221.Transport behaviour (hts221 v1.1.0)

A behaviour to communicate to the HTS221

Link to this section Summary

Types

Arguments for the implementation init/1 callback

The underline communication data structure for the transport implementation to use when sending data to the HTS221.

A module that implements the HTS221.Transport behaviour

t()

Callbacks

Initialize the transport implementation

Write the register

Functions

Helper function initializing the transport implementation

Send the IO request to the HTS221

Link to this section Types

Specs

arg() :: any()

Arguments for the implementation init/1 callback

See the implementation's docs to see what the arguments are.

Specs

comm() :: any()

The underline communication data structure for the transport implementation to use when sending data to the HTS221.

For example in Circuits.I2C the data structure is a reference.

Specs

impl() :: module()

A module that implements the HTS221.Transport behaviour

Specs

t() :: {impl(), comm()}

Link to this section Callbacks

Specs

init([arg()]) :: {:ok, t()} | {:error, any()}

Initialize the transport implementation

Link to this callback

read_register(comm, binary, non_neg_integer)

View Source

Specs

read_register(comm(), binary(), non_neg_integer()) ::
  {:ok, binary()} | {:error, any()}

Read the register

Link to this callback

write_register(comm, binary)

View Source

Specs

write_register(comm(), binary()) :: :ok | {:error, any()}

Write the register

Link to this section Functions

Specs

init(impl(), [arg()]) :: {:ok, t()} | {:error, any()}

Helper function initializing the transport implementation

Specs

send(t(), HTS221.IORead.t() | HTS221.IOWrite.t()) ::
  :ok | {:ok, binary()} | {:error, any()}

Send the IO request to the HTS221