2 * -------------------------------------------
3 * MSP432 DriverLib - v01_04_00_18
4 * -------------------------------------------
6 * --COPYRIGHT--,BSD,BSD
7 * Copyright (c) 2015, Texas Instruments Incorporated
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
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.
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.
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.
40 //*****************************************************************************
42 //! \addtogroup pss_api
45 //*****************************************************************************
47 //*****************************************************************************
49 // If building with a C++ compiler, make all of the definitions in this header
52 //*****************************************************************************
62 //*****************************************************************************
64 // Control specific variables
66 //*****************************************************************************
67 #define PSS_KEY_VALUE 0x0000695A
69 #define PSS_SVSMH SVSMHIE
71 #define PSS_FULL_PERFORMANCE_MODE 0x01
72 #define PSS_NORMAL_PERFORMANCE_MODE 0x00
74 //*****************************************************************************
76 // Prototypes for the APIs.
78 //*****************************************************************************
80 //*****************************************************************************
82 //! Enables output of the High Side interrupt flag on the device \b SVMHOUT pin
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.
89 //*****************************************************************************
90 extern void PSS_enableHighSidePinToggle(bool activeLow);
92 //*****************************************************************************
94 //! Disables output of the High Side interrupt flag on the device \b SVMHOUT pin
98 //*****************************************************************************
99 extern void PSS_disableHighSidePinToggle(void);
101 //*****************************************************************************
103 //! Enables high side voltage supervisor/monitor.
107 //*****************************************************************************
108 extern void PSS_enableHighSide(void);
110 //*****************************************************************************
112 //! Disables high side voltage supervisor/monitor.
116 //*****************************************************************************
117 extern void PSS_disableHighSide(void);
119 //*****************************************************************************
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.
125 //! \param powerMode is the performance mode to set. Valid values are one of
127 //! - \b PSS_FULL_PERFORMANCE_MODE,
128 //! - \b PSS_NORMAL_PERFORMANCE_MODE
132 //*****************************************************************************
133 extern void PSS_setHighSidePerformanceMode(uint_fast8_t powerMode);
135 //*****************************************************************************
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.
141 //! \return Performance mode of the voltage regulator
143 //*****************************************************************************
144 extern uint_fast8_t PSS_getHighSidePerformanceMode(void);
146 //*****************************************************************************
148 //! Sets the high side voltage supervisor to monitor mode
152 //*****************************************************************************
153 extern void PSS_enableHighSideMonitor(void);
155 //*****************************************************************************
157 //! Switches the high side of the power supply system to be a supervisor instead
162 //*****************************************************************************
163 extern void PSS_disableHighSideMonitor(void);
165 //*****************************************************************************
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.
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.
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:
189 //*****************************************************************************
190 extern void PSS_setHighSideVoltageTrigger(uint_fast8_t triggerVoltage);
192 //*****************************************************************************
194 //! Returns the voltage level at which the high side of the device voltage
195 //! regulator triggers a reset.
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
203 //*****************************************************************************
204 extern uint_fast8_t PSS_getHighSideVoltageTrigger(void);
206 //*****************************************************************************
208 //! Enables low side voltage supervisor/monitor.
212 //*****************************************************************************
213 extern void PSS_enableLowSide(void);
215 //*****************************************************************************
217 //! Disables low side voltage supervisor/monitor.
221 //*****************************************************************************
222 extern void PSS_disableLowSide(void);
224 //*****************************************************************************
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.
230 //! \param ui8PowerMode is the performance mode to set. Valid values are one of
232 //! - \b PSS_FULL_PERFORMANCE_MODE,
233 //! - \b PSS_NORMAL_PERFORMANCE_MODE
237 //*****************************************************************************
238 extern void PSS_setLowSidePerformanceMode(uint_fast8_t ui8PowerMode);
240 //*****************************************************************************
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.
246 //! \return Performance mode of the voltage regulator
248 //*****************************************************************************
249 extern uint_fast8_t PSS_getLowSidePerformanceMode(void);
251 //*****************************************************************************
253 //! Enables the power supply system interrupt source.
257 //*****************************************************************************
258 extern void PSS_enableInterrupt(void);
260 //*****************************************************************************
262 //! Disables the power supply system interrupt source.
266 //*****************************************************************************
267 extern void PSS_disableInterrupt(void);
269 //*****************************************************************************
271 //! Gets the current interrupt status.
273 //! \return The current interrupt status ( \b PSS_SVSMH )
275 //*****************************************************************************
276 extern uint32_t PSS_getInterruptStatus(void);
278 //*****************************************************************************
280 //! Clears power supply system interrupt source.
284 //*****************************************************************************
285 extern void PSS_clearInterruptFlag(void);
287 //*****************************************************************************
289 //! Registers an interrupt handler for the power supply system interrupt.
291 //! \param intHandler is a pointer to the function to be called when the power
292 //! supply system interrupt occurs.
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().
300 //! \sa Interrupt_registerInterrupt() for important information about
301 //! registering interrupt handlers.
305 //*****************************************************************************
306 extern void PSS_registerInterrupt(void (*intHandler)(void));
308 //*****************************************************************************
310 //! Unregisters the interrupt handler for the power supply system
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.
316 //! \sa Interrupt_registerInterrupt() for important information about
317 //! registering interrupt handlers.
321 //*****************************************************************************
322 extern void PSS_unregisterInterrupt(void);
324 //*****************************************************************************
326 // Mark the end of the C bindings section for C++ compilers.
328 //*****************************************************************************
333 //*****************************************************************************
335 // Close the Doxygen group.
338 //*****************************************************************************