espforge-devices

Writes new ESP32 device drivers for the espforge framework from Rust driver crates.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/mohankumargupta/skills --skill espforge-devices-mohankumargupta
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: espforge-devices
Source: https://github.com/mohankumargupta/skills/tree/main/espforge-devices
Command: npx skills add https://github.com/mohankumargupta/skills --skill espforge-devices-mohankumargupta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, curl, cargo-info, tiged, and includes scripts (resource) and references (resource) components.

What problem does it solve? Integrating a new sensor, display, or peripheral into the espforge ESP32 framework requires coordinated changes across a no_std runtime crate and a host-side code-generation plugin, which is error-prone without a guided process. ## Core Features & Use Cases - Runtime device authoring: Creates a no_std device wrapper in espforge_devices that is generic over embedded-hal bus types, with correct trait bound propagation and Cargo feature wiring. - Builder plugin generation: Implements an espforge_devices_builder plugin with a YAML config struct, dependency resolution, and quote!-based code generation following strict guardrails. - End-to-end workflow: Orchestrates sub-skills for adding the device, committing to git, compiling espforge, compiling a generated example, and producing a diff of all changes. - Use Case: Given the bmp085-180-rs crate, generate a complete BMP180 pressure sensor integration including the runtime driver, builder plugin, YAML example, and a compiled test project. ## Quick Start Add a new bmp180 device driver to espforge using the bmp085-180-rs crate and compile the generated example.

Frequently Asked Questions about espforge-devices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new sensor driver to espforge?▼

Create a no_std device wrapper in espforge_devices generic over the embedded-hal bus type, register it with a Cargo feature, then write a builder plugin in espforge_devices_builder that parses YAML config and generates initialization code. Finish with a YAML example and app.rs.

How do I write a device plugin for espforge_devices_builder?▼

Define a Deserialize config struct using DeviceRef<ComponentRef> or DeviceRef<PinRef>, derive DevicePlugin with name, features, and config attributes, then implement validate_config, resolve_dependencies, and generate_code returning GeneratedCode via the codegen() helper.

Does espforge support embedded-hal v1 driver crates?▼

Yes, espforge devices are built on embedded-hal v1 traits such as I2c and SpiDevice. The included check_crate.sh and findcrates.sh scripts query crates.io to verify a candidate crate depends on embedded-hal version 1.x before integration.

Why does my espforge device fail with use of undeclared crate or module std?▼

The runtime device crate espforge_devices is compiled no_std for ESP32, so std:: paths are forbidden. Replace them with core:: equivalents, or use alloc:: types like String and Vec after adding extern crate alloc.

Why does quote! interpolation fail with ctx.instance_name in generate_code?▼

quote! cannot interpolate struct field access like #ctx.instance_name directly. Bind the value to a local identifier first using format_ident!("{}", ctx.instance_name), then interpolate that identifier inside the quote! block.

When should a device driver take a delay argument in espforge?▼

If the upstream driver constructor accepts a DelayNs parameter, pass *delay in the builder init block since esp-hal Delay is Copy. If delay is only needed per read call, pass &mut delay from app code instead of storing it in the device.