Skip to content

pguyot/atomvm_ulp

Repository files navigation

ESP32 ULP Driver for AtomVM

This project brings ESP32 ULP support to AtomVM. It also includes implementation for rtc_gpio APIs for use with ULP.

Installation

  • Install ESP-IDF SDK 5.0 or higher
  • Checkout atomvm
  • Within src/platform/esp32/components, checkout this project
  • Activate ESP-IDF environment and within src/platform/esp32/ run idf.py build

Usage

ULP needs to be activated with menuconfig. If it isn't, compilation will fail. Sufficient memory should be allocated for ULP programs, if it is not the case loading binary will fail with badarg. Default is 512 bytes. One example requires 700 bytes.

ULP binaries are loaded with ulp:load_binary/1,2. Binaries can be generated using the ULP toolchain or directly with macros from ulp.hrl. Erlang compiler can even compute absolute and relative addresses of some instructions by calling ulp:compile/1.

Please also refer to API documentation.

Examples

  • blink: very simple example toggling a GPIO pin on and off while the ESP32 is in deep sleep, typically to drive a LED;
  • blink_timer: variant using ULP timer, so even ULP is stopped
  • interrupt: example waking up the ESP32 with an interrupt that can be generated by a button;
  • hx711: example driving a HX711, a chipset used in scales, waking the ESP32 when a given weight is above a threshold;
  • sht20: example driving a SHT20, a chipset that measures temperature with an I2C interface, and taking measures while the ESP32 is deep sleeping, waking it up after a series.

About

ESP32 ULP Driver for AtomVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors