MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
dac12_a

Functions

bool DAC12_A_init (uint16_t baseAddress, DAC12_A_initParam *param)
 Initializes the DAC12_A module with the specified settings. More...
 
void DAC12_A_setAmplifierSetting (uint16_t baseAddress, uint8_t submoduleSelect, uint8_t amplifierSetting)
 Sets the amplifier settings for the Vref+ and Vout buffers. More...
 
void DAC12_A_disable (uint16_t baseAddress, uint8_t submoduleSelect)
 Clears the amplifier settings to disable the DAC12_A module. More...
 
void DAC12_A_enableGrouping (uint16_t baseAddress)
 Enables grouping of two DAC12_A modules in a dual DAC12_A system. More...
 
void DAC12_A_disableGrouping (uint16_t baseAddress)
 Disables grouping of two DAC12_A modules in a dual DAC12_A system. More...
 
void DAC12_A_enableInterrupt (uint16_t baseAddress, uint8_t submoduleSelect)
 Enables the DAC12_A module interrupt source. More...
 
void DAC12_A_disableInterrupt (uint16_t baseAddress, uint8_t submoduleSelect)
 Disables the DAC12_A module interrupt source. More...
 
uint16_t DAC12_A_getInterruptStatus (uint16_t baseAddress, uint8_t submoduleSelect)
 Returns the status of the DAC12_A module interrupt flag. More...
 
void DAC12_A_clearInterrupt (uint16_t baseAddress, uint8_t submoduleSelect)
 Clears the DAC12_A module interrupt flag. More...
 
void DAC12_A_calibrateOutput (uint16_t baseAddress, uint8_t submoduleSelect)
 Calibrates the output offset. More...
 
uint16_t DAC12_A_getCalibrationData (uint16_t baseAddress, uint8_t submoduleSelect)
 Returns the calibrated offset of the output buffer. More...
 
void DAC12_A_setCalibrationOffset (uint16_t baseAddress, uint8_t submoduleSelect, uint16_t calibrationOffsetValue)
 Returns the calibrated offset of the output buffer. More...
 
void DAC12_A_enableConversions (uint16_t baseAddress, uint8_t submoduleSelect)
 Enables triggers to start conversions. More...
 
void DAC12_A_setData (uint16_t baseAddress, uint8_t submoduleSelect, uint16_t data)
 Sets the given data into the buffer to be converted. More...
 
void DAC12_A_disableConversions (uint16_t baseAddress, uint8_t submoduleSelect)
 Disables triggers to start conversions. More...
 
void DAC12_A_setResolution (uint16_t baseAddress, uint8_t submoduleSelect, uint16_t resolutionSelect)
 Sets the resolution to be used by the DAC12_A module. More...
 
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. More...
 
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. More...
 

Detailed Description

Function Documentation

§ DAC12_A_calibrateOutput()

void DAC12_A_calibrateOutput ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Calibrates the output offset.

This function disables the calibration lock, starts the calibration, whats for the calibration to complete, and then re-locks the calibration lock. Please note, this function should be called after initializing the dac12 module, and before using it.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1

Modified bits are DAC12CALON of DAC12_xCTL0 register; bits DAC12PW of DAC12_xCALCTL register.

Returns
None

§ DAC12_A_clearInterrupt()

void DAC12_A_clearInterrupt ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Clears the DAC12_A module interrupt flag.

The DAC12_A module interrupt flag is cleared, so that it no longer asserts. Note that an interrupt is not thrown when DAC12_A_TRIGGER_ENCBYPASS has been set for the parameter conversionTriggerSelect in initialization.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1

Modified bits are DAC12IFG of DAC12_xCTL0 register.

Returns
None

§ DAC12_A_disable()

void DAC12_A_disable ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Clears the amplifier settings to disable the DAC12_A module.

This function clears the amplifier settings for the selected DAC12_A module to disable the DAC12_A module.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1

Modified bits are DAC12AMP_7 of DAC12_xCTL0 register.

Returns
None

§ DAC12_A_disableConversions()

void DAC12_A_disableConversions ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Disables triggers to start conversions.

This function is used to disallow triggers to start a conversion. Note that this function does not have any affect if DAC12_A_TRIGGER_ENCBYPASS was set for the conversionTriggerSelect parameter during initialization.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1

Modified bits are DAC12ENC of DAC12_xCTL0 register.

Returns
None

§ DAC12_A_disableGrouping()

void DAC12_A_disableGrouping ( uint16_t  baseAddress)

Disables grouping of two DAC12_A modules in a dual DAC12_A system.

This function disables grouping of two DAC12_A modules in a dual DAC12_A system.

Parameters
baseAddressis the base address of the DAC12_A module.
Returns
None

§ DAC12_A_disableInterrupt()

void DAC12_A_disableInterrupt ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Disables the DAC12_A module interrupt source.

Enables the DAC12_A module interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
Returns
None

§ DAC12_A_enableConversions()

void DAC12_A_enableConversions ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Enables triggers to start conversions.

This function is used to allow triggers to start a conversion. Note that this function does not need to be used if DAC12_A_TRIGGER_ENCBYPASS was set for the conversionTriggerSelect parameter during initialization. If DAC grouping is enabled, this has to be called for both DAC's.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1

Modified bits are DAC12ENC of DAC12_xCTL0 register.

Returns
None

§ DAC12_A_enableGrouping()

void DAC12_A_enableGrouping ( uint16_t  baseAddress)

Enables grouping of two DAC12_A modules in a dual DAC12_A system.

This function enables grouping two DAC12_A modules in a dual DAC12_A system. Both DAC12_A modules will work in sync, converting data at the same time. To convert data, the same trigger should be set for both DAC12_A modules during initialization (which should not be DAC12_A_TRIGGER_ENCBYPASS), the enableConversions() function needs to be called with both DAC12_A modules, and data needs to be set for both DAC12_A modules separately.

Parameters
baseAddressis the base address of the DAC12_A module.

Modified bits are DAC12GRP of DAC12_xCTL0 register.

Returns
None

§ DAC12_A_enableInterrupt()

void DAC12_A_enableInterrupt ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Enables the DAC12_A module interrupt source.

This function to enable the DAC12_A module interrupt, which throws an interrupt when the data buffer is available for new data to be set. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Note that an interrupt is not thrown when DAC12_A_TRIGGER_ENCBYPASS has been set for the parameter conversionTriggerSelect in initialization. Does not clear interrupt flags.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
Returns
None

§ DAC12_A_getCalibrationData()

uint16_t DAC12_A_getCalibrationData ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Returns the calibrated offset of the output buffer.

This function returns the calibrated offset of the output buffer. The output buffer offset is used to obtain accurate results from the output pin. This function should only be used while the calibration lock is enabled. Only the lower byte of the word of the register is returned, and the value is between -128 and +127.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
Returns
The calibrated offset of the output buffer.

§ DAC12_A_getDataBufferMemoryAddressForDMA()

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.

Returns the address of the specified memory buffer. This can be used in conjunction with the DMA to obtain the data directly from memory.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
Returns
The address of the specified memory buffer

§ DAC12_A_getInterruptStatus()

uint16_t DAC12_A_getInterruptStatus ( uint16_t  baseAddress,
uint8_t  submoduleSelect 
)

Returns the status of the DAC12_A module interrupt flag.

This function returns the status of the DAC12_A module interrupt flag. Note that an interrupt is not thrown when DAC12_A_TRIGGER_ENCBYPASS has been set for the conversionTriggerSelect parameter in initialization.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
Returns
One of the following:
  • DAC12_A_INT_ACTIVE
  • DAC12_A_INT_INACTIVE
    indicating the status for the selected DAC12_A module

§ DAC12_A_init()

bool DAC12_A_init ( uint16_t  baseAddress,
DAC12_A_initParam param 
)

Initializes the DAC12_A module with the specified settings.

This function initializes the DAC12_A module with the specified settings. Upon successful completion of the initialization of this module the control registers and interrupts of this module are all reset, and the specified variables will be set. Please note, that if conversions are enabled with the enableConversions() function, then disableConversions() must be called before re-initializing the DAC12_A module with this function.

Parameters
baseAddressis the base address of the DAC12_A module.
paramis the pointer to struct for initialization.
Returns
STATUS_SUCCESS or STATUS_FAILURE of the initialization process.

References DAC12_A_initParam::amplifierSetting, DAC12_A_initParam::conversionTriggerSelect, DAC12_A_initParam::outputSelect, DAC12_A_initParam::outputVoltageMultiplier, DAC12_A_initParam::positiveReferenceVoltage, and DAC12_A_initParam::submoduleSelect.

§ DAC12_A_setAmplifierSetting()

void DAC12_A_setAmplifierSetting ( uint16_t  baseAddress,
uint8_t  submoduleSelect,
uint8_t  amplifierSetting 
)

Sets the amplifier settings for the Vref+ and Vout buffers.

This function sets the amplifier settings of the DAC12_A module for the Vref+ and Vout buffers without re-initializing the DAC12_A module. This can be used to disable the control of the pin by the DAC12_A module.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
amplifierSettingis the setting of the settling speed and current of the Vref+ and the Vout buffer. Valid values are:
  • DAC12_A_AMP_OFF_PINOUTHIGHZ [Default] - Initialize the DAC12_A Module with settings, but do not turn it on.
  • DAC12_A_AMP_OFF_PINOUTLOW - Initialize the DAC12_A Module with settings, and allow it to take control of the selected output pin to pull it low (Note: this takes control away port mapping module).
  • DAC12_A_AMP_LOWIN_LOWOUT - Select a slow settling speed and current for Vref+ input buffer and for Vout output buffer.
  • DAC12_A_AMP_LOWIN_MEDOUT - Select a slow settling speed and current for Vref+ input buffer and a medium settling speed and current for Vout output buffer.
  • DAC12_A_AMP_LOWIN_HIGHOUT - Select a slow settling speed and current for Vref+ input buffer and a high settling speed and current for Vout output buffer.
  • DAC12_A_AMP_MEDIN_MEDOUT - Select a medium settling speed and current for Vref+ input buffer and for Vout output buffer.
  • DAC12_A_AMP_MEDIN_HIGHOUT - Select a medium settling speed and current for Vref+ input buffer and a high settling speed and current for Vout output buffer.
  • DAC12_A_AMP_HIGHIN_HIGHOUT - Select a high settling speed and current for Vref+ input buffer and for Vout output buffer.
Returns
None

§ DAC12_A_setCalibrationOffset()

void DAC12_A_setCalibrationOffset ( uint16_t  baseAddress,
uint8_t  submoduleSelect,
uint16_t  calibrationOffsetValue 
)

Returns the calibrated offset of the output buffer.

This function is used to manually set the calibration offset value. The calibration is automatically unlocked and re-locked to be able to allow for the offset value to be set.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
calibrationOffsetValuecalibration offset value

Modified bits are DAC12LOCK of DAC12_xCALDAT register; bits DAC12PW of DAC12_xCTL0 register; bits DAC12PW of DAC12_xCALCTL register.

Returns
None

§ DAC12_A_setData()

void DAC12_A_setData ( uint16_t  baseAddress,
uint8_t  submoduleSelect,
uint16_t  data 
)

Sets the given data into the buffer to be converted.

This function is used to set the given data into the data buffer of the DAC12_A module. The data given should be in the format set (12-bit Unsigned, Right-justified by default). Note if DAC12_A_TRIGGER_ENCBYPASS was set for the conversionTriggerSelect during initialization then using this function will set the data and automatically trigger a conversion. If any other trigger was set during initialization, then the DAC12_A_enableConversions() function needs to be called before a conversion can be started. If grouping DAC's and DAC12_A_TRIGGER_ENC was set during initialization, then both data buffers must be set before a conversion will be started.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
datais the data to be set into the DAC12_A data buffer to be converted.
Modified bits are DAC12_DATA of DAC12_xDAT register.

Modified bits of DAC12_xDAT register.

Returns
None

§ DAC12_A_setInputDataFormat()

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.

This function sets the input format for the binary data to be converted.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
inputJustificationis the justification of the data to be converted. Valid values are:
  • DAC12_A_JUSTIFICATION_RIGHT [Default]
  • DAC12_A_JUSTIFICATION_LEFT
    Modified bits are DAC12DFJ of DAC12_xCTL1 register.
inputSignis the sign of the data to be converted. Valid values are:
  • DAC12_A_UNSIGNED_BINARY [Default]
  • DAC12_A_SIGNED_2SCOMPLEMENT
    Modified bits are DAC12DF of DAC12_xCTL0 register.
Returns
None

§ DAC12_A_setResolution()

void DAC12_A_setResolution ( uint16_t  baseAddress,
uint8_t  submoduleSelect,
uint16_t  resolutionSelect 
)

Sets the resolution to be used by the DAC12_A module.

This function sets the resolution of the data to be converted.

Parameters
baseAddressis the base address of the DAC12_A module.
submoduleSelectdecides which DAC12_A sub-module to configure. Valid values are:
  • DAC12_A_SUBMODULE_0
  • DAC12_A_SUBMODULE_1
resolutionSelectis the resolution to use for conversions. Valid values are:
  • DAC12_A_RESOLUTION_8BIT
  • DAC12_A_RESOLUTION_12BIT [Default]
    Modified bits are DAC12RES of DAC12_xCTL0 register.

Modified bits are DAC12ENC and DAC12RES of DAC12_xCTL0 register.

Returns
None

Copyright 2020, Texas Instruments Incorporated