i2c_write_reg
Write to I2C slave device registers, supporting hex, comma-separated, or array data, with optional readback verification to avoid false fails on write-only registers.
Instructions
写 I2C 从设备的寄存器。data 支持 "0x01" / "1,2" / [1,2]。
verify=True 会在写完后回读比对。★ 默认关:有些寄存器是只写的 (命令寄存器、软复位寄存器),回读必然拿到别的东西,默认开着会造成大量假 FAIL。
写操作受隔离层写权限门禁:只读档会被拒绝,并给出放开方式。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bus | No | ||
| reg | Yes | ||
| addr | Yes | ||
| data | Yes | ||
| port | No | ||
| verify | No | ||
| baudrate | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |