IBASE MRS-801-RE User Manual
Page 83

Copyright © 2013 IBASE Technology Inc. All Rights Reserved.
75
IBASE Technology Inc.
/* Walk the list of i2c busses, looking for the one with the
right name */
for (i = 0; adapters[i].name; i++) {
if (strcmp(adapters[i].name, bus_name) == 0) {
if (i2cbus >= 0) {
fprintf(stderr,
"Error: I2C bus name is not unique!\n");
i2cbus = -4;
goto done;
}
i2cbus = adapters[i].nr;
}
}
if (i2cbus == -1)
fprintf(stderr, "Error: I2C bus name doesn't match any "
"bus present!\n");
done:
free_adapters(adapters);
return i2cbus;
}
/*
* Parse an I2CBUS command line argument and return the corresponding
* bus number, or a negative value if the bus is invalid.
*/
int lookup_i2c_bus(const char *i2cbus_arg)
{
unsigned long i2cbus;
char *end;
i2cbus = strtoul(i2cbus_arg, &end, 0);
if (*end || !*i2cbus_arg) {
/* Not a number, maybe a name? */
return lookup_i2c_bus_by_name(i2cbus_arg);
}
if (i2cbus > 0xFFFFF) {
- IPPC08A7 (70 pages)
- IB898 (58 pages)
- IB908 (76 pages)
- IB906 (56 pages)
- IB520 (56 pages)
- IB550 (58 pages)
- IB893 (68 pages)
- IB892 (56 pages)
- IB905 (62 pages)
- IB882 (56 pages)
- IB903 (58 pages)
- IB886 (60 pages)
- IB889 (56 pages)
- IB897 (64 pages)
- IB885 (58 pages)
- IB530 (56 pages)
- IB950 (63 pages)
- IB825 (68 pages)
- IB815 (63 pages)
- IB704 (51 pages)
- AMS100-807 (12 pages)
- AMI400 (27 pages)
- CSB200-888 (13 pages)
- SI-06 (44 pages)
- SI-22 (51 pages)
- SI-18 (51 pages)
- IOPS-76 (36 pages)
- SI-28 (44 pages)
- SI-606 (103 pages)
- SI-12 (48 pages)
- SI-304 (62 pages)
- SI-32-N (50 pages)
- SI-62 (73 pages)
- SI-38 (49 pages)
- SI-64 (80 pages)
- SE-92 (63 pages)
- SI-83 (78 pages)
- SI-38N (53 pages)
- IOPS-18 (46 pages)
- SI-58 (73 pages)
- IPPCXXA7-RE (59 pages)
- INOSP Series (74 pages)
- IPPC15B7-RE (55 pages)
- SSPA-24 (7 pages)