I2cServer (i2c_server v0.1.3) View Source
I2C Server wraps Circuits.I2C
reference in a GenServer
, creating a separate
process for each I2C device. I2C device processes are
identified with a composite key of bus name and bus address. By default, I2C device processes are
stored in Registry
, but you can alternatively use
:global
.
Link to this section Summary
Functions
Initiates a read transaction to the I2C device.
Returns the module atom of currently-used registry.
Returns the PID for a specified bus name and bus address.
Writes data to the I2C device.
Writes data to an I2C device and then immediately issue a read.
Link to this section Types
Specs
registry() :: I2cServer.DeviceRegistry | :global | atom()
Link to this section Functions
Specs
read(GenServer.server(), integer()) :: any()
Initiates a read transaction to the I2C device.
Specs
registry() :: registry()
Returns the module atom of currently-used registry.
Specs
Returns the PID for a specified bus name and bus address.
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.