]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/ref_a.h
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / ref_a.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 __REF_B_H__
38 #define __REF_B_H__
39
40 //*****************************************************************************
41 //
42 //! \addtogroup ref_api
43 //! @{
44 //
45 //*****************************************************************************
46
47 #include <msp.h>
48 #include <stdbool.h>
49 #include <stdint.h>
50
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61
62 //*****************************************************************************
63 //
64 //The following are values that can be passed to Ref_setReferenceVoltage()
65 //in the referenceVoltageSelect parameter.
66 //
67 //*****************************************************************************
68 #define REF_A_VREF1_2V  REFVSEL_0
69 #define REF_A_VREF1_45V REFVSEL_1
70 #define REF_A_VREF2_5V  REFVSEL_3
71
72 //*****************************************************************************
73 //
74 //The following are values that are returned by Ref_getBandgapMode().
75 //
76 //*****************************************************************************
77 #define REF_A_STATICMODE 0x0
78 #define REF_A_SAMPLEMODE BGMODE
79
80 //*****************************************************************************
81 //
82 //! Sets the reference voltage for the voltage generator.
83 //!
84 //! \param referenceVoltageSelect is the desired voltage to generate for a
85 //!       reference voltage.
86 //!        Valid values are:
87 //!        - \b REF_A_VREF1_2V [Default]
88 //!        - \b REF_A_VREF1_45V
89 //!        - \b REF_A_VREF2_5V
90 //!        Modified bits are \b REFVSEL of \b REFCTL0 register.
91 //!
92 //! This function sets the reference voltage generated by the voltage generator
93 //! to be used by other peripherals. This reference voltage will only be valid
94 //! while the REF module is in control.
95 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns \b REF_BUSY,
96 //! this function  will have no effect.
97 //!
98 //! \return none
99 //
100 //*****************************************************************************
101 extern void REF_A_setReferenceVoltage(uint_fast8_t referenceVoltageSelect);
102
103 //*****************************************************************************
104 //
105 //! Disables the internal temperature sensor to save power consumption.
106 //!
107 //! This function is used to turn off the internal temperature sensor to save
108 //! on power consumption. The temperature sensor is enabled by default. Please
109 //! note, that giving ADC12 module control over the REF module, the state of the
110 //! temperature sensor is dependent on the controls of the ADC12 module.
111 //! Please note, if the \link REF_A_isRefGenBusy() \endlink  returns
112 //! \b REF_A_BUSY, this function will have no effect.
113 //!
114 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.
115 //! \return none
116 //
117 //*****************************************************************************
118 extern void REF_A_disableTempSensor(void);
119
120 //*****************************************************************************
121 //
122 //! Enables the internal temperature sensor.
123 //!
124 //! This function is used to turn on the internal temperature sensor to use by
125 //! other peripherals. The temperature sensor is enabled by default.
126 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns
127 //! \b REF_A_BUSY, this function will have no effect.
128 //!
129 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.
130 //!
131 //! \return none
132 //
133 //*****************************************************************************
134 extern void REF_A_enableTempSensor(void);
135
136 //*****************************************************************************
137 //
138 //! Outputs the reference voltage to an output pin.
139 //!
140 //! This function is used to output the reference voltage being generated to an
141 //! output pin. Please note, the output pin is device specific. Please note,
142 //! that giving ADC12 module control over the REF module, the state of the
143 //! reference voltage as an output to a pin is dependent on the controls of the
144 //! ADC12 module.
145 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns
146 //! \b REF_A_BUSY, this function will have no effect.
147 //!
148 //! Modified bits are \b REFOUT of \b REFCTL0 register.
149 //! \return none
150 //
151 //*****************************************************************************
152 extern void REF_A_enableReferenceVoltageOutput(void);
153
154 //*****************************************************************************
155 //
156 //! Disables the reference voltage as an output to a pin.
157 //!
158 //! This function is used to disables the reference voltage being generated to
159 //! be given to an output pin.
160 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns
161 //! \b REF_A_BUSY, this function will have no effect.
162 //!
163 //! Modified bits are \b REFOUT of \b REFCTL0 register.
164 //! \return none
165 //
166 //*****************************************************************************
167 extern void REF_A_disableReferenceVoltageOutput(void);
168
169 //*****************************************************************************
170 //
171 //! Enables the reference voltage to be used by peripherals.
172 //!
173 //! This function is used to enable the generated reference voltage to be used
174 //! other peripherals or by an output pin, if enabled. Please note, that giving
175 //! ADC12 module control over the REF module, the state of the reference voltage
176 //! is dependent on the controls of the ADC12 module.
177 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns
178 //! REF_A_BUSY, this function will have no effect.
179 //!
180 //! Modified bits are \b REFON of \b REFCTL0 register.
181 //! \return none
182 //
183 //*****************************************************************************
184 extern void REF_A_enableReferenceVoltage(void);
185
186 //*****************************************************************************
187 //
188 //! Disables the reference voltage.
189 //!
190 //! This function is used to disable the generated reference voltage.
191 //! Please note, if the \link REF_A_isRefGenBusy() \endlink returns
192 //!  \b  REF_A_BUSY, this function will have no effect.
193 //!
194 //! Modified bits are \b REFON of \b REFCTL0 register.
195 //! \return none
196 //
197 //*****************************************************************************
198 extern void REF_A_disableReferenceVoltage(void);
199
200 //*****************************************************************************
201 //
202 //! Returns the bandgap mode of the REF module.
203 //!
204 //! This function is used to return the bandgap mode of the REF module,
205 //! requested by the peripherals using the bandgap. If a peripheral requests
206 //! static mode, then the bandgap mode will be static for all modules, whereas
207 //! if all of the peripherals using the bandgap request sample mode, then that
208 //! will be the mode returned. Sample mode allows the bandgap to be active only
209 //! when necessary to save on power consumption, static mode requires the
210 //! bandgap to be active until no peripherals are using it anymore.
211 //!
212 //! \return The bandgap mode of the REF module:
213 //!        - \b REF_A_STATICMODE if the bandgap is operating in static mode
214 //!        - \b REF_A_SAMPLEMODE if the bandgap is operating in sample mode
215 //
216 //*****************************************************************************
217 extern uint_fast8_t REF_A_getBandgapMode(void);
218
219 //*****************************************************************************
220 //
221 //! Returns the active status of the bandgap in the REF module.
222 //!
223 //! This function is used to return the active status of the bandgap in the REF
224 //! module. If the bandgap is in use by a peripheral, then the status will be
225 //! seen as active.
226 //!
227 //! \return true if the bandgap is being used, false otherwise
228 //
229 //*****************************************************************************
230 extern bool REF_A_isBandgapActive(void);
231
232 //*****************************************************************************
233 //
234 //! Returns the busy status of the reference generator in the REF module.
235 //!
236 //! This function is used to return the busy status of the reference generator
237 //! in the REF module. If the ref. generator is in use by a peripheral, then the
238 //! status will be seen as busy.
239 //!
240 //! \return true if the reference generator is being used, false otherwise.
241 //*****************************************************************************
242 extern bool REF_A_isRefGenBusy(void);
243
244 //*****************************************************************************
245 //
246 //! Returns the active status of the reference generator in the REF module.
247 //!
248 //! This function is used to return the active status of the reference generator
249 //! in the REF module. If the ref. generator is on and ready to use, then the
250 //! status will be seen as active.
251 //!
252 //! \return true if the reference generator is active, false otherwise.
253 //
254 //*****************************************************************************
255 extern bool REF_A_isRefGenActive(void);
256
257 //*****************************************************************************
258 //
259 //! Returns the busy status of the reference generator in the REF module.
260 //!
261 //! This function is used to return the buys status of the buffered bandgap
262 //! voltage in the REF module. If the ref. generator is on and ready to use,
263 //! then the status will be seen as active.
264 //!
265 //! \return true if the buffered bandgap voltage is ready to be used, false
266 //!         otherwise
267 //
268 //*****************************************************************************
269 extern bool REF_A_getBufferedBandgapVoltageStatus(void);
270
271 //*****************************************************************************
272 //
273 //! Returns the busy status of the variable reference voltage in the REF module.
274 //!
275 //! This function is used to return the buys status of the variable reference
276 //! voltage in the REF module. If the ref. generator is on and ready to use,
277 //! then the status will be seen as active.
278 //!
279 //! \return true if the variable bandgap voltage is ready to be used, false
280 //!         otherwise
281 //
282 //*****************************************************************************
283 extern bool REF_A_getVariableReferenceVoltageStatus(void);
284
285 //*****************************************************************************
286 //
287 //! Enables the one-time trigger of the reference voltage.
288 //!
289 //! Triggers the one-time generation of the variable reference voltage.  Once
290 //! the reference voltage request is set, this bit is cleared by hardware
291 //!
292 //! Modified bits are \b REFGENOT of \b REFCTL0 register.
293 //!
294 //! \return none
295 //
296 //*****************************************************************************
297 extern void REF_A_setReferenceVoltageOneTimeTrigger(void);
298
299 //*****************************************************************************
300 //
301 //! Enables the one-time trigger of the buffered bandgap voltage.
302 //!
303 //! Triggers the one-time generation of the buffered bandgap voltage.  Once
304 //! the buffered bandgap voltage request is set, this bit is cleared by hardware
305 //!
306 //! Modified bits are \b RefGOT of \b REFCTL0 register.
307 //!
308 //! \return none
309 //
310 //*****************************************************************************
311 extern void REF_A_setBufferedBandgapVoltageOneTimeTrigger(void);
312
313 /* Defines for future devices that might have multiple instances */
314 #define REF_A_setReferenceVoltageMultipleInstance(a,b) REF_A_setReferenceVoltage(b)
315 #define REF_A_disableTempSensorMultipleInstance(a) REF_A_disableTempSensor()
316 #define REF_A_enableTempSensorMultipleInstance(a) REF_A_enableTempSensor()
317 #define REF_A_enableReferenceVoltageOutputMultipleInstance(a) REF_A_enableReferenceVoltageOutput()
318 #define REF_A_disableReferenceVoltageOutputMultipleInstance(a) REF_A_disableReferenceVoltageOutput()
319 #define REF_A_enableReferenceVoltageMultipleInstance(a) REF_A_enableReferenceVoltage()
320 #define REF_A_disableReferenceVoltageMultipleInstance(a) REF_A_disableReferenceVoltage()
321 #define REF_A_getBandgapModeMultipleInstance(a) REF_A_getBandgapMode()
322 #define REF_A_isBandgapActiveMultipleInstance(a) REF_A_isBandgapActive()
323 #define REF_A_isRefGenBusyMultipleInstance(a) REF_A_isRefGenBusy()
324 #define REF_A_isRefGenActiveMultipleInstance(a) REF_A_isRefGenActive()
325 #define REF_A_getBufferedBandgapVoltageStatusMultipleInstance(a) REF_A_getBufferedBandgapVoltageStatus()
326 #define REF_A_getVariableReferenceVoltageStatusMultipleInstance(a) REF_A_getVariableReferenceVoltageStatus()
327 #define REF_A_setReferenceVoltageOneTimeTriggerMultipleInstance(a) REF_A_setReferenceVoltageOneTimeTrigger()
328 #define REF_A_setBufferedBandgapVoltageOneTimeTriggerMultipleInstance(a) REF_A_setBufferedBandgapVoltageOneTimeTrigger()
329
330 //*****************************************************************************
331 //
332 // Mark the end of the C bindings section for C++ compilers.
333 //
334 //*****************************************************************************
335 #ifdef __cplusplus
336 }
337 #endif
338
339 //*****************************************************************************
340 //
341 // Close the Doxygen group.
342 //! @}
343 //
344 //*****************************************************************************
345
346 #endif // __REF_A_H__