2020-2021 Sunseeker Telemetry and Lighting System
ref.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // ref.h - Driver for the REF Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_REF_H__
8 #define __MSP430WARE_REF_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_REF__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 //*****************************************************************************
26 //
27 // The following are values that can be passed to the referenceVoltageSelect
28 // parameter for functions: Ref_setReferenceVoltage().
29 //
30 //*****************************************************************************
31 #define REF_VREF1_5V (REFVSEL_0)
32 #define REF_VREF2_0V (REFVSEL_1)
33 #define REF_VREF2_5V (REFVSEL_2)
34 
35 //*****************************************************************************
36 //
37 // The following are values that can be passed toThe following are values that
38 // can be returned by the Ref_isBandgapActive() function and the
39 // Ref_isRefGenActive() function.
40 //
41 //*****************************************************************************
42 #define REF_ACTIVE true
43 #define REF_INACTIVE false
44 
45 //*****************************************************************************
46 //
47 // The following are values that can be passed toThe following are values that
48 // can be returned by the Ref_getBandgapMode() function.
49 //
50 //*****************************************************************************
51 #define REF_STATICMODE 0x00
52 #define REF_SAMPLEMODE BGMODE
53 
54 //*****************************************************************************
55 //
56 // The following are values that can be passed toThe following are values that
57 // can be returned by the Ref_isRefGenBusy() function.
58 //
59 //*****************************************************************************
60 #define REF_NOTBUSY 0x00
61 #define REF_BUSY REFGENBUSY
62 
63 //*****************************************************************************
64 //
65 // Prototypes for the APIs.
66 //
67 //*****************************************************************************
68 
69 //*****************************************************************************
70 //
88 //
89 //*****************************************************************************
90 extern void Ref_setReferenceVoltage(uint16_t baseAddress,
91  uint8_t referenceVoltageSelect);
92 
93 //*****************************************************************************
94 //
109 //
110 //*****************************************************************************
111 extern void Ref_disableTempSensor(uint16_t baseAddress);
112 
113 //*****************************************************************************
114 //
127 //
128 //*****************************************************************************
129 extern void Ref_enableTempSensor(uint16_t baseAddress);
130 
131 //*****************************************************************************
132 //
152 //
153 //*****************************************************************************
154 extern void Ref_enableReferenceVoltageOutput(uint16_t baseAddress);
155 
156 //*****************************************************************************
157 //
169 //
170 //*****************************************************************************
171 extern void Ref_disableReferenceVoltageOutput(uint16_t baseAddress);
172 
173 //*****************************************************************************
174 //
189 //
190 //*****************************************************************************
191 extern void Ref_enableReferenceVoltage(uint16_t baseAddress);
192 
193 //*****************************************************************************
194 //
206 //
207 //*****************************************************************************
208 extern void Ref_disableReferenceVoltage(uint16_t baseAddress);
209 
210 //*****************************************************************************
211 //
228 //
229 //*****************************************************************************
230 extern uint16_t Ref_getBandgapMode(uint16_t baseAddress);
231 
232 //*****************************************************************************
233 //
246 //
247 //*****************************************************************************
248 extern bool Ref_isBandgapActive(uint16_t baseAddress);
249 
250 //*****************************************************************************
251 //
266 //
267 //*****************************************************************************
268 extern uint16_t Ref_isRefGenBusy(uint16_t baseAddress);
269 
270 //*****************************************************************************
271 //
285 //
286 //*****************************************************************************
287 extern bool Ref_isRefGenActive(uint16_t baseAddress);
288 
289 //*****************************************************************************
290 //
291 // Mark the end of the C bindings section for C++ compilers.
292 //
293 //*****************************************************************************
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif
299 #endif // __MSP430WARE_REF_H__