34 #if defined(DAC_COUNT) && (DAC_COUNT > 0)
62 #define DAC_CH_VALID(ch) ((ch) <= 1)
65 #define DAC_MAX_CLOCK 1000000
88 volatile uint32_t *reg;
90 EFM_ASSERT(DAC_REF_VALID(dac));
91 EFM_ASSERT(DAC_CH_VALID(ch));
127 EFM_ASSERT(DAC_REF_VALID(dac));
199 EFM_ASSERT(DAC_REF_VALID(dac));
200 EFM_ASSERT(DAC_CH_VALID(ch));
248 unsigned int channel,
292 if (dacFreq > DAC_MAX_CLOCK)
294 dacFreq = DAC_MAX_CLOCK;
308 if ((hfperFreq >> ret) <= dacFreq)
Clock management unit (CMU) API.
#define DAC_CH0CTRL_REFREN
#define DAC_CTRL_SINEMODE
Emlib peripheral API "assert" implementation.
void DAC_Enable(DAC_TypeDef *dac, unsigned int ch, bool enable)
Enable/disable DAC channel.
RAM and peripheral bit-field set and clear API.
DAC_Ref_TypeDef reference
void DAC_InitChannel(DAC_TypeDef *dac, const DAC_InitChannel_TypeDef *init, unsigned int ch)
Initialize DAC channel.
uint8_t DAC_PrescaleCalc(uint32_t dacFreq, uint32_t hfperFreq)
Calculate prescaler value used to determine DAC clock.
#define _DAC_BIASPROG_RESETVALUE
#define _DAC_CTRL_CONVMODE_SHIFT
#define _DAC_CTRL_REFRSEL_SHIFT
DAC_Refresh_TypeDef refresh
#define DAC_CTRL_CH0PRESCRST
#define DAC_CH0CTRL_PRSEN
#define _DAC_CTRL_PRESC_MASK
Digital to Analog Converter (DAC) peripheral API.
__STATIC_INLINE void DAC_Channel0OutputSet(DAC_TypeDef *dac, uint32_t value)
Set the output signal of DAC channel 0 to a given value.
#define _DAC_CTRL_PRESC_SHIFT
__STATIC_INLINE void DAC_Channel1OutputSet(DAC_TypeDef *dac, uint32_t value)
Set the output signal of DAC channel 1 to a given value.
DAC_Output_TypeDef outMode
#define _DAC_CTRL_REFSEL_SHIFT
#define DAC_CTRL_OUTENPRS
DAC_ConvMode_TypeDef convMode
#define _DAC_CH0CTRL_RESETVALUE
#define _DAC_CH0CTRL_EN_SHIFT
void DAC_Reset(DAC_TypeDef *dac)
Reset DAC to same state as after a HW reset.
#define _DAC_CH0CTRL_PRSSEL_SHIFT
DAC_PRSSEL_TypeDef prsSel
#define _DAC_CTRL_OUTMODE_SHIFT
__STATIC_INLINE void BUS_RegBitWrite(volatile uint32_t *addr, unsigned int bit, unsigned int val)
Perform a single-bit write operation on a peripheral register.
#define _DAC_CTRL_RESETVALUE
#define _DAC_IEN_RESETVALUE
uint32_t CMU_ClockFreqGet(CMU_Clock_TypeDef clock)
Get clock frequency for a clock point.
void DAC_ChannelOutputSet(DAC_TypeDef *dac, unsigned int channel, uint32_t value)
Set the output signal of a DAC channel to a given value.
void DAC_Init(DAC_TypeDef *dac, const DAC_Init_TypeDef *init)
Initialize DAC.
#define _DAC_CH1CTRL_RESETVALUE