I2cServer (i2c_server v0.2.0) View Source
I2C Server wraps Circuits.I2C
reference
in a GenServer
, creating a separate process per
I2C bus.
Link to this section Summary
Functions
Returns the module atom of currently-used bus registry.
Returns a specification to start this module under a supervisor.
Initiates a read transaction to the I2C device.
Writes data to the I2C device.
Writes data to an I2C device and then immediately issue a read.
Link to this section Types
Specs
bus_address() :: 0..127
Specs
bus_name() :: binary()
Specs
bus_registry() :: I2cServer.Busbus_registry | :global | atom()
Specs
init_arg() :: [bus_name: bus_name(), bus_address: bus_address()]
Link to this section Functions
Specs
bus_registry() :: bus_registry()
Returns the module atom of currently-used bus registry.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
read(GenServer.server(), integer()) :: any()
Initiates a read transaction to the I2C device.
Specs
start_link(init_arg()) :: GenServer.on_start()
Specs
write(GenServer.server(), iodata()) :: any()
Writes data to the I2C device.
Specs
write(GenServer.server(), integer(), binary() | integer()) :: any()
Specs
write_read(GenServer.server(), binary() | integer(), integer()) :: any()
Writes data to an I2C device and then immediately issue a read.