1

This may be a simple question but I am new to all this. Do the HAT drivers only work with Raspberry Pi OS or will the work with any suitable Linux?

2
  • 1
    Drivers for which HAT? AFAIK there are no generic HAT drivers.
    – Dirk
    Commented Nov 28, 2022 at 13:43
  • 1
    To the extent that they are kernel based (which generally a "driver" is), they could be used on any linux, presuming it uses the mainstream Pi kernel (which they generally do). Beware though: "I am new to all this..." Unless you have a good reason (which, "I like ubuntu and use it on my laptop" is not a good reason), you will be better off using RpiOS (mostly because that's the norm, and most of the docs/tutorials/etc you find will start from that context).
    – goldilocks
    Commented Nov 28, 2022 at 14:46

2 Answers 2

0

There is no such thing as a "HAT driver".

HATs may contain an EPROM which specifies GPIO map and Device Tree overlays - most of which are "standard" i.e. they can be used by any device and must exist.

Any custom Device Tree overlay required would need to be installed although there is provision for a Device Tree overlay to be provided in the EPROM.

2
  • 2
    This seems misleading. Anything more complex than some fan HATs must have driver software that actually communicates with or controls the device (like a display driver for OLED/LED matrix HATs, or to redirect sound to the onboard DAC, or read the power button/battery level, etc). So there would be a driver unless it's just a protoboard. Some of these may be downloadable for other OSes, but usually they're designed to work specifically for RpiOS or are built-in. Even the Device Tree overlay in the HAT EEPROM - wouldn't the Pi then need some sort of driver to detect and load the tree?
    – user50441
    Commented Nov 30, 2022 at 0:09
  • A good example would be the PiJuice HAT, which requires a special application to be installed on the Pi in order to read the battery level and do the auto-power-off detection and button/LED integration. There is a device tree EEPROM on the HAT (in practice I think it just enables I2C), but you also do need the driver/daemon and application to use it beyond a glorified 5V supply.
    – user50441
    Commented Nov 30, 2022 at 0:11
0

Hardware Attached to HAT drivers is typically designed to work with the Raspberry Pi OS. However, many HATs and drivers are developed to be compatible with any Linux distribution that supports the required kernel and libraries. You must check the documents before purchasing.

Are you considering making a Raspberry pi Hat by yourself, you can see here: https://www.pcbway.com/project/shareproject/Raspberry_Pi_4_Relay_HAT.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.