I2cServer (i2c_server v0.1.2) View Source

I2cServer creates a separate process for each I2C device. A server process is identified with a composite key of bus name and address.

Link to this section Summary

Functions

Returns the module atom of currently-used registry.

Returns the PID for a specified bus name and bus address.

Link to this section Types

Specs

registry() :: I2cServer.DeviceRegistry | :global | atom()

Link to this section Functions

Link to this function

read(server, bytes_to_read)

View Source

Specs

read(GenServer.server(), integer()) :: any()

Specs

registry() :: registry()

Returns the module atom of currently-used registry.

Link to this function

server_process(bus_name, bus_address)

View Source

Specs

server_process(binary(), 0..127) :: pid()

Returns the PID for a specified bus name and bus address.

Specs

write(GenServer.server(), iodata()) :: any()
Link to this function

write(server, register, data)

View Source

Specs

write(GenServer.server(), integer(), binary() | integer()) :: any()
Link to this function

write_read(server, write_data, bytes_to_read)

View Source

Specs

write_read(GenServer.server(), binary() | integer(), integer()) :: any()