i2c-tools  4.3
About: i2c-tools are an heterogeneous set of I2C tools for Linux (originally part of the lm-sensors package).
  Fossies Dox: i2c-tools-4.3.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

i2cbusses.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <dirent.h>
#include <fcntl.h>
#include <errno.h>
#include "i2cbusses.h"
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
Include dependency graph for i2cbusses.c:

Go to the source code of this file.

Data Structures

struct  adap_type
 

Macros

#define _BSD_SOURCE   1 /* for glibc <= 2.19 */
 
#define _DEFAULT_SOURCE   1 /* for glibc >= 2.19 */
 
#define BUNCH   8
 

Enumerations

enum  adt {
  adt_dummy , adt_isa , adt_i2c , adt_smbus ,
  adt_unknown
}
 

Functions

static enum adt i2c_get_funcs (int i2cbus)
  More...
 
static int rtrim (char *s)
  More...
 
void free_adapters (struct i2c_adap *adapters)
  More...
 
static struct i2c_adapmore_adapters (struct i2c_adap *adapters, int n)
  More...
 
static int sort_i2c_busses (const void *a, const void *b)
  More...
 
struct i2c_adapgather_i2c_busses (void)
  More...
 
static int lookup_i2c_bus_by_name (const char *bus_name)
  More...
 
int lookup_i2c_bus (const char *i2cbus_arg)
  More...
 
int parse_i2c_address (const char *address_arg, int all_addrs)
  More...
 
int open_i2c_dev (int i2cbus, char *filename, size_t size, int quiet)
  More...
 
int set_slave_addr (int file, int address, int force)
  More...
 

Variables

static struct adap_type adap_types [5]
  More...
 

Enumeration Type Documentation

◆ adt

enum adt
Enumerator
adt_dummy 
adt_isa 
adt_i2c 
adt_smbus 
adt_unknown 

Definition at line 46 of file i2cbusses.c.

Variable Documentation

◆ adap_types

struct adap_type adap_types[5]
static
Initial value:
= {
{ .funcs = "dummy",
.algo = "Dummy bus", },
{ .funcs = "isa",
.algo = "ISA bus", },
{ .funcs = "i2c",
.algo = "I2C adapter", },
{ .funcs = "smbus",
.algo = "SMBus adapter", },
{ .funcs = "unknown",
.algo = "N/A", },
}

Definition at line 1 of file i2cbusses.c.

Referenced by gather_i2c_busses().