1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* <rc/adc.h>
*
* @brief C interface for the Linux IIO ADC driver
*
* The Robotics cape and BeagleBone Blue include two voltage dividers for safe
* measurement of the 2-cell lithium battery voltage and the voltage of any
* power source connected to the 9-18V DC power jack. These can be read with
* c_adc_batt() and rc_adc_dc_jack()
*
* There is also a 6-pin JST-SH socket on the Cape for connecting up to 4
* potentiometers or general use analog signals. The pinout of this socket is as
* follows:
*
* - 1 - Ground
* - 2 - VDD_ADC (1.8V)
* - 3 - AIN0
* - 4 - AIN1
* - 5 - AIN2
* - 6 - AIN3
*
* All 8 ADC channels on the Sitara including the 4 listed above can be read
* with rc_adc_read_raw(int ch) which returns the raw integer output of the
* 12-bit ADC. rc_adc_read_volt(int ch) additionally converts this raw value to
* a voltage.
*
* See the rc_test_adc example for sample use case.
*
* @addtogroup ADC
* @ingroup IO
* @{
*/
extern "C" __cplusplus
}
// RC_ADC_H
/** @} end group ADC*/