38 #if defined(DAC_COUNT) && (DAC_COUNT > 0)
61 #define DAC_REF_VALID(ref) ((ref) == DAC0)
72 dacConvModeContinuous = _DAC_CTRL_CONVMODE_CONTINUOUS,
73 dacConvModeSampleHold = _DAC_CTRL_CONVMODE_SAMPLEHOLD,
74 dacConvModeSampleOff = _DAC_CTRL_CONVMODE_SAMPLEOFF
75 } DAC_ConvMode_TypeDef;
80 dacOutputDisable = _DAC_CTRL_OUTMODE_DISABLE,
81 dacOutputPin = _DAC_CTRL_OUTMODE_PIN,
82 dacOutputADC = _DAC_CTRL_OUTMODE_ADC,
83 dacOutputPinADC = _DAC_CTRL_OUTMODE_PINADC
90 dacPRSSELCh0 = _DAC_CH0CTRL_PRSSEL_PRSCH0,
91 dacPRSSELCh1 = _DAC_CH0CTRL_PRSSEL_PRSCH1,
92 dacPRSSELCh2 = _DAC_CH0CTRL_PRSSEL_PRSCH2,
93 dacPRSSELCh3 = _DAC_CH0CTRL_PRSSEL_PRSCH3,
94 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH4 )
95 dacPRSSELCh4 = _DAC_CH0CTRL_PRSSEL_PRSCH4,
97 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH5 )
98 dacPRSSELCh5 = _DAC_CH0CTRL_PRSSEL_PRSCH5,
100 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH6 )
101 dacPRSSELCh6 = _DAC_CH0CTRL_PRSSEL_PRSCH6,
103 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH7 )
104 dacPRSSELCh7 = _DAC_CH0CTRL_PRSSEL_PRSCH7,
106 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH8 )
107 dacPRSSELCh8 = _DAC_CH0CTRL_PRSSEL_PRSCH8,
109 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH9 )
110 dacPRSSELCh9 = _DAC_CH0CTRL_PRSSEL_PRSCH9,
112 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH10 )
113 dacPRSSELCh10 = _DAC_CH0CTRL_PRSSEL_PRSCH10,
115 #if defined( _DAC_CH0CTRL_PRSSEL_PRSCH11 )
116 dacPRSSELCh11 = _DAC_CH0CTRL_PRSSEL_PRSCH11,
118 } DAC_PRSSEL_TypeDef;
124 dacRef1V25 = _DAC_CTRL_REFSEL_1V25,
125 dacRef2V5 = _DAC_CTRL_REFSEL_2V5,
126 dacRefVDD = _DAC_CTRL_REFSEL_VDD
133 dacRefresh8 = _DAC_CTRL_REFRSEL_8CYCLES,
134 dacRefresh16 = _DAC_CTRL_REFRSEL_16CYCLES,
135 dacRefresh32 = _DAC_CTRL_REFRSEL_32CYCLES,
136 dacRefresh64 = _DAC_CTRL_REFRSEL_64CYCLES
137 } DAC_Refresh_TypeDef;
148 DAC_Refresh_TypeDef refresh;
151 DAC_Ref_TypeDef reference;
154 DAC_Output_TypeDef outMode;
157 DAC_ConvMode_TypeDef convMode;
182 #define DAC_INIT_DEFAULT \
187 dacConvModeContinuous, \
219 DAC_PRSSEL_TypeDef prsSel;
220 } DAC_InitChannel_TypeDef;
223 #define DAC_INITCHANNEL_DEFAULT \
236 void DAC_Enable(DAC_TypeDef *dac,
unsigned int ch,
bool enable);
237 void DAC_Init(DAC_TypeDef *dac,
const DAC_Init_TypeDef *init);
238 void DAC_InitChannel(DAC_TypeDef *dac,
239 const DAC_InitChannel_TypeDef *init,
241 void DAC_ChannelOutputSet(DAC_TypeDef *dac,
242 unsigned int channel,
259 __STATIC_INLINE
void DAC_Channel0OutputSet( DAC_TypeDef *dac,
262 EFM_ASSERT(value<=_DAC_CH0DATA_MASK);
263 dac->CH0DATA = value;
281 __STATIC_INLINE
void DAC_Channel1OutputSet( DAC_TypeDef *dac,
284 EFM_ASSERT(value<=_DAC_CH1DATA_MASK);
285 dac->CH1DATA = value;
300 __STATIC_INLINE
void DAC_IntClear(DAC_TypeDef *dac, uint32_t flags)
317 __STATIC_INLINE
void DAC_IntDisable(DAC_TypeDef *dac, uint32_t flags)
339 __STATIC_INLINE
void DAC_IntEnable(DAC_TypeDef *dac, uint32_t flags)
359 __STATIC_INLINE uint32_t DAC_IntGet(DAC_TypeDef *dac)
384 __STATIC_INLINE uint32_t DAC_IntGetEnabled(DAC_TypeDef *dac)
393 return dac->IF & ien;
408 __STATIC_INLINE
void DAC_IntSet(DAC_TypeDef *dac, uint32_t flags)
413 uint8_t DAC_PrescaleCalc(uint32_t dacFreq, uint32_t hfperFreq);
414 void DAC_Reset(DAC_TypeDef *dac);
Emlib peripheral API "assert" implementation.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.