MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.70.00.08
 All Data Structures Files Functions Variables Enumerations Modules Pages
ref_a.h
1 //*****************************************************************************
2 //
3 // ref_a.h - Driver for the REF_A Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_REF_A_H__
8 #define __MSP430WARE_REF_A_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_REF_A__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 //*****************************************************************************
26 //
27 // The following are values that can be passed to the referenceVoltageSelect
28 // parameter for functions: Ref_A_setReferenceVoltage().
29 //
30 //*****************************************************************************
31 #define REF_A_VREF1_2V (REFVSEL_0)
32 #define REF_A_VREF2_0V (REFVSEL_1)
33 #define REF_A_VREF2_5V (REFVSEL_2)
34 
35 //*****************************************************************************
36 //
37 // The following are values that can be passed toThe following are values that
38 // can be returned by the Ref_A_isBandgapActive() function and the
39 // Ref_A_isRefGenActive() function.
40 //
41 //*****************************************************************************
42 #define REF_A_ACTIVE true
43 #define REF_A_INACTIVE false
44 
45 //*****************************************************************************
46 //
47 // The following are values that can be passed toThe following are values that
48 // can be returned by the Ref_A_getBandgapMode() function.
49 //
50 //*****************************************************************************
51 #define REF_A_STATICMODE 0x00
52 #define REF_A_SAMPLEMODE BGMODE
53 
54 //*****************************************************************************
55 //
56 // The following are values that can be passed toThe following are values that
57 // can be returned by the Ref_A_isRefGenBusy() function.
58 //
59 //*****************************************************************************
60 #define REF_A_NOTBUSY 0x00
61 #define REF_A_BUSY REFGENBUSY
62 
63 //*****************************************************************************
64 //
65 // The following are values that can be passed toThe following are values that
66 // can be returned by the Ref_A_isVariableReferenceVoltageOutputReady()
67 // function and the Ref_A_isBufferedBandgapVoltageReady() function.
68 //
69 //*****************************************************************************
70 #define REF_A_NOTREADY false
71 #define REF_A_READY true
72 
73 //*****************************************************************************
74 //
75 // Prototypes for the APIs.
76 //
77 //*****************************************************************************
78 
79 //*****************************************************************************
80 //
81 //! \brief Sets the reference voltage for the voltage generator.
82 //!
83 //! This function sets the reference voltage generated by the voltage generator
84 //! to be used by other peripherals. This reference voltage will only be valid
85 //! while the Ref_A module is in control. Please note, if the
86 //! Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will have no effect.
87 //!
88 //! \param baseAddress is the base address of the REF_A module.
89 //! \param referenceVoltageSelect is the desired voltage to generate for a
90 //! reference voltage.
91 //! Valid values are:
92 //! - \b REF_A_VREF1_2V [Default]
93 //! - \b REF_A_VREF2_0V
94 //! - \b REF_A_VREF2_5V
95 //! \n Modified bits are \b REFVSEL of \b REFCTL0 register.
96 //!
97 //! \return None
98 //
99 //*****************************************************************************
100 extern void Ref_A_setReferenceVoltage(uint16_t baseAddress,
101  uint8_t referenceVoltageSelect);
102 
103 //*****************************************************************************
104 //
105 //! \brief 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_A module, the state of
110 //! the temperature sensor is dependent on the controls of the ADC12 module.
111 //! Please note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function
112 //! will have no effect.
113 //!
114 //! \param baseAddress is the base address of the REF_A module.
115 //!
116 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.
117 //!
118 //! \return None
119 //
120 //*****************************************************************************
121 extern void Ref_A_disableTempSensor(uint16_t baseAddress);
122 
123 //*****************************************************************************
124 //
125 //! \brief Enables the internal temperature sensor.
126 //!
127 //! This function is used to turn on the internal temperature sensor to use by
128 //! other peripherals. The temperature sensor is enabled by default. Please
129 //! note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will
130 //! have no effect.
131 //!
132 //! \param baseAddress is the base address of the REF_A module.
133 //!
134 //! Modified bits are \b REFTCOFF of \b REFCTL0 register.
135 //!
136 //! \return None
137 //
138 //*****************************************************************************
139 extern void Ref_A_enableTempSensor(uint16_t baseAddress);
140 
141 //*****************************************************************************
142 //
143 //! \brief Outputs the reference voltage to an output pin.
144 //!
145 //! This function is used to output the reference voltage being generated to an
146 //! output pin. Please note, the output pin is device specific. Please note,
147 //! that giving ADC12 module control over the Ref_A module, the state of the
148 //! reference voltage as an output to a pin is dependent on the controls of the
149 //! ADC12 module. If ADC12_A reference burst is disabled or DAC12_A is enabled,
150 //! this output is available continuously. If ADC12_A reference burst is
151 //! enabled, this output is available only during an ADC12_A conversion. For
152 //! devices with CTSD16, Ref_enableReferenceVoltage() needs to be invoked to
153 //! get VREFBG available continuously. Otherwise, VREFBG is only available
154 //! externally when a module requests it. Please note, if the
155 //! Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will have no effect.
156 //!
157 //! \param baseAddress is the base address of the REF_A module.
158 //!
159 //! Modified bits are \b REFOUT of \b REFCTL0 register.
160 //!
161 //! \return None
162 //
163 //*****************************************************************************
164 extern void Ref_A_enableReferenceVoltageOutput(uint16_t baseAddress);
165 
166 //*****************************************************************************
167 //
168 //! \brief Disables the reference voltage as an output to a pin.
169 //!
170 //! This function is used to disables the reference voltage being generated to
171 //! be given to an output pin. Please note, if the Ref_A_isRefGenBusy() returns
172 //! Ref_A_BUSY, this function will have no effect.
173 //!
174 //! \param baseAddress is the base address of the REF_A module.
175 //!
176 //! Modified bits are \b REFOUT of \b REFCTL0 register.
177 //!
178 //! \return None
179 //
180 //*****************************************************************************
181 extern void Ref_A_disableReferenceVoltageOutput(uint16_t baseAddress);
182 
183 //*****************************************************************************
184 //
185 //! \brief Enables the reference voltage to be used by peripherals.
186 //!
187 //! This function is used to enable the generated reference voltage to be used
188 //! other peripherals or by an output pin, if enabled. Please note, that giving
189 //! ADC12 module control over the Ref_A module, the state of the reference
190 //! voltage is dependent on the controls of the ADC12 module. Please note,
191 //! ADC10_A does not support the reference request. If the Ref_A_isRefGenBusy()
192 //! returns Ref_A_BUSY, this function will have no effect.
193 //!
194 //! \param baseAddress is the base address of the REF_A module.
195 //!
196 //! Modified bits are \b REFON of \b REFCTL0 register.
197 //!
198 //! \return None
199 //
200 //*****************************************************************************
201 extern void Ref_A_enableReferenceVoltage(uint16_t baseAddress);
202 
203 //*****************************************************************************
204 //
205 //! \brief Disables the reference voltage.
206 //!
207 //! This function is used to disable the generated reference voltage. Please
208 //! note, if the Ref_A_isRefGenBusy() returns Ref_A_BUSY, this function will
209 //! have no effect.
210 //!
211 //! \param baseAddress is the base address of the REF_A module.
212 //!
213 //! Modified bits are \b REFON of \b REFCTL0 register.
214 //!
215 //! \return None
216 //
217 //*****************************************************************************
218 extern void Ref_A_disableReferenceVoltage(uint16_t baseAddress);
219 
220 //*****************************************************************************
221 //
222 //! \brief Returns the bandgap mode of the Ref_A module.
223 //!
224 //! This function is used to return the bandgap mode of the Ref_A module,
225 //! requested by the peripherals using the bandgap. If a peripheral requests
226 //! static mode, then the bandgap mode will be static for all modules, whereas
227 //! if all of the peripherals using the bandgap request sample mode, then that
228 //! will be the mode returned. Sample mode allows the bandgap to be active only
229 //! when necessary to save on power consumption, static mode requires the
230 //! bandgap to be active until no peripherals are using it anymore.
231 //!
232 //! \param baseAddress is the base address of the REF_A module.
233 //!
234 //! \return One of the following:
235 //! - \b Ref_A_STATICMODE if the bandgap is operating in static mode
236 //! - \b Ref_A_SAMPLEMODE if the bandgap is operating in sample mode
237 //! \n indicating the bandgap mode of the module
238 //
239 //*****************************************************************************
240 extern uint16_t Ref_A_getBandgapMode(uint16_t baseAddress);
241 
242 //*****************************************************************************
243 //
244 //! \brief Returns the active status of the bandgap in the Ref_A module.
245 //!
246 //! This function is used to return the active status of the bandgap in the
247 //! Ref_A module. If the bandgap is in use by a peripheral, then the status
248 //! will be seen as active.
249 //!
250 //! \param baseAddress is the base address of the REF_A module.
251 //!
252 //! \return One of the following:
253 //! - \b Ref_A_ACTIVE if active
254 //! - \b Ref_A_INACTIVE if not active
255 //! \n indicating the bandgap active status of the module
256 //
257 //*****************************************************************************
258 extern bool Ref_A_isBandgapActive(uint16_t baseAddress);
259 
260 //*****************************************************************************
261 //
262 //! \brief Returns the busy status of the reference generator in the Ref_A
263 //! module.
264 //!
265 //! This function is used to return the busy status of the reference generator
266 //! in the Ref_A module. If the ref generator is in use by a peripheral, then
267 //! the status will be seen as busy.
268 //!
269 //! \param baseAddress is the base address of the REF_A module.
270 //!
271 //! \return One of the following:
272 //! - \b Ref_A_NOTBUSY if the reference generator is not being used
273 //! - \b Ref_A_BUSY if the reference generator is being used,
274 //! disallowing changes to be made to the Ref_A module controls
275 //! \n indicating the reference generator busy status of the module
276 //
277 //*****************************************************************************
278 extern uint16_t Ref_A_isRefGenBusy(uint16_t baseAddress);
279 
280 //*****************************************************************************
281 //
282 //! \brief Returns the active status of the reference generator in the Ref_A
283 //! module.
284 //!
285 //! This function is used to return the active status of the reference
286 //! generator in the Ref_A module. If the ref generator is on and ready to use,
287 //! then the status will be seen as active.
288 //!
289 //! \param baseAddress is the base address of the REF_A module.
290 //!
291 //! \return One of the following:
292 //! - \b Ref_A_ACTIVE if active
293 //! - \b Ref_A_INACTIVE if not active
294 //! \n indicating the reference generator active status of the module
295 //
296 //*****************************************************************************
297 extern bool Ref_A_isRefGenActive(uint16_t baseAddress);
298 
299 //*****************************************************************************
300 //
301 //! \brief Returns the busy status of the reference generator in the Ref_A
302 //! module.
303 //!
304 //! This function is used to return the buys status of the buffered bandgap
305 //! voltage in the Ref_A module. If the ref generator is on and ready to use,
306 //! then the status will be seen as active.
307 //!
308 //! \param baseAddress is the base address of the REF_A module.
309 //!
310 //! \return One of the following:
311 //! - \b Ref_A_NOTREADY if NOT ready to be used
312 //! - \b Ref_A_READY if ready to be used
313 //! \n indicating the the busy status of the reference generator in the
314 //! module
315 //
316 //*****************************************************************************
317 extern bool Ref_A_isBufferedBandgapVoltageReady(uint16_t baseAddress);
318 
319 //*****************************************************************************
320 //
321 //! \brief Returns the busy status of the variable reference voltage in the
322 //! Ref_A module.
323 //!
324 //! This function is used to return the busy status of the variable reference
325 //! voltage in the Ref_A module. If the ref generator is on and ready to use,
326 //! then the status will be seen as active.
327 //!
328 //! \param baseAddress is the base address of the REF_A module.
329 //!
330 //! \return One of the following:
331 //! - \b Ref_A_NOTREADY if NOT ready to be used
332 //! - \b Ref_A_READY if ready to be used
333 //! \n indicating the the busy status of the variable reference voltage
334 //! in the module
335 //
336 //*****************************************************************************
337 extern bool Ref_A_isVariableReferenceVoltageOutputReady(uint16_t baseAddress);
338 
339 //*****************************************************************************
340 //
341 //! \brief Enables the one-time trigger of the reference voltage.
342 //!
343 //! Triggers the one-time generation of the variable reference voltage. Once
344 //! the reference voltage request is set, this bit is cleared by hardware
345 //!
346 //! \param baseAddress is the base address of the REF_A module.
347 //!
348 //! Modified bits are \b REFGENOT of \b REFCTL0 register.
349 //!
350 //! \return None
351 //
352 //*****************************************************************************
353 extern void Ref_A_setReferenceVoltageOneTimeTrigger(uint16_t baseAddress);
354 
355 //*****************************************************************************
356 //
357 //! \brief Enables the one-time trigger of the buffered bandgap voltage.
358 //!
359 //! Triggers the one-time generation of the buffered bandgap voltage. Once the
360 //! buffered bandgap voltage request is set, this bit is cleared by hardware
361 //!
362 //! \param baseAddress is the base address of the REF_A module.
363 //!
364 //! Modified bits are \b REFBGOT of \b REFCTL0 register.
365 //!
366 //! \return None
367 //
368 //*****************************************************************************
369 extern void Ref_A_setBufferedBandgapVoltageOneTimeTrigger(uint16_t baseAddress);
370 
371 //*****************************************************************************
372 //
373 // Mark the end of the C bindings section for C++ compilers.
374 //
375 //*****************************************************************************
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif
381 #endif // __MSP430WARE_REF_A_H__
void Ref_A_setReferenceVoltageOneTimeTrigger(uint16_t baseAddress)
Enables the one-time trigger of the reference voltage.
Definition: ref_a.c:104
bool Ref_A_isVariableReferenceVoltageOutputReady(uint16_t baseAddress)
Returns the busy status of the variable reference voltage in the Ref_A module.
Definition: ref_a.c:95
void Ref_A_setBufferedBandgapVoltageOneTimeTrigger(uint16_t baseAddress)
Enables the one-time trigger of the buffered bandgap voltage.
Definition: ref_a.c:109
void Ref_A_enableReferenceVoltage(uint16_t baseAddress)
Enables the reference voltage to be used by peripherals.
Definition: ref_a.c:48
uint16_t Ref_A_getBandgapMode(uint16_t baseAddress)
Returns the bandgap mode of the Ref_A module.
Definition: ref_a.c:58
bool Ref_A_isBandgapActive(uint16_t baseAddress)
Returns the active status of the bandgap in the Ref_A module.
Definition: ref_a.c:63
void Ref_A_setReferenceVoltage(uint16_t baseAddress, uint8_t referenceVoltageSelect)
Sets the reference voltage for the voltage generator.
Definition: ref_a.c:21
void Ref_A_enableTempSensor(uint16_t baseAddress)
Enables the internal temperature sensor.
Definition: ref_a.c:33
bool Ref_A_isBufferedBandgapVoltageReady(uint16_t baseAddress)
Returns the busy status of the reference generator in the Ref_A module.
Definition: ref_a.c:86
void Ref_A_disableTempSensor(uint16_t baseAddress)
Disables the internal temperature sensor to save power consumption.
Definition: ref_a.c:28
void Ref_A_enableReferenceVoltageOutput(uint16_t baseAddress)
Outputs the reference voltage to an output pin.
Definition: ref_a.c:38
uint16_t Ref_A_isRefGenBusy(uint16_t baseAddress)
Returns the busy status of the reference generator in the Ref_A module.
Definition: ref_a.c:72
void Ref_A_disableReferenceVoltageOutput(uint16_t baseAddress)
Disables the reference voltage as an output to a pin.
Definition: ref_a.c:43
void Ref_A_disableReferenceVoltage(uint16_t baseAddress)
Disables the reference voltage.
Definition: ref_a.c:53
bool Ref_A_isRefGenActive(uint16_t baseAddress)
Returns the active status of the reference generator in the Ref_A module.
Definition: ref_a.c:77

Copyright 2016, Texas Instruments Incorporated