1
1
//
2
2
// FILE: ADS1X15.cpp
3
3
// AUTHOR: Rob Tillaart
4
- // VERSION: 0.4.3
4
+ // VERSION: 0.4.4
5
5
// DATE: 2013-03-24
6
6
// PURPOSE: Arduino library for ADS1015 and ADS1115
7
7
// URL: https://github.com/RobTillaart/ADS1X15
24
24
25
25
// CONFIG REGISTER
26
26
27
- // BIT 15 Operational Status // 1 << 15
27
+ // BIT 15 Operational Status // 1 << 15
28
28
#define ADS1X15_OS_BUSY 0x0000
29
29
#define ADS1X15_OS_NOT_BUSY 0x8000
30
30
#define ADS1X15_OS_START_SINGLE 0x8000
53
53
#define ADS1X15_MODE_CONTINUE 0x0000
54
54
#define ADS1X15_MODE_SINGLE 0x0100
55
55
56
- // BIT 5-7 data rate sample per second // (0..7) << 5
56
+ // BIT 5-7 data rate sample per second // (0..7) << 5
57
57
/*
58
58
differs for different devices, check datasheet or readme.md
59
59
@@ -69,26 +69,26 @@ differs for different devices, check datasheet or readme.md
69
69
| 7 | 3300 | 860 | fastest |
70
70
*/
71
71
72
- // BIT 4 comparator modi // 1 << 4
72
+ // BIT 4 comparator modi // 1 << 4
73
73
#define ADS1X15_COMP_MODE_TRADITIONAL 0x0000
74
74
#define ADS1X15_COMP_MODE_WINDOW 0x0010
75
75
76
- // BIT 3 ALERT active value // 1 << 3
76
+ // BIT 3 ALERT active value // 1 << 3
77
77
#define ADS1X15_COMP_POL_ACTIV_LOW 0x0000
78
78
#define ADS1X15_COMP_POL_ACTIV_HIGH 0x0008
79
79
80
- // BIT 2 ALERT latching // 1 << 2
80
+ // BIT 2 ALERT latching // 1 << 2
81
81
#define ADS1X15_COMP_NON_LATCH 0x0000
82
82
#define ADS1X15_COMP_LATCH 0x0004
83
83
84
- // BIT 0-1 ALERT mode // (0..3)
84
+ // BIT 0-1 ALERT mode // (0..3)
85
85
#define ADS1X15_COMP_QUE_1_CONV 0x0000 // trigger alert after 1 convert
86
86
#define ADS1X15_COMP_QUE_2_CONV 0x0001 // trigger alert after 2 converts
87
87
#define ADS1X15_COMP_QUE_4_CONV 0x0002 // trigger alert after 4 converts
88
88
#define ADS1X15_COMP_QUE_NONE 0x0003 // disable comparator
89
89
90
90
91
- // _CONFIG masks
91
+ // _CONFIG masks
92
92
//
93
93
// | bit | description |
94
94
// |:-----:|:-----------------------|
@@ -131,7 +131,7 @@ void ADS1X15::reset()
131
131
setMode (1 ); // _mode = ADS1X15_MODE_SINGLE;
132
132
setDataRate (4 ); // middle speed, depends on device.
133
133
134
- // COMPARATOR variables # see notes .h
134
+ // COMPARATOR variables # see notes .h
135
135
_compMode = 0 ;
136
136
_compPol = 1 ;
137
137
_compLatch = 0 ;
@@ -423,7 +423,7 @@ void ADS1X15::setWireClock(uint32_t clockSpeed)
423
423
// TODO: get the real clock speed from the I2C interface if possible.
424
424
uint32_t ADS1X15::getWireClock ()
425
425
{
426
- // UNO 328 and
426
+ // UNO 328 and
427
427
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
428
428
uint32_t speed = F_CPU / ((TWBR * 2 ) + 16 );
429
429
return speed;
0 commit comments