Lines Matching refs:toys
72 #include "toys.h"
185 if (toys.optc) error_exit("-l doesn't take arguments");
188 if (toys.optc != 1) error_exit("-F BUS");
189 i2cdetect_dash_F(atolx_range(*toys.optargs, 0, INT_MAX));
198 if (toys.optc!=1 && toys.optc!=3) help_exit("Needs 1 or 3 arguments");
199 bus = atolx_range(*toys.optargs, 0, INT_MAX);
200 if (toys.optc==3) {
201 first = atolx_range(toys.optargs[1], 0, 0x7f);
202 last = atolx_range(toys.optargs[2], 0, 0x7f);
239 int bus = atolx_range(toys.optargs[0], 0, INT_MAX);
240 int chip = atolx_range(toys.optargs[1], 0, 0x7f);
268 int bus = atolx_range(toys.optargs[0], 0, INT_MAX);
269 int chip = atolx_range(toys.optargs[1], 0, 0x7f);
270 int addr = atolx_range(toys.optargs[2], 0, 0xff);
287 int bus = atolx_range(toys.optargs[0], 0, INT_MAX);
288 int chip = atolx_range(toys.optargs[1], 0, 0x7f);
289 int addr = atolx_range(toys.optargs[2], 0, 0xff);
290 char *mode = toys.optargs[toys.optc-1];
297 if (*mode=='b' && toys.optc==5) {
299 data.byte = atolx_range(toys.optargs[3], 0, 0xff);
300 } else if (*mode=='w' && toys.optc==5) {
302 data.word = atolx_range(toys.optargs[3], 0, 0xffff);
303 } else if (*mode=='i' && toys.optc>=5) {
304 if (toys.optc-4>I2C_SMBUS_BLOCK_MAX) error_exit("too much data");
306 for (i = 0; i<toys.optc-4; ++i)
307 data.block[i+1] = atolx_range(toys.optargs[3+i], 0, 0xff);
308 data.block[0] = toys.optc-4;