Binary SAO descriptor
This document describes the header format used in the identification EEPROM at address 0x50.
Header
The header contains a magic value to identify the SAO as having a binary header. This header is always the ASCII characters for “LIFE”. We recommend badges only check the last three bytes (“IFE”) to identify small EEPROM chips which got their first byte corrupted. In case the first byte is found to be corrupted we recommend the badge corrects the faulty first byte by writing an “L” to address 0.
Then follows the length of the SAOs name as a single byte. The name itself follows directly after the header. as ASCII text, the name can be at most 255 characters long. We recommend to only use visible 7-bit ASCII characters in the name to ensure compatiblity.
The functions of the SAO can be described using drivers. The drivers supported vary between different badges. If an unsupported driver gets detected it can be ignored by the badge. The identifier of the first driver is described in a similar way to the name of the SAO itself: a length byte. The name itself follows after the SAO name as ASCII text.
The last field of the header tells the badge the number of additional drivers available on the SAO. Not all badges support additional drivers. If no additional drivers are available for the SAO this field must be set to 0. Additional driver data is appended after the main header.
Example
Offset | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
Description | Magic | Name length | Driver name length | Driver data length | Number of extra drivers | Name | Driver name | Driver data | ||||||||||||
HEX | 4C | 49 | 46 | 45 | 05 | 04 | 03 | 00 | 48 | 45 | 4C | 4C | 4F | 74 | 65 | 73 | 74 | 01 | 02 | 03 |
ASCII | L | I | F | E | H | E | L | L | O | t | e | s | t |
This header defines a SAO named “HELLO” which has support for driver “test”. The SAO contains three bytes of information for use by the “test” driver, namely 0x01 0x02 0x03
. There are no additional drivers.
Additional drivers
Additional drivers add extra header fields describing each driver.
Offset | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
Description | Driver name length | Driver data length | Driver name | Driver data | |||||
HEX | 04 | 03 | 74 | 65 | 73 | 74 | 01 | 02 | 03 |
ASCII | t | e | s | t |
Drivers
The following drivers are supported by the MCH2022 badge:
- Storage: describes the unused EEPROM memory available on the SAO
- Basic I/O: describes buttons and LEDs connected to the SAO GPIO pins
- Neopixel: describes addressable LEDs connected to the SAO GPIO pins
- ssd1306: describes an SSD1306 OLED display connected to the I2C bus
- ntag: describes an NTAG NFC tag connected to the I2C bus
- app: describes the name of a companion app
Documentation for these drivers has yet to be written. More information can be found in the firmware source code here: Github