GPIO Toolkit
Control Raspberry Pi GPIO pins with read, write, edge watching, and software PWM. Compatible with Pi 5 (chip 4) and Pi 4 (chip 0). Requiresnode-libgpiod as an optional peer dependency.
Quick Start
Config
number
default:"0"
GPIO chip number. Use
4 for Pi 5, 0 for Pi 4 and earlier.number[]
default:"[]"
Allowlist of pin numbers. Empty array = all pins allowed.
number
default:"1000"
Maximum software PWM frequency in Hz.
Tools
Safety
Pin Allowlisting
TheallowedPins config restricts which GPIO pins the agent can access. This prevents accidental writes to system-critical pins (e.g., I2C, SPI, UART lines):
allowedPins, the tool returns an error:
Best Practices
- Always set
allowedPinsin production to prevent unintended hardware interaction - Use descriptive instructions that tell the agent which pins correspond to which hardware:
- Limit PWM frequency with
maxPwmFrequencyto protect sensitive components - Test in simulation first — use a breadboard with LEDs before connecting to production hardware