So I am in the process of creating my first HAT, for a product that will provide multiple hardware accelerated 1-Wire interfaces to overcome the limitations of the existing 1-Wire drivers and their accocated hardware shortcommings.
The documentation for HATs tells me that I need an CAT24C32 SPI EEPROM (or somthing compatible with / emulating such a device) to store information pertaining to my HAT so that the host can correctly configure itself and so that drivers and applications can identify what hardware is available.
As part of the Vendor Info Atom:
I am faily convinced that HATs are explicitly NONE-STACKABLE so this doesn't appear to make sence.Note that the UUID is mandatory and must be filled in correctly according to RFC 4122 (every HAT can then be uniquely identified). It protects against the case where a user accidentally stacks 2 identical HATs on top of each other - this error case is only detectable if the EEPROM data in each is different. The UUID is also useful for manufacturers as a per-board 'serial number'.
Additionly the EEPROM should be at address 0xA0 (the most significant nibble comming from the CAT24C32, whilst the least Significant 3 bits comming from the the 3 Address lines which should all be tied to ground) so even if I did "accidentally stacks 2 identical HATs on top of each other" the EEPROM address colision would prevent the Pi from correctly reading data from the EEPROMs anyway.
(1) Have I missed somthing or is this a hangover from an initial design concept for HATs that would have made sence if HATs were stackable, but the idea being abandoned because making All hats stackable is just to complex?
(2) Is there a register for the PID & VSTR fields or is this a free for all and hope that we don't have conflicts? I am assuming that PID is supposed to be unique for each HAT 'product' and this is the field that is parsed by the boot loader / HAT bring up process so a centeral register makes sence. If this is the case how does one go apout registering a PID?
As an asside I would have expected to see a Vendor ID field here as well - but I do understand that many differant vendors may make what is effectivly the same HAT. Without this field though is 16k worth of product IDs enough?!? (/me inserts 'magic 'PID 0xffff to point to extended PID structure in new atom as yet to be defined)