MSPM0GX51X Driver Library  2.05.00.05
Data Structures | Macros | Enumerations | Functions
dl_dac12.h File Reference

Detailed Description

12-bit DAC Driver Library


#include <stdbool.h>
#include <stdint.h>
#include <ti/devices/msp/msp.h>
#include <ti/driverlib/dl_common.h>
Include dependency graph for dl_dac12.h:

Go to the source code of this file.

Data Structures

struct  DL_DAC12_Config
 Configuration struct for DL_DAC12_init. More...
 

Macros

#define DL_DAC12_INTERRUPT_MODULE_READY   (DAC12_GEN_EVENT_IMASK_MODRDYIFG_SET)
 Interrupt raised when the module ready event has occurred.
 
#define DL_DAC12_INTERRUPT_FIFO_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFOEMPTYIFG_SET)
 Interrupt raised when the FIFO is empty.
 
#define DL_DAC12_INTERRUPT_FIFO_THREE_QTRS_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO3B4IFG_SET)
 Interrupt raised when the FIFO is 3/4th empty.
 
#define DL_DAC12_INTERRUPT_FIFO_TWO_QTRS_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO1B2IFG_SET)
 Interrupt raised when the FIFO is 2/4ths empty.
 
#define DL_DAC12_INTERRUPT_FIFO_ONE_QTR_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO1B4IFG_SET)
 Interrupt raised when the FIFO is 1/4th empty.
 
#define DL_DAC12_INTERRUPT_FIFO_FULL   (DAC12_GEN_EVENT_IMASK_FIFOFULLIFG_SET)
 Interrupt raised when the FIFO is full.
 
#define DL_DAC12_INTERRUPT_FIFO_UNDERRUN   (DAC12_GEN_EVENT_IMASK_FIFOURUNIFG_SET)
 Interrupt raised when the FIFO is underrun (tried to read from an empty FIFO)
 
#define DL_DAC12_INTERRUPT_DMA_DONE   (DAC12_GEN_EVENT_IMASK_DMADONEIFG_SET)
 Interrupt raised as an Acknowledgement to the DMA completing a transfer. More...
 
#define DL_DAC12_EVENT_MODULE_READY   (DAC12_GEN_EVENT_IMASK_MODRDYIFG_SET)
 Event raised when the module ready event has occurred.
 
#define DL_DAC12_EVENT_FIFO_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFOEMPTYIFG_SET)
 Event raised when the FIFO is empty.
 
#define DL_DAC12_EVENT_FIFO_THREE_QTRS_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO3B4IFG_SET)
 Event raised when the FIFO is 3/4th empty.
 
#define DL_DAC12_EVENT_FIFO_TWO_QTRS_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO1B2IFG_SET)
 Event raised when the FIFO is 2/4ths empty.
 
#define DL_DAC12_EVENT_FIFO_ONE_QTR_EMPTY   (DAC12_GEN_EVENT_IMASK_FIFO1B4IFG_SET)
 Event raised when the FIFO is 1/4th empty.
 
#define DL_DAC12_EVENT_FIFO_FULL   (DAC12_GEN_EVENT_IMASK_FIFOFULLIFG_SET)
 Event raised when the FIFO is full.
 
#define DL_DAC12_EVENT_FIFO_UNDERRUN   (DAC12_GEN_EVENT_IMASK_FIFOURUNIFG_SET)
 Event raised when the FIFO is underrun (tried to read from an empty FIFO)
 
#define DL_DAC12_EVENT_DMA_DONE   (DAC12_GEN_EVENT_IMASK_DMADONEIFG_SET)
 Event raised as an Acknowledgement to the DMA completing a transfer. More...
 

Enumerations

enum  DL_DAC12_OUTPUT {
  DL_DAC12_OUTPUT_DISABLED = DAC12_CTL1_OPS_NOC0,
  DL_DAC12_OUTPUT_ENABLED = DAC12_CTL1_OPS_OUT0
}
 
enum  DL_DAC12_REPRESENTATION {
  DL_DAC12_REPRESENTATION_BINARY = DAC12_CTL0_DFM_BINARY,
  DL_DAC12_REPRESENTATION_TWOS_COMPLEMENT = DAC12_CTL0_DFM_TWOS_COMP
}
 
enum  DL_DAC12_RESOLUTION {
  DL_DAC12_RESOLUTION_12BIT = DAC12_CTL0_RES__12BITS,
  DL_DAC12_RESOLUTION_8BIT = DAC12_CTL0_RES__8BITS
}
 
enum  DL_DAC12_AMP {
  DL_DAC12_AMP_OFF_TRISTATE = DAC12_CTL1_AMPHIZ_HIZ,
  DL_DAC12_AMP_OFF_0V = DAC12_CTL1_AMPHIZ_PULLDOWN,
  DL_DAC12_AMP_ON = DAC12_CTL1_AMPEN_ENABLE
}
 
enum  DL_DAC12_VREF_SOURCE {
  DL_DAC12_VREF_SOURCE_VDDA_VEREFN,
  DL_DAC12_VREF_SOURCE_VEREFP_VEREFN,
  DL_DAC12_VREF_SOURCE_VDDA_VSSA,
  DL_DAC12_VREF_SOURCE_VEREFP_VSSA
}
 
enum  DL_DAC12_SAMPLETIMER {
  DL_DAC12_SAMPLETIMER_DISABLE = DAC12_CTL3_STIMEN_CLR,
  DL_DAC12_SAMPLETIMER_ENABLE = DAC12_CTL3_STIMEN_SET
}
 
enum  DL_DAC12_SAMPLES_PER_SECOND {
  DL_DAC12_SAMPLES_PER_SECOND_500 = DAC12_CTL3_STIMCONFIG__500SPS,
  DL_DAC12_SAMPLES_PER_SECOND_1K = DAC12_CTL3_STIMCONFIG__1KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_2K = DAC12_CTL3_STIMCONFIG__2KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_4K = DAC12_CTL3_STIMCONFIG__4KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_8K = DAC12_CTL3_STIMCONFIG__8KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_16K = DAC12_CTL3_STIMCONFIG__16KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_100K = DAC12_CTL3_STIMCONFIG__100KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_200K = DAC12_CTL3_STIMCONFIG__200KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_500K = DAC12_CTL3_STIMCONFIG__500KSPS,
  DL_DAC12_SAMPLES_PER_SECOND_1M = DAC12_CTL3_STIMCONFIG__1MSPS
}
 
enum  DL_DAC12_FIFO {
  DL_DAC12_FIFO_DISABLED = DAC12_CTL2_FIFOEN_CLR,
  DL_DAC12_FIFO_ENABLED = DAC12_CTL2_FIFOEN_SET
}
 
enum  DL_DAC12_FIFO_THRESHOLD {
  DL_DAC12_FIFO_THRESHOLD_ONE_QTR_EMPTY = DAC12_CTL2_FIFOTH_LOW,
  DL_DAC12_FIFO_THRESHOLD_TWO_QTRS_EMPTY = DAC12_CTL2_FIFOTH_MED,
  DL_DAC12_FIFO_THRESHOLD_THREE_QTRS_EMPTY = DAC12_CTL2_FIFOTH_HIGH
}
 
enum  DL_DAC12_FIFO_TRIGGER {
  DL_DAC12_FIFO_TRIGGER_SAMPLETIMER = DAC12_CTL2_FIFOTRIGSEL_STIM,
  DL_DAC12_FIFO_TRIGGER_HWTRIG0 = DAC12_CTL2_FIFOTRIGSEL_TRIG0
}
 
enum  DL_DAC12_DMA_TRIGGER {
  DL_DAC12_DMA_TRIGGER_DISABLED = DAC12_CTL2_DMATRIGEN_CLR,
  DL_DAC12_DMA_TRIGGER_ENABLED = DAC12_CTL2_DMATRIGEN_SET
}
 
enum  DL_DAC12_CALIBRATION {
  DL_DAC12_CALIBRATION_FACTORY = DAC12_CALCTL_CALSEL_FACTORYTRIM,
  DL_DAC12_CALIBRATION_SELF = DAC12_CALCTL_CALSEL_SELFCALIBRATIONTRIM
}
 
enum  DL_DAC12_IIDX {
  DL_DAC12_IIDX_NO_INT = DAC12_CPU_INT_IIDX_STAT_NO_INTR,
  DL_DAC12_IIDX_MODULE_READY = DAC12_CPU_INT_IIDX_STAT_MODRDYIFG,
  DL_DAC12_IIDX_FIFO_FULL = DAC12_CPU_INT_IIDX_STAT_FIFOFULLIFG,
  DL_DAC12_IIDX_FIFO_1_4_EMPTY = DAC12_CPU_INT_IIDX_STAT_FIFO1B4IFG,
  DL_DAC12_IIDX_FIFO_1_2_EMPTY = DAC12_CPU_INT_IIDX_STAT_FIFO1B2IFG,
  DL_DAC12_IIDX_FIFO_3_4_EMPTY = DAC12_CPU_INT_IIDX_STAT_FIFO3B4IFG,
  DL_DAC12_IIDX_FIFO_EMPTY = DAC12_CPU_INT_IIDX_STAT_FIFOEMPTYIFG,
  DL_DAC12_IIDX_FIFO_UNDERRUN = DAC12_CPU_INT_IIDX_STAT_FIFOURUNIFG,
  DL_DAC12_IIDX_DMA_DONE = DAC12_CPU_INT_IIDX_STAT_DMADONEIFG
}
 
enum  DL_DAC12_SUBSCRIBER_INDEX { DL_DAC12_SUBSCRIBER_INDEX_0 = 0 }
 
enum  DL_DAC12_EVENT_ROUTE { DL_DAC12_EVENT_ROUTE_1 = 0 }
 

Functions

void DL_DAC12_init (DAC12_Regs *dac12, const DL_DAC12_Config *config)
 Initialize the DAC module. More...
 
__STATIC_INLINE void DL_DAC12_enablePower (DAC12_Regs *dac12)
 Enables the Peripheral Write Enable (PWREN) register for the DAC12. More...
 
__STATIC_INLINE void DL_DAC12_disablePower (DAC12_Regs *dac12)
 Disables the Peripheral Write Enable (PWREN) register for the DAC12. More...
 
__STATIC_INLINE bool DL_DAC12_isPowerEnabled (const DAC12_Regs *dac12)
 Returns if the Peripheral Write Enable (PWREN) register for the DAC12 is enabled. More...
 
__STATIC_INLINE void DL_DAC12_reset (DAC12_Regs *dac12)
 Resets dac12 peripheral. More...
 
__STATIC_INLINE bool DL_DAC12_isReset (const DAC12_Regs *dac12)
 Returns if dac12 peripheral was reset. More...
 
__STATIC_INLINE void DL_DAC12_enable (DAC12_Regs *dac12)
 Enables the DAC module. More...
 
__STATIC_INLINE void DL_DAC12_disable (DAC12_Regs *dac12)
 Disables the DAC Module. More...
 
__STATIC_INLINE bool DL_DAC12_isEnabled (const DAC12_Regs *dac12)
 Checks the enable bit of the DAC. More...
 
__STATIC_INLINE void DL_DAC12_configDataFormat (DAC12_Regs *dac12, DL_DAC12_REPRESENTATION rep, DL_DAC12_RESOLUTION res)
 Sets all elements of the input data format at once. More...
 
__STATIC_INLINE DL_DAC12_AMP DL_DAC12_getAmplifier (const DAC12_Regs *dac12)
 Gets the currently configured amplifier setting. More...
 
__STATIC_INLINE void DL_DAC12_setAmplifier (DAC12_Regs *dac12, DL_DAC12_AMP ampVal)
 Sets the DAC and output amplifer setting. More...
 
__STATIC_INLINE DL_DAC12_VREF_SOURCE DL_DAC12_getReferenceVoltageSource (const DAC12_Regs *dac12)
 Gets the currently configured reference voltage source. More...
 
__STATIC_INLINE void DL_DAC12_setReferenceVoltageSource (DAC12_Regs *dac12, DL_DAC12_VREF_SOURCE refsVal)
 Set the reference voltage source of the DAC. More...
 
__STATIC_INLINE void DL_DAC12_enableOutputPin (DAC12_Regs *dac12)
 Enables the DAC output by connecting it to the OUT0 pin. More...
 
__STATIC_INLINE void DL_DAC12_disableOutputPin (DAC12_Regs *dac12)
 Disable the DAC output by disconnecting it from the OUT0 pin. More...
 
__STATIC_INLINE bool DL_DAC12_isOutputPinEnabled (const DAC12_Regs *dac12)
 Checks to see whether the output is connected. More...
 
__STATIC_INLINE void DL_DAC12_enableFIFO (DAC12_Regs *dac12)
 Enables the FIFO module. More...
 
__STATIC_INLINE void DL_DAC12_disableFIFO (DAC12_Regs *dac12)
 Disables the FIFO. More...
 
__STATIC_INLINE bool DL_DAC12_isFIFOEnabled (const DAC12_Regs *dac12)
 Checks whether the FIFO is enabled. More...
 
__STATIC_INLINE DL_DAC12_FIFO_THRESHOLD DL_DAC12_getFIFOThreshold (const DAC12_Regs *dac12)
 Gets the FIFO threshold. More...
 
__STATIC_INLINE void DL_DAC12_setFIFOThreshold (DAC12_Regs *dac12, DL_DAC12_FIFO_THRESHOLD fifoThreshold)
 Sets the FIFO threshold. More...
 
__STATIC_INLINE DL_DAC12_FIFO_TRIGGER DL_DAC12_getFIFOTriggerSource (const DAC12_Regs *dac12)
 Gets the FIFO read trigger source. More...
 
__STATIC_INLINE void DL_DAC12_setFIFOTriggerSource (DAC12_Regs *dac12, DL_DAC12_FIFO_TRIGGER fifoTrig)
 Sets the FIFO read trigger source. More...
 
__STATIC_INLINE void DL_DAC12_enableDMATrigger (DAC12_Regs *dac12)
 Enables the DMA trigger generator. More...
 
__STATIC_INLINE void DL_DAC12_disableDMATrigger (DAC12_Regs *dac12)
 Disables the DMA trigger generator. More...
 
__STATIC_INLINE bool DL_DAC12_isDMATriggerEnabled (const DAC12_Regs *dac12)
 Checks whether the DMA trigger generator is enabled. More...
 
__STATIC_INLINE void DL_DAC12_enableSampleTimeGenerator (DAC12_Regs *dac12)
 Enables the sample time generator. More...
 
__STATIC_INLINE void DL_DAC12_disableSampleTimeGenerator (DAC12_Regs *dac12)
 Disables the sample time generator. More...
 
__STATIC_INLINE bool DL_DAC12_isSampleTimeGeneratorEnabled (const DAC12_Regs *dac12)
 Checks whether the sample time trigger generator is enabled. More...
 
__STATIC_INLINE DL_DAC12_SAMPLES_PER_SECOND DL_DAC12_getSampleRate (const DAC12_Regs *dac12)
 Gets the sample trigger rate of the sample time generator. More...
 
__STATIC_INLINE void DL_DAC12_setSampleRate (DAC12_Regs *dac12, DL_DAC12_SAMPLES_PER_SECOND sampleRate)
 Sets the sample triggering rate of the sample time generator. More...
 
__STATIC_INLINE bool DL_DAC12_isCalibrationRunning (const DAC12_Regs *dac12)
 Checks whether a calibration sequence is currently running. More...
 
__STATIC_INLINE void DL_DAC12_startCalibration (DAC12_Regs *dac12)
 Initiates the DAC offset error calibration sequence. More...
 
__STATIC_INLINE uint32_t DL_DAC12_getCalibrationData (const DAC12_Regs *dac12)
 Gets the DAC Calibration offset. More...
 
void DL_DAC12_performSelfCalibrationBlocking (DAC12_Regs *dac12)
 Perform calibration sequence. More...
 
__STATIC_INLINE void DL_DAC12_output8 (DAC12_Regs *dac12, uint8_t dataValue)
 Outputs an 8-bit data value. More...
 
__STATIC_INLINE void DL_DAC12_output12 (DAC12_Regs *dac12, uint32_t dataValue)
 Outputs a 12-bit Data Value. More...
 
uint32_t DL_DAC12_fillFIFO8 (DAC12_Regs *dac12, const uint8_t *buffer, uint32_t count)
 Fills the DAC fifo with 8-bit data values from the buffer. More...
 
uint32_t DL_DAC12_fillFIFO12 (DAC12_Regs *dac12, const uint16_t *buffer, uint32_t count)
 Fills the DAC fifo with 12-bit data values from the buffer. More...
 
void DL_DAC12_outputBlocking8 (DAC12_Regs *dac12, uint8_t data)
 Blocking 8-bit output to the DAC FIFO. More...
 
void DL_DAC12_outputBlocking12 (DAC12_Regs *dac12, uint16_t data)
 Blocking 12-bit output to the DAC FIFO. More...
 
__STATIC_INLINE uint32_t DL_DAC12_getInterruptStatus (const DAC12_Regs *dac12, uint32_t interruptMask)
 Checks the raw interrupt status of one or more interrupts. More...
 
__STATIC_INLINE void DL_DAC12_clearInterruptStatus (DAC12_Regs *dac12, uint32_t interruptMask)
 Clears the interrupt status of one or more interrupts. More...
 
__STATIC_INLINE void DL_DAC12_enableInterrupt (DAC12_Regs *dac12, uint32_t interruptMask)
 Enables one or more interrupts. More...
 
__STATIC_INLINE void DL_DAC12_disableInterrupt (DAC12_Regs *dac12, uint32_t interruptMask)
 Disables one or more interrupts. More...
 
__STATIC_INLINE DL_DAC12_IIDX DL_DAC12_getPendingInterrupt (const DAC12_Regs *dac12)
 Gets the highest priority pending interrupt. More...
 
__STATIC_INLINE bool DL_DAC12_isFIFOFull (const DAC12_Regs *dac12)
 Checks if the DAC FIFO is currently full. More...
 
__STATIC_INLINE void DL_DAC12_setPublisherChanID (DAC12_Regs *dac12, uint8_t chanID)
 Sets the event publisher channel id. More...
 
__STATIC_INLINE uint8_t DL_DAC12_getPublisherChanID (const DAC12_Regs *dac12)
 Gets the event publisher channel id. More...
 
__STATIC_INLINE void DL_DAC12_setSubscriberChanID (DAC12_Regs *dac12, DL_DAC12_SUBSCRIBER_INDEX index, uint8_t chanID)
 Sets the event subscriber channel id. More...
 
__STATIC_INLINE uint8_t DL_DAC12_getSubscriberChanID (DAC12_Regs *dac12, DL_DAC12_SUBSCRIBER_INDEX index)
 Gets the event subscriber channel id. More...
 
__STATIC_INLINE void DL_DAC12_enableEvent (DAC12_Regs *dac12, uint32_t eventMask)
 Enable DAC event. More...
 
__STATIC_INLINE void DL_DAC12_disableEvent (DAC12_Regs *dac12, uint32_t eventMask)
 Disable DAC event. More...
 
__STATIC_INLINE uint32_t DL_DAC12_getEnabledEvents (const DAC12_Regs *dac12, uint32_t eventMask)
 Check which DAC events are enabled. More...
 
__STATIC_INLINE uint32_t DL_DAC12_getEnabledEventStatus (const DAC12_Regs *dac12, uint32_t eventMask)
 Check event flag of enabled DAC event. More...
 
__STATIC_INLINE uint32_t DL_DAC12_getRawEventsStatus (const DAC12_Regs *dac12, uint32_t eventMask)
 Check interrupt flag of any DAC event. More...
 
__STATIC_INLINE void DL_DAC12_clearEventsStatus (DAC12_Regs *dac12, uint32_t eventMask)
 Clear pending DAC events. More...
 
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale