root/i2c-tools/trunk/tools/i2cbusses.h

Revision 5885, 1.3 KB (checked in by khali, 15 months ago)

Use a 20-bit limit for the i2c bus number.
Use snprintf for the i2c dev node name.
Update copyright years.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2    i2cbusses.h - Part of the i2c-tools package
3
4    Copyright (C) 2004-2010  Jean Delvare <khali@linux-fr.org>
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19    MA 02110-1301 USA.
20*/
21
22#ifndef _I2CBUSSES_H
23#define _I2CBUSSES_H
24
25#include <unistd.h>
26
27struct i2c_adap {
28        int nr;
29        char *name;
30        const char *funcs;
31        const char *algo;
32};
33
34struct i2c_adap *gather_i2c_busses(void);
35void free_adapters(struct i2c_adap *adapters);
36
37int lookup_i2c_bus(const char *i2cbus_arg);
38int parse_i2c_address(const char *address_arg);
39int open_i2c_dev(int i2cbus, char *filename, size_t size, int quiet);
40int set_slave_addr(int file, int address, int force);
41
42#define MISSING_FUNC_FMT        "Error: Adapter does not have %s capability\n"
43
44#endif
Note: See TracBrowser for help on using the browser.