![]() |
![]() |
|
MSPM0G1X0X_G3X0X Driver Library
1.10.01.05
|
|
Modules | |
| DL_DAC12_INTERRUPT | |
| DL_DAC12_EVENT | |
Data Structures | |
| struct | DL_DAC12_Config |
| Configuration struct for DL_DAC12_init. More... | |
Functions | |
| void | DL_DAC12_init (DAC12_Regs *dac12, DL_DAC12_Config *config) |
| Initialize the DAC module. More... | |
| __STATIC_INLINE void | DL_DAC12_enablePower (DAC12_Regs *dac12) |
| Enables power on DAC12 module. More... | |
| __STATIC_INLINE void | DL_DAC12_disablePower (DAC12_Regs *dac12) |
| Disables power on dac12 module. More... | |
| __STATIC_INLINE bool | DL_DAC12_isPowerEnabled (DAC12_Regs *dac12) |
| Returns if power on dac12 module. More... | |
| __STATIC_INLINE void | DL_DAC12_reset (DAC12_Regs *dac12) |
| Resets dac12 peripheral. More... | |
| __STATIC_INLINE bool | DL_DAC12_isReset (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 (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 (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 (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 (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 (DAC12_Regs *dac12) |
| Checks whether the FIFO is enabled. More... | |
| __STATIC_INLINE DL_DAC12_FIFO_THRESHOLD | DL_DAC12_getFIFOThreshold (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 (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 (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 (DAC12_Regs *dac12) |
| Checks whether the sample time trigger generator is enabled. More... | |
| __STATIC_INLINE DL_DAC12_SAMPLES_PER_SECOND | DL_DAC12_getSampleRate (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 (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 (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, 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, 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 (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 (DAC12_Regs *dac12) |
| Gets the highest priority pending interrupt. More... | |
| __STATIC_INLINE bool | DL_DAC12_isFIFOFull (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 (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 (DAC12_Regs *dac12, uint32_t eventMask) |
| Check which DAC events are enabled. More... | |
| __STATIC_INLINE uint32_t | DL_DAC12_getEnabledEventStatus (DAC12_Regs *dac12, uint32_t eventMask) |
| Check event flag of enabled DAC event. More... | |
| __STATIC_INLINE uint32_t | DL_DAC12_getRawEventsStatus (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... | |
The Digital to Analog Converter Driver Library allows full configuration of the MSPM0 DAC12 module. The DAC module is a 12-bit voltage-output digital-to-analog converter (DAC).
| enum DL_DAC12_OUTPUT |
| enum DL_DAC12_RESOLUTION |
| enum DL_DAC12_AMP |
| enum DL_DAC12_VREF_SOURCE |
| enum DL_DAC12_SAMPLETIMER |
| enum DL_DAC12_FIFO |
| enum DL_DAC12_DMA_TRIGGER |
| enum DL_DAC12_CALIBRATION |
| enum DL_DAC12_IIDX |
| enum DL_DAC12_EVENT_ROUTE |
| void DL_DAC12_init | ( | DAC12_Regs * | dac12, |
| DL_DAC12_Config * | config | ||
| ) |
Initialize the DAC module.
Initializes all the common configurable options for the DAC module. Any other custom configuration can be done after this initialization.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | config | Configuration for DAC12 peripheral |
| __STATIC_INLINE void DL_DAC12_enablePower | ( | DAC12_Regs * | dac12 | ) |
Enables power on DAC12 module.
| dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_DAC12_disablePower | ( | DAC12_Regs * | dac12 | ) |
Disables power on dac12 module.
| dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_DAC12_isPowerEnabled | ( | DAC12_Regs * | dac12 | ) |
Returns if power on dac12 module.
| dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_DAC12_reset | ( | DAC12_Regs * | dac12 | ) |
Resets dac12 peripheral.
| dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_DAC12_isReset | ( | DAC12_Regs * | dac12 | ) |
Returns if dac12 peripheral was reset.
| dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_DAC12_enable | ( | DAC12_Regs * | dac12 | ) |
Enables the DAC module.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE void DL_DAC12_disable | ( | DAC12_Regs * | dac12 | ) |
Disables the DAC Module.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE bool DL_DAC12_isEnabled | ( | DAC12_Regs * | dac12 | ) |
Checks the enable bit of the DAC.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | Module enabled |
| false | Module disabled |
| __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.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | rep | Data Representation. One of DL_DAC12_REPRESENTATION |
| [in] | res | Data Resolution. One of DL_DAC12_RESOLUTION |
References DL_Common_updateReg().
| __STATIC_INLINE DL_DAC12_AMP DL_DAC12_getAmplifier | ( | DAC12_Regs * | dac12 | ) |
Gets the currently configured amplifier setting.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| One | of DL_DAC12_AMP |
| __STATIC_INLINE void DL_DAC12_setAmplifier | ( | DAC12_Regs * | dac12, |
| DL_DAC12_AMP | ampVal | ||
| ) |
Sets the DAC and output amplifer setting.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | ampVal | amplifier configuration value. One of DL_DAC12_AMP |
References DL_Common_updateReg().
| __STATIC_INLINE DL_DAC12_VREF_SOURCE DL_DAC12_getReferenceVoltageSource | ( | DAC12_Regs * | dac12 | ) |
Gets the currently configured reference voltage source.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| Bitwise | OR of DL_DAC12_VREF_SOURCE |
| __STATIC_INLINE void DL_DAC12_setReferenceVoltageSource | ( | DAC12_Regs * | dac12, |
| DL_DAC12_VREF_SOURCE | refsVal | ||
| ) |
Set the reference voltage source of the DAC.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | refsVal | reference voltage source. Bitwise OR of DL_DAC12_VREF_SOURCE |
References DL_Common_updateReg().
| __STATIC_INLINE void DL_DAC12_enableOutputPin | ( | DAC12_Regs * | dac12 | ) |
Enables the DAC output by connecting it to the OUT0 pin.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE void DL_DAC12_disableOutputPin | ( | DAC12_Regs * | dac12 | ) |
Disable the DAC output by disconnecting it from the OUT0 pin.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE bool DL_DAC12_isOutputPinEnabled | ( | DAC12_Regs * | dac12 | ) |
Checks to see whether the output is connected.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | Output is connected |
| false | Output is not connected |
| __STATIC_INLINE void DL_DAC12_enableFIFO | ( | DAC12_Regs * | dac12 | ) |
Enables the FIFO module.
Enables the FIFO and the FIFO hardware control state machine
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE void DL_DAC12_disableFIFO | ( | DAC12_Regs * | dac12 | ) |
Disables the FIFO.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE bool DL_DAC12_isFIFOEnabled | ( | DAC12_Regs * | dac12 | ) |
Checks whether the FIFO is enabled.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | FIFO is enabled |
| false | FIFO is not enabled |
| __STATIC_INLINE DL_DAC12_FIFO_THRESHOLD DL_DAC12_getFIFOThreshold | ( | DAC12_Regs * | dac12 | ) |
Gets the FIFO threshold.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| One | of DL_DAC12_FIFO_THRESHOLD |
| __STATIC_INLINE void DL_DAC12_setFIFOThreshold | ( | DAC12_Regs * | dac12, |
| DL_DAC12_FIFO_THRESHOLD | fifoThreshold | ||
| ) |
Sets the FIFO threshold.
Determines the FIFO threshold In case of DMA based operation, DAC generates new DMA trigger when the number of empty locations in FIFO match the selected FIFO threshold level. In the case of CPU based operation, the FIFO threshold bits are don't care and FIFO level is directly indicated through the respective bits in the RIS register
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | fifoThreshold | Threshold value. One of DL_DAC12_FIFO_THRESHOLD |
References DL_Common_updateReg().
| __STATIC_INLINE DL_DAC12_FIFO_TRIGGER DL_DAC12_getFIFOTriggerSource | ( | DAC12_Regs * | dac12 | ) |
Gets the FIFO read trigger source.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| One | of DL_DAC12_FIFO_TRIGGER |
| __STATIC_INLINE void DL_DAC12_setFIFOTriggerSource | ( | DAC12_Regs * | dac12, |
| DL_DAC12_FIFO_TRIGGER | fifoTrig | ||
| ) |
Sets the FIFO read trigger source.
Selects the source for FIFO read trigger by the DAC. When the selected FIFO read trigger is asserted, the data from FIFO (as indicated by read pointer) is moved into internal DAC data register
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | fifoTrig | Read Trigger Source. One of DL_DAC12_FIFO_TRIGGER |
References DL_Common_updateReg().
| __STATIC_INLINE void DL_DAC12_enableDMATrigger | ( | DAC12_Regs * | dac12 | ) |
Enables the DMA trigger generator.
When this is and the FIFO are enabled, the DMA trigger is generated based on the empty FIFO locations qualified by the selected FIFO Threshold settings. This bit is automatically cleared by hardware when the DMA done event is asserted with DMA status signal value being nonzero
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE void DL_DAC12_disableDMATrigger | ( | DAC12_Regs * | dac12 | ) |
Disables the DMA trigger generator.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE bool DL_DAC12_isDMATriggerEnabled | ( | DAC12_Regs * | dac12 | ) |
Checks whether the DMA trigger generator is enabled.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | DMA Trigger enabled |
| false | DMA Trigger not enabled |
| __STATIC_INLINE void DL_DAC12_enableSampleTimeGenerator | ( | DAC12_Regs * | dac12 | ) |
Enables the sample time generator.
The sample time generator can be selected as the FIFO Trigger DL_DAC12_setFIFOTriggerSource and control the rate at which the DAC will consume inputs from the FIFO
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE void DL_DAC12_disableSampleTimeGenerator | ( | DAC12_Regs * | dac12 | ) |
Disables the sample time generator.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE bool DL_DAC12_isSampleTimeGeneratorEnabled | ( | DAC12_Regs * | dac12 | ) |
Checks whether the sample time trigger generator is enabled.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | Sample time generator is enabled |
| false | Sample time generator is not enabled |
| __STATIC_INLINE DL_DAC12_SAMPLES_PER_SECOND DL_DAC12_getSampleRate | ( | DAC12_Regs * | dac12 | ) |
Gets the sample trigger rate of the sample time generator.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| One | of DL_DAC12_SAMPLES_PER_SECOND |
| __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.
Sets the sample trigger rate of the sample time generator. The sample time generator can be selected as the FIFO Trigger DL_DAC12_setFIFOTriggerSource and control the rate at which the DAC will consume inputs from the FIFO
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | sampleRate | Desired sample rate. One of DL_DAC12_SAMPLES_PER_SECOND |
References DL_Common_updateReg().
| __STATIC_INLINE bool DL_DAC12_isCalibrationRunning | ( | DAC12_Regs * | dac12 | ) |
Checks whether a calibration sequence is currently running.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | Calibration Sequence is currently running |
| false | Calibration Sequence is not running |
| __STATIC_INLINE void DL_DAC12_startCalibration | ( | DAC12_Regs * | dac12 | ) |
Initiates the DAC offset error calibration sequence.
Initiates the DAC offset error calibration sequence and the CALON_ACTIVE bit is automatically reset when the offset error calibration completes. Upon completion, the correct calibration will be put into the CALDATA register. This sequence can be started either on the fly (once the module is ready) or during setup (where this is called directy after enabling the DAC).
In order for the calibration to be successful, the AMP must already be configured and the LOCK bit must be cleared for the value to be written successfully. The output is also tri-stated during calibration.
A negative offset will mean that low input values will have a output of 0. A positive offset will mean that an input of 0 will result in a non-zero output.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| __STATIC_INLINE uint32_t DL_DAC12_getCalibrationData | ( | DAC12_Regs * | dac12 | ) |
Gets the DAC Calibration offset.
Reads of the CALDATA register should only be performed after the calibration sequence has completed. During calibration, this register is continuously written to, and inaccurate values could be obtained.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| -64 | to +63 in two's complement |
References DL_DAC12_performSelfCalibrationBlocking().
| void DL_DAC12_performSelfCalibrationBlocking | ( | DAC12_Regs * | dac12 | ) |
Perform calibration sequence.
Enables writes, and then starts the calibration sequence. Should only be called after the DAC module is enabled. This will only return when the calibration sequence has completed.
| [in] | dac12 | pointer to the register overlay of the peripheral |
Referenced by DL_DAC12_getCalibrationData().
| __STATIC_INLINE void DL_DAC12_output8 | ( | DAC12_Regs * | dac12, |
| uint8_t | dataValue | ||
| ) |
Outputs an 8-bit data value.
Using the CPU to control the DAC, this register can be written to if a fixed output voltage is desired (ex. DC Generation) with the FIFO disabled, or it can write with variable output (ex. AC Generation) by enabling the FIFO and writing to this register. The value will then be written to the FIFO internally. With FIFO enabled with DL_DAC12_enableFIFO, the FIFO-specific interrupts will be generated inside the DAC.
The DMA trigger generation mechanism must be kept disabled when CPU is used to load data into DAC
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | dataValue | value to be written to the bit-field from 0x0 to 0xFF. It can be either binary or two's complement |
| __STATIC_INLINE void DL_DAC12_output12 | ( | DAC12_Regs * | dac12, |
| uint32_t | dataValue | ||
| ) |
Outputs a 12-bit Data Value.
Using the CPU to control the DAC, this register can be written to if a fixed output voltage is desired (ex. DC Generation) with the FIFO disabled, or it can write with variable output (ex. AC Generation) by enabling the FIFO and writing to this register. The value will then be written to the FIFO internally. With FIFO enabled with DL_DAC12_enableFIFO, the FIFO-specific interrupts will be generated inside the DAC.
The DMA trigger generation mechanism must be kept disabled when CPU is used to load data into DAC
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | dataValue | value to be written to the bit-field from 0x0 to 0xFFF. It can be either binary or two's complement |
References DL_DAC12_fillFIFO12(), DL_DAC12_fillFIFO8(), DL_DAC12_outputBlocking12(), and DL_DAC12_outputBlocking8().
| uint32_t DL_DAC12_fillFIFO8 | ( | DAC12_Regs * | dac12, |
| uint8_t * | buffer, | ||
| uint32_t | count | ||
| ) |
Fills the DAC fifo with 8-bit data values from the buffer.
Writes as many values from the data buffer to the FIFO as possible, and then exits when either the count is matched or the FIFO is full.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | buffer | array containing the data values (0x00 - 0xFF) to be written |
| [in] | count | length of the buffer, or maximum desired transfer |
| 0 | - max(number of empty fifo slots, count) |
Referenced by DL_DAC12_output12().
| uint32_t DL_DAC12_fillFIFO12 | ( | DAC12_Regs * | dac12, |
| uint16_t * | buffer, | ||
| uint32_t | count | ||
| ) |
Fills the DAC fifo with 12-bit data values from the buffer.
Writes as many values from the data buffer to the FIFO as possible, and then exits when either the count is matched or the FIFO is full.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | buffer | array containing the data values (0x00 - 0xFFF) to be written |
| [in] | count | length of the buffer, or maximum desired transfer |
| 0 | - max(number of empty fifo slots, count) |
Referenced by DL_DAC12_output12().
| void DL_DAC12_outputBlocking8 | ( | DAC12_Regs * | dac12, |
| uint8_t | data | ||
| ) |
Blocking 8-bit output to the DAC FIFO.
Waits until the FIFO is not full, then writes a single value
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | data | data value (0x00 - 0xFF) to be written |
Referenced by DL_DAC12_output12().
| void DL_DAC12_outputBlocking12 | ( | DAC12_Regs * | dac12, |
| uint16_t | data | ||
| ) |
Blocking 12-bit output to the DAC FIFO.
Waits until the FIFO is not full, then writes a single value
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | data | data value (0x000 - 0xFFF) to be written |
Referenced by DL_DAC12_output12().
| __STATIC_INLINE uint32_t DL_DAC12_getInterruptStatus | ( | DAC12_Regs * | dac12, |
| uint32_t | interruptMask | ||
| ) |
Checks the raw interrupt status of one or more interrupts.
The raw interrupt status is independent of whether a specific interrupt is enabled.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | interruptMask | the desired interrupt(s). One or more of DL_DAC12_INTERRUPT |
| 0 | no interrupts that were inputted are currently asserted |
| not | 0 a bit-wise OR of the inputted DL_DAC12_INTERRUPT registers that are currently asserted. |
Referenced by DL_DAC12_isFIFOFull().
| __STATIC_INLINE void DL_DAC12_clearInterruptStatus | ( | DAC12_Regs * | dac12, |
| uint32_t | interruptMask | ||
| ) |
Clears the interrupt status of one or more interrupts.
Accesses the write only interrupt clear (ICLR) register and writes a 1 to the bits specified. Any bit that has 1 written to it will clear that pending interrupt if it is currently pending.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | interruptMask | the desired interrupt(s). One or more of DL_DAC12_INTERRUPT |
| __STATIC_INLINE void DL_DAC12_enableInterrupt | ( | DAC12_Regs * | dac12, |
| uint32_t | interruptMask | ||
| ) |
Enables one or more interrupts.
Access and write to the IMASK register to enable the interrupts specified.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | interruptMask | the desired interrupt(s). One or more of DL_DAC12_INTERRUPT |
| __STATIC_INLINE void DL_DAC12_disableInterrupt | ( | DAC12_Regs * | dac12, |
| uint32_t | interruptMask | ||
| ) |
Disables one or more interrupts.
Access and write to the IMASK register to disable the interrupts specified.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| [in] | interruptMask | the desired interrupt(s). One or more of DL_DAC12_INTERRUPT |
| __STATIC_INLINE DL_DAC12_IIDX DL_DAC12_getPendingInterrupt | ( | DAC12_Regs * | dac12 | ) |
Gets the highest priority pending interrupt.
Accesses and reads the IIDX register to obtain the highest currently pending interrupt. Interrupts with lower offsets (and smaller values) are higher priority than interrupts with higher offsets (and larger values). In order for the interrupt to be pending, it must have been enabled and asserted. Clearing the interrupt should will un-pend the interrupt.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| One | of DL_DAC12_IIDX |
| __STATIC_INLINE bool DL_DAC12_isFIFOFull | ( | DAC12_Regs * | dac12 | ) |
Checks if the DAC FIFO is currently full.
Accesses the raw interrupt status (RIS) register in order to get the current state of the FIFOFull Interrupt flag.
| [in] | dac12 | pointer to the register overlay of the peripheral |
| true | FIFO is currently full |
| false | FIFO is not full |
References DL_DAC12_getInterruptStatus(), and DL_DAC12_INTERRUPT_FIFO_FULL.
| __STATIC_INLINE void DL_DAC12_setPublisherChanID | ( | DAC12_Regs * | dac12, |
| uint8_t | chanID | ||
| ) |
Sets the event publisher channel id.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0 publisher is disconnected. |
| __STATIC_INLINE uint8_t DL_DAC12_getPublisherChanID | ( | DAC12_Regs * | dac12 | ) |
Gets the event publisher channel id.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_DAC12_setSubscriberChanID | ( | DAC12_Regs * | dac12, |
| DL_DAC12_SUBSCRIBER_INDEX | index, | ||
| uint8_t | chanID | ||
| ) |
Sets the event subscriber channel id.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | index | Specifies the register event index to be configured |
| [in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0 subscriber is disconnected. |
| __STATIC_INLINE uint8_t DL_DAC12_getSubscriberChanID | ( | DAC12_Regs * | dac12, |
| DL_DAC12_SUBSCRIBER_INDEX | index | ||
| ) |
Gets the event subscriber channel id.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | index | Specifies the register event index to be configured |
| __STATIC_INLINE void DL_DAC12_enableEvent | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Enable DAC event.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to enable. Bitwise OR of DL_DAC12_EVENT. |
| __STATIC_INLINE void DL_DAC12_disableEvent | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Disable DAC event.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to enable. Bitwise OR of DL_DAC12_EVENT. |
| __STATIC_INLINE uint32_t DL_DAC12_getEnabledEvents | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Check which DAC events are enabled.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_DAC12_EVENT. |
| Bitwise | OR of DL_DAC12_EVENT values |
| __STATIC_INLINE uint32_t DL_DAC12_getEnabledEventStatus | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Check event flag of enabled DAC event.
Checks if any of the DAC events that were previously enabled are pending.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_DAC12_EVENT. |
| Bitwise | OR of DL_DAC12_EVENT values |
| __STATIC_INLINE uint32_t DL_DAC12_getRawEventsStatus | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Check interrupt flag of any DAC event.
Checks if any events are pending. Events do not have to be previously enabled.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_DAC12_EVENT. |
| Bitwise | OR of DL_DAC12_EVENT values |
| __STATIC_INLINE void DL_DAC12_clearEventsStatus | ( | DAC12_Regs * | dac12, |
| uint32_t | eventMask | ||
| ) |
Clear pending DAC events.
| [in] | dac12 | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to clear. Bitwise OR of DL_DAC12_EVENT. |