Lines Matching refs:addr
109 static int i2c_read_byte(int fd, int addr, int *byte)
113 .size = I2C_SMBUS_BYTE_DATA, .command = addr, .data = &data };
121 static int i2c_quick_write(int fd, int addr)
124 .size = 0, .command = addr };
191 int bus, first = 0x03, last = 0x77, fd, row, addr, byte;
212 for (addr = row; addr<row+16; ++addr) {
213 if (addr<first || addr>last) printf(" ");
215 if (ioctl(fd, I2C_SLAVE, addr) == -1) {
222 if ((FLAG(r) ? i2c_read_byte(fd, addr, &byte)
223 : i2c_quick_write(fd, addr)) == -1) xprintf(" --");
224 else xprintf(" %02x", addr);
241 int fd, row, addr, byte;
249 for (addr = row; addr<row+16; ++addr) {
250 if (!i2c_read_byte(fd, addr, &byte)) printf(" %02x", byte);
255 toybuf[addr-row] = isprint(byte) ? byte : (byte ? '?' : '.');
270 int addr = atolx_range(toys.optargs[2], 0, 0xff);
273 confirm("Read register 0x%02x from chip 0x%02x on bus %d?", addr, chip, bus);
276 if (i2c_read_byte(fd, addr, &byte)==-1) perror_exit("i2c_read_byte");
289 int addr = atolx_range(toys.optargs[2], 0, 0xff);
311 confirm("Write register 0x%02x from chip 0x%02x on bus %d?", addr, chip, bus);
315 ioctl_data.command = addr;