2020-2021 Sunseeker Telemetry and Lighting System
ldopwr.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // ldopwr.h - Driver for the LDOPWR Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_LDOPWR_H__
8 #define __MSP430WARE_LDOPWR_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_PU__
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 value parameter for
28 // functions: LDOPWR_setPort_U1_outputData(), and
29 // LDOPWR_setPort_U0_outputData() as well as returned by the
30 // LDOPWR_getPort_U1_inputData() function, the LDOPWR_getPort_U0_inputData()
31 // function, the LDOPWR_getPort_U1_outputData() function and the
32 // LDOPWR_getPort_U0_outputData() function.
33 //
34 //*****************************************************************************
35 #define LDOPWR_PORTU_PIN_HIGH PUOUT0
36 #define LDOPWR_PORTU_PIN_LOW 0x00
37 
38 //*****************************************************************************
39 //
40 // The following are values that can be passed toThe following are values that
41 // can be returned by the LDOPWR_isLDOInputValid() function.
42 //
43 //*****************************************************************************
44 #define LDOPWR_LDO_INPUT_VALID LDOBGVBV
45 #define LDOPWR_LDO_INPUT_INVALID 0x00
46 
47 //*****************************************************************************
48 //
49 // The following are values that can be passed toThe following are values that
50 // can be returned by the LDOPWR_getOverloadAutoOffStatus() function.
51 //
52 //*****************************************************************************
53 #define LDOPWR_AUTOOFF_ENABLED OVLAOFF_H
54 #define LDOPWR_AUTOOFF_DISABLED 0x00
55 
56 //*****************************************************************************
57 //
58 // The following are values that can be passed to the mask parameter for
59 // functions: LDOPWR_enableInterrupt(), LDOPWR_disableInterrupt(),
60 // LDOPWR_getInterruptStatus(), and LDOPWR_clearInterrupt() as well as returned
61 // by the LDOPWR_getInterruptStatus() function.
62 //
63 //*****************************************************************************
64 #define LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT LDOOFFIE_H
65 #define LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT LDOONIE_H
66 #define LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT LDOOVLIE_H
67 
68 //*****************************************************************************
69 //
70 // Prototypes for the APIs.
71 //
72 //*****************************************************************************
73 
74 //*****************************************************************************
75 //
83 //
84 //*****************************************************************************
85 extern void LDOPWR_unLockConfiguration(uint16_t baseAddress);
86 
87 //*****************************************************************************
88 //
96 //
97 //*****************************************************************************
98 extern void LDOPWR_lockConfiguration(uint16_t baseAddress);
99 
100 //*****************************************************************************
101 //
109 //
110 //*****************************************************************************
111 extern void LDOPWR_enablePort_U_inputs(uint16_t baseAddress);
112 
113 //*****************************************************************************
114 //
122 //
123 //*****************************************************************************
124 extern void LDOPWR_disablePort_U_inputs(uint16_t baseAddress);
125 
126 //*****************************************************************************
127 //
135 //
136 //*****************************************************************************
137 extern void LDOPWR_enablePort_U_outputs(uint16_t baseAddress);
138 
139 //*****************************************************************************
140 //
148 //
149 //*****************************************************************************
150 extern void LDOPWR_disablePort_U_outputs(uint16_t baseAddress);
151 
152 //*****************************************************************************
153 //
161 //
162 //*****************************************************************************
163 extern uint8_t LDOPWR_getPort_U1_inputData(uint16_t baseAddress);
164 
165 //*****************************************************************************
166 //
174 //
175 //*****************************************************************************
176 extern uint8_t LDOPWR_getPort_U0_inputData(uint16_t baseAddress);
177 
178 //*****************************************************************************
179 //
187 //
188 //*****************************************************************************
189 extern uint8_t LDOPWR_getPort_U1_outputData(uint16_t baseAddress);
190 
191 //*****************************************************************************
192 //
200 //
201 //*****************************************************************************
202 extern uint8_t LDOPWR_getPort_U0_outputData(uint16_t baseAddress);
203 
204 //*****************************************************************************
205 //
217 //
218 //*****************************************************************************
219 extern void LDOPWR_setPort_U1_outputData(uint16_t baseAddress,
220  uint8_t value);
221 
222 //*****************************************************************************
223 //
235 //
236 //*****************************************************************************
237 extern void LDOPWR_setPort_U0_outputData(uint16_t baseAddress,
238  uint8_t value);
239 
240 //*****************************************************************************
241 //
249 //
250 //*****************************************************************************
251 extern void LDOPWR_togglePort_U1_outputData(uint16_t baseAddress);
252 
253 //*****************************************************************************
254 //
262 //
263 //*****************************************************************************
264 extern void LDOPWR_togglePort_U0_outputData(uint16_t baseAddress);
265 
266 //*****************************************************************************
267 //
282 //
283 //*****************************************************************************
284 extern void LDOPWR_enableInterrupt(uint16_t baseAddress,
285  uint16_t mask);
286 
287 //*****************************************************************************
288 //
301 //
302 //*****************************************************************************
303 extern void LDOPWR_disableInterrupt(uint16_t baseAddress,
304  uint16_t mask);
305 
306 //*****************************************************************************
307 //
315 //
316 //*****************************************************************************
317 extern void LDOPWR_enable(uint16_t baseAddress);
318 
319 //*****************************************************************************
320 //
328 //
329 //*****************************************************************************
330 extern void LDOPWR_disable(uint16_t baseAddress);
331 
332 //*****************************************************************************
333 //
348 //
349 //*****************************************************************************
350 extern uint8_t LDOPWR_getInterruptStatus(uint16_t baseAddress,
351  uint16_t mask);
352 
353 //*****************************************************************************
354 //
367 //
368 //*****************************************************************************
369 extern void LDOPWR_clearInterrupt(uint16_t baseAddress,
370  uint16_t mask);
371 
372 //*****************************************************************************
373 //
381 //
382 //*****************************************************************************
383 extern uint8_t LDOPWR_isLDOInputValid(uint16_t baseAddress);
384 
385 //*****************************************************************************
386 //
394 //
395 //*****************************************************************************
396 extern void LDOPWR_enableOverloadAutoOff(uint16_t baseAddress);
397 
398 //*****************************************************************************
399 //
407 //
408 //*****************************************************************************
409 extern void LDOPWR_disableOverloadAutoOff(uint16_t baseAddress);
410 
411 //*****************************************************************************
412 //
420 //
421 //*****************************************************************************
422 extern uint8_t LDOPWR_getOverloadAutoOffStatus(uint16_t baseAddress);
423 
424 //*****************************************************************************
425 //
426 // Mark the end of the C bindings section for C++ compilers.
427 //
428 //*****************************************************************************
429 #ifdef __cplusplus
430 }
431 #endif
432 
433 #endif
434 #endif // __MSP430WARE_LDOPWR_H__