Skip to main content

Module calib_store

Module calib_store 

Source
Expand description

Calibration EEPROM serialization.

Structsยง

CalibEntry
Per-key full-travel calibration value stored in EEPROM.

Constantsยง

CALIB_BUF_LEN
Pre-computed buffer length for the HE matrix.
CRC16 ๐Ÿ”’
CRC-16/CCITT-FALSE (poly 0x1021, init 0xFFFF).
CRC_LEN ๐Ÿ”’
Byte length of the trailing CRC field.
EEPROM_BASE_ADDR
EEPROM word address at which the calibration block begins.
ENTRY_LEN ๐Ÿ”’
Byte length of a single serialized entry (one u16 full-travel value).
HEADER_LEN ๐Ÿ”’
Byte length of the header: magic + version.
MAGIC ๐Ÿ”’
Magic number identifying a valid Q6 HE calibration block.
VERSION ๐Ÿ”’
Format version. Must be incremented on any incompatible layout change.

Functionsยง

read_array ๐Ÿ”’
Copy exactly N bytes from buf[start..end] into a fixed-size array.
serialize
Serialize entries (row-major, ROW ร— COL) into buf.
total_len
Compute the total serialized byte length for a rows ร— cols matrix.
try_deserialize
Attempt to deserialize a calibration block from buf into out.