I2cServer.Transport behaviour (i2c_server v0.2.0) View Source

I2cServer.Transport lets you communicate with hardware devices using the I2C protocol.

Link to this section Summary

Link to this section Types

Specs

bus_address() :: 0..127

Specs

bus_name() :: binary()

Link to this section Callbacks

Specs

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

read(reference, bus_address, pos_integer)

View Source

Specs

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

write(reference, bus_address, iodata)

View Source

Specs

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

write_read(reference, bus_address, iodata, pos_integer)

View Source

Specs

write_read(reference(), bus_address(), iodata(), pos_integer()) ::
  {:ok, binary()} | {:error, any()}