OpenBIC
OpenSource Bridge-IC
ads112c.h
Go to the documentation of this file.
1#ifndef ADS112C_H
2#define ADS112C_H
3
5 //Input multiplexer configuration(Bit 7:4)
6 ADS112C_REG0_INPUT_AIN0AIN1 = 0x00, //AINP = AIN0, AINN = AIN1(default)
7 ADS112C_REG0_INPUT_AIN0AIN2 = 0x10, //AINP = AIN0, AINN = AIN2
8 ADS112C_REG0_INPUT_AIN0AIN3 = 0x20, //AINP = AIN0, AINN = AIN3
9 ADS112C_REG0_INPUT_AIN1AIN0 = 0x30, //AINP = AIN1, AINN = AIN0
10 ADS112C_REG0_INPUT_AIN1AIN2 = 0x40, //AINP = AIN1, AINN = AIN2
11 ADS112C_REG0_INPUT_AIN1AIN3 = 0x50, //AINP = AIN1, AINN = AIN3
12 ADS112C_REG0_INPUT_AIN2AIN3 = 0x60, //AINP = AIN2, AINN = AIN3
13 ADS112C_REG0_INPUT_AIN3AIN2 = 0x70, //AINP = AIN3, AINN = AIN2
14 ADS112C_REG0_INPUT_AIN0AVSS = 0x80, //AINP = AIN0, AINN = AVSS
15 ADS112C_REG0_INPUT_AIN1AVSS = 0x90, //AINP = AIN1, AINN = AVSS
16 ADS112C_REG0_INPUT_AIN2AVSS = 0xA0, //AINP = AIN2, AINN = AVSS
17 ADS112C_REG0_INPUT_AIN3AVSS = 0xB0, //AINP = AIN3, AINN = AVSS
18 //Gain configuration(Bit 3:1)
19 ADS112C_REG0_GAIN1 = 0x00, //Gain = 1 (default)
27 //Disables and bypasses the internal low-noise PGA (Bit 0)
30};
31
33 //Data rate (Bit 5:7)
35 //Conversion mode. (Bit 3)
38 //Voltage reference selection. (Bit 2:1)
41 //Temperature sensor mode. (Bit 0)
44};
45
47 //IDAC current setting (Bit 2:0)
56};
57
59 //IDAC1 routing configuration (Bit 7:5)
68};
69
70// Command Byte to control device
71#define CMD_RESET 0x06 //000 011x(06h)
72#define CMD_START_SYNC 0x08 //000 100x(08h)
73#define CMD_POWERDOWN 0x02 //000 001x(08h)
74#define CMD_RDATA 0x10 //001 000x(10h)
75#define CMD_RREG 0x20 //010 000x(20h)
76#define CMD_WREG 0x40 //100 000x(40h)
77
78// Configuration Registers offset
79#define CFG_REG_OFFSET0 0x00
80#define CFG_REG_OFFSET1 0x04
81#define CFG_REG_OFFSET2 0x08
82#define CFG_REG_OFFSET3 0x0C
83
84#define ADS112C_REG2_DRDY_READY 0x80
85#define ENABLE_RESET_CFG_REG 1
86#define DISABLE_RESET_CFG_REG 0
87
88typedef struct _ads112c_init_arg {
89 uint8_t reg0_input;
90 uint8_t reg0_gain;
91 uint8_t reg0_pga;
92 uint8_t reg1_dr;
97 uint8_t reg2_idac;
100
105};
106
107#endif //ADS112C_H
struct _ads112c_init_arg ads112c_init_arg
ADS112C_READ_OUTPUT_OFFSET
Definition: ads112c.h:101
@ ADS112C_READ_OUTPUT_RAW
Definition: ads112c.h:102
@ ADS112C_READ_OUTPUT_TEMP
Definition: ads112c.h:104
@ ADS112C_READ_OUTPUT_VOLT
Definition: ads112c.h:103
ADS112C_REG2_CONFIG
Definition: ads112c.h:46
@ ADS112C_REG2_IDAC_250UA
Definition: ads112c.h:52
@ ADS112C_REG2_IDAC_50UA
Definition: ads112c.h:50
@ ADS112C_REG2_IDAC_1500UA
Definition: ads112c.h:55
@ ADS112C_REG2_IDAC_500UA
Definition: ads112c.h:53
@ ADS112C_REG2_IDAC_OFF
Definition: ads112c.h:48
@ ADS112C_REG2_IDAC_1000UA
Definition: ads112c.h:54
@ ADS112C_REG2_IDAC_100UA
Definition: ads112c.h:51
@ ADS112C_REG2_IDAC_10UA
Definition: ads112c.h:49
ADS112C_REG3_CONFIG
Definition: ads112c.h:58
@ ADS112C_REG3_IDAC1_DISABLED
Definition: ads112c.h:60
@ ADS112C_REG3_IDAC1_REFN
Definition: ads112c.h:66
@ ADS112C_REG3_IDAC1_RESERVED
Definition: ads112c.h:67
@ ADS112C_REG3_IDAC1_REFP
Definition: ads112c.h:65
@ ADS112C_REG3_IDAC1_AIN3
Definition: ads112c.h:64
@ ADS112C_REG3_IDAC1_AIN1
Definition: ads112c.h:62
@ ADS112C_REG3_IDAC1_AIN0
Definition: ads112c.h:61
@ ADS112C_REG3_IDAC1_AIN2
Definition: ads112c.h:63
ADS112C_REG0_CONFIG
Definition: ads112c.h:4
@ ADS112C_REG0_GAIN64
Definition: ads112c.h:25
@ ADS112C_REG0_INPUT_AIN3AIN2
Definition: ads112c.h:13
@ ADS112C_REG0_GAIN1
Definition: ads112c.h:19
@ ADS112C_REG0_INPUT_AIN1AVSS
Definition: ads112c.h:15
@ ADS112C_REG0_INPUT_AIN1AIN3
Definition: ads112c.h:11
@ ADS112C_REG0_GAIN2
Definition: ads112c.h:20
@ ADS112C_REG0_INPUT_AIN0AVSS
Definition: ads112c.h:14
@ ADS112C_REG0_PGA_DISABLE
Definition: ads112c.h:29
@ ADS112C_REG0_INPUT_AIN3AVSS
Definition: ads112c.h:17
@ ADS112C_REG0_GAIN8
Definition: ads112c.h:22
@ ADS112C_REG0_INPUT_AIN1AIN2
Definition: ads112c.h:10
@ ADS112C_REG0_INPUT_AIN0AIN1
Definition: ads112c.h:6
@ ADS112C_REG0_GAIN32
Definition: ads112c.h:24
@ ADS112C_REG0_INPUT_AIN0AIN2
Definition: ads112c.h:7
@ ADS112C_REG0_INPUT_AIN1AIN0
Definition: ads112c.h:9
@ ADS112C_REG0_INPUT_AIN2AVSS
Definition: ads112c.h:16
@ ADS112C_REG0_INPUT_AIN0AIN3
Definition: ads112c.h:8
@ ADS112C_REG0_PGA_ENABLE
Definition: ads112c.h:28
@ ADS112C_REG0_GAIN16
Definition: ads112c.h:23
@ ADS112C_REG0_GAIN4
Definition: ads112c.h:21
@ ADS112C_REG0_GAIN128
Definition: ads112c.h:26
@ ADS112C_REG0_INPUT_AIN2AIN3
Definition: ads112c.h:12
ADS112C_REG1_CONFIG
Definition: ads112c.h:32
@ ADS112C_REG1_CONTINUEMODE
Definition: ads112c.h:37
@ ADS112C_REG1_SINGLEMODE
Definition: ads112c.h:36
@ ADS112C_REG1_INTERNALV
Definition: ads112c.h:39
@ ADS112C_REG1_TEMPMODE_DISABLE
Definition: ads112c.h:42
@ ADS112C_REG1_TEMPMODE_ENABLE
Definition: ads112c.h:43
@ ADS112C_REG1_EXTERNALV
Definition: ads112c.h:40
@ ADS112C_REG1_DR_1000_SPS
Definition: ads112c.h:34
Definition: ads112c.h:88
uint8_t reg1_conversion
Definition: ads112c.h:93
uint8_t reg0_pga
Definition: ads112c.h:91
double vol_refer_val
Definition: ads112c.h:95
uint8_t reg1_dr
Definition: ads112c.h:92
uint8_t reg2_idac
Definition: ads112c.h:97
uint8_t reg1_temp_mode
Definition: ads112c.h:96
uint8_t reg0_input
Definition: ads112c.h:89
uint8_t reg0_gain
Definition: ads112c.h:90
uint8_t reg3_idac1_cfg
Definition: ads112c.h:98
uint8_t reg1_vol_refer
Definition: ads112c.h:94