atecc508a v0.1.0 ATECC508A.Configuration
This module handles operations on the configuration zone.
Link to this section Summary
Functions
Convert a raw configuration to a nice map
Lock the configuration zone
Read the configuration
Read the entire contents of the configuration zone and don’t interpret them
Read the current slot configuration
Read the current slot configuration
Convert a nice config map back to a raw configuration
Write the configuration
Write the key configuration
Write a slot configuration
Link to this section Types
t() :: %ATECC508A.Configuration{ chip_mode: non_neg_integer(), counter0: non_neg_integer(), counter1: non_neg_integer(), i2c_address: non_neg_integer(), i2c_enable: byte(), key_config: <<_::256>>, last_key_use: binary(), lock_config: non_neg_integer(), lock_value: non_neg_integer(), otp_mode: non_neg_integer(), reserved0: byte(), reserved1: byte(), reserved2: byte(), rev_num: atom() | binary(), rfu: <<_::16>>, selector: non_neg_integer(), serial_number: binary(), slot_config: <<_::256>>, slot_locked: non_neg_integer(), user_extra: non_neg_integer(), x509_format: <<_::32>> }
Link to this section Functions
Convert a raw configuration to a nice map.
lock(ATECC508A.Transport.t(), t()) :: :ok | {:error, atom()}
Lock the configuration zone.
The expected contents need to be passed for a CRC calculation. They are not written by design. The logic is that this is a final chance before it’s too late to check that the device is programmed correctly.
read(ATECC508A.Transport.t()) :: {:ok, t()} | {:error, atom()}
Read the configuration
read_all_raw(ATECC508A.Transport.t()) :: {:ok, <<_::1024>>} | {:error, atom()}
Read the entire contents of the configuration zone and don’t interpret them
read_key_config(ATECC508A.Transport.t()) :: {:ok, <<_::256>>} | {:error, atom()}
Read the current slot configuration
read_slot_config(ATECC508A.Transport.t()) :: {:ok, <<_::256>>} | {:error, atom()}
Read the current slot configuration
Convert a nice config map back to a raw configuration
write(ATECC508A.Transport.t(), t()) :: :ok | {:error, atom()}
Write the configuration.
This only works when the ATECC508A is unlocked and only bytes not all bytes can be changed. This only writes the ones that can.
write_key_config(ATECC508A.Transport.t(), <<_::256>>) :: :ok | {:error, atom()}
Write the key configuration.
write_slot_config(ATECC508A.Transport.t(), <<_::256>>) :: :ok | {:error, atom()}
Write a slot configuration.