MSP430 DriverLib for MSP430i2xx Devices  2.91.13.01
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__
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 voltageMonitorLevel
28 // parameter for functions: PMM_setupVoltageMonitor().
29 //
30 //*****************************************************************************
31 #define PMM_DISABLE_VMON (VMONLVL_0)
32 #define PMM_DVCC_2350MV (VMONLVL_1)
33 #define PMM_DVCC_2650MV (VMONLVL_2)
34 #define PMM_DVCC_2850MV (VMONLVL_3)
35 #define PMM_VMONIN_1160MV (VMONLVL_7)
36 
37 //*****************************************************************************
38 //
39 // The following are values that can be passed to the status parameter for
40 // functions: PMM_setRegulatorStatus().
41 //
42 //*****************************************************************************
43 #define PMM_REGULATOR_ON (0x00)
44 #define PMM_REGULATOR_OFF PMMREGOFF
45 
46 //*****************************************************************************
47 //
48 // The following are values that can be passed to the mask parameter for
49 // functions: PMM_enableInterrupt(), PMM_disableInterrupt(),
50 // PMM_getInterruptStatus(), and PMM_clearInterrupt() as well as returned by
51 // the PMM_getInterruptStatus() function.
52 //
53 //*****************************************************************************
54 #define PMM_VMON_INTERRUPT VMONIE
55 #define PMM_LPM45_INTERRUPT LPM45IFG
56 
57 //*****************************************************************************
58 //
59 // Prototypes for the APIs.
60 //
61 //*****************************************************************************
62 
63 //*****************************************************************************
64 //
65 //! \brief Sets up the voltage monitor.
66 //!
67 //! \param voltageMonitorLevel
68 //! Valid values are:
69 //! - \b PMM_DISABLE_VMON - Disable the voltage monitor
70 //! - \b PMM_DVCC_2350MV - Compare DVCC to 2350mV
71 //! - \b PMM_DVCC_2650MV - Compare DVCC to 2650mV
72 //! - \b PMM_DVCC_2850MV - Compare DVCC to 2850mV
73 //! - \b PMM_VMONIN_1160MV - Compare VMONIN to 1160mV
74 //! \n Modified bits are \b VMONLVLx of \b VMONCTL register.
75 //!
76 //! Modified bits of \b VMONCTL register.
77 //!
78 //! \return None
79 //
80 //*****************************************************************************
81 extern void PMM_setupVoltageMonitor(uint8_t voltageMonitorLevel);
82 
83 //*****************************************************************************
84 //
85 //! \brief Setup the calibration.
86 //!
87 //!
88 //! Modified bits of \b REFCAL0 register and bits of \b REFCAL1 register.
89 //!
90 //! \return None
91 //
92 //*****************************************************************************
93 extern void PMM_calibrateReference(void);
94 
95 //*****************************************************************************
96 //
97 //! \brief Set the status of the PMM regulator
98 //!
99 //! \param status
100 //! Valid values are:
101 //! - \b PMM_REGULATOR_ON - Turn the PMM regulator off
102 //! - \b PMM_REGULATOR_OFF - Turn the PMM regulator on
103 //! \n Modified bits are \b REGOFF of \b LPM45CTL register.
104 //!
105 //! Modified bits of \b LPM45CTL register.
106 //!
107 //! \return None
108 //
109 //*****************************************************************************
110 extern void PMM_setRegulatorStatus(uint8_t status);
111 
112 //*****************************************************************************
113 //
114 //! \brief Unlocks the IO
115 //!
116 //!
117 //! Modified bits are \b LOCKLPM45 of \b LPM45CTL register.
118 //!
119 //! \return None
120 //
121 //*****************************************************************************
122 extern void PMM_unlockIOConfiguration(void);
123 
124 //*****************************************************************************
125 //
126 //! \brief Enables interrupts
127 //!
128 //! \param mask
129 //! Mask value is the logical OR of any of the following:
130 //! - \b PMM_VMON_INTERRUPT - Voltage Monitor Interrupt
131 //!
132 //! \return None
133 //
134 //*****************************************************************************
135 extern void PMM_enableInterrupt(uint8_t mask);
136 
137 //*****************************************************************************
138 //
139 //! \brief Disables interrupts
140 //!
141 //! \param mask
142 //! Mask value is the logical OR of any of the following:
143 //! - \b PMM_VMON_INTERRUPT - Voltage Monitor Interrupt
144 //!
145 //! \return None
146 //
147 //*****************************************************************************
148 extern void PMM_disableInterrupt(uint8_t mask);
149 
150 //*****************************************************************************
151 //
152 //! \brief Returns the interrupt status
153 //!
154 //! \param mask
155 //! Mask value is the logical OR of any of the following:
156 //! - \b PMM_VMON_INTERRUPT - Voltage Monitor Interrupt
157 //! - \b PMM_LPM45_INTERRUPT - LPM 4.5 Interrupt
158 //!
159 //! \return Logical OR of any of the following:
160 //! - \b PMM_VMON_INTERRUPT Voltage Monitor Interrupt
161 //! - \b PMM_LPM45_INTERRUPT LPM 4.5 Interrupt
162 //! \n indicating the status of the masked interrupts
163 //
164 //*****************************************************************************
165 extern uint8_t PMM_getInterruptStatus(uint8_t mask);
166 
167 //*****************************************************************************
168 //
169 //! \brief Clears the masked interrupts
170 //!
171 //! \param mask
172 //! Mask value is the logical OR of any of the following:
173 //! - \b PMM_LPM45_INTERRUPT - LPM 4.5 Interrupt
174 //!
175 //! \return None
176 //
177 //*****************************************************************************
178 extern void PMM_clearInterrupt(uint8_t mask);
179 
180 //*****************************************************************************
181 //
182 // Mark the end of the C bindings section for C++ compilers.
183 //
184 //*****************************************************************************
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif
190 #endif // __MSP430WARE_PMM_H__
void PMM_setupVoltageMonitor(uint8_t voltageMonitorLevel)
Sets up the voltage monitor.
Definition: pmm.c:21
void PMM_enableInterrupt(uint8_t mask)
Enables interrupts.
Definition: pmm.c:44
void PMM_clearInterrupt(uint8_t mask)
Clears the masked interrupts.
Definition: pmm.c:66
void PMM_disableInterrupt(uint8_t mask)
Disables interrupts.
Definition: pmm.c:48
void PMM_unlockIOConfiguration(void)
Unlocks the IO.
Definition: pmm.c:40
void PMM_setRegulatorStatus(uint8_t status)
Set the status of the PMM regulator.
Definition: pmm.c:33
uint8_t PMM_getInterruptStatus(uint8_t mask)
Returns the interrupt status.
Definition: pmm.c:52
void PMM_calibrateReference(void)
Setup the calibration.
Definition: pmm.c:28

Copyright 2020, Texas Instruments Incorporated