跳到主要内容

Hardware tools

Hardware tools expose real devices to the agent. They are disabled by default and intended for boards and machines where PicoClaw has direct device access.

ToolWhat it doesSwitch (default)Platform
i2cDetect buses, scan, read, and write I2C devicestools.i2c.enabled (false)Linux
spiList SPI devices and run transferstools.spi.enabled (false)Linux
serialList ports and read/write serial datatools.serial.enabled (false)Linux, macOS, Windows

Environment variables follow the pattern PICOCLAW_TOOLS_I2C_ENABLED, PICOCLAW_TOOLS_SPI_ENABLED, PICOCLAW_TOOLS_SERIAL_ENABLED. See Hardware compatibility for supported boards and wiring notes.

i2c​

ArgumentTypeRequiredDescription
actionstringyesdetect (list buses), scan (find devices on a bus), read, or write
busstringscan/read/writeBus number, for example "1" for /dev/i2c-1
addressstringread/write7-bit device address (0x03–0x77)
registerstringnoRegister address; when set, it is sent before the read/write
dataarraywriteBytes to write (0–255 each)
countintegernoNumber of bytes to read (1–256). Default: 1
confirmboolwriteSafety guard: must be true for write operations

spi​

ArgumentTypeRequiredDescription
actionstringyeslist, transfer (full-duplex send/receive), or read (receive by sending zeros)
devicestringtransfer/readSPI device identifier, for example "2.0" for /dev/spidev2.0
speedintegernoClock speed in Hz. Default: 1000000 (1 MHz)
modeintegernoSPI mode 0–3 (CPOL/CPHA). Default: 0
bitsintegernoBits per word. Default: 8
dataarraytransferBytes to send (0–255 each)
countintegerreadNumber of bytes to read (1–4096)
confirmbooltransferSafety guard: must be true for transfers

serial​

ArgumentTypeRequiredDescription
actionstringyeslist, read, or write
portstringread/writePort path or name, for example /dev/ttyUSB0, /dev/cu.usbserial-0001, or COM3
baudintegernoBaud rate. Default: 115200. Linux/macOS support standard termios rates up to 230400; Windows accepts up to 4000000
data_bitsintegernoData bits: 5, 6, 7, or 8. Default: 8
paritystringnonone, even, or odd. Default: none
stop_bitsintegerno1 or 2. Default: 1
timeout_msintegernoRead/write timeout in milliseconds. Default: 1000
lengthintegerreadNumber of bytes to read (1–4096)
dataarraywriteBytes to write (0–255 each); required for write unless text is provided
textstringwriteUTF-8 text to write; required for write if data is omitted
confirmboolwriteSafety guard: must be true for write operations

All three tools return structured results (bus lists, scan tables, hex dumps) that the model can reason about directly. Write-style actions always require the explicit confirm: true argument; there is no configuration to disable that guard.