Available modules
The features of a firmware are Composer packages. This page lists every package you can require for an ESP32 board, what it does, and where it is covered.
A module is a Composer package. To use one, require it in your project; to remove it, remove it from
composer.json.
composer require php-baremetal/<package>adds the package. Requiring a driver (for exampleimu-qmi8658) also brings the extension it needs (ext-i2c).- The conductor, the Composer plugin that
phpbm initputs in your project, installs the packages into.phpbm/packages/and adds the esp32 HAL (the hardware layer) of each extension by itself. You never require a HAL. - A package only reaches the board when the firmware is rebuilt: run
phpbm flash. Without the package, its functions and classes do not exist, sofunction_exists()andclass_exists()tell you what a firmware has. - Every package page on the registry has the full PHP API. The pages of this group cover what is specific to ESP32 boards.
How to create a project and flash it is in Your first firmware.
Packages
All packages are php-baremetal/<name>. The Examples column names each example by its category folder and
project, such as 08-network-web/wifi-ap.
| Package | What it does | Page | Examples |
|---|---|---|---|
| ext-gpio | Digital pins: gpio_mode(), gpio_write(), gpio_read() |
GPIO | 04-gpio-led/blink-sos, 04-gpio-led/button-led, 07-event-driven/gpio-interrupt |
| ext-led | Baremetal\Led\Device: pixel buffer, colours, show() |
LED strips | 04-gpio-led/s3-rgb-show |
| led-ws2812 | Ws2812 class for WS2812 strips, rings and on-board LEDs; requires ext-led |
LED strips | 04-gpio-led/s3-rgb-show |
| led-sk6812 | Sk6812 class for SK6812 RGBW LEDs; requires ext-led |
LED strips | none |
| ext-i2c | I2C master: Bus, Device, scan, background sampling; requires ext-events |
I2C and sensors | 05-i2c-sensors/i2c-scan, 05-i2c-sensors/i2c-core1 |
| imu-qmi8658 | Qmi8658 accelerometer and gyroscope; requires ext-i2c |
I2C and sensors | 05-i2c-sensors/imu-events, 05-i2c-sensors/imu-ws-stream |
| mag-mmc5603 | Mmc5603 magnetometer and compass heading; requires ext-i2c |
I2C and sensors | 05-i2c-sensors/mmc5603, 05-i2c-sensors/compass |
| rtc-pcf85063 | Pcf85063 real-time clock; requires ext-i2c |
I2C and sensors | 05-i2c-sensors/rtc-pcf85063, 05-i2c-sensors/rtc-clock |
| ext-spi | SPI master: Bus (up to four data lines) and raw Device |
SPI and displays | 06-display/display-hello (through the driver) |
| esp32-display-st77916 | St77916 QSPI round display; requires ext-spi; ESP32 only |
SPI and displays | 06-display/display-hello |
| ext-input | Touch input contract: Touch, Pressed, Moved, Released, Gesture, GestureType; requires ext-events; no HAL |
Touch input | 06-display/touch-paint |
| touch-cst816s | Cst816s touch controller driver (point, gestures, events); requires ext-i2c, ext-input and ext-gpio |
Touch input | 06-display/touch-paint |
| ext-slate | Scene graph for display panels: Slate, Scene, RoundRect, Circle, Arc, Line, Text, Canvas, Group, gradients, shadows, blur, touch; requires ext-display, ext-events and ext-input |
Slate | 06-display/slate-hello, 06-display/slate-gauge |
| ext-events | Events, listeners, timers, pin and button watchers, power_hold(); required by the event-driven runtime |
Events and timers | 07-event-driven/* |
| ext-wifi | Scan, join a network, open an access point | Wi-Fi | 08-network-web/wifi-connect, 08-network-web/wifi-ap |
| ext-web | HTTP and WebSocket server for the event-driven runtime |
HTTP and the web | 08-network-web/sensor-webpage, 07-event-driven/http-events |
| ext-store | Key-value store in flash that survives a reset | Saving data | 03-storage/store-demo |
| ext-mem | Key-value store in RAM, shared by all requests of one boot; no HAL | Saving data | 08-network-web/web-init-mem |
| ext-sys | sys_* functions: delay(), uptime, restart, sleep, chip identity, memory |
System and power | 04-gpio-led/blink-sos, 10-power/power-bench |
| ext-hello | bm_hello(), the smallest possible extension; no HAL |
Package page only | 00-hello |
php-bcmath, php-ctype, php-date, php-filter, php-mbstring, php-opcache, php-openssl, php-pdo, php-pdo_sqlite, php-session, php-sqlite3, php-tokenizer, php-zlib |
The matching standard PHP extensions, switched on in the firmware | PHP extensions | 02-extensions/* |
php-pdo_sqlite requires php-pdo. The PHP extension packages need no HAL.
A package only does something when the board has the hardware: ext-wifi needs a board with a Wi-Fi radio, and the
pins in an example are those of the board named in its composer.json. See
Supported boards.