12#include "fsl_common.h"
28#define FSL_DAC12_DRIVER_VERSION (MAKE_VERSION(2, 1, 0))
32#define DAC12_CR_W1C_FLAGS_MASK (DAC_CR_OVFF_MASK | DAC_CR_UDFF_MASK)
34#define DAC12_CR_ALL_FLAGS_MASK (DAC12_CR_W1C_FLAGS_MASK | DAC_CR_WMF_MASK | DAC_CR_NEMPTF_MASK | DAC_CR_FULLF_MASK)
163#if !(defined(FSL_FEATURE_DAC12_HAS_NO_ITRM_REGISTER) && FSL_FEATURE_DAC12_HAS_NO_ITRM_REGISTER)
171#if defined(__cplusplus)
227static inline void DAC12_Enable(
DAC_Type *base,
bool enable)
231 base->CR = (base->CR & ~DAC12_CR_W1C_FLAGS_MASK) | DAC_CR_DACEN_MASK;
235 base->CR &= ~DAC_CR_DACEN_MASK;
244static inline void DAC12_ResetConfig(
DAC_Type *base)
246 base->CR = DAC_CR_SWRST_MASK;
257static inline void DAC12_ResetFIFO(
DAC_Type *base)
260 base->CR = (base->CR & ~DAC12_CR_W1C_FLAGS_MASK) | DAC_CR_FIFORST_MASK;
276static inline uint32_t DAC12_GetStatusFlags(
DAC_Type *base)
290static inline void DAC12_ClearStatusFlags(
DAC_Type *base, uint32_t flags)
308static inline void DAC12_EnableInterrupts(
DAC_Type *base, uint32_t mask)
310 base->CR = (base->CR & ~DAC12_CR_W1C_FLAGS_MASK) | mask;
319static inline void DAC12_DisableInterrupts(
DAC_Type *base, uint32_t mask)
337static inline void DAC12_EnableDMA(
DAC_Type *base,
bool enable)
341 base->CR = (base->CR & ~DAC12_CR_W1C_FLAGS_MASK) | DAC_CR_DMAEN_MASK;
345 base->CR &= ~DAC_CR_DMAEN_MASK;
368static inline void DAC12_SetData(
DAC_Type *base, uint32_t value)
383static inline void DAC12_DoSoftwareTrigger(
DAC_Type *base)
385 base->CR = (base->CR & ~DAC12_CR_W1C_FLAGS_MASK) | DAC_CR_SWTRG_MASK;
394static inline uint32_t DAC12_GetFIFOReadPointer(
DAC_Type *base)
396 return (DAC_PTR_DACRFP_MASK & base->PTR) >> DAC_PTR_DACRFP_SHIFT;
405static inline uint32_t DAC12_GetFIFOWritePointer(
DAC_Type *base)
407 return (DAC_PTR_DACWFP_MASK & base->PTR) >> DAC_PTR_DACWFP_SHIFT;
412#if defined(__cplusplus)
#define DAC_DATA_DATA0(x)
Definition: MIMXRT1166_cm4.h:27963
enum _dac12_fifo_work_mode dac12_fifo_work_mode_t
DAC12 FIFO work mode.
_dac12_reference_voltage_source
DAC12 reference voltage source.
Definition: fsl_dac12.h:97
struct _dac12_hardware_info dac12_hardware_info_t
DAC12 hardware information.
enum _dac12_speed_mode dac12_speed_mode_t
DAC analog buffer speed mode for conversion.
#define DAC12_CR_W1C_FLAGS_MASK
Define "write 1 to clear" flags.
Definition: fsl_dac12.h:32
enum _dac12_fifo_trigger_mode dac12_fifo_trigger_mode_t
DAC12 FIFO trigger mode.
_dac12_interrupt_enable
DAC12 interrupts.
Definition: fsl_dac12.h:57
enum _dac12_reference_voltage_source dac12_reference_voltage_source_t
DAC12 reference voltage source.
void DAC12_Deinit(DAC_Type *base)
De-initialize the DAC12 module.
Definition: fsl_dac12.c:159
_dac12_fifo_size_info
DAC12 FIFO size information provided by hardware.
Definition: fsl_dac12.h:68
enum _dac12_reference_current_source dac12_reference_current_source_t
DAC internal reference current source.
dac12_reference_current_source_t referenceCurrentSource
Definition: fsl_dac12.h:160
_dac12_fifo_work_mode
DAC12 FIFO work mode.
Definition: fsl_dac12.h:83
dac12_reference_voltage_source_t referenceVoltageSource
Definition: fsl_dac12.h:156
_dac12_reference_current_source
DAC internal reference current source.
Definition: fsl_dac12.h:120
_dac12_speed_mode
DAC analog buffer speed mode for conversion.
Definition: fsl_dac12.h:133
void DAC12_Init(DAC_Type *base, const dac12_config_t *config)
Initialize the DAC12 module.
Definition: fsl_dac12.c:78
void DAC12_GetDefaultConfig(dac12_config_t *config)
Initializes the DAC12 user configuration structure.
Definition: fsl_dac12.c:183
_dac12_fifo_trigger_mode
DAC12 FIFO trigger mode.
Definition: fsl_dac12.h:106
dac12_fifo_size_info_t fifoSizeInfo
Definition: fsl_dac12.h:144
#define DAC12_CR_ALL_FLAGS_MASK
Define all the flag bits in DACx_CR register.
Definition: fsl_dac12.h:34
void DAC12_GetHardwareInfo(DAC_Type *base, dac12_hardware_info_t *info)
Get hardware information about this module.
Definition: fsl_dac12.c:64
enum _dac12_fifo_size_info dac12_fifo_size_info_t
DAC12 FIFO size information provided by hardware.
dac12_speed_mode_t speedMode
Definition: fsl_dac12.h:161
uint32_t currentReferenceInternalTrimValue
Definition: fsl_dac12.h:164
bool enableAnalogBuffer
Definition: fsl_dac12.h:162
dac12_fifo_work_mode_t fifoWorkMode
Definition: fsl_dac12.h:155
uint32_t fifoWatermarkLevel
Definition: fsl_dac12.h:154
_dac12_status_flags
DAC12 flags.
Definition: fsl_dac12.h:40
@ kDAC12_ReferenceVoltageSourceAlt1
Definition: fsl_dac12.h:98
@ kDAC12_ReferenceVoltageSourceAlt2
Definition: fsl_dac12.h:99
@ kDAC12_FullInterruptEnable
Definition: fsl_dac12.h:61
@ kDAC12_NearlyEmptyInterruptEnable
Definition: fsl_dac12.h:60
@ kDAC12_WatermarkInterruptEnable
Definition: fsl_dac12.h:59
@ kDAC12_UnderOrOverflowInterruptEnable
Definition: fsl_dac12.h:58
@ kDAC12_FIFOSize32
Definition: fsl_dac12.h:73
@ kDAC12_FIFOSize64
Definition: fsl_dac12.h:74
@ kDAC12_FIFOSize2
Definition: fsl_dac12.h:69
@ kDAC12_FIFOSize256
Definition: fsl_dac12.h:76
@ kDAC12_FIFOSize4
Definition: fsl_dac12.h:70
@ kDAC12_FIFOSize128
Definition: fsl_dac12.h:75
@ kDAC12_FIFOSize16
Definition: fsl_dac12.h:72
@ kDAC12_FIFOSize8
Definition: fsl_dac12.h:71
@ kDAC12_FIFOWorkAsNormalMode
Definition: fsl_dac12.h:86
@ kDAC12_FIFOWorkAsSwingMode
Definition: fsl_dac12.h:87
@ kDAC12_FIFODisabled
Definition: fsl_dac12.h:84
@ kDAC12_ReferenceCurrentSourceAlt2
Definition: fsl_dac12.h:125
@ kDAC12_ReferenceCurrentSourceAlt0
Definition: fsl_dac12.h:122
@ kDAC12_ReferenceCurrentSourceDisabled
Definition: fsl_dac12.h:121
@ kDAC12_ReferenceCurrentSourceAlt1
Definition: fsl_dac12.h:123
@ kDAC12_SpeedHighMode
Definition: fsl_dac12.h:136
@ kDAC12_SpeedMiddleMode
Definition: fsl_dac12.h:135
@ kDAC12_SpeedLowMode
Definition: fsl_dac12.h:134
@ kDAC12_FIFOTriggerBySoftwareMode
Definition: fsl_dac12.h:108
@ kDAC12_FIFOTriggerByHardwareMode
Definition: fsl_dac12.h:107
@ kDAC12_NearlyEmptyFlag
Definition: fsl_dac12.h:47
@ kDAC12_WatermarkFlag
Definition: fsl_dac12.h:45
@ kDAC12_OverflowFlag
Definition: fsl_dac12.h:41
@ kDAC12_UnderflowFlag
Definition: fsl_dac12.h:43
@ kDAC12_FullFlag
Definition: fsl_dac12.h:49
Definition: MIMXRT1166_cm4.h:27894
DAC12 hardware information.
Definition: fsl_dac12.h:143
Definition: deflate.c:114
DAC12 module configuration.
Definition: fsl_dac12.h:153