![]() |
i2c
1.4.2
RoadNarrows Robotics I2C Package
|
I2C Bus Scan. More...
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <libgen.h>
#include <unistd.h>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/opts.h"
#include "rnr/i2c-dev.h"
#include "rnr/i2c.h"
#include "version.h"
Go to the source code of this file.
Functions | |
static int | scanCallback (i2c_t *pI2C, i2c_addr_t addr, void *context) |
Found scanned device callback. More... | |
static int | execScan (i2c_t *pI2C) |
Execute I2C slave device scan. More... | |
static void | MainInit (int argc, char *argv[], i2c_t *pI2C) |
Command initialization. More... | |
int | main (int argc, char *argv[]) |
i2cscan main() More... | |
Variables | |
static char * | Argv0 |
command name | |
static int | OptVerbose = 0 |
verbose option | |
static char * | OptDevName = "/dev/i2c/0" |
i2c bus device option | |
static int | OptDevFd = -1 |
opened i2c bus device fd option | |
static OptsPgmInfo_T | I2CScanPgmInfo |
Program Information. More... | |
static OptsInfo_T | I2CScanOptsInfo [] |
Command Line Options Information. | |
I2C Bus Scan.
Definition in file i2cscan.c.
|
static |
Execute I2C slave device scan.
pI2C | Pointer to I2C handle. |
Definition at line 160 of file i2cscan.c.
References Argv0, i2c_scan(), OptVerbose, and scanCallback().
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
i2cscan main()
argc | Count of command-line options and arguments. |
argv | Array of command-line options and arguments. |
Definition at line 239 of file i2cscan.c.
References execScan(), and MainInit().
|
static |
Command initialization.
argc | Command-line argument count. |
argv | Command-line arguments. |
pI2C | Pointer to I2C handle. |
Definition at line 191 of file i2cscan.c.
References i2c_struct::addr, Argv0, i2c_struct::fd, i2c_open(), I2CScanOptsInfo, I2CScanPgmInfo, OptDevFd, OptDevName, OptVerbose, and PkgInfo.
Referenced by main().
|
static |
Found scanned device callback.
pI2C | Pointer to I2C handle. |
addr | Slave device address. |
context | User provided context. |
Definition at line 147 of file i2cscan.c.
Referenced by execScan().
|
static |
Program Information.
Definition at line 78 of file i2cscan.c.
Referenced by MainInit().