MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
ldopwr.h
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 //
76 //! \brief Unlocks the configuration registers and enables write access
77 //!
78 //! \param baseAddress is the base address of the LDOPWR module.
79 //!
80 //! Modified bits of \b LDOKEYPID register.
81 //!
82 //! \return None
83 //
84 //*****************************************************************************
85 extern void LDOPWR_unLockConfiguration(uint16_t baseAddress);
86 
87 //*****************************************************************************
88 //
89 //! \brief Locks the configuration registers and disables write access
90 //!
91 //! \param baseAddress is the base address of the LDOPWR module.
92 //!
93 //! Modified bits of \b LDOKEYPID register.
94 //!
95 //! \return None
96 //
97 //*****************************************************************************
98 extern void LDOPWR_lockConfiguration(uint16_t baseAddress);
99 
100 //*****************************************************************************
101 //
102 //! \brief Enables Port U inputs
103 //!
104 //! \param baseAddress is the base address of the LDOPWR module.
105 //!
106 //! Modified bits of \b PUCTL register.
107 //!
108 //! \return None
109 //
110 //*****************************************************************************
111 extern void LDOPWR_enablePort_U_inputs(uint16_t baseAddress);
112 
113 //*****************************************************************************
114 //
115 //! \brief Disables Port U inputs
116 //!
117 //! \param baseAddress is the base address of the LDOPWR module.
118 //!
119 //! Modified bits of \b PUCTL register.
120 //!
121 //! \return None
122 //
123 //*****************************************************************************
124 extern void LDOPWR_disablePort_U_inputs(uint16_t baseAddress);
125 
126 //*****************************************************************************
127 //
128 //! \brief Enables Port U outputs
129 //!
130 //! \param baseAddress is the base address of the LDOPWR module.
131 //!
132 //! Modified bits of \b PUCTL register.
133 //!
134 //! \return None
135 //
136 //*****************************************************************************
137 extern void LDOPWR_enablePort_U_outputs(uint16_t baseAddress);
138 
139 //*****************************************************************************
140 //
141 //! \brief Disables Port U inputs
142 //!
143 //! \param baseAddress is the base address of the LDOPWR module.
144 //!
145 //! Modified bits of \b PUCTL register.
146 //!
147 //! \return None
148 //
149 //*****************************************************************************
150 extern void LDOPWR_disablePort_U_outputs(uint16_t baseAddress);
151 
152 //*****************************************************************************
153 //
154 //! \brief Returns PU.1 input data
155 //!
156 //! \param baseAddress is the base address of the LDOPWR module.
157 //!
158 //! \return One of the following:
159 //! - \b LDOPWR_PORTU_PIN_HIGH
160 //! - \b LDOPWR_PORTU_PIN_LOW
161 //
162 //*****************************************************************************
163 extern uint8_t LDOPWR_getPort_U1_inputData(uint16_t baseAddress);
164 
165 //*****************************************************************************
166 //
167 //! \brief Returns PU.0 input data
168 //!
169 //! \param baseAddress is the base address of the LDOPWR module.
170 //!
171 //! \return One of the following:
172 //! - \b LDOPWR_PORTU_PIN_HIGH
173 //! - \b LDOPWR_PORTU_PIN_LOW
174 //
175 //*****************************************************************************
176 extern uint8_t LDOPWR_getPort_U0_inputData(uint16_t baseAddress);
177 
178 //*****************************************************************************
179 //
180 //! \brief Returns PU.1 output data
181 //!
182 //! \param baseAddress is the base address of the LDOPWR module.
183 //!
184 //! \return One of the following:
185 //! - \b LDOPWR_PORTU_PIN_HIGH
186 //! - \b LDOPWR_PORTU_PIN_LOW
187 //
188 //*****************************************************************************
189 extern uint8_t LDOPWR_getPort_U1_outputData(uint16_t baseAddress);
190 
191 //*****************************************************************************
192 //
193 //! \brief Returns PU.0 output data
194 //!
195 //! \param baseAddress is the base address of the LDOPWR module.
196 //!
197 //! \return One of the following:
198 //! - \b LDOPWR_PORTU_PIN_HIGH
199 //! - \b LDOPWR_PORTU_PIN_LOW
200 //
201 //*****************************************************************************
202 extern uint8_t LDOPWR_getPort_U0_outputData(uint16_t baseAddress);
203 
204 //*****************************************************************************
205 //
206 //! \brief Sets PU.1 output data
207 //!
208 //! \param baseAddress is the base address of the LDOPWR module.
209 //! \param value
210 //! Valid values are:
211 //! - \b LDOPWR_PORTU_PIN_HIGH
212 //! - \b LDOPWR_PORTU_PIN_LOW
213 //!
214 //! Modified bits of \b PUCTL register.
215 //!
216 //! \return None
217 //
218 //*****************************************************************************
219 extern void LDOPWR_setPort_U1_outputData(uint16_t baseAddress,
220  uint8_t value);
221 
222 //*****************************************************************************
223 //
224 //! \brief Sets PU.0 output data
225 //!
226 //! \param baseAddress is the base address of the LDOPWR module.
227 //! \param value
228 //! Valid values are:
229 //! - \b LDOPWR_PORTU_PIN_HIGH
230 //! - \b LDOPWR_PORTU_PIN_LOW
231 //!
232 //! Modified bits of \b PUCTL register.
233 //!
234 //! \return None
235 //
236 //*****************************************************************************
237 extern void LDOPWR_setPort_U0_outputData(uint16_t baseAddress,
238  uint8_t value);
239 
240 //*****************************************************************************
241 //
242 //! \brief Toggles PU.1 output data
243 //!
244 //! \param baseAddress is the base address of the LDOPWR module.
245 //!
246 //! Modified bits of \b PUCTL register.
247 //!
248 //! \return None
249 //
250 //*****************************************************************************
251 extern void LDOPWR_togglePort_U1_outputData(uint16_t baseAddress);
252 
253 //*****************************************************************************
254 //
255 //! \brief Toggles PU.0 output data
256 //!
257 //! \param baseAddress is the base address of the LDOPWR module.
258 //!
259 //! Modified bits of \b PUCTL register.
260 //!
261 //! \return None
262 //
263 //*****************************************************************************
264 extern void LDOPWR_togglePort_U0_outputData(uint16_t baseAddress);
265 
266 //*****************************************************************************
267 //
268 //! \brief Enables LDO-PWR module interrupts
269 //!
270 //! Does not clear interrupt flags.
271 //!
272 //! \param baseAddress is the base address of the LDOPWR module.
273 //! \param mask mask of interrupts to enable
274 //! Mask value is the logical OR of any of the following:
275 //! - \b LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT
276 //! - \b LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT
277 //! - \b LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT
278 //!
279 //! Modified bits of \b LDOPWRCTL register.
280 //!
281 //! \return None
282 //
283 //*****************************************************************************
284 extern void LDOPWR_enableInterrupt(uint16_t baseAddress,
285  uint16_t mask);
286 
287 //*****************************************************************************
288 //
289 //! \brief Disables LDO-PWR module interrupts
290 //!
291 //! \param baseAddress is the base address of the LDOPWR module.
292 //! \param mask mask of interrupts to disable
293 //! Mask value is the logical OR of any of the following:
294 //! - \b LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT
295 //! - \b LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT
296 //! - \b LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT
297 //!
298 //! Modified bits of \b LDOPWRCTL register.
299 //!
300 //! \return None
301 //
302 //*****************************************************************************
303 extern void LDOPWR_disableInterrupt(uint16_t baseAddress,
304  uint16_t mask);
305 
306 //*****************************************************************************
307 //
308 //! \brief Enables LDO-PWR module
309 //!
310 //! \param baseAddress is the base address of the LDOPWR module.
311 //!
312 //! Modified bits of \b LDOPWRCTL register.
313 //!
314 //! \return None
315 //
316 //*****************************************************************************
317 extern void LDOPWR_enable(uint16_t baseAddress);
318 
319 //*****************************************************************************
320 //
321 //! \brief Disables LDO-PWR module
322 //!
323 //! \param baseAddress is the base address of the LDOPWR module.
324 //!
325 //! Modified bits of \b LDOPWRCTL register.
326 //!
327 //! \return None
328 //
329 //*****************************************************************************
330 extern void LDOPWR_disable(uint16_t baseAddress);
331 
332 //*****************************************************************************
333 //
334 //! \brief Returns the interrupt status of LDO-PWR module interrupts
335 //!
336 //! \param baseAddress is the base address of the LDOPWR module.
337 //! \param mask mask of interrupts to get the status of
338 //! Mask value is the logical OR of any of the following:
339 //! - \b LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT
340 //! - \b LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT
341 //! - \b LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT
342 //!
343 //! \return Logical OR of any of the following:
344 //! - \b LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT
345 //! - \b LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT
346 //! - \b LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT
347 //! \n indicating the status of the masked interrupts
348 //
349 //*****************************************************************************
350 extern uint8_t LDOPWR_getInterruptStatus(uint16_t baseAddress,
351  uint16_t mask);
352 
353 //*****************************************************************************
354 //
355 //! \brief Clears the interrupt status of LDO-PWR module interrupts
356 //!
357 //! \param baseAddress is the base address of the LDOPWR module.
358 //! \param mask mask of interrupts to clear the status of
359 //! Mask value is the logical OR of any of the following:
360 //! - \b LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT
361 //! - \b LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT
362 //! - \b LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT
363 //!
364 //! Modified bits of \b LDOPWRCTL register.
365 //!
366 //! \return None
367 //
368 //*****************************************************************************
369 extern void LDOPWR_clearInterrupt(uint16_t baseAddress,
370  uint16_t mask);
371 
372 //*****************************************************************************
373 //
374 //! \brief Returns if the the LDOI is valid and within bounds
375 //!
376 //! \param baseAddress is the base address of the LDOPWR module.
377 //!
378 //! \return One of the following:
379 //! - \b LDOPWR_LDO_INPUT_VALID
380 //! - \b LDOPWR_LDO_INPUT_INVALID
381 //
382 //*****************************************************************************
383 extern uint8_t LDOPWR_isLDOInputValid(uint16_t baseAddress);
384 
385 //*****************************************************************************
386 //
387 //! \brief Enables the LDO overload auto-off
388 //!
389 //! \param baseAddress is the base address of the LDOPWR module.
390 //!
391 //! Modified bits of \b LDOPWRCTL register.
392 //!
393 //! \return None
394 //
395 //*****************************************************************************
396 extern void LDOPWR_enableOverloadAutoOff(uint16_t baseAddress);
397 
398 //*****************************************************************************
399 //
400 //! \brief Disables the LDO overload auto-off
401 //!
402 //! \param baseAddress is the base address of the LDOPWR module.
403 //!
404 //! Modified bits of \b LDOPWRCTL register.
405 //!
406 //! \return None
407 //
408 //*****************************************************************************
409 extern void LDOPWR_disableOverloadAutoOff(uint16_t baseAddress);
410 
411 //*****************************************************************************
412 //
413 //! \brief Returns if the LDOI overload auto-off is enabled or disabled
414 //!
415 //! \param baseAddress is the base address of the LDOPWR module.
416 //!
417 //! \return One of the following:
418 //! - \b LDOPWR_AUTOOFF_ENABLED
419 //! - \b LDOPWR_AUTOOFF_DISABLED
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__
void LDOPWR_disablePort_U_inputs(uint16_t baseAddress)
Disables Port U inputs.
Definition: ldopwr.c:36
void LDOPWR_setPort_U0_outputData(uint16_t baseAddress, uint8_t value)
Sets PU.0 output data.
Definition: ldopwr.c:82
void LDOPWR_enableOverloadAutoOff(uint16_t baseAddress)
Enables the LDO overload auto-off.
Definition: ldopwr.c:146
void LDOPWR_togglePort_U1_outputData(uint16_t baseAddress)
Toggles PU.1 output data.
Definition: ldopwr.c:93
void LDOPWR_lockConfiguration(uint16_t baseAddress)
Locks the configuration registers and disables write access.
Definition: ldopwr.c:26
uint8_t LDOPWR_getPort_U1_outputData(uint16_t baseAddress)
Returns PU.1 output data.
Definition: ldopwr.c:61
uint8_t LDOPWR_getInterruptStatus(uint16_t baseAddress, uint16_t mask)
Returns the interrupt status of LDO-PWR module interrupts.
Definition: ldopwr.c:127
void LDOPWR_disableOverloadAutoOff(uint16_t baseAddress)
Disables the LDO overload auto-off.
Definition: ldopwr.c:151
void LDOPWR_enablePort_U_inputs(uint16_t baseAddress)
Enables Port U inputs.
Definition: ldopwr.c:31
void LDOPWR_togglePort_U0_outputData(uint16_t baseAddress)
Toggles PU.0 output data.
Definition: ldopwr.c:98
uint8_t LDOPWR_getPort_U0_inputData(uint16_t baseAddress)
Returns PU.0 input data.
Definition: ldopwr.c:56
void LDOPWR_setPort_U1_outputData(uint16_t baseAddress, uint8_t value)
Sets PU.1 output data.
Definition: ldopwr.c:71
void LDOPWR_disable(uint16_t baseAddress)
Disables LDO-PWR module.
Definition: ldopwr.c:122
void LDOPWR_enableInterrupt(uint16_t baseAddress, uint16_t mask)
Enables LDO-PWR module interrupts.
Definition: ldopwr.c:103
uint8_t LDOPWR_getOverloadAutoOffStatus(uint16_t baseAddress)
Returns if the LDOI overload auto-off is enabled or disabled.
Definition: ldopwr.c:156
uint8_t LDOPWR_isLDOInputValid(uint16_t baseAddress)
Returns if the the LDOI is valid and within bounds.
Definition: ldopwr.c:141
void LDOPWR_enable(uint16_t baseAddress)
Enables LDO-PWR module.
Definition: ldopwr.c:117
uint8_t LDOPWR_getPort_U1_inputData(uint16_t baseAddress)
Returns PU.1 input data.
Definition: ldopwr.c:51
void LDOPWR_disableInterrupt(uint16_t baseAddress, uint16_t mask)
Disables LDO-PWR module interrupts.
Definition: ldopwr.c:110
void LDOPWR_unLockConfiguration(uint16_t baseAddress)
Unlocks the configuration registers and enables write access.
Definition: ldopwr.c:21
void LDOPWR_disablePort_U_outputs(uint16_t baseAddress)
Disables Port U inputs.
Definition: ldopwr.c:46
void LDOPWR_clearInterrupt(uint16_t baseAddress, uint16_t mask)
Clears the interrupt status of LDO-PWR module interrupts.
Definition: ldopwr.c:134
uint8_t LDOPWR_getPort_U0_outputData(uint16_t baseAddress)
Returns PU.0 output data.
Definition: ldopwr.c:66
void LDOPWR_enablePort_U_outputs(uint16_t baseAddress)
Enables Port U outputs.
Definition: ldopwr.c:41

Copyright 2020, Texas Instruments Incorporated