I have been working with many HATs along with Raspberry Pi such as Sense HAT, Pimoroni Enviro pHAT; and so on. However, HATs report its existence to the device tree in /proc/device-tree/hat and /sys/firmware/devicetree/base/hat (see details from here). I could extract few information (such as product, vendor; and so on) that were answered in that Q/A. I could enlist the list of sensors (i.e temperature, pressure, humidity; and so on) available on a HAT from vendor/manufacturer end (through website/guidelines) manually. The complexity increases as the number of HATs increases. Anyway, is it possible to read these information (list of available sensors on a HAT) either from PROM / EPROM / EEPROM?
Asked
Active
Viewed 235 times
1
testuser
- 85
- 1
- 2
- 10
1 Answers
3
There is nothing in HAT requirements about supplying a machine-readable list of sensors. Therefore, there is no generic methods to list sensors on a HAT: even if such a method exists, it will be manufacturer-specific at best and HAT-unique at worst.
HAT EEPROM contains either a device tree overlay or a name of such overlay in an external file. See if parsing that gives you the information you need (though it's far from a "list of sensors").
Dmitry Grigoryev
- 28,277
- 6
- 54
- 147