← 返回命令列表

Linux command

i2cset 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Write

i2cset [i2cbus] [device_address] [register_address] [value]

Example

i2cset -y [i2cbus] [device_address] [register_address] [value]

Example

i2cset [i2cbus] [device_address] [register_address] [value] [b|w|c|s|i]

说明

i2cset writes a value to a specified register of an I2C device. This allows configuration of I2C peripherals, setting parameters, or controlling device behavior. All addresses and values should be specified in hexadecimal notation. The command will prompt for confirmation before writing unless the -y flag is used.

参数

-y
Disable interactive confirmation (dangerous on some hardware)
b
Byte mode - write single byte (default)
w
Word mode - write 16-bit value
c
Consecutive byte mode
s
SMBus block mode
i
I2C block mode

FAQ

What is the i2cset command used for?

i2cset writes a value to a specified register of an I2C device. This allows configuration of I2C peripherals, setting parameters, or controlling device behavior. All addresses and values should be specified in hexadecimal notation. The command will prompt for confirmation before writing unless the -y flag is used.

How do I run a basic i2cset example?

Run `i2cset [i2cbus] [device_address] [register_address] [value]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -y do in i2cset?

Disable interactive confirmation (dangerous on some hardware)