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_CH1CTRL_RESETVALUE
#define _DAC_CTRL_REFSEL_SHIFT
#define DAC_CTRL_OUTENPRS
Emlib peripheral API "assert" implementation.
#define _DAC_CTRL_PRESC_SHIFT
void DAC_Enable(DAC_TypeDef *dac, unsigned int ch, bool enable)
Enable/disable DAC channel.
#define _DAC_CTRL_CONVMODE_SHIFT
RAM and peripheral bit-field set and clear API.
DAC_Ref_TypeDef reference
#define DAC_CTRL_CH0PRESCRST
void DAC_InitChannel(DAC_TypeDef *dac, const DAC_InitChannel_TypeDef *init, unsigned int ch)
Initialize DAC channel.
#define _DAC_CH0CTRL_EN_SHIFT
uint8_t DAC_PrescaleCalc(uint32_t dacFreq, uint32_t hfperFreq)
Calculate prescaler value used to determine DAC clock.
#define DAC_CTRL_SINEMODE
#define DAC_CH0CTRL_REFREN
DAC_Refresh_TypeDef refresh
#define _DAC_CH0CTRL_PRSSEL_SHIFT
#define _DAC_CTRL_OUTMODE_SHIFT
#define _DAC_CTRL_RESETVALUE
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.
__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_PRESC_MASK
#define _DAC_CTRL_REFRSEL_SHIFT
#define _DAC_CH0CTRL_RESETVALUE
DAC_ConvMode_TypeDef convMode
#define DAC_CH0CTRL_PRSEN
void DAC_Reset(DAC_TypeDef *dac)
Reset DAC to same state as after a HW reset.
#define _DAC_IEN_RESETVALUE
#define _DAC_BIASPROG_RESETVALUE
DAC_PRSSEL_TypeDef prsSel
__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.
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.