2 * Copyright © 2019 Bdale Garbee <bdale@gag.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
15 #ifndef _AO_ADS1256_H_
16 #define _AO_ADS1256_H_
19 #define AO_ADS1256_WAKEUP 0x00
20 #define AO_ADS1256_RDATA 0x01
21 #define AO_ADS1256_RDATAC 0x03
22 #define AO_ADS1256_SDATAC 0x0f
23 #define AO_ADS1256_RREG 0x10
24 #define AO_ADS1256_WREG 0x50
25 #define AO_ADS1256_SELFCAL 0xf0
26 #define AO_ADS1256_SELFOCAL 0xf1
27 #define AO_ADS1256_SELFGCAL 0xf2
28 #define AO_ADS1256_SYSOCAL 0xf3
29 #define AO_ADS1256_SYSGCAL 0xf4
30 #define AO_ADS1256_SYNC 0xfc
31 #define AO_ADS1256_STANDBY 0xfd
32 #define AO_ADS1256_RESET 0xfe
33 #define AO_ADS1256_WAKEUP2 0xff
36 #define AO_ADS1256_STATUS 0x00
37 #define AO_ADS1256_ID_ADS1256 0x03
38 #define AO_ADS1256_MUX 0x01
39 #define AO_ADS1256_ADCON 0x02
40 #define AO_ADS1256_DRATE 0x03
41 #define AO_ADS1256_IO 0x04
42 #define AO_ADS1256_OFC0 0x05
43 #define AO_ADS1256_OFC1 0x06
44 #define AO_ADS1256_OFC2 0x07
45 #define AO_ADS1256_FSC0 0x08
46 #define AO_ADS1256_FSC1 0x09
47 #define AO_ADS1256_FSC2 0x0a
49 struct ao_ads1256_sample {
50 int32_t ain[AO_ADS1256_CHANNELS];
53 extern struct ao_ads1256_sample ao_ads1256_current;
56 ao_ads1256_init(void);
58 #endif /* _AO_ADS1256_H_ */