]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/pss.h
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / pss.h
1 /*
2  * -------------------------------------------
3  *    MSP432 DriverLib - v01_04_00_18 
4  * -------------------------------------------
5  *
6  * --COPYRIGHT--,BSD,BSD
7  * Copyright (c) 2015, 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 0x0000695A
68
69 #define PSS_SVSMH 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 low side voltage supervisor/monitor.
209 //!
210 //! \return None.
211 //
212 //*****************************************************************************
213 extern void PSS_enableLowSide(void);
214
215 //*****************************************************************************
216 //
217 //! Disables low side voltage supervisor/monitor.
218 //!
219 //! \return None.
220 //
221 //*****************************************************************************
222 extern void PSS_disableLowSide(void);
223
224 //*****************************************************************************
225 //
226 //! Sets the performance mode of the high side regulator. Full performance
227 //! mode allows for the best response times while normal performance mode is
228 //! optimized for the lowest possible current consumption.
229 //!
230 //! \param ui8PowerMode is the performance mode to set. Valid values are one of
231 //! the following:
232 //!     - \b PSS_FULL_PERFORMANCE_MODE,
233 //!     - \b PSS_NORMAL_PERFORMANCE_MODE
234 //!
235 //! \return None.
236 //
237 //*****************************************************************************
238 extern void PSS_setLowSidePerformanceMode(uint_fast8_t ui8PowerMode);
239
240 //*****************************************************************************
241 //
242 //! Gets the performance mode of the low side voltage regulator. Refer to the
243 //! user's guide for specific information about information about the different
244 //! performance modes.
245 //!
246 //! \return Performance mode of the voltage regulator
247 //
248 //*****************************************************************************
249 extern uint_fast8_t PSS_getLowSidePerformanceMode(void);
250
251 //*****************************************************************************
252 //
253 //! Enables the power supply system interrupt source.
254 //!
255 //! \return None.
256 //
257 //*****************************************************************************
258 extern void PSS_enableInterrupt(void);
259
260 //*****************************************************************************
261 //
262 //! Disables the power supply system interrupt source.
263 //!
264 //! \return None.
265 //
266 //*****************************************************************************
267 extern void PSS_disableInterrupt(void);
268
269 //*****************************************************************************
270 //
271 //! Gets the current interrupt status.
272 //!
273 //! \return The current interrupt status ( \b PSS_SVSMH )
274 //!
275 //*****************************************************************************
276 extern uint32_t PSS_getInterruptStatus(void);
277
278 //*****************************************************************************
279 //
280 //! Clears power supply system interrupt source.
281 //!
282 //! \return None.
283 //
284 //*****************************************************************************
285 extern void PSS_clearInterruptFlag(void);
286
287 //*****************************************************************************
288 //
289 //! Registers an interrupt handler for the power supply system interrupt.
290 //!
291 //! \param intHandler is a pointer to the function to be called when the power
292 //! supply system interrupt occurs.
293 //!
294 //! This function registers the handler to be called when a power supply system
295 //! interrupt occurs. This function enables the global interrupt in the
296 //! interrupt controller; specific PSS interrupts must be enabled
297 //! via PSS_enableInterrupt().  It is the interrupt handler's responsibility to
298 //! clear the interrupt source via PSS_clearInterruptFlag().
299 //!
300 //! \sa Interrupt_registerInterrupt() for important information about
301 //! registering interrupt handlers.
302 //!
303 //! \return None.
304 //
305 //*****************************************************************************
306 extern void PSS_registerInterrupt(void (*intHandler)(void));
307
308 //*****************************************************************************
309 //
310 //! Unregisters the interrupt handler for the power supply system
311 //!
312 //! This function unregisters the handler to be called when a power supply
313 //! system interrupt occurs.  This function also masks off the interrupt in the
314 //! interrupt controller so that the interrupt handler no longer is called.
315 //!
316 //! \sa Interrupt_registerInterrupt() for important information about
317 //! registering interrupt handlers.
318 //!
319 //! \return None.
320 //
321 //*****************************************************************************
322 extern void PSS_unregisterInterrupt(void);
323
324 //*****************************************************************************
325 //
326 // Mark the end of the C bindings section for C++ compilers.
327 //
328 //*****************************************************************************
329 #ifdef __cplusplus
330 }
331 #endif
332
333 //*****************************************************************************
334 //
335 // Close the Doxygen group.
336 //! @}
337 //
338 //*****************************************************************************
339
340 #endif // __PSS_H__