3 * Extend wiringPi with the MCP3422 I2C ADC chip
4 ***********************************************************************
5 * This file is part of wiringPi:
6 * https://projects.drogon.net/raspberry-pi/wiringpi/
8 * wiringPi is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
13 * wiringPi is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with wiringPi.
20 * If not, see <http://www.gnu.org/licenses/>.
21 ***********************************************************************
24 #define MCP3422_SR_3_75 0
25 #define MCP3422_SR_15 1
26 #define MCP3422_SR_60 2
27 #define MCP3422_SR_240 3
29 #define MCP3422_GAIN_1 0
30 #define MCP3422_GAIN_2 1
31 #define MCP3422_GAIN_4 2
32 #define MCP3422_GAIN_8 3
39 extern int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain) ;