Expand description
Encoding and decoding of ATECC608B command and response frames.
§Command frame layout (sent host to chip)
+---------+--------+---------+---------+-----------+---------+
| Count | Opcode | Param1 | Param2 | Data... | CRC16 |
| (1 B) | (1 B) | (1 B) | (2 B,LE)| (0..155) | (2 B,LE)|
+---------+--------+---------+---------+-----------+---------+
^ ^
| |
+-- Count includes itself, the CRC, and ---------- +
everything in between.The byte sent before this frame on I2C is the “word address”
crate::opcodes::WORD_ADDRESS_COMMAND (0x03). It is not part of the
frame proper and is not covered by the CRC.
§Response frame layout (sent chip to host)
+---------+----------------+---------+
| Count | Payload | CRC16 |
| (1 B) | (Count-3 B) | (2 B,LE)|
+---------+----------------+---------+When the chip reports an error, the response is exactly 4 bytes:
04 <status> <crc_lo> <crc_hi>. The 1-byte status is one of the values
mapped by crate::error::ChipError::from_status_byte.
Enums§
- Packet
Build 🔒Error - Errors that can arise while serializing a command frame.
- Packet
Parse 🔒Error - Errors that can arise while parsing a response frame.
- Response
Frame 🔒 - A parsed and CRC-verified response frame.
Functions§
- build_
command_ 🔒frame - Build a command frame into
outand return the number of bytes written. - parse_
response_ 🔒frame - Parse a response frame.