MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
dac12_a.h
1 //*****************************************************************************
2 //
3 // dac12_a.h - Driver for the DAC12_A Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_DAC12_A_H__
8 #define __MSP430WARE_DAC12_A_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_DAC12_2__
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 #include "inc/hw_memmap.h"
26 //*****************************************************************************
27 //
28 //! \brief Used in the DAC12_A_init() function as the param parameter.
29 //
30 //*****************************************************************************
31 typedef struct DAC12_A_initParam {
32  //! Decides which DAC12_A sub-module to configure.
33  //! \n Valid values are:
34  //! - \b DAC12_A_SUBMODULE_0
35  //! - \b DAC12_A_SUBMODULE_1
36  uint8_t submoduleSelect;
37  //! Selects the output pin that the selected DAC12_A module will output to.
38  //! \n Valid values are:
39  //! - \b DAC12_A_OUTPUT_1 [Default]
40  //! - \b DAC12_A_OUTPUT_2
41  uint16_t outputSelect;
42  //! Is the upper limit voltage that the data can be converted in to.
43  //! \n Valid values are:
44  //! - \b DAC12_A_VREF_INT [Default]
45  //! - \b DAC12_A_VREF_AVCC
46  //! - \b DAC12_A_VREF_EXT - For devices with CTSD16, use Ref module
47  //! Ref_enableReferenceVoltageOutput/Ref__disableReferenceVoltageOutput
48  //! to select VeREF(external reference signal) or VREFBG(internally
49  //! generated reference signal)
51  //! Is the multiplier of the Vout voltage.
52  //! \n Valid values are:
53  //! - \b DAC12_A_VREFx1 [Default]
54  //! - \b DAC12_A_VREFx2
55  //! - \b DAC12_A_VREFx3
57  //! Is the setting of the settling speed and current of the Vref+ and the
58  //! Vout buffer.
59  //! \n Valid values are:
60  //! - \b DAC12_A_AMP_OFF_PINOUTHIGHZ [Default] - Initialize the DAC12_A
61  //! Module with settings, but do not turn it on.
62  //! - \b DAC12_A_AMP_OFF_PINOUTLOW - Initialize the DAC12_A Module with
63  //! settings, and allow it to take control of the selected output pin to
64  //! pull it low (Note: this takes control away port mapping module).
65  //! - \b DAC12_A_AMP_LOWIN_LOWOUT - Select a slow settling speed and
66  //! current for Vref+ input buffer and for Vout output buffer.
67  //! - \b DAC12_A_AMP_LOWIN_MEDOUT - Select a slow settling speed and
68  //! current for Vref+ input buffer and a medium settling speed and
69  //! current for Vout output buffer.
70  //! - \b DAC12_A_AMP_LOWIN_HIGHOUT - Select a slow settling speed and
71  //! current for Vref+ input buffer and a high settling speed and current
72  //! for Vout output buffer.
73  //! - \b DAC12_A_AMP_MEDIN_MEDOUT - Select a medium settling speed and
74  //! current for Vref+ input buffer and for Vout output buffer.
75  //! - \b DAC12_A_AMP_MEDIN_HIGHOUT - Select a medium settling speed and
76  //! current for Vref+ input buffer and a high settling speed and current
77  //! for Vout output buffer.
78  //! - \b DAC12_A_AMP_HIGHIN_HIGHOUT - Select a high settling speed and
79  //! current for Vref+ input buffer and for Vout output buffer.
81  //! Selects the trigger that will start a conversion.
82  //! \n Valid values are:
83  //! - \b DAC12_A_TRIGGER_ENCBYPASS [Default] - Automatically converts data
84  //! as soon as it is written into the data buffer. (Note: Do not use
85  //! this selection if grouping DAC's).
86  //! - \b DAC12_A_TRIGGER_ENC - Requires a call to enableConversions() to
87  //! allow a conversion, but starts a conversion as soon as data is
88  //! written to the data buffer (Note: with DAC12_A module's grouped,
89  //! data has to be set in BOTH DAC12_A data buffers to start a
90  //! conversion).
91  //! - \b DAC12_A_TRIGGER_TA - Requires a call to enableConversions() to
92  //! allow a conversion, and a rising edge of Timer_A's Out1 (TA1) to
93  //! start a conversion.
94  //! - \b DAC12_A_TRIGGER_TB - Requires a call to enableConversions() to
95  //! allow a conversion, and a rising edge of Timer_B's Out2 (TB2) to
96  //! start a conversion.
99 
100 
101 //*****************************************************************************
102 //
103 // The following are values that can be passed to the positiveReferenceVoltage
104 // parameter for functions: DAC12_A_init(); the param parameter for functions:
105 // DAC12_A_init().
106 //
107 //*****************************************************************************
108 #define DAC12_A_VREF_INT (DAC12SREF_0)
109 #define DAC12_A_VREF_AVCC (DAC12SREF_1)
110 #define DAC12_A_VREF_EXT (DAC12SREF_2)
111 
112 //*****************************************************************************
113 //
114 // The following are values that can be passed to the param parameter for
115 // functions: DAC12_A_init(); the amplifierSetting parameter for functions:
116 // DAC12_A_init(), and DAC12_A_setAmplifierSetting().
117 //
118 //*****************************************************************************
119 #define DAC12_A_AMP_OFF_PINOUTHIGHZ (DAC12AMP_0)
120 #define DAC12_A_AMP_OFF_PINOUTLOW (DAC12AMP_1)
121 #define DAC12_A_AMP_LOWIN_LOWOUT (DAC12AMP_2)
122 #define DAC12_A_AMP_LOWIN_MEDOUT (DAC12AMP_3)
123 #define DAC12_A_AMP_LOWIN_HIGHOUT (DAC12AMP_4)
124 #define DAC12_A_AMP_MEDIN_MEDOUT (DAC12AMP_5)
125 #define DAC12_A_AMP_MEDIN_HIGHOUT (DAC12AMP_6)
126 #define DAC12_A_AMP_HIGHIN_HIGHOUT (DAC12AMP_7)
127 
128 //*****************************************************************************
129 //
130 // The following are values that can be passed to the outputSelect parameter
131 // for functions: DAC12_A_init(); the param parameter for functions:
132 // DAC12_A_init().
133 //
134 //*****************************************************************************
135 #define DAC12_A_OUTPUT_1 (!(DAC12OPS))
136 #define DAC12_A_OUTPUT_2 (DAC12OPS)
137 
138 //*****************************************************************************
139 //
140 // The following are values that can be passed to the submoduleSelect parameter
141 // for functions: DAC12_A_init(), DAC12_A_setAmplifierSetting(),
142 // DAC12_A_disable(), DAC12_A_enableInterrupt(), DAC12_A_disableInterrupt(),
143 // DAC12_A_getInterruptStatus(), DAC12_A_clearInterrupt(),
144 // DAC12_A_calibrateOutput(), DAC12_A_getCalibrationData(),
145 // DAC12_A_setCalibrationOffset(), DAC12_A_enableConversions(),
146 // DAC12_A_setData(), DAC12_A_disableConversions(), DAC12_A_setResolution(),
147 // DAC12_A_setInputDataFormat(), and
148 // DAC12_A_getDataBufferMemoryAddressForDMA(); the param parameter for
149 // functions: DAC12_A_init().
150 //
151 //*****************************************************************************
152 #define DAC12_A_SUBMODULE_0 (0x00)
153 #define DAC12_A_SUBMODULE_1 (0x10)
154 
155 //*****************************************************************************
156 //
157 // The following are values that can be passed to the outputVoltageMultiplier
158 // parameter for functions: DAC12_A_init(); the param parameter for functions:
159 // DAC12_A_init().
160 //
161 //*****************************************************************************
162 #define DAC12_A_VREFx1 (DAC12IR)
163 #define DAC12_A_VREFx2 (DAC12OG)
164 #define DAC12_A_VREFx3 (0x0)
165 
166 //*****************************************************************************
167 //
168 // The following are values that can be passed to the conversionTriggerSelect
169 // parameter for functions: DAC12_A_init(); the param parameter for functions:
170 // DAC12_A_init().
171 //
172 //*****************************************************************************
173 #define DAC12_A_TRIGGER_ENCBYPASS (DAC12LSEL_0)
174 #define DAC12_A_TRIGGER_ENC (DAC12LSEL_1)
175 #define DAC12_A_TRIGGER_TA (DAC12LSEL_2)
176 #define DAC12_A_TRIGGER_TB (DAC12LSEL_3)
177 
178 //*****************************************************************************
179 //
180 // The following are values that can be passed to the resolutionSelect
181 // parameter for functions: DAC12_A_setResolution().
182 //
183 //*****************************************************************************
184 #define DAC12_A_RESOLUTION_8BIT (DAC12RES)
185 #define DAC12_A_RESOLUTION_12BIT (!(DAC12RES))
186 
187 //*****************************************************************************
188 //
189 // The following are values that can be passed to the inputJustification
190 // parameter for functions: DAC12_A_setInputDataFormat().
191 //
192 //*****************************************************************************
193 #define DAC12_A_JUSTIFICATION_RIGHT (!(DAC12DFJ))
194 #define DAC12_A_JUSTIFICATION_LEFT (DAC12DFJ)
195 
196 //*****************************************************************************
197 //
198 // The following are values that can be passed to the inputSign parameter for
199 // functions: DAC12_A_setInputDataFormat().
200 //
201 //*****************************************************************************
202 #define DAC12_A_UNSIGNED_BINARY (!(DAC12DF))
203 #define DAC12_A_SIGNED_2SCOMPLEMENT (DAC12DF)
204 
205 //*****************************************************************************
206 //
207 // The following are values that can be passed toThe following are values that
208 // can be returned by the DAC12_A_getInterruptStatus() function.
209 //
210 //*****************************************************************************
211 #define DAC12_A_INT_ACTIVE (DAC12IFG)
212 #define DAC12_A_INT_INACTIVE (0x00)
213 
214 //*****************************************************************************
215 //
216 // Prototypes for the APIs.
217 //
218 //*****************************************************************************
219 
220 //*****************************************************************************
221 //
222 //! \brief Initializes the DAC12_A module with the specified settings.
223 //!
224 //! This function initializes the DAC12_A module with the specified settings.
225 //! Upon successful completion of the initialization of this module the control
226 //! registers and interrupts of this module are all reset, and the specified
227 //! variables will be set. Please note, that if conversions are enabled with
228 //! the enableConversions() function, then disableConversions() must be called
229 //! before re-initializing the DAC12_A module with this function.
230 //!
231 //! \param baseAddress is the base address of the DAC12_A module.
232 //! \param param is the pointer to struct for initialization.
233 //!
234 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
235 //
236 //*****************************************************************************
237 extern bool DAC12_A_init(uint16_t baseAddress,
238  DAC12_A_initParam *param);
239 
240 //*****************************************************************************
241 //
242 //! \brief Sets the amplifier settings for the Vref+ and Vout buffers.
243 //!
244 //! This function sets the amplifier settings of the DAC12_A module for the
245 //! Vref+ and Vout buffers without re-initializing the DAC12_A module. This can
246 //! be used to disable the control of the pin by the DAC12_A module.
247 //!
248 //! \param baseAddress is the base address of the DAC12_A module.
249 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
250 //! Valid values are:
251 //! - \b DAC12_A_SUBMODULE_0
252 //! - \b DAC12_A_SUBMODULE_1
253 //! \param amplifierSetting is the setting of the settling speed and current of
254 //! the Vref+ and the Vout buffer.
255 //! Valid values are:
256 //! - \b DAC12_A_AMP_OFF_PINOUTHIGHZ [Default] - Initialize the DAC12_A
257 //! Module with settings, but do not turn it on.
258 //! - \b DAC12_A_AMP_OFF_PINOUTLOW - Initialize the DAC12_A Module with
259 //! settings, and allow it to take control of the selected output pin
260 //! to pull it low (Note: this takes control away port mapping
261 //! module).
262 //! - \b DAC12_A_AMP_LOWIN_LOWOUT - Select a slow settling speed and
263 //! current for Vref+ input buffer and for Vout output buffer.
264 //! - \b DAC12_A_AMP_LOWIN_MEDOUT - Select a slow settling speed and
265 //! current for Vref+ input buffer and a medium settling speed and
266 //! current for Vout output buffer.
267 //! - \b DAC12_A_AMP_LOWIN_HIGHOUT - Select a slow settling speed and
268 //! current for Vref+ input buffer and a high settling speed and
269 //! current for Vout output buffer.
270 //! - \b DAC12_A_AMP_MEDIN_MEDOUT - Select a medium settling speed and
271 //! current for Vref+ input buffer and for Vout output buffer.
272 //! - \b DAC12_A_AMP_MEDIN_HIGHOUT - Select a medium settling speed and
273 //! current for Vref+ input buffer and a high settling speed and
274 //! current for Vout output buffer.
275 //! - \b DAC12_A_AMP_HIGHIN_HIGHOUT - Select a high settling speed and
276 //! current for Vref+ input buffer and for Vout output buffer.
277 //!
278 //! \return None
279 //
280 //*****************************************************************************
281 extern void DAC12_A_setAmplifierSetting(uint16_t baseAddress,
282  uint8_t submoduleSelect,
283  uint8_t amplifierSetting);
284 
285 //*****************************************************************************
286 //
287 //! \brief Clears the amplifier settings to disable the DAC12_A module.
288 //!
289 //! This function clears the amplifier settings for the selected DAC12_A module
290 //! to disable the DAC12_A module.
291 //!
292 //! \param baseAddress is the base address of the DAC12_A module.
293 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
294 //! Valid values are:
295 //! - \b DAC12_A_SUBMODULE_0
296 //! - \b DAC12_A_SUBMODULE_1
297 //!
298 //! Modified bits are \b DAC12AMP_7 of \b DAC12_xCTL0 register.
299 //!
300 //! \return None
301 //
302 //*****************************************************************************
303 extern void DAC12_A_disable(uint16_t baseAddress,
304  uint8_t submoduleSelect);
305 
306 //*****************************************************************************
307 //
308 //! \brief Enables grouping of two DAC12_A modules in a dual DAC12_A system.
309 //!
310 //! This function enables grouping two DAC12_A modules in a dual DAC12_A
311 //! system. Both DAC12_A modules will work in sync, converting data at the same
312 //! time. To convert data, the same trigger should be set for both DAC12_A
313 //! modules during initialization (which should not be
314 //! DAC12_A_TRIGGER_ENCBYPASS), the enableConversions() function needs to be
315 //! called with both DAC12_A modules, and data needs to be set for both DAC12_A
316 //! modules separately.
317 //!
318 //! \param baseAddress is the base address of the DAC12_A module.
319 //!
320 //! Modified bits are \b DAC12GRP of \b DAC12_xCTL0 register.
321 //!
322 //! \return None
323 //
324 //*****************************************************************************
325 extern void DAC12_A_enableGrouping(uint16_t baseAddress);
326 
327 //*****************************************************************************
328 //
329 //! \brief Disables grouping of two DAC12_A modules in a dual DAC12_A system.
330 //!
331 //! This function disables grouping of two DAC12_A modules in a dual DAC12_A
332 //! system.
333 //!
334 //! \param baseAddress is the base address of the DAC12_A module.
335 //!
336 //! \return None
337 //
338 //*****************************************************************************
339 extern void DAC12_A_disableGrouping(uint16_t baseAddress);
340 
341 //*****************************************************************************
342 //
343 //! \brief Enables the DAC12_A module interrupt source.
344 //!
345 //! This function to enable the DAC12_A module interrupt, which throws an
346 //! interrupt when the data buffer is available for new data to be set. Only
347 //! the sources that are enabled can be reflected to the processor interrupt;
348 //! disabled sources have no effect on the processor. Note that an interrupt is
349 //! not thrown when DAC12_A_TRIGGER_ENCBYPASS has been set for the parameter
350 //! conversionTriggerSelect in initialization. Does not clear interrupt flags.
351 //!
352 //! \param baseAddress is the base address of the DAC12_A module.
353 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
354 //! Valid values are:
355 //! - \b DAC12_A_SUBMODULE_0
356 //! - \b DAC12_A_SUBMODULE_1
357 //!
358 //! \return None
359 //
360 //*****************************************************************************
361 extern void DAC12_A_enableInterrupt(uint16_t baseAddress,
362  uint8_t submoduleSelect);
363 
364 //*****************************************************************************
365 //
366 //! \brief Disables the DAC12_A module interrupt source.
367 //!
368 //! Enables the DAC12_A module interrupt source. Only the sources that are
369 //! enabled can be reflected to the processor interrupt; disabled sources have
370 //! no effect on the processor.
371 //!
372 //! \param baseAddress is the base address of the DAC12_A module.
373 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
374 //! Valid values are:
375 //! - \b DAC12_A_SUBMODULE_0
376 //! - \b DAC12_A_SUBMODULE_1
377 //!
378 //! \return None
379 //
380 //*****************************************************************************
381 extern void DAC12_A_disableInterrupt(uint16_t baseAddress,
382  uint8_t submoduleSelect);
383 
384 //*****************************************************************************
385 //
386 //! \brief Returns the status of the DAC12_A module interrupt flag.
387 //!
388 //! This function returns the status of the DAC12_A module interrupt flag. Note
389 //! that an interrupt is not thrown when DAC12_A_TRIGGER_ENCBYPASS has been set
390 //! for the conversionTriggerSelect parameter in initialization.
391 //!
392 //! \param baseAddress is the base address of the DAC12_A module.
393 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
394 //! Valid values are:
395 //! - \b DAC12_A_SUBMODULE_0
396 //! - \b DAC12_A_SUBMODULE_1
397 //!
398 //! \return One of the following:
399 //! - \b DAC12_A_INT_ACTIVE
400 //! - \b DAC12_A_INT_INACTIVE
401 //! \n indicating the status for the selected DAC12_A module
402 //
403 //*****************************************************************************
404 extern uint16_t DAC12_A_getInterruptStatus(uint16_t baseAddress,
405  uint8_t submoduleSelect);
406 
407 //*****************************************************************************
408 //
409 //! \brief Clears the DAC12_A module interrupt flag.
410 //!
411 //! The DAC12_A module interrupt flag is cleared, so that it no longer asserts.
412 //! Note that an interrupt is not thrown when DAC12_A_TRIGGER_ENCBYPASS has
413 //! been set for the parameter conversionTriggerSelect in initialization.
414 //!
415 //! \param baseAddress is the base address of the DAC12_A module.
416 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
417 //! Valid values are:
418 //! - \b DAC12_A_SUBMODULE_0
419 //! - \b DAC12_A_SUBMODULE_1
420 //!
421 //! Modified bits are \b DAC12IFG of \b DAC12_xCTL0 register.
422 //!
423 //! \return None
424 //
425 //*****************************************************************************
426 extern void DAC12_A_clearInterrupt(uint16_t baseAddress,
427  uint8_t submoduleSelect);
428 
429 //*****************************************************************************
430 //
431 //! \brief Calibrates the output offset.
432 //!
433 //! This function disables the calibration lock, starts the calibration, whats
434 //! for the calibration to complete, and then re-locks the calibration lock.
435 //! Please note, this function should be called after initializing the dac12
436 //! module, and before using it.
437 //!
438 //! \param baseAddress is the base address of the DAC12_A module.
439 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
440 //! Valid values are:
441 //! - \b DAC12_A_SUBMODULE_0
442 //! - \b DAC12_A_SUBMODULE_1
443 //!
444 //! Modified bits are \b DAC12CALON of \b DAC12_xCTL0 register; bits \b DAC12PW
445 //! of \b DAC12_xCALCTL register.
446 //!
447 //! \return None
448 //
449 //*****************************************************************************
450 extern void DAC12_A_calibrateOutput(uint16_t baseAddress,
451  uint8_t submoduleSelect);
452 
453 //*****************************************************************************
454 //
455 //! \brief Returns the calibrated offset of the output buffer.
456 //!
457 //! This function returns the calibrated offset of the output buffer. The
458 //! output buffer offset is used to obtain accurate results from the output
459 //! pin. This function should only be used while the calibration lock is
460 //! enabled. Only the lower byte of the word of the register is returned, and
461 //! the value is between -128 and +127.
462 //!
463 //! \param baseAddress is the base address of the DAC12_A module.
464 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
465 //! Valid values are:
466 //! - \b DAC12_A_SUBMODULE_0
467 //! - \b DAC12_A_SUBMODULE_1
468 //!
469 //! \return The calibrated offset of the output buffer.
470 //
471 //*****************************************************************************
472 extern uint16_t DAC12_A_getCalibrationData(uint16_t baseAddress,
473  uint8_t submoduleSelect);
474 
475 //*****************************************************************************
476 //
477 //! \brief Returns the calibrated offset of the output buffer.
478 //!
479 //! This function is used to manually set the calibration offset value. The
480 //! calibration is automatically unlocked and re-locked to be able to allow for
481 //! the offset value to be set.
482 //!
483 //! \param baseAddress is the base address of the DAC12_A module.
484 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
485 //! Valid values are:
486 //! - \b DAC12_A_SUBMODULE_0
487 //! - \b DAC12_A_SUBMODULE_1
488 //! \param calibrationOffsetValue calibration offset value
489 //!
490 //! Modified bits are \b DAC12LOCK of \b DAC12_xCALDAT register; bits \b
491 //! DAC12PW of \b DAC12_xCTL0 register; bits \b DAC12PW of \b DAC12_xCALCTL
492 //! register.
493 //!
494 //! \return None
495 //
496 //*****************************************************************************
497 extern void DAC12_A_setCalibrationOffset(uint16_t baseAddress,
498  uint8_t submoduleSelect,
499  uint16_t calibrationOffsetValue);
500 
501 //*****************************************************************************
502 //
503 //! \brief Enables triggers to start conversions.
504 //!
505 //! This function is used to allow triggers to start a conversion. Note that
506 //! this function does not need to be used if DAC12_A_TRIGGER_ENCBYPASS was set
507 //! for the conversionTriggerSelect parameter during initialization. If DAC
508 //! grouping is enabled, this has to be called for both DAC's.
509 //!
510 //! \param baseAddress is the base address of the DAC12_A module.
511 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
512 //! Valid values are:
513 //! - \b DAC12_A_SUBMODULE_0
514 //! - \b DAC12_A_SUBMODULE_1
515 //!
516 //! Modified bits are \b DAC12ENC of \b DAC12_xCTL0 register.
517 //!
518 //! \return None
519 //
520 //*****************************************************************************
521 extern void DAC12_A_enableConversions(uint16_t baseAddress,
522  uint8_t submoduleSelect);
523 
524 //*****************************************************************************
525 //
526 //! \brief Sets the given data into the buffer to be converted.
527 //!
528 //! This function is used to set the given data into the data buffer of the
529 //! DAC12_A module. The data given should be in the format set (12-bit
530 //! Unsigned, Right-justified by default). Note if DAC12_A_TRIGGER_ENCBYPASS
531 //! was set for the conversionTriggerSelect during initialization then using
532 //! this function will set the data and automatically trigger a conversion. If
533 //! any other trigger was set during initialization, then the
534 //! DAC12_A_enableConversions() function needs to be called before a conversion
535 //! can be started. If grouping DAC's and DAC12_A_TRIGGER_ENC was set during
536 //! initialization, then both data buffers must be set before a conversion will
537 //! be started.
538 //!
539 //! \param baseAddress is the base address of the DAC12_A module.
540 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
541 //! Valid values are:
542 //! - \b DAC12_A_SUBMODULE_0
543 //! - \b DAC12_A_SUBMODULE_1
544 //! \param data is the data to be set into the DAC12_A data buffer to be
545 //! converted.
546 //! \n Modified bits are \b DAC12_DATA of \b DAC12_xDAT register.
547 //!
548 //! Modified bits of \b DAC12_xDAT register.
549 //!
550 //! \return None
551 //
552 //*****************************************************************************
553 extern void DAC12_A_setData(uint16_t baseAddress,
554  uint8_t submoduleSelect,
555  uint16_t data);
556 
557 //*****************************************************************************
558 //
559 //! \brief Disables triggers to start conversions.
560 //!
561 //! This function is used to disallow triggers to start a conversion. Note that
562 //! this function does not have any affect if DAC12_A_TRIGGER_ENCBYPASS was set
563 //! for the conversionTriggerSelect parameter during initialization.
564 //!
565 //! \param baseAddress is the base address of the DAC12_A module.
566 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
567 //! Valid values are:
568 //! - \b DAC12_A_SUBMODULE_0
569 //! - \b DAC12_A_SUBMODULE_1
570 //!
571 //! Modified bits are \b DAC12ENC of \b DAC12_xCTL0 register.
572 //!
573 //! \return None
574 //
575 //*****************************************************************************
576 extern void DAC12_A_disableConversions(uint16_t baseAddress,
577  uint8_t submoduleSelect);
578 
579 //*****************************************************************************
580 //
581 //! \brief Sets the resolution to be used by the DAC12_A module.
582 //!
583 //! This function sets the resolution of the data to be converted.
584 //!
585 //! \param baseAddress is the base address of the DAC12_A module.
586 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
587 //! Valid values are:
588 //! - \b DAC12_A_SUBMODULE_0
589 //! - \b DAC12_A_SUBMODULE_1
590 //! \param resolutionSelect is the resolution to use for conversions.
591 //! Valid values are:
592 //! - \b DAC12_A_RESOLUTION_8BIT
593 //! - \b DAC12_A_RESOLUTION_12BIT [Default]
594 //! \n Modified bits are \b DAC12RES of \b DAC12_xCTL0 register.
595 //!
596 //! Modified bits are \b DAC12ENC and \b DAC12RES of \b DAC12_xCTL0 register.
597 //!
598 //! \return None
599 //
600 //*****************************************************************************
601 extern void DAC12_A_setResolution(uint16_t baseAddress,
602  uint8_t submoduleSelect,
603  uint16_t resolutionSelect);
604 
605 //*****************************************************************************
606 //
607 //! \brief Sets the input data format for the DAC12_A module.
608 //!
609 //! This function sets the input format for the binary data to be converted.
610 //!
611 //! \param baseAddress is the base address of the DAC12_A module.
612 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
613 //! Valid values are:
614 //! - \b DAC12_A_SUBMODULE_0
615 //! - \b DAC12_A_SUBMODULE_1
616 //! \param inputJustification is the justification of the data to be converted.
617 //! Valid values are:
618 //! - \b DAC12_A_JUSTIFICATION_RIGHT [Default]
619 //! - \b DAC12_A_JUSTIFICATION_LEFT
620 //! \n Modified bits are \b DAC12DFJ of \b DAC12_xCTL1 register.
621 //! \param inputSign is the sign of the data to be converted.
622 //! Valid values are:
623 //! - \b DAC12_A_UNSIGNED_BINARY [Default]
624 //! - \b DAC12_A_SIGNED_2SCOMPLEMENT
625 //! \n Modified bits are \b DAC12DF of \b DAC12_xCTL0 register.
626 //!
627 //! \return None
628 //
629 //*****************************************************************************
630 extern void DAC12_A_setInputDataFormat(uint16_t baseAddress,
631  uint8_t submoduleSelect,
632  uint8_t inputJustification,
633  uint8_t inputSign);
634 
635 //*****************************************************************************
636 //
637 //! \brief Returns the address of the specified DAC12_A data buffer for the DMA
638 //! module.
639 //!
640 //! Returns the address of the specified memory buffer. This can be used in
641 //! conjunction with the DMA to obtain the data directly from memory.
642 //!
643 //! \param baseAddress is the base address of the DAC12_A module.
644 //! \param submoduleSelect decides which DAC12_A sub-module to configure.
645 //! Valid values are:
646 //! - \b DAC12_A_SUBMODULE_0
647 //! - \b DAC12_A_SUBMODULE_1
648 //!
649 //! \return The address of the specified memory buffer
650 //
651 //*****************************************************************************
652 extern uint32_t DAC12_A_getDataBufferMemoryAddressForDMA(uint16_t baseAddress,
653  uint8_t submoduleSelect);
654 
655 //*****************************************************************************
656 //
657 // Mark the end of the C bindings section for C++ compilers.
658 //
659 //*****************************************************************************
660 #ifdef __cplusplus
661 }
662 #endif
663 
664 #endif
665 #endif // __MSP430WARE_DAC12_A_H__
void DAC12_A_enableInterrupt(uint16_t baseAddress, uint8_t submoduleSelect)
Enables the DAC12_A module interrupt source.
Definition: dac12_a.c:68
uint16_t positiveReferenceVoltage
Definition: dac12_a.h:50
void DAC12_A_setCalibrationOffset(uint16_t baseAddress, uint8_t submoduleSelect, uint16_t calibrationOffsetValue)
Returns the calibrated offset of the output buffer.
Definition: dac12_a.c:115
void DAC12_A_setAmplifierSetting(uint16_t baseAddress, uint8_t submoduleSelect, uint8_t amplifierSetting)
Sets the amplifier settings for the Vref+ and Vout buffers.
Definition: dac12_a.c:42
Used in the DAC12_A_init() function as the param parameter.
Definition: dac12_a.h:31
void DAC12_A_calibrateOutput(uint16_t baseAddress, uint8_t submoduleSelect)
Calibrates the output offset.
Definition: dac12_a.c:92
void DAC12_A_disableGrouping(uint16_t baseAddress)
Disables grouping of two DAC12_A modules in a dual DAC12_A system.
Definition: dac12_a.c:63
uint16_t DAC12_A_getCalibrationData(uint16_t baseAddress, uint8_t submoduleSelect)
Returns the calibrated offset of the output buffer.
Definition: dac12_a.c:109
uint16_t DAC12_A_getInterruptStatus(uint16_t baseAddress, uint8_t submoduleSelect)
Returns the status of the DAC12_A module interrupt flag.
Definition: dac12_a.c:80
uint8_t submoduleSelect
Definition: dac12_a.h:36
void DAC12_A_setInputDataFormat(uint16_t baseAddress, uint8_t submoduleSelect, uint8_t inputJustification, uint8_t inputSign)
Sets the input data format for the DAC12_A module.
Definition: dac12_a.c:171
void DAC12_A_clearInterrupt(uint16_t baseAddress, uint8_t submoduleSelect)
Clears the DAC12_A module interrupt flag.
Definition: dac12_a.c:86
uint8_t amplifierSetting
Definition: dac12_a.h:80
void DAC12_A_enableConversions(uint16_t baseAddress, uint8_t submoduleSelect)
Enables triggers to start conversions.
Definition: dac12_a.c:131
bool DAC12_A_init(uint16_t baseAddress, DAC12_A_initParam *param)
Initializes the DAC12_A module with the specified settings.
Definition: dac12_a.c:21
void DAC12_A_enableGrouping(uint16_t baseAddress)
Enables grouping of two DAC12_A modules in a dual DAC12_A system.
Definition: dac12_a.c:58
void DAC12_A_setData(uint16_t baseAddress, uint8_t submoduleSelect, uint16_t data)
Sets the given data into the buffer to be converted.
Definition: dac12_a.c:137
uint16_t outputVoltageMultiplier
Definition: dac12_a.h:56
void DAC12_A_disableInterrupt(uint16_t baseAddress, uint8_t submoduleSelect)
Disables the DAC12_A module interrupt source.
Definition: dac12_a.c:74
uint16_t conversionTriggerSelect
Definition: dac12_a.h:97
uint32_t DAC12_A_getDataBufferMemoryAddressForDMA(uint16_t baseAddress, uint8_t submoduleSelect)
Returns the address of the specified DAC12_A data buffer for the DMA module.
Definition: dac12_a.c:199
void DAC12_A_disable(uint16_t baseAddress, uint8_t submoduleSelect)
Clears the amplifier settings to disable the DAC12_A module.
Definition: dac12_a.c:51
void DAC12_A_disableConversions(uint16_t baseAddress, uint8_t submoduleSelect)
Disables triggers to start conversions.
Definition: dac12_a.c:144
uint16_t outputSelect
Definition: dac12_a.h:41
void DAC12_A_setResolution(uint16_t baseAddress, uint8_t submoduleSelect, uint16_t resolutionSelect)
Sets the resolution to be used by the DAC12_A module.
Definition: dac12_a.c:150

Copyright 2020, Texas Instruments Incorporated