MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
pmm.h
1 //*****************************************************************************
2 //
3 // pmm.h - Driver for the PMM Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_PMM_H__
8 #define __MSP430WARE_PMM_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_PMM_FRAM__
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 mask parameter for
28 // functions: PMM_clearInterrupt(), and PMM_getInterruptStatus() as well as
29 // returned by the PMM_getInterruptStatus() function.
30 //
31 //*****************************************************************************
32 #define PMM_BOR_INTERRUPT PMMBORIFG
33 #define PMM_RST_INTERRUPT PMMRSTIFG
34 #define PMM_POR_INTERRUPT PMMPORIFG
35 #define PMM_SVSH_INTERRUPT SVSHIFG
36 #define PMM_LPM5_INTERRUPT PMMLPM5IFG
37 #define PMM_ALL (0xA7)
38 
39 //*****************************************************************************
40 //
41 // The following are values that can be passed toThe following are values that
42 // can be returned by the PMM_getBandgapMode() function.
43 //
44 //*****************************************************************************
45 #define PMM_STATICMODE (0x0)
46 #define PMM_SAMPLEMODE BGMODE
47 
48 //*****************************************************************************
49 //
50 // The following are values that can be passed toThe following are values that
51 // can be returned by the PMM_isBandgapActive() function.
52 //
53 //*****************************************************************************
54 #define PMM_REFBG_INACTIVE (0x0)
55 #define PMM_REFBG_ACTIVE REFBGACT
56 
57 //*****************************************************************************
58 //
59 // The following are values that can be passed toThe following are values that
60 // can be returned by the PMM_isRefGenActive() function.
61 //
62 //*****************************************************************************
63 #define PMM_REFGEN_INACTIVE (0x0)
64 #define PMM_REFGEN_ACTIVE REFGENACT
65 
66 //*****************************************************************************
67 //
68 // The following are values that can be passed toThe following are values that
69 // can be returned by the PMM_getBufferedBandgapVoltageStatus() function.
70 //
71 //*****************************************************************************
72 #define PMM_REFBG_NOTREADY (0x0)
73 #define PMM_REFBG_READY REFBGRDY
74 
75 //*****************************************************************************
76 //
77 // The following are values that can be passed toThe following are values that
78 // can be returned by the PMM_getVariableReferenceVoltageStatus() function.
79 //
80 //*****************************************************************************
81 #define PMM_REFGEN_NOTREADY (0x0)
82 #define PMM_REFGEN_READY REFGENRDY
83 
84 //*****************************************************************************
85 //
86 // Prototypes for the APIs.
87 //
88 //*****************************************************************************
89 
90 //*****************************************************************************
91 //
92 //! \brief Enables the low power reset. SVSH does not reset device, but
93 //! triggers a system NMI
94 //!
95 //!
96 //! Modified bits of \b PMMCTL0 register.
97 //!
98 //! \return None
99 //
100 //*****************************************************************************
101 extern void PMM_enableLowPowerReset(void);
102 
103 //*****************************************************************************
104 //
105 //! \brief Disables the low power reset. SVSH resets device.
106 //!
107 //!
108 //! Modified bits of \b PMMCTL0 register.
109 //!
110 //! \return None
111 //
112 //*****************************************************************************
113 extern void PMM_disableLowPowerReset(void);
114 
115 //*****************************************************************************
116 //
117 //! \brief Enables the high-side SVS circuitry
118 //!
119 //!
120 //! Modified bits of \b PMMCTL0 register.
121 //!
122 //! \return None
123 //
124 //*****************************************************************************
125 extern void PMM_enableSVSH(void);
126 
127 //*****************************************************************************
128 //
129 //! \brief Disables the high-side SVS circuitry
130 //!
131 //!
132 //! Modified bits of \b PMMCTL0 register.
133 //!
134 //! \return None
135 //
136 //*****************************************************************************
137 extern void PMM_disableSVSH(void);
138 
139 //*****************************************************************************
140 //
141 //! \brief Makes the low-dropout voltage regulator (LDO) remain ON when going
142 //! into LPM 3/4.
143 //!
144 //!
145 //! Modified bits of \b PMMCTL0 register.
146 //!
147 //! \return None
148 //
149 //*****************************************************************************
150 extern void PMM_turnOnRegulator(void);
151 
152 //*****************************************************************************
153 //
154 //! \brief Turns OFF the low-dropout voltage regulator (LDO) when going into
155 //! LPM3/4, thus the system will enter LPM3.5 or LPM4.5 respectively
156 //!
157 //!
158 //! Modified bits of \b PMMCTL0 register.
159 //!
160 //! \return None
161 //
162 //*****************************************************************************
163 extern void PMM_turnOffRegulator(void);
164 
165 //*****************************************************************************
166 //
167 //! \brief Calling this function will trigger a software Power On Reset (POR).
168 //!
169 //!
170 //! Modified bits of \b PMMCTL0 register.
171 //!
172 //! \return None
173 //
174 //*****************************************************************************
175 extern void PMM_trigPOR(void);
176 
177 //*****************************************************************************
178 //
179 //! \brief Calling this function will trigger a software Brown Out Rest (BOR).
180 //!
181 //!
182 //! Modified bits of \b PMMCTL0 register.
183 //!
184 //! \return None
185 //
186 //*****************************************************************************
187 extern void PMM_trigBOR(void);
188 
189 //*****************************************************************************
190 //
191 //! \brief Clears interrupt flags for the PMM
192 //!
193 //! \param mask is the mask for specifying the required flag
194 //! Mask value is the logical OR of any of the following:
195 //! - \b PMM_BOR_INTERRUPT - Software BOR interrupt
196 //! - \b PMM_RST_INTERRUPT - RESET pin interrupt
197 //! - \b PMM_POR_INTERRUPT - Software POR interrupt
198 //! - \b PMM_SVSH_INTERRUPT - SVS high side interrupt
199 //! - \b PMM_LPM5_INTERRUPT - LPM5 indication
200 //! - \b PMM_ALL - All interrupts
201 //!
202 //! Modified bits of \b PMMCTL0 register and bits of \b PMMIFG register.
203 //!
204 //! \return None
205 //
206 //*****************************************************************************
207 extern void PMM_clearInterrupt(uint16_t mask);
208 
209 //*****************************************************************************
210 //
211 //! \brief Returns interrupt status
212 //!
213 //! \param mask is the mask for specifying the required flag
214 //! Mask value is the logical OR of any of the following:
215 //! - \b PMM_BOR_INTERRUPT - Software BOR interrupt
216 //! - \b PMM_RST_INTERRUPT - RESET pin interrupt
217 //! - \b PMM_POR_INTERRUPT - Software POR interrupt
218 //! - \b PMM_SVSH_INTERRUPT - SVS high side interrupt
219 //! - \b PMM_LPM5_INTERRUPT - LPM5 indication
220 //! - \b PMM_ALL - All interrupts
221 //!
222 //! \return Logical OR of any of the following:
223 //! - \b PMM_BOR_INTERRUPT Software BOR interrupt
224 //! - \b PMM_RST_INTERRUPT RESET pin interrupt
225 //! - \b PMM_POR_INTERRUPT Software POR interrupt
226 //! - \b PMM_SVSH_INTERRUPT SVS high side interrupt
227 //! - \b PMM_LPM5_INTERRUPT LPM5 indication
228 //! - \b PMM_ALL All interrupts
229 //! \n indicating the status of the selected interrupt flags
230 //
231 //*****************************************************************************
232 extern uint16_t PMM_getInterruptStatus(uint16_t mask);
233 
234 //*****************************************************************************
235 //
236 //! \brief Unlock LPM5
237 //!
238 //! LPMx.5 configuration is not locked and defaults to its reset condition.
239 //! Disable the GPIO power-on default high-impedance mode to activate
240 //! previously configured port settings.
241 //!
242 //!
243 //! \return None
244 //
245 //*****************************************************************************
246 extern void PMM_unlockLPM5(void);
247 
248 //*****************************************************************************
249 //
250 //! \brief Returns the bandgap mode of the PMM module.
251 //!
252 //! This function is used to return the bandgap mode of the PMM module,
253 //! requested by the peripherals using the bandgap. If a peripheral requests
254 //! static mode, then the bandgap mode will be static for all modules, whereas
255 //! if all of the peripherals using the bandgap request sample mode, then that
256 //! will be the mode returned. Sample mode allows the bandgap to be active only
257 //! when necessary to save on power consumption, static mode requires the
258 //! bandgap to be active until no peripherals are using it anymore.
259 //!
260 //!
261 //! \return The bandgap mode of the PMM module:
262 //! Return Logical OR of any of the following:
263 //! - \b PMM_STATICMODE if the bandgap is operating in static mode
264 //! - \b PMM_SAMPLEMODE if the bandgap is operating in sample mode
265 //
266 //*****************************************************************************
267 extern uint16_t PMM_getBandgapMode(void);
268 
269 //*****************************************************************************
270 //
271 //! \brief Returns the active status of the bandgap in the PMM module.
272 //!
273 //! This function is used to return the active status of the bandgap in the PMM
274 //! module. If the bandgap is in use by a peripheral, then the status will be
275 //! seen as active.
276 //!
277 //!
278 //! \return The bandgap active status of the PMM module:
279 //! Return Logical OR of any of the following:
280 //! - \b PMM_REFBG_INACTIVE if the bandgap is not being used at the
281 //! time of query
282 //! - \b PMM_REFBG_ACTIVE if the bandgap is being used at the time of
283 //! query
284 //
285 //*****************************************************************************
286 extern uint16_t PMM_isBandgapActive(void);
287 
288 //*****************************************************************************
289 //
290 //! \brief Returns the active status of the reference generator in the PMM
291 //! module.
292 //!
293 //! This function is used to return the active status of the reference
294 //! generator in the PMM module. If the reference generator is on and ready to
295 //! use, then the status will be seen as active.
296 //!
297 //!
298 //! \return The reference generator active status of the PMM module:
299 //! Return Logical OR of any of the following:
300 //! - \b PMM_REFGEN_INACTIVE if the reference generator is off and not
301 //! operating
302 //! - \b PMM_REFGEN_ACTIVE if the reference generator is on and ready
303 //! to be used
304 //
305 //*****************************************************************************
306 extern uint16_t PMM_isRefGenActive(void);
307 
308 //*****************************************************************************
309 //
310 //! \brief Returns the active status of the reference generator in the PMM
311 //! module.
312 //!
313 //! This function is used to return the ready status of the buffered bandgap
314 //! voltage in the PMM module. If the buffered bandgap voltage is ready to use,
315 //! the ready status will be returned.
316 //!
317 //!
318 //! \return The buffered bandgap voltage ready status of the PMM module:
319 //! Return Logical OR of any of the following:
320 //! - \b PMM_REFBG_NOTREADY if buffered bandgap voltage is NOT ready to
321 //! be used
322 //! - \b PMM_REFBG_READY if buffered bandgap voltage ready to be used
323 //
324 //*****************************************************************************
325 extern uint16_t PMM_getBufferedBandgapVoltageStatus(void);
326 
327 //*****************************************************************************
328 //
329 //! \brief Returns the busy status of the variable reference voltage in the PMM
330 //! module.
331 //!
332 //! This function is used to return the ready status of the variable reference
333 //! voltage in the REFPMM module. If the reference generator is on and ready to
334 //! use, then the ready status will be returned.
335 //!
336 //!
337 //! \return The variable reference voltage active status of the PMM module:
338 //! Return Logical OR of any of the following:
339 //! - \b PMM_REFGEN_NOTREADY if variable reference voltage is NOT ready
340 //! to be used
341 //! - \b PMM_REFGEN_READY if variable reference voltage ready to be
342 //! used
343 //
344 //*****************************************************************************
345 extern uint16_t PMM_getVariableReferenceVoltageStatus(void);
346 
347 //*****************************************************************************
348 //
349 //! \brief Disables the internal temperature sensor to save power consumption.
350 //!
351 //! This function is used to turn off the internal temperature sensor to save
352 //! on power consumption. The temperature sensor is disabled by default.
353 //!
354 //!
355 //! Modified bits are \b TSENSOREN of \b PMMCTL2 register.
356 //!
357 //! \return None
358 //
359 //*****************************************************************************
360 extern void PMM_disableTempSensor(void);
361 
362 //*****************************************************************************
363 //
364 //! \brief Enables the internal temperature sensor.
365 //!
366 //! This function is used to turn on the internal temperature sensor to use by
367 //! other peripherals. The temperature sensor is disabled by default.
368 //!
369 //!
370 //! Modified bits are \b TSENSOREN of \b PMMCTL2 register.
371 //!
372 //! \return None
373 //
374 //*****************************************************************************
375 extern void PMM_enableTempSensor(void);
376 
377 //*****************************************************************************
378 //
379 //! \brief Disables the external reference output.
380 //!
381 //! This function is used to disable the external reference output. The
382 //! external reference is connected to a given external ADC channel. The
383 //! external reference is disabled by default.
384 //!
385 //!
386 //! Modified bits are \b EXTREFEN of \b PMMCTL2 register.
387 //!
388 //! \return None
389 //
390 //*****************************************************************************
391 extern void PMM_disableExternalReference(void);
392 
393 //*****************************************************************************
394 //
395 //! \brief Enables the external reference output.
396 //!
397 //! This function is used to enable the external reference output. The external
398 //! reference is connected to a given external ADC channel. The external
399 //! reference is disabled by default.
400 //!
401 //!
402 //! Modified bits are \b EXTREFEN of \b PMMCTL2 register.
403 //!
404 //! \return None
405 //
406 //*****************************************************************************
407 extern void PMM_enableExternalReference(void);
408 
409 //*****************************************************************************
410 //
411 //! \brief Disables the internal reference output.
412 //!
413 //! This function is used to disable the internal reference output. The
414 //! internal reference is internally connected to the ADC channel. The internal
415 //! reference is disabled by default.
416 //!
417 //!
418 //! Modified bits are \b INTREFEN of \b PMMCTL2 register.
419 //!
420 //! \return None
421 //
422 //*****************************************************************************
423 extern void PMM_disableInternalReference(void);
424 
425 //*****************************************************************************
426 //
427 //! \brief Enables the internal reference output.
428 //!
429 //! This function is used to enable the internal reference output. The internal
430 //! reference is internally connected to the ADC channel. The internal
431 //! reference is disabled by default.
432 //!
433 //!
434 //! Modified bits are \b INTREFEN of \b PMMCTL2 register.
435 //!
436 //! \return None
437 //
438 //*****************************************************************************
439 extern void PMM_enableInternalReference(void);
440 
441 //*****************************************************************************
442 //
443 // Mark the end of the C bindings section for C++ compilers.
444 //
445 //*****************************************************************************
446 #ifdef __cplusplus
447 }
448 #endif
449 
450 #endif
451 #endif // __MSP430WARE_PMM_H__
uint16_t PMM_getVariableReferenceVoltageStatus(void)
Returns the busy status of the variable reference voltage in the PMM module.
Definition: pmm.c:114
void PMM_clearInterrupt(uint16_t mask)
Clears interrupt flags for the PMM.
Definition: pmm.c:77
uint16_t PMM_isBandgapActive(void)
Returns the active status of the bandgap in the PMM module.
Definition: pmm.c:99
uint16_t PMM_getInterruptStatus(uint16_t mask)
Returns interrupt status.
Definition: pmm.c:84
uint16_t PMM_isRefGenActive(void)
Returns the active status of the reference generator in the PMM module.
Definition: pmm.c:104
void PMM_enableInternalReference(void)
Enables the internal reference output.
Definition: pmm.c:164
void PMM_disableSVSH(void)
Disables the high-side SVS circuitry.
Definition: pmm.c:42
void PMM_disableTempSensor(void)
Disables the internal temperature sensor to save power consumption.
Definition: pmm.c:119
void PMM_disableInternalReference(void)
Disables the internal reference output.
Definition: pmm.c:155
void PMM_enableTempSensor(void)
Enables the internal temperature sensor.
Definition: pmm.c:128
void PMM_enableSVSH(void)
Enables the high-side SVS circuitry.
Definition: pmm.c:35
void PMM_turnOnRegulator(void)
Makes the low-dropout voltage regulator (LDO) remain ON when going into LPM 3/4.
Definition: pmm.c:49
void PMM_trigBOR(void)
Calling this function will trigger a software Brown Out Rest (BOR).
Definition: pmm.c:70
uint16_t PMM_getBufferedBandgapVoltageStatus(void)
Returns the active status of the reference generator in the PMM module.
Definition: pmm.c:109
void PMM_turnOffRegulator(void)
Turns OFF the low-dropout voltage regulator (LDO) when going into LPM3/4, thus the system will enter ...
Definition: pmm.c:56
void PMM_trigPOR(void)
Calling this function will trigger a software Power On Reset (POR).
Definition: pmm.c:63
uint16_t PMM_getBandgapMode(void)
Returns the bandgap mode of the PMM module.
Definition: pmm.c:94
void PMM_unlockLPM5(void)
Unlock LPM5.
Definition: pmm.c:89
void PMM_enableExternalReference(void)
Enables the external reference output.
Definition: pmm.c:146
void PMM_disableExternalReference(void)
Disables the external reference output.
Definition: pmm.c:137
void PMM_enableLowPowerReset(void)
Enables the low power reset. SVSH does not reset device, but triggers a system NMI.
Definition: pmm.c:21
void PMM_disableLowPowerReset(void)
Disables the low power reset. SVSH resets device.
Definition: pmm.c:28

Copyright 2015, Texas Instruments Incorporated