Lines Matching +full:- +full:- +full:force +full:- +full:yes
1 /* i2ctools.c - i2c tools
7 * Note: -y must have the same value in each toy for `confirm`.
9 * TODO: i2cdetect -q/-r and the "auto" mode?
10 * TODO: i2cdump non-byte modes, -r FIRST-LAST?
11 * TODO: i2cget non-byte modes? default to current read address?
12 * TODO: i2cset -r? -m MASK? c/s modes, p mode modifier?
23 usage: i2cdetect [-aqry] BUS [FIRST LAST]
24 usage: i2cdetect -F BUS
25 usage: i2cdetect -l
29 -a All addresses (0x00-0x7f rather than 0x03-0x77 or FIRST-LAST)
30 -F Show functionality
31 -l List available buses
32 -q Probe with SMBus Quick Write (default)
33 -r Probe with SMBus Read Byte
34 -y Answer "yes" to confirmation prompts (for script use)
40 usage: i2cdump [-fy] BUS CHIP
44 -f Force access to busy devices
45 -y Answer "yes" to confirmation prompts (for script use)
51 usage: i2cget [-fy] BUS CHIP ADDR
55 -f Force access to busy devices
56 -y Answer "yes" to confirmation prompts (for script use)
62 usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE
64 Write an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.
66 -f Force access to busy devices
67 -y Answer "yes" to confirmation prompts (for script use)
75 #include <linux/i2c-dev.h>
93 snprintf(toybuf, sizeof(toybuf), "/dev/i2c-%d", bus); in i2c_open()
116 if (ioctl(fd, I2C_SMBUS, &ioctl_data)==-1) return -1; in i2c_read_byte()
153 printf("%-32s %s\n", funcs[i].name, (sup & funcs[i].mask) ? "yes" : "no"); in i2cdetect_dash_F()
163 if (!node->parent) return DIRTREE_RECURSE; // Skip the directory itself. in i2cdetect_dash_l()
165 if (sscanf(node->name, "i2c-%d", &bus)!=1) return 0; in i2cdetect_dash_l()
174 // "i2c-1 i2c Synopsys DesignWare I2C adapter I2C adapter" in i2cdetect_dash_l()
175 printf("%s\t%-10s\t%-32s\t%s\n", node->name, in i2cdetect_dash_l()
185 if (toys.optc) error_exit("-l doesn't take arguments"); in i2cdetect_main()
186 dirtree_flagread("/sys/class/i2c-dev", DIRTREE_SHUTUP, i2cdetect_dash_l); in i2cdetect_main()
188 if (toys.optc != 1) error_exit("-F BUS"); in i2cdetect_main()
206 confirm("Probe chips 0x%02x-0x%02x on bus %d?", first, last, bus); in i2cdetect_main()
215 if (ioctl(fd, I2C_SLAVE, addr) == -1) { in i2cdetect_main()
223 : i2c_quick_write(fd, addr)) == -1) xprintf(" --"); in i2cdetect_main()
255 toybuf[addr-row] = isprint(byte) ? byte : (byte ? '?' : '.'); in i2cdump_main()
276 if (i2c_read_byte(fd, addr, &byte)==-1) perror_exit("i2c_read_byte"); in i2cget_main()
290 char *mode = toys.optargs[toys.optc-1]; in i2cset_main()
304 if (toys.optc-4>I2C_SMBUS_BLOCK_MAX) error_exit("too much data"); in i2cset_main()
306 for (i = 0; i<toys.optc-4; ++i) in i2cset_main()
308 data.block[0] = toys.optc-4; in i2cset_main()