]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430FR5969_LaunchPad/driverlib/MSP430FR5xx_6xx/ref_a.h
Start of an MSP430FR5969 IAR project - currently running Blinky only.
[freertos] / FreeRTOS / Demo / MSP430FR5969_LaunchPad / driverlib / MSP430FR5xx_6xx / ref_a.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // ref_a.h - Driver for the REF_A Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_REF_A_H__\r
39 #define __MSP430WARE_REF_A_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_REF_A__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 //*****************************************************************************\r
57 //\r
58 // The following are values that can be passed to the referenceVoltageSelect\r
59 // parameter for functions: Ref_A_setReferenceVoltage().\r
60 //\r
61 //*****************************************************************************\r
62 #define REF_A_VREF1_2V                                              (REFVSEL_0)\r
63 #define REF_A_VREF2_0V                                              (REFVSEL_1)\r
64 #define REF_A_VREF2_5V                                              (REFVSEL_2)\r
65 \r
66 //*****************************************************************************\r
67 //\r
68 // The following are values that can be passed toThe following are values that\r
69 // can be returned by the Ref_A_isBandgapActive() function and the\r
70 // Ref_A_isRefGenActive() function.\r
71 //\r
72 //*****************************************************************************\r
73 #define REF_A_ACTIVE                                                       true\r
74 #define REF_A_INACTIVE                                                    false\r
75 \r
76 //*****************************************************************************\r
77 //\r
78 // The following are values that can be passed toThe following are values that\r
79 // can be returned by the Ref_A_getBandgapMode() function.\r
80 //\r
81 //*****************************************************************************\r
82 #define REF_A_STATICMODE                                                   0x00\r
83 #define REF_A_SAMPLEMODE                                                 BGMODE\r
84 \r
85 //*****************************************************************************\r
86 //\r
87 // The following are values that can be passed toThe following are values that\r
88 // can be returned by the Ref_A_isRefGenBusy() function.\r
89 //\r
90 //*****************************************************************************\r
91 #define REF_A_NOTBUSY                                                      0x00\r
92 #define REF_A_BUSY                                                   REFGENBUSY\r
93 \r
94 //*****************************************************************************\r
95 //\r
96 // The following are values that can be passed toThe following are values that\r
97 // can be returned by the Ref_A_isVariableReferenceVoltageOutputReady()\r
98 // function and the Ref_A_isBufferedBandgapVoltageReady() function.\r
99 //\r
100 //*****************************************************************************\r
101 #define REF_A_NOTREADY                                                    false\r
102 #define REF_A_READY                                                        true\r
103 \r
104 //*****************************************************************************\r
105 //\r
106 // Prototypes for the APIs.\r
107 //\r
108 //*****************************************************************************\r
109 \r
110 //*****************************************************************************\r
111 //\r
112 //! \brief Sets the reference voltage for the voltage generator.\r
113 //!\r
114 //! This function sets the reference voltage generated by the voltage generator\r
115 //! to be used by other peripherals. This reference voltage will only be valid\r
116 //! while the Ref_A module is in control. Please note, if the\r
117 //! Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will have no effect.\r
118 //!\r
119 //! \param baseAddress is the base address of the REF_A module.\r
120 //! \param referenceVoltageSelect is the desired voltage to generate for a\r
121 //!        reference voltage.\r
122 //!        Valid values are:\r
123 //!        - \b REF_A_VREF1_2V [Default]\r
124 //!        - \b REF_A_VREF2_0V\r
125 //!        - \b REF_A_VREF2_5V\r
126 //!        \n Modified bits are \b REFVSEL of \b REFCTL0 register.\r
127 //!\r
128 //! \return None\r
129 //\r
130 //*****************************************************************************\r
131 extern void Ref_A_setReferenceVoltage(uint16_t baseAddress,\r
132                                       uint8_t referenceVoltageSelect);\r
133 \r
134 //*****************************************************************************\r
135 //\r
136 //! \brief Disables the internal temperature sensor to save power consumption.\r
137 //!\r
138 //! This function is used to turn off the internal temperature sensor to save\r
139 //! on power consumption. The temperature sensor is enabled by default. Please\r
140 //! note, that giving ADC12 module control over the Ref_A module, the state of\r
141 //! the temperature sensor is dependent on the controls of the ADC12 module.\r
142 //! Please note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function\r
143 //! will have no effect.\r
144 //!\r
145 //! \param baseAddress is the base address of the REF_A module.\r
146 //!\r
147 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.\r
148 //!\r
149 //! \return None\r
150 //\r
151 //*****************************************************************************\r
152 extern void Ref_A_disableTempSensor(uint16_t baseAddress);\r
153 \r
154 //*****************************************************************************\r
155 //\r
156 //! \brief Enables the internal temperature sensor.\r
157 //!\r
158 //! This function is used to turn on the internal temperature sensor to use by\r
159 //! other peripherals. The temperature sensor is enabled by default. Please\r
160 //! note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will\r
161 //! have no effect.\r
162 //!\r
163 //! \param baseAddress is the base address of the REF_A module.\r
164 //!\r
165 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.\r
166 //!\r
167 //! \return None\r
168 //\r
169 //*****************************************************************************\r
170 extern void Ref_A_enableTempSensor(uint16_t baseAddress);\r
171 \r
172 //*****************************************************************************\r
173 //\r
174 //! \brief Outputs the reference voltage to an output pin.\r
175 //!\r
176 //! This function is used to output the reference voltage being generated to an\r
177 //! output pin. Please note, the output pin is device specific. Please note,\r
178 //! that giving ADC12 module control over the Ref_A module, the state of the\r
179 //! reference voltage as an output to a pin is dependent on the controls of the\r
180 //! ADC12 module. Please note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY,\r
181 //! this function will have no effect.\r
182 //!\r
183 //! \param baseAddress is the base address of the REF_A module.\r
184 //!\r
185 //! Modified bits are \b REFOUT of \b REFCTL0 register.\r
186 //!\r
187 //! \return None\r
188 //\r
189 //*****************************************************************************\r
190 extern void Ref_A_enableReferenceVoltageOutput(uint16_t baseAddress);\r
191 \r
192 //*****************************************************************************\r
193 //\r
194 //! \brief Disables the reference voltage as an output to a pin.\r
195 //!\r
196 //! This function is used to disables the reference voltage being generated to\r
197 //! be given to an output pin. Please note, if the Ref_A_isRefGenBusy() returns\r
198 //! Ref_A_BUSY, this function will have no effect.\r
199 //!\r
200 //! \param baseAddress is the base address of the REF_A module.\r
201 //!\r
202 //! Modified bits are \b REFOUT of \b REFCTL0 register.\r
203 //!\r
204 //! \return None\r
205 //\r
206 //*****************************************************************************\r
207 extern void Ref_A_disableReferenceVoltageOutput(uint16_t baseAddress);\r
208 \r
209 //*****************************************************************************\r
210 //\r
211 //! \brief Enables the reference voltage to be used by peripherals.\r
212 //!\r
213 //! This function is used to enable the generated reference voltage to be used\r
214 //! other peripherals or by an output pin, if enabled. Please note, that giving\r
215 //! ADC12 module control over the Ref_A module, the state of the reference\r
216 //! voltage is dependent on the controls of the ADC12 module. Please note, if\r
217 //! the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will have no\r
218 //! effect.\r
219 //!\r
220 //! \param baseAddress is the base address of the REF_A module.\r
221 //!\r
222 //! Modified bits are \b REFON of \b REFCTL0 register.\r
223 //!\r
224 //! \return None\r
225 //\r
226 //*****************************************************************************\r
227 extern void Ref_A_enableReferenceVoltage(uint16_t baseAddress);\r
228 \r
229 //*****************************************************************************\r
230 //\r
231 //! \brief Disables the reference voltage.\r
232 //!\r
233 //! This function is used to disable the generated reference voltage. Please\r
234 //! note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will\r
235 //! have no effect.\r
236 //!\r
237 //! \param baseAddress is the base address of the REF_A module.\r
238 //!\r
239 //! Modified bits are \b REFON of \b REFCTL0 register.\r
240 //!\r
241 //! \return None\r
242 //\r
243 //*****************************************************************************\r
244 extern void Ref_A_disableReferenceVoltage(uint16_t baseAddress);\r
245 \r
246 //*****************************************************************************\r
247 //\r
248 //! \brief Returns the bandgap mode of the Ref_A module.\r
249 //!\r
250 //! This function is used to return the bandgap mode of the Ref_A module,\r
251 //! requested by the peripherals using the bandgap. If a peripheral requests\r
252 //! static mode, then the bandgap mode will be static for all modules, whereas\r
253 //! if all of the peripherals using the bandgap request sample mode, then that\r
254 //! will be the mode returned. Sample mode allows the bandgap to be active only\r
255 //! when necessary to save on power consumption, static mode requires the\r
256 //! bandgap to be active until no peripherals are using it anymore.\r
257 //!\r
258 //! \param baseAddress is the base address of the REF_A module.\r
259 //!\r
260 //! \return One of the following:\r
261 //!         - \b Ref_A_STATICMODE if the bandgap is operating in static mode\r
262 //!         - \b Ref_A_SAMPLEMODE if the bandgap is operating in sample mode\r
263 //!         \n indicating the bandgap mode of the module\r
264 //\r
265 //*****************************************************************************\r
266 extern uint16_t Ref_A_getBandgapMode(uint16_t baseAddress);\r
267 \r
268 //*****************************************************************************\r
269 //\r
270 //! \brief Returns the active status of the bandgap in the Ref_A module.\r
271 //!\r
272 //! This function is used to return the active status of the bandgap in the\r
273 //! Ref_A module. If the bandgap is in use by a peripheral, then the status\r
274 //! will be seen as active.\r
275 //!\r
276 //! \param baseAddress is the base address of the REF_A module.\r
277 //!\r
278 //! \return One of the following:\r
279 //!         - \b Ref_A_ACTIVE if active\r
280 //!         - \b Ref_A_INACTIVE if not active\r
281 //!         \n indicating the bandgap active status of the module\r
282 //\r
283 //*****************************************************************************\r
284 extern bool Ref_A_isBandgapActive(uint16_t baseAddress);\r
285 \r
286 //*****************************************************************************\r
287 //\r
288 //! \brief Returns the busy status of the reference generator in the Ref_A\r
289 //! module.\r
290 //!\r
291 //! This function is used to return the busy status of the reference generator\r
292 //! in the Ref_A module. If the ref generator is in use by a peripheral, then\r
293 //! the status will be seen as busy.\r
294 //!\r
295 //! \param baseAddress is the base address of the REF_A module.\r
296 //!\r
297 //! \return One of the following:\r
298 //!         - \b Ref_A_NOTBUSY if the reference generator is not being used\r
299 //!         - \b Ref_A_BUSY if the reference generator is being used,\r
300 //!         disallowing changes to be made to the Ref_A module controls\r
301 //!         \n indicating the reference generator busy status of the module\r
302 //\r
303 //*****************************************************************************\r
304 extern uint16_t Ref_A_isRefGenBusy(uint16_t baseAddress);\r
305 \r
306 //*****************************************************************************\r
307 //\r
308 //! \brief Returns the active status of the reference generator in the Ref_A\r
309 //! module.\r
310 //!\r
311 //! This function is used to return the active status of the reference\r
312 //! generator in the Ref_A module. If the ref generator is on and ready to use,\r
313 //! then the status will be seen as active.\r
314 //!\r
315 //! \param baseAddress is the base address of the REF_A module.\r
316 //!\r
317 //! \return One of the following:\r
318 //!         - \b Ref_A_ACTIVE if active\r
319 //!         - \b Ref_A_INACTIVE if not active\r
320 //!         \n indicating the reference generator active status of the module\r
321 //\r
322 //*****************************************************************************\r
323 extern bool Ref_A_isRefGenActive(uint16_t baseAddress);\r
324 \r
325 //*****************************************************************************\r
326 //\r
327 //! \brief Returns the busy status of the reference generator in the Ref_A\r
328 //! module.\r
329 //!\r
330 //! This function is used to return the buys status of the buffered bandgap\r
331 //! voltage in the Ref_A module. If the ref generator is on and ready to use,\r
332 //! then the status will be seen as active.\r
333 //!\r
334 //! \param baseAddress is the base address of the REF_A module.\r
335 //!\r
336 //! \return One of the following:\r
337 //!         - \b Ref_A_NOTREADY if NOT ready to be used\r
338 //!         - \b Ref_A_READY if ready to be used\r
339 //!         \n indicating the the busy status of the reference generator in the\r
340 //!         module\r
341 //\r
342 //*****************************************************************************\r
343 extern bool Ref_A_isBufferedBandgapVoltageReady(uint16_t baseAddress);\r
344 \r
345 //*****************************************************************************\r
346 //\r
347 //! \brief Returns the busy status of the variable reference voltage in the\r
348 //! Ref_A module.\r
349 //!\r
350 //! This function is used to return the busy status of the variable reference\r
351 //! voltage in the Ref_A module. If the ref generator is on and ready to use,\r
352 //! then the status will be seen as active.\r
353 //!\r
354 //! \param baseAddress is the base address of the REF_A module.\r
355 //!\r
356 //! \return One of the following:\r
357 //!         - \b Ref_A_NOTREADY if NOT ready to be used\r
358 //!         - \b Ref_A_READY if ready to be used\r
359 //!         \n indicating the the busy status of the variable reference voltage\r
360 //!         in the module\r
361 //\r
362 //*****************************************************************************\r
363 extern bool Ref_A_isVariableReferenceVoltageOutputReady(uint16_t baseAddress);\r
364 \r
365 //*****************************************************************************\r
366 //\r
367 //! \brief Enables the one-time trigger of the reference voltage.\r
368 //!\r
369 //! Triggers the one-time generation of the variable reference voltage. Once\r
370 //! the reference voltage request is set, this bit is cleared by hardware\r
371 //!\r
372 //! \param baseAddress is the base address of the REF_A module.\r
373 //!\r
374 //! Modified bits are \b REFGENOT of \b REFCTL0 register.\r
375 //!\r
376 //! \return None\r
377 //\r
378 //*****************************************************************************\r
379 extern void Ref_A_setReferenceVoltageOneTimeTrigger(uint16_t baseAddress);\r
380 \r
381 //*****************************************************************************\r
382 //\r
383 //! \brief Enables the one-time trigger of the buffered bandgap voltage.\r
384 //!\r
385 //! Triggers the one-time generation of the buffered bandgap voltage. Once the\r
386 //! buffered bandgap voltage request is set, this bit is cleared by hardware\r
387 //!\r
388 //! \param baseAddress is the base address of the REF_A module.\r
389 //!\r
390 //! Modified bits are \b REFBGOT of \b REFCTL0 register.\r
391 //!\r
392 //! \return None\r
393 //\r
394 //*****************************************************************************\r
395 extern void Ref_A_setBufferedBandgapVoltageOneTimeTrigger(uint16_t baseAddress);\r
396 \r
397 //*****************************************************************************\r
398 //\r
399 // Mark the end of the C bindings section for C++ compilers.\r
400 //\r
401 //*****************************************************************************\r
402 #ifdef __cplusplus\r
403 }\r
404 #endif\r
405 \r
406 #endif\r
407 #endif // __MSP430WARE_REF_A_H__\r