View Source ATECC508A.Transport.I2C (atecc508a v1.2.0)

Implementation for communicating with ATECC508A parts connected over I2C

Link to this section Summary

Types

I2C transports are specified by a bus name like "i2c-1" and an I2C address.

Functions

Initialize an I2C transport to an ATECC508A

Link to this section Types

@type i2c_args() :: [bus_name: String.t(), address: Circuits.I2C.address()]

I2C transports are specified by a bus name like "i2c-1" and an I2C address.

@type instance() :: module()

Link to this section Functions

@spec init(i2c_args()) :: {:ok, ATECC508A.Transport.t()} | {:error, atom()}

Initialize an I2C transport to an ATECC508A

Options are:

  • :bus_name - "i2c-0", "i2c-1", etc. The default is "i2c-1" which frequently works on Raspberry Pis and Beaglebones
  • :address - This is the I2C address of the ATECC508A/608A. The default is 0x60. It is not common to change this address in Nerves devices.

If a transport has already been created to the specified ATECC508A, that transport will be returned. All commands to the ATECC508A are serialized so that they don't interfere with each other.