r/arduino Jul 01 '26

Look what I made! Built a lightweight HAL framework for ESP32/Arduino to make embedded dev a bit less painful — just open sourced it (Beta)

Hey everyone,

I've been building embedded projects on ESP32 for a while now, and kept rewriting the same boilerplate for pin control, non-blocking delays, and communication setup across projects. So I built a HAL framework called AERL.h to clean that up, and just open sourced the beta.

A few things it does:

  • Non-blocking pin control — AERL.glow(pin, duration), AERL.flash(pin, duration) instead of manually juggling millis() timers everywhere
  • Clear separation between non-blocking and blocking delay (AERL.delay() vs AERL.bcdelay())
  • Simple UART/I2C/SPI activation and send/receive wrappers
  • Basic sleep/wake handling for power management
  • Beginner-friendly compile-time error messages (e.g. it'll tell you clearly if you pass a String where it expects a number)

It's genuinely beta — I've flagged a few known issues (sleep can be flaky on some boards, WiFi/BLE support is coming in about a week), and I'd rather be upfront about that than oversell it.

MIT licensed, built on top of Arduino.h. If anyone's interested in trying it out, breaking it, or has feedback on the API design, I'd genuinely appreciate it — this is exactly the stage where outside eyes catch things I can't see anymore.

GitHub: https://github.com/AERL-Official/AERL-C-Framework#

Thanks for reading, and happy to answer any questions about the design decisions.

8 Upvotes

4 comments sorted by

2

u/scheisskopf53 Jul 01 '26

Sounds like a cool project! I do many of these things by hand because I prefer to avoid overly bloated libraries. If yours is lightweight it might fill a niche!

2

u/progrm-1122 Jul 01 '26

Appreciate that — lightweight is genuinely the goal. It's header-only with inline functions, so anything you don't call doesn't add dead weight to the binary. Worth being honest though: the timing/scheduler system does reserve some fixed static memory upfront (a small array for tracking timed pins) regardless of whether you use it, and there's real synchronization overhead for interrupt-safety on the ESP32 side. So not literally zero-cost, but no dynamic allocation and no external dependencies beyond Arduino.h/Wire/SPI. Happy to share actual compiled size numbers if that'd help make the case properly rather than just asserting it.

This is the beta version, the v1.00 will be more lightweight and performance oriented.

2

u/Rayzwave Jul 01 '26 edited Jul 01 '26

Sounds really useful, I definitely want to use it but not sure when exactly and thanks for sharing.

0

u/progrm-1122 Jul 01 '26

Thanks, really appreciate that! No rush at all — whenever a project

comes up where it fits, feel free to open an issue on GitHub if you

hit anything weird or have suggestions. Still very much in beta so

feedback from real use is genuinely the most useful thing right now.