Additionally, add some error checking in the constructor, and determine the ADC resolution and use that in the voltage calculation rather than a hardcoded 1024.0. Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Zion Orent <zorent@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
|
||
59 | 59 |
|
60 | 60 |
|
61 | 61 |
|
62 |
|
|
62 |
|
|
63 | 63 |
|
64 | 64 |
|
65 | 65 |
|
|
||
151 | 151 |
|
152 | 152 |
|
153 | 153 |
|
154 |
|
|
154 |
|
|
155 | 155 |
|
156 | 156 |
|
157 | 157 |
|
|
||
257 | 257 |
|
258 | 258 |
|
259 | 259 |
|
260 |
|
|
260 |
|
|
261 | 261 |
|
262 | 262 |
|
263 | 263 |
|
|
||
25 | 25 |
|
26 | 26 |
|
27 | 27 |
|
28 |
|
|
28 |
|
|
29 | 29 |
|
30 | 30 |
|
31 | 31 |
|
32 | 32 |
|
33 | 33 |
|
34 | 34 |
|
35 |
|
|
35 |
|
|
36 | 36 |
|
37 | 37 |
|
38 | 38 |
|
|
||
46 | 46 |
|
47 | 47 |
|
48 | 48 |
|
49 |
|
|
50 |
|
|
51 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 | 52 |
|
53 |
|
|
54 |
|
|
53 |
|
|
54 |
|
|
55 | 55 |
|
56 | 56 |
|
57 | 57 |
|
58 | 58 |
|
59 | 59 |
|
60 | 60 |
|
61 |
|
|
61 |
|
|
62 | 62 |
|
63 |
|
|
63 |
|
|
64 | 64 |
|
65 | 65 |
|
66 | 66 |
|
|
||
1 | 1 |
|
2 | 2 |
|
3 |
|
|
4 | 3 |
|
5 | 4 |
|
6 | 5 |
|
|
||
24 | 23 |
|
25 | 24 |
|
26 | 25 |
|
27 |
|
|
26 |
|
|
28 | 27 |
|
29 | 28 |
|
30 |
|
|
29 |
|
|
31 | 30 |
|
32 | 31 |
|
33 |
|
|
32 |
|
|
34 | 33 |
|
35 |
|
|
34 |
|
|
36 | 35 |
|
37 | 36 |
|
38 |
|
|
39 |
|
|
37 |
|
|
38 |
|
|
40 | 39 |
|
41 | 40 |
|
42 | 41 |
|
43 |
|
|
44 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 | 45 |
|
46 |
|
|
46 |
|
|
47 | 47 |
|
48 |
|
|
48 |
|
|
49 | 49 |
|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
|
53 | 53 |
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
54 | 58 |
|
55 | 59 |
|
56 | 60 |
|
|
||
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 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
||
1 | 1 |
|
2 | 2 |
|
3 |
|
|
3 |
|
|
4 | 4 |
|
5 | 5 |
|
6 | 6 |
|
|
||
24 | 24 |
|
25 | 25 |
|
26 | 26 |
|
27 |
|
|
27 |
|
|
28 | 28 |
|
29 |
|
|
29 | 30 |
|
30 | 31 |
|
31 |
|
|
32 |
|
|
32 | 33 |
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
34 | 39 |
|
35 |
|
|
40 |
|
|
41 |
|
|
36 | 42 |
|
37 | 43 |
|
38 |
|
|
44 |
|
|
39 | 45 |
|
40 | 46 |
|
41 | 47 |
|
42 | 48 |
|
43 |
|
|
49 |
|
|
44 | 50 |
|
45 | 51 |
|
46 | 52 |
|
|
||
52 | 58 |
|
53 | 59 |
|
54 | 60 |
|
55 |
|
|
61 |
|
|
56 | 62 |
|
57 | 63 |
|
58 | 64 |
|
|
||
1 | 1 |
|
2 | 2 |
|
3 |
|
|
3 |
|
|
4 | 4 |
|
5 | 5 |
|
6 | 6 |
|
|
||
23 | 23 |
|
24 | 24 |
|
25 | 25 |
|
26 |
|
|
26 | 27 |
|
27 | 28 |
|
28 | 29 |
|
29 | 30 |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
30 | 36 |
|
31 | 37 |
|
32 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
33 | 46 |
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
47 |
|
|
48 |
|
|
38 | 49 |
|
39 |
|
|
50 |
|
|
40 | 51 |
|
41 |
|
|
42 |
|
|
52 |
|
|
43 | 53 |
|
44 |
|
|
54 |
|
|
45 | 55 |
|
56 |
|
|
46 | 57 |
|
47 |
|
|
58 |
|
|
48 | 59 |
|
49 | 60 |
|
50 | 61 |
|
51 |
|
|
62 |
|
|
63 |
|
|
52 | 64 |
|
53 |
|
|
65 |
|
|
54 | 66 |
|
55 |
|
|
67 |
|
|
68 |
|
|
56 | 69 |
|
57 | 70 |
|
58 | 71 |
|
|
||
64 | 77 |
|
65 | 78 |
|
66 | 79 |
|
80 |
|
|
81 |
|
|
67 | 82 |
|
68 | 83 |
|
69 | 84 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|