]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pss.h
Update MSP432 projects to use updated driver library files.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / pss.h
1 /*
2  * -------------------------------------------
3  *    MSP432 DriverLib - v3_10_00_09 
4  * -------------------------------------------
5  *
6  * --COPYRIGHT--,BSD,BSD
7  * Copyright (c) 2014, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * *  Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  *
17  * *  Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * *  Neither the name of Texas Instruments Incorporated nor the names of
22  *    its contributors may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  * --/COPYRIGHT--*/
37 #ifndef __PSS_H__
38 #define __PSS_H__
39
40 //*****************************************************************************
41 //
42 //! \addtogroup pss_api
43 //! @{
44 //
45 //*****************************************************************************
46
47 //*****************************************************************************
48 //
49 // If building with a C++ compiler, make all of the definitions in this header
50 // have a C binding.
51 //
52 //*****************************************************************************
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57
58 #include <stdint.h>
59 #include <msp.h>
60 #include <stdbool.h>
61
62 //*****************************************************************************
63 //
64 // Control specific variables
65 //
66 //*****************************************************************************
67 #define PSS_KEY_VALUE PSS_KEY_KEY_VAL
68
69 #define PSS_SVSMH PSS_IE_SVSMHIE
70
71 #define PSS_FULL_PERFORMANCE_MODE   0x01
72 #define PSS_NORMAL_PERFORMANCE_MODE 0x00
73
74 //*****************************************************************************
75 //
76 // Prototypes for the APIs.
77 //
78 //*****************************************************************************
79
80 //*****************************************************************************
81 //
82 //! Enables output of the High Side interrupt flag on the device \b SVMHOUT pin
83 //!
84 //! \param activeLow True if the signal should be logic low when SVSMHIFG
85 //!     is set. False if signal should be high when \b SVSMHIFG is set.
86 //!
87 //! \return None.
88 //
89 //*****************************************************************************
90 extern void PSS_enableHighSidePinToggle(bool activeLow);
91
92 //*****************************************************************************
93 //
94 //! Disables output of the High Side interrupt flag on the device \b SVMHOUT pin
95 //!
96 //! \return None.
97 //
98 //*****************************************************************************
99 extern void PSS_disableHighSidePinToggle(void);
100
101 //*****************************************************************************
102 //
103 //! Enables high side voltage supervisor/monitor.
104 //!
105 //! \return None.
106 //
107 //*****************************************************************************
108 extern void PSS_enableHighSide(void);
109
110 //*****************************************************************************
111 //
112 //! Disables high side voltage supervisor/monitor.
113 //!
114 //! \return None.
115 //
116 //*****************************************************************************
117 extern void PSS_disableHighSide(void);
118
119 //*****************************************************************************
120 //
121 //! Sets the performance mode of the high side regulator. Full performance
122 //! mode allows for the best response times while normal performance mode is
123 //! optimized for the lowest possible current consumption.
124 //!
125 //! \param powerMode is the performance mode to set. Valid values are one of
126 //! the following:
127 //!     - \b PSS_FULL_PERFORMANCE_MODE,
128 //!     - \b PSS_NORMAL_PERFORMANCE_MODE
129 //!
130 //! \return None.
131 //
132 //*****************************************************************************
133 extern void PSS_setHighSidePerformanceMode(uint_fast8_t powerMode);
134
135 //*****************************************************************************
136 //
137 //! Gets the performance mode of the high side voltage regulator. Refer to the
138 //! user's guide for specific information about information about the different
139 //! performance modes.
140 //!
141 //! \return Performance mode of the voltage regulator
142 //
143 //*****************************************************************************
144 extern uint_fast8_t PSS_getHighSidePerformanceMode(void);
145
146 //*****************************************************************************
147 //
148 //! Sets the high side voltage supervisor to monitor mode
149 //!
150 //! \return None.
151 //
152 //*****************************************************************************
153 extern void PSS_enableHighSideMonitor(void);
154
155 //*****************************************************************************
156 //
157 //! Switches the high side of the power supply system to be a supervisor instead
158 //! of a monitor
159 //!
160 //! \return None.
161 //
162 //*****************************************************************************
163 extern void PSS_disableHighSideMonitor(void);
164
165 //*****************************************************************************
166 //
167 //! Sets the voltage level at which the high side of the device voltage
168 //! regulator triggers a reset. This value is represented as an unsigned eight
169 //! bit integer where only the lowest three bits are most significant.
170 //!
171 //! \param triggerVoltage Voltage level in which high side supervisor/monitor
172 //!         triggers a reset. See the device specific data sheet for details
173 //!         on these voltage levels.
174 //!
175 //! Typical values will vary from part to part (so it is very important to
176 //! check the SVSH section of the data sheet. For reference only, the typical
177 //! MSP432 101 values are listed below:
178 //!     - 0 --> 1.57V
179 //!     - 1 --> 1.62V
180 //!     - 2 --> 1.83V
181 //!     - 3 --> 2V
182 //!     - 4 --> 2.25V
183 //!     - 5 --> 2.4V
184 //!     - 6 --> 2.6V
185 //!     - 7 --> 2.8V
186 //!
187 //! \return None.
188 //
189 //*****************************************************************************
190 extern void PSS_setHighSideVoltageTrigger(uint_fast8_t triggerVoltage);
191
192 //*****************************************************************************
193 //
194 //! Returns the voltage level at which the high side of the device voltage
195 //! regulator triggers a reset.
196 //!
197 //! \return The voltage level that the high side voltage supervisor/monitor
198 //! triggers a reset. This value is represented as an unsigned eight
199 //! bit integer where only the lowest three bits are most significant.
200 //! See \link PSS_setHighSideVoltageTrigger \endlink for information regarding
201 //! the return value
202 //
203 //*****************************************************************************
204 extern uint_fast8_t PSS_getHighSideVoltageTrigger(void);
205
206 //*****************************************************************************
207 //
208 //! Enables the power supply system interrupt source.
209 //!
210 //! \return None.
211 //
212 //*****************************************************************************
213 extern void PSS_enableInterrupt(void);
214
215 //*****************************************************************************
216 //
217 //! Disables the power supply system interrupt source.
218 //!
219 //! \return None.
220 //
221 //*****************************************************************************
222 extern void PSS_disableInterrupt(void);
223
224 //*****************************************************************************
225 //
226 //! Gets the current interrupt status.
227 //!
228 //! \return The current interrupt status ( \b PSS_SVSMH )
229 //!
230 //*****************************************************************************
231 extern uint32_t PSS_getInterruptStatus(void);
232
233 //*****************************************************************************
234 //
235 //! Clears power supply system interrupt source.
236 //!
237 //! \return None.
238 //
239 //*****************************************************************************
240 extern void PSS_clearInterruptFlag(void);
241
242
243 //*****************************************************************************
244 //
245 //! Enables the "forced" mode of the DCDC regulator. In this mode, the fail
246 //! safe mechanism that disables the regulator to LDO mode when the supply
247 //! voltage falls below the minimum supply voltage required for DCDC operation
248 //! is turned off.
249 //!
250 //! \return None.
251 //
252 //*****************************************************************************
253 extern void PSS_enableForcedDCDCOperation(void);
254
255
256 //*****************************************************************************
257 //
258 //! Disables the "forced" mode of the DCDC regulator. In this mode, the fail
259 //! safe mechanism that disables the regulator to LDO mode when the supply
260 //! voltage falls below the minimum supply voltage required for DCDC operation
261 //! is turned on.
262 //!
263 //! \return None.
264 //
265 //*****************************************************************************
266 extern void PSS_disableForcedDCDCOperation(void);
267
268 //*****************************************************************************
269 //
270 //! Registers an interrupt handler for the power supply system interrupt.
271 //!
272 //! \param intHandler is a pointer to the function to be called when the power
273 //! supply system interrupt occurs.
274 //!
275 //! This function registers the handler to be called when a power supply system
276 //! interrupt occurs. This function enables the global interrupt in the
277 //! interrupt controller; specific PSS interrupts must be enabled
278 //! via PSS_enableInterrupt().  It is the interrupt handler's responsibility to
279 //! clear the interrupt source via PSS_clearInterruptFlag().
280 //!
281 //! \sa Interrupt_registerInterrupt() for important information about
282 //! registering interrupt handlers.
283 //!
284 //! \return None.
285 //
286 //*****************************************************************************
287 extern void PSS_registerInterrupt(void (*intHandler)(void));
288
289 //*****************************************************************************
290 //
291 //! Unregisters the interrupt handler for the power supply system
292 //!
293 //! This function unregisters the handler to be called when a power supply
294 //! system interrupt occurs.  This function also masks off the interrupt in the
295 //! interrupt controller so that the interrupt handler no longer is called.
296 //!
297 //! \sa Interrupt_registerInterrupt() for important information about
298 //! registering interrupt handlers.
299 //!
300 //! \return None.
301 //
302 //*****************************************************************************
303 extern void PSS_unregisterInterrupt(void);
304
305 //*****************************************************************************
306 //
307 // Mark the end of the C bindings section for C++ compilers.
308 //
309 //*****************************************************************************
310 #ifdef __cplusplus
311 }
312 #endif
313
314 //*****************************************************************************
315 //
316 // Close the Doxygen group.
317 //! @}
318 //
319 //*****************************************************************************
320
321 #endif // __PSS_H__