atecc508a v0.1.0 ATECC508A.Request

This module knows how to send requests to the ATECC508A.

Link to this section Summary

Types

A transaction is a tuple with the binary to send, how long to wait in milliseconds for the response and the size of payload to expect to read for the response

Link to this section Types

Link to this type access_data()
access_data() :: <<_::32>> | <<_::256>>
Link to this type access_size()
access_size() :: 4 | 32
Link to this type addr()
addr() :: 0..65535
Link to this type block()
block() :: 0..3
Link to this type offset()
offset() :: 0..7
Link to this type slot()
slot() :: 0..15
Link to this type transaction()
transaction() :: {binary(), non_neg_integer(), non_neg_integer()}

A transaction is a tuple with the binary to send, how long to wait in milliseconds for the response and the size of payload to expect to read for the response.

Link to this type zone()
zone() :: :config | :otp | :data

Link to this section Functions

Link to this function genkey(transport, key_id, create_key?)
genkey(ATECC508A.Transport.t(), slot(), boolean()) ::
  {:ok, binary()} | {:error, atom()}

Create a genkey request message.

Link to this function lock_zone(transport, zone, zone_crc)
lock_zone(ATECC508A.Transport.t(), zone(), ATECC508A.crc16()) ::
  :ok | {:error, atom()}

Create a message to lock a zone.

Link to this function random(transport)
random(ATECC508A.Transport.t()) :: {:ok, binary()} | {:error, atom()}

Request a random number.

Link to this function read_zone(transport, zone, addr, length)
read_zone(ATECC508A.Transport.t(), zone(), addr(), access_size()) ::
  {:ok, binary()} | {:error, atom()}

Create a read message

Link to this function to_config_addr(byte_offset)
to_config_addr(0..127) :: addr()
Link to this function to_config_addr(block, offset)
to_config_addr(block(), offset()) :: addr()
Link to this function to_data_addr(slot, byte_offset)
to_data_addr(slot(), 0..416) :: addr()
Link to this function to_data_addr(slot, block, offset)
to_data_addr(slot(), block(), offset()) :: addr()
Link to this function to_otp_addr(byte_offset)
to_otp_addr(0..127) :: addr()
Link to this function to_otp_addr(block, offset)
to_otp_addr(block(), offset()) :: addr()
Link to this function write_zone(transport, zone, addr, data)
write_zone(ATECC508A.Transport.t(), zone(), addr(), access_data()) ::
  :ok | {:error, atom()}

Create a write message