Interface: moteiv.tos.platform.msp430.dac.MSP430DAC

interface MSP430DAC

HAL Interface for using the DAC on MSP430 microcontrollers.

Typical procedure of operation:

Intended process for single output:

  1. bind, specifically ref volt
  2. enable
  3. wait for enableDone
  4. enableOutput
  5. set
  6. do whatever
  7. disable
Intended process for multiple sequential outputs:
  1. bind, specifically ref volt -- load select bits ignored (reset later)
  2. enable
  3. wait for enableDone
  4. enableOutput
  5. setSequence / Repeat -- use the DMA and TimerA
  6. do whatever
  7. disable

Author:
Joe Polastre, Moteiv Corporation

Commands
command result_t bind(dac12ref_t reference, dac12res_t resolution, dac12load_t loadselect, dac12fsout_t fsout, dac12amp_t amp, dac12df_t dataformat, dac12group_t group) Bind settings to the DAC.
command result_t disable() Disable/Turn off the DAC port.
command result_t disableOutput() Enable DAC output.
command result_t enable() Enable/Turn on the DAC.
command result_t enableOutput() Disable DAC output.
command result_t set(uint16_t dacunits) Set the value, fails if sequence or repeat in progress.

Events
event void disableDone(result_t success) Notification that the DAC has been disabled with the result code.
event void enableDone(result_t success) Notification that the DAC has been enabled with the resulting status.

Commands - Details

bind

command result_t bind(dac12ref_t reference, dac12res_t resolution, dac12load_t loadselect, dac12fsout_t fsout, dac12amp_t amp, dac12df_t dataformat, dac12group_t group)

Bind settings to the DAC. See MSP430DAC12.h for a full description of possible settings for each of the parameters.

disable

command result_t disable()

Disable/Turn off the DAC port. The release is dependent on the reference voltage.

Returns:
SUCCESS if possible to disable at this time.

disableOutput

command result_t disableOutput()

Enable DAC output.

enable

command result_t enable()

Enable/Turn on the DAC. Starts the process of acquiring the correct reference voltage and calibrating the DAC output if necessary.

Returns:
SUCCESS if the DAC can start now.

enableOutput

command result_t enableOutput()

Disable DAC output.

set

command result_t set(uint16_t dacunits)

Set the value, fails if sequence or repeat in progress.

Events - Details

disableDone

event void disableDone(result_t success)

Notification that the DAC has been disabled with the result code.

enableDone

event void enableDone(result_t success)

Notification that the DAC has been enabled with the resulting status.