ads101x_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 OTA keys S.A.
3  * 2018 Acutam Automation, LLC
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef ADS101X_REGS_H
22 #define ADS101X_REGS_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define ADS101X_CONV_RES_ADDR (0)
33 #define ADS101X_CONF_ADDR (1)
34 #define ADS101X_LOW_LIMIT_ADDR (2)
35 #define ADS101X_HIGH_LIMIT_ADDR (3)
36 
45 #define ADS101X_CONF_OS_CONV (1 << 7)
46 #define ADS101X_CONF_COMP_MODE_WIND (1 << 4)
47 #define ADS101X_CONF_COMP_DIS ((1 << 1) | (1 << 0))
48 
58 #define ADS101X_MUX_MASK ((1 << 6) | (1 << 5) | (1 << 4))
59 #define ADS101X_AIN0_DIFFM_AIN1 ((0 << 6) | (0 << 5) | (0 << 4))
60 #define ADS101X_AIN0_DIFFM_AIN3 ((0 << 6) | (0 << 5) | (1 << 4))
61 #define ADS101X_AIN1_DIFFM_AIN3 ((0 << 6) | (1 << 5) | (0 << 4))
62 #define ADS101X_AIN2_DIFFM_AIN3 ((0 << 6) | (1 << 5) | (1 << 4))
63 #define ADS101X_AIN0_SINGM ((1 << 6) | (0 << 5) | (0 << 4))
64 #define ADS101X_AIN1_SINGM ((1 << 6) | (0 << 5) | (1 << 4))
65 #define ADS101X_AIN2_SINGM ((1 << 6) | (1 << 5) | (0 << 4))
66 #define ADS101X_AIN3_SINGM ((1 << 6) | (1 << 5) | (1 << 4))
67 
77 #define ADS101X_PGA_MASK ((1 << 3) | (1 << 2) | (1 << 1))
78 #define ADS101X_PGA_FSR_6V144 ((0 << 3) | (0 << 2) | (0 << 1))
79 #define ADS101X_PGA_FSR_4V096 ((0 << 3) | (0 << 2) | (1 << 1))
80 #define ADS101X_PGA_FSR_2V048 ((0 << 3) | (1 << 2) | (0 << 1))
81 #define ADS101X_PGA_FSR_1V024 ((0 << 3) | (1 << 2) | (1 << 1))
82 #define ADS101X_PGA_FSR_0V512 ((1 << 3) | (0 << 2) | (0 << 1))
83 #define ADS101X_PGA_FSR_0V256 ((1 << 3) | (0 << 2) | (1 << 1))
84 
93 #define ADS101X_DATAR_MASK ((1 << 7) | (1 << 6) | (1 << 5))
94 #define ADS101X_DATAR_128 ((0 << 7) | (0 << 6) | (0 << 5))
95 #define ADS101X_DATAR_250 ((0 << 7) | (0 << 6) | (1 << 5))
96 #define ADS101X_DATAR_490 ((0 << 7) | (1 << 6) | (0 << 5))
97 #define ADS101X_DATAR_920 ((0 << 7) | (1 << 6) | (1 << 5))
98 #define ADS101X_DATAR_1600 ((1 << 7) | (0 << 6) | (0 << 5))
99 #define ADS101X_DATAR_2400 ((1 << 7) | (0 << 6) | (1 << 5))
100 #define ADS101X_DATAR_3300 ((1 << 7) | (1 << 6) | (0 << 5))
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif /* ADS101X_REGS_H */
107