![]() |
i2c
1.4.2
RoadNarrows Robotics I2C Package
|
Check if I2C device with the specified address exists on the I2C Bus. 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 | execCheck (i2c_t *pI2C, int addr) |
Execute I2C slave device check. More... | |
static void | MainInit (int argc, char *argv[], i2c_t *pI2C) |
Command initialization. More... | |
int | main (int argc, char *argv[]) |
i2ccheck 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 int | OptI2CAddr = -1 |
slave device address option | |
static OptsPgmInfo_T | I2CCheckPgmInfo |
Program Information. More... | |
static OptsInfo_T | I2CCheckOptsInfo [] |
Command Line Options Information. | |
Check if I2C device with the specified address exists on the I2C Bus.
Definition in file i2ccheck.c.
|
static |
Execute I2C slave device check.
pI2C | Pointer to I2C handle. |
addr | Slave device address. |
Definition at line 167 of file i2ccheck.c.
References Argv0, i2c_exists(), and OptVerbose.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
i2ccheck main()
argc | Count of command-line options and arguments. |
argv | Array of command-line options and arguments. |
Definition at line 257 of file i2ccheck.c.
References execCheck(), MainInit(), and OptI2CAddr.
|
static |
Command initialization.
argc | Command-line argument count. |
argv | Command-line arguments. |
pI2C | Pointer to I2C handle. |
Definition at line 197 of file i2ccheck.c.
References i2c_struct::addr, Argv0, i2c_struct::fd, I2C_ADDR_DEV_HIGH, I2C_ADDR_DEV_LOW, i2c_open(), I2CCheckOptsInfo, I2CCheckPgmInfo, OptDevFd, OptDevName, OptI2CAddr, OptVerbose, and PkgInfo.
Referenced by main().
|
static |
Program Information.
Definition at line 83 of file i2ccheck.c.
Referenced by MainInit().