1 | #include "SPIinit.h"
|
2 | #include <stdlib.h>
|
3 | #include <util/delay.h>
|
4 | #include <stdint.h>
|
5 |
|
6 | #ifndef TRUE
|
7 | #define TRUE 1
|
8 | #endif
|
9 |
|
10 | #ifndef FALSE
|
11 | #define FALSE 0
|
12 | #endif
|
13 |
|
14 |
|
15 | #ifndef TEMPADS1118_H_
|
16 | #define TEMPADS1118_H_
|
17 |
|
18 |
|
19 | /* left ext sense
|
20 | * SingleShot (SS)
|
21 | * default MUX to left (MUX = 000; default)
|
22 | * lowest amplification (e.g. PGA = 101)
|
23 | * SingleShot + PowerDown (MODE = 1)
|
24 | * 16SPS DataRate (DR = 001)
|
25 | * ADC mode (TS_MODE = 0; default)
|
26 | * internal pullup resistor (PULL_UP_EN = 1)
|
27 | * no operation (NOP = 01) otherwise failure
|
28 | * Reserved always 1 (R=1)
|
29 | */
|
30 |
|
31 | #define ADS_DEFAULT_CONFIG_LINKS 0b1000101100101011//1 000 101 1 001 0 1 01 1
|
32 |
|
33 |
|
34 |
|
35 | /* right ext sense
|
36 | * SingleShot (SS)
|
37 | * MUX to right (MUX = 011)
|
38 | * lowest amplification (e.g. PGA = 101)
|
39 | * SingleShot + PowerDown (MODE = 1)
|
40 | * 16SPS DataRate (DR = 001)
|
41 | * internal pullup resistor (PULL_UP_EN = 1)
|
42 | * no operation (NOP = 01) otherwise failure
|
43 | * Reserved always 1 (R=1)
|
44 | * ADC mode (TS_MODE = 0; default)
|
45 | */
|
46 |
|
47 | #define ADS_DEFAULT_CONFIG_RECHTS 0b1011101100101011//1 011 101 1 001 0 1 01 1
|
48 |
|
49 |
|
50 | /* left int sense
|
51 | * SingleShot (SS)
|
52 | * MUX to left (MUX = 000; default)
|
53 | * lowest amplification (e.g. PGA = 101)
|
54 | * SingleShot + PowerDown (MODE = 1)
|
55 | * 16SPS DataRate (DR = 001)
|
56 | * internal pullup resistor (PULL_UP_EN = 1)
|
57 | * no operation (NOP = 01) otherwise failure
|
58 | * Reserved always 1 (R=1)
|
59 | * Tsense mode (TS_MODE = 0)
|
60 | */
|
61 |
|
62 | #define ADS_DEFAULT_CONFIG_LINKS_INT 0b1000101100111011 //1 000 101 1 001 1 1 01 1
|
63 |
|
64 |
|
65 |
|
66 | /* right int sense
|
67 | * SingleShot (SS)
|
68 | * MUX to right (MUX = 011)
|
69 | * lowest amplification (e.g. PGA = 101)
|
70 | * SingleShot + PowerDown (MODE = 1)
|
71 | * 16SPS DataRate (DR = 001)
|
72 | * Tsense mode (TS_MODE = 1)
|
73 | * internal pullup resistor (PULL_UP_EN = 1)
|
74 | * no operation (NOP = 01) otherwise failure
|
75 | * Reserved always 1 (R=1)
|
76 | */
|
77 |
|
78 | #define ADS_DEFAULT_CONFIG_RECHTS_INT 0b1011101100111011 //1 011 101 1 001 1 1 01 1
|
79 |
|
80 |
|
81 | #define ADS_DEFAULT_CONFIG_T0 ADS_DEFAULT_CONFIG_LINKS
|
82 | #define ADS_DEFAULT_CONFIG_T0_INT ADS_DEFAULT_CONFIG_LINKS_INT
|
83 | #define ADS_DEFAULT_CONFIG_T1 ADS_DEFAULT_CONFIG_RECHTS
|
84 | #define ADS_DEFAULT_CONFIG_T1_INT ADS_DEFAULT_CONFIG_RECHTS_INT
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | //perform one 16Bit Measurement (which is the measurement size of our ADC)
|
90 | int16_t perform16BitMeasurement(int16_t valueMsg);
|
91 |
|
92 | #endif /* TEMPADS1118_H_ */
|