Kontron KTAM3874-pITX Manual de usuario Pagina 51

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 293
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 50
KTD-S0057-I Page 47 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
/* Read address range if present */
if (argc == flags + 4 && mode != MODE_FUNC)
{
int tmp;
tmp = (int) strtoul (argv[flags+2], NULL, 16);
if ((tmp < first) || (tmp > last))
{
fprintf (stderr, "Error: FIRST argument out of range (0x%02x-0x%02x)!\n", first, last);
return -1;
}
first = tmp;
tmp = (int) strtoul (argv[flags+3], NULL, 16);
if ((tmp < first) || (tmp > last))
{
fprintf (stderr, "Error: FIRST argument out of range (0x%02x-0x%02x)!\n", first, last);
return -1;
}
last = tmp;
}
file = open_i2c_dev (i2cbus, filename, 0);
if (file < 0)
return -1;
/* Special case, we only list the implemented functionalities */
if (mode == MODE_FUNC)
{
if (ioctl (file, I2C_FUNCS, &funcs) < 0)
{
fprintf (stderr, "Error: Could not get the adapter functionality matrix: %s\n", strerror (errno));
close (file);
return -1;
}
close (file);
printf ("Functionalities implemented by %s:\n", filename);
print_functionality (funcs);
return 0;
}
res = scan_i2c_bus (file, mode, first, last);
close (file);
exit (res?1:0);
}
Further information about the I
2
C
TM
bus is available on https://www.kernel.org/doc/Documentation/i2c/
dev-interface
.
Vista de pagina 50
1 2 ... 46 47 48 49 50 51 52 53 54 55 56 ... 292 293

Comentarios a estos manuales

Sin comentarios