ws-ESP32-S3-CAM: Command for Claude Code

.claude/commands/peripherals.md

peripherals is a command for Claude Code from chayuto/ws-ESP32-S3-CAM. It costs 0 tokens per session (1,861 once invoked), scanned A, original, MIT.

A set of instructions for using Waveshare’s board-support package with an ESP32-S3 camera board. The package hides hardware details such as the I/O expander, shared I²C bus, camera pins, and audio codec addresses.

In plain words
What is it for?
Use it when adding camera, microphone, speaker, display, touch, or LED support to the specified ESP32-S3-CAM board. It covers dependency setup and the standard initialization sequence.
Why use it?
It prevents each project from having to rediscover the board’s wiring and initialization order. Following the documented setup helps initialize the camera, audio, and other peripherals consistently.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is chayuto/ws-ESP32-S3-CAM's own configuration. It tells Claude Code how to work on ws-ESP32-S3-CAM itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ws-ESP32-S3-CAM configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chayuto/ws-ESP32-S3-CAM. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/chayuto/ws-ESP32-S3-CAM/main/.claude/commands/peripherals.md
Clone the repo
git clone --depth 1 https://github.com/chayuto/ws-ESP32-S3-CAM

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for peripherals

README.md
[![agentmods](https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/peripherals.svg)](https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/peripherals)
Your own site
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/peripherals"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/peripherals.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,861 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01861
Opus 5 $0.00000 $0.00931
Sonnet 5 $0.00000 $0.00372
Haiku 4.5 $0.00000 $0.00186

Measured 7d ago against content hash e4ea0b2b1002, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

peripherals scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/peripherals.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Peripheral cookbook — ESP32-S3-CAM-GC2145

Use the vendor BSP waveshare/esp32_s3_cam_ovxxxx for anything nontrivial. It hides the CH32V003 IO-expander quirks, I²C bus init, camera pin config, and codec addresses. Header: ref/demo/ESP32-S3-CAM-OVxxxx/examples/ESP-IDF-v5.5.1/04_dvp_camera_display/components/waveshare__esp32_s3_cam_ovxxxx/include/bsp/esp32_s3_cam_ovxxxx.h

Dependency Line

# main/idf_component.yml
dependencies:
  waveshare/esp32_s3_cam_ovxxxx: ^1.0.0

Standard Init Sequence

#include "bsp/esp-bsp.h"

bsp_i2c_init();                    // GPIO 7/8 shared bus for everything
bsp_io_expander_init();            // CH32V003 — needed before display/touch/LED
bsp_audio_init(NULL);              // default duplex mono 16-bit 22050 Hz

// Then any of:
esp_codec_dev_handle_t spk = bsp_audio_codec_speaker_init();     // ES8311 DAC
esp_codec_dev_handle_t mic = bsp_audio_codec_microphone_init();  // ES7210 ADC
esp_camera_init(&(camera_config_t)BSP_CAMERA_DEFAULT_CONFIG);    // GC2145
// bsp_display_start() only if an LCD is fitted

Camera (GC2145)

Driver auto-detects the sensor. BSP provides a filled-in config macro:

camera_config_t cfg = BSP_CAMERA_DEFAULT_CONFIG;
// cfg: pin_xclk=38, pin_pclk=41, pin_vsync=17, pin_href=18, D0-D7 = 45/47/48/46/42/40/39/21
// cfg: RGB565, QVGA (320×240), 2 framebuffers in PSRAM, XCLK 20 MHz, JPEG q=12
esp_camera_init(&cfg);
sensor_t *s = esp_camera_sensor_get();
s->set_framesize(s, FRAMESIZE_UXGA);    // 1600×1200 if you want max
s->set_pixformat(s, PIXFORMAT_JPEG);    // or RGB565/YUV422

Boot log expectation: 3 E (…) SCCB probe-miss lines for OV2640/OV5640/GC0308 before I (…) gc2145: Detected Camera sensor PID=0x2145. Not errors.

  • SCCB shares the main I²C (no separate pins)
  • PWDN and RESET are NC — sensor is always powered; no software power-cycle
  • XCLK ≥ 16 MHz enables EDMA to PSRAM (faster throughput)

Audio Out (ES8311 → speaker)

esp_codec_dev_handle_t spk = bsp_audio_codec_speaker_init();
esp_codec_dev_sample_info_t fs = {
    .sample_rate = 16000, .channel = 1, .bits_per_sample = 16,
};
esp_codec_dev_open(spk, &fs);
esp_codec_dev_set_out_vol(spk, 70);     // 0-100
esp_codec_dev_write(spk, wav_samples, len);
esp_codec_dev_close(spk);

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 151 lines · 0 tokens per session scan A e4ea0b2b1002

Subscribe to this mod's changes

peripherals is a command published in the GitHub repository chayuto/ws-ESP32-S3-CAM (5 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,861 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.