chiark / gitweb /
wiringPi Version 2 - First commit (of v2)
[wiringPi.git] / wiringPi / mcp3422.h
1 /*
2  * mcp3422.c:
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/
7  *
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.
12  *
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.
17  *
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  ***********************************************************************
22  */
23
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
28
29 #define MCP3422_GAIN_1  0
30 #define MCP3422_GAIN_2  1
31 #define MCP3422_GAIN_4  2
32 #define MCP3422_GAIN_8  3
33
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 extern int mcp3422Setup (int pinBase, int i2cAddress, int channels, int sampleRate, int gain) ;
40
41 #ifdef __cplusplus
42 }
43 #endif