atecc508a v0.2.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
Functions
Create a genkey request message
Lock a specific slot
Create a message to lock a zone
Request a random number
Create a read message
Create a write message
Link to this section Types
Link to this type
access_data()
access_data()
access_data() :: <<_::32>> | <<_::256>>
access_data() :: <<_::32>> | <<_::256>>
Link to this type
access_size()
access_size()
access_size() :: 4 | 32
access_size() :: 4 | 32
Link to this type
addr()
addr()
addr() :: 0..65535
addr() :: 0..65535
Link to this type
block()
block()
block() :: 0..3
block() :: 0..3
Link to this type
offset()
offset()
offset() :: 0..7
offset() :: 0..7
Link to this type
slot()
slot()
slot() :: 0..15
slot() :: 0..15
Link to this type
transaction()
transaction()
transaction() :: {binary(), non_neg_integer(), non_neg_integer()}
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()
zone() :: :config | :otp | :data
zone() :: :config | :otp | :data
Link to this section Functions
Link to this function
genkey(transport, key_id, create_key?)
genkey(transport, key_id, create_key?)
genkey(ATECC508A.Transport.t(), slot(), boolean()) ::
{:ok, binary()} | {:error, atom()}
genkey(ATECC508A.Transport.t(), slot(), boolean()) :: {:ok, binary()} | {:error, atom()}
Create a genkey request message.
Link to this function
lock_slot(transport, slot)
lock_slot(transport, slot)
lock_slot(ATECC508A.Transport.t(), slot()) :: :ok | {:error, atom()}
lock_slot(ATECC508A.Transport.t(), slot()) :: :ok | {:error, atom()}
Lock a specific slot.
Link to this function
lock_zone(transport, zone, zone_crc)
lock_zone(transport, zone, zone_crc)
lock_zone(ATECC508A.Transport.t(), zone(), ATECC508A.crc16()) ::
:ok | {:error, atom()}
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(transport)
random(ATECC508A.Transport.t()) :: {:ok, binary()} | {:error, atom()}
random(ATECC508A.Transport.t()) :: {:ok, binary()} | {:error, atom()}
Request a random number.
Link to this function
read_zone(transport, zone, addr, length)
read_zone(transport, zone, addr, length)
read_zone(ATECC508A.Transport.t(), zone(), addr(), access_size()) ::
{:ok, binary()} | {:error, atom()}
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(byte_offset)
to_config_addr(0..127) :: addr()
to_config_addr(0..127) :: addr()
Link to this function
to_config_addr(block, offset)
Link to this function
to_data_addr(slot, byte_offset)
Link to this function
to_data_addr(slot, block, offset)
Link to this function
to_otp_addr(byte_offset)
to_otp_addr(byte_offset)
to_otp_addr(0..127) :: addr()
to_otp_addr(0..127) :: addr()
Link to this function
to_otp_addr(block, offset)
Link to this function
write_zone(transport, zone, addr, data)
write_zone(transport, zone, addr, data)
write_zone(ATECC508A.Transport.t(), zone(), addr(), access_data()) ::
:ok | {:error, atom()}
write_zone(ATECC508A.Transport.t(), zone(), addr(), access_data()) :: :ok | {:error, atom()}
Create a write message