34 #if defined(VDAC_COUNT) && (VDAC_COUNT > 0)
54 #define VDAC_CH_VALID(ch) ((ch) <= 1)
57 #define VDAC_MAX_CLOCK 1000000
60 #define VDAC_INTERNAL_CLOCK_FREQ 12000000
83 EFM_ASSERT(VDAC_REF_VALID(vdac));
84 EFM_ASSERT(VDAC_CH_VALID(ch));
134 uint32_t cal, tmp = 0;
135 uint32_t
const volatile *calData;
137 EFM_ASSERT(VDAC_REF_VALID(vdac));
150 calData = &
DEVINFO->VDAC0MAINCAL;
154 calData = &
DEVINFO->VDAC0ALTCAL;
244 uint32_t vdacChCtrl, vdacStatus;
246 EFM_ASSERT(VDAC_REF_VALID(vdac));
247 EFM_ASSERT(VDAC_CH_VALID(ch));
250 vdacStatus = vdac->
STATUS;
317 unsigned int channel,
368 uint32_t ret, refFreq;
371 if (vdacFreq > VDAC_MAX_CLOCK)
373 vdacFreq = VDAC_MAX_CLOCK;
378 refFreq = VDAC_INTERNAL_CLOCK_FREQ;
397 if ((refFreq / (ret + 1)) <= vdacFreq)
Clock management unit (CMU) API.
#define VDAC_STATUS_CH0ENS
#define _DEVINFO_VDAC0CH1CAL_GAINERRTRIMCH1A_SHIFT
#define _VDAC_CH0CTRL_RESETVALUE
#define VDAC_STATUS_CH1ENS
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM1V25LN_MASK
#define _VDAC_CTRL_WARMUPMODE_SHIFT
#define _VDAC_IEN_RESETVALUE
#define _VDAC_CTRL_OUTENPRS_SHIFT
#define _VDAC_CAL_RESETVALUE
void VDAC_Init(VDAC_TypeDef *vdac, const VDAC_Init_TypeDef *init)
Initialize VDAC.
VDAC_Ref_TypeDef reference
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIMVDDANAEXTPIN_MASK
#define _VDAC_CH0CTRL_PRSSEL_SHIFT
VDAC_PrsSel_TypeDef prsSel
#define _DEVINFO_VDAC0CH1CAL_OFFSETTRIM_MASK
#define _VDAC_CH0CTRL_TRIGMODE_SHIFT
void VDAC_InitChannel(VDAC_TypeDef *vdac, const VDAC_InitChannel_TypeDef *init, unsigned int ch)
Initialize a VDAC channel.
void VDAC_ChannelOutputSet(VDAC_TypeDef *vdac, unsigned int channel, uint32_t value)
Set the output signal of a VDAC channel to a given value.
#define _VDAC_CAL_OFFSETTRIM_SHIFT
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM2V5_SHIFT
#define _VDAC_CH0DATA_RESETVALUE
#define _VDAC_CTRL_CH0PRESCRST_SHIFT
#define _VDAC_CTRL_RESETVALUE
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM1V25LN_SHIFT
void VDAC_Reset(VDAC_TypeDef *vdac)
Reset VDAC to same state as after a HW reset.
uint32_t VDAC_PrescaleCalc(uint32_t vdacFreq, bool syncMode, uint32_t hfperFreq)
Calculate prescaler value used to determine VDAC clock.
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIMVDDANAEXTPIN_SHIFT
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM1V25_MASK
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM2V5LN_MASK
__STATIC_INLINE void VDAC_Channel0OutputSet(VDAC_TypeDef *vdac, uint32_t value)
Set the output signal of VDAC channel 0 to a given value.
#define _VDAC_CH0CTRL_PRSASYNC_SHIFT
void VDAC_Enable(VDAC_TypeDef *vdac, unsigned int ch, bool enable)
Enable/disable VDAC channel.
__STATIC_INLINE void VDAC_Channel1OutputSet(VDAC_TypeDef *vdac, uint32_t value)
Set the output signal of VDAC channel 1 to a given value.
Digital to Analog Converter (VDAC) peripheral API.
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM1V25_SHIFT
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM2V5LN_SHIFT
#define _VDAC_CH1DATA_RESETVALUE
#define _DEVINFO_VDAC0CH1CAL_GAINERRTRIMCH1B_SHIFT
#define _VDAC_CTRL_REFRESHPERIOD_SHIFT
#define _VDAC_CTRL_PRESC_MASK
#define _VDAC_CAL_GAINERRTRIMCH1_SHIFT
#define _VDAC_CH0CTRL_CONVMODE_SHIFT
VDAC_Refresh_TypeDef refresh
#define _DEVINFO_VDAC0MAINCAL_GAINERRTRIM2V5_MASK
VDAC_TrigMode_TypeDef trigMode
#define _VDAC_CTRL_REFSEL_SHIFT
#define _VDAC_CTRL_SINEMODE_SHIFT
#define _DEVINFO_VDAC0CH1CAL_GAINERRTRIMCH1A_MASK
#define _VDAC_CTRL_DIFF_SHIFT
uint32_t CMU_ClockFreqGet(CMU_Clock_TypeDef clock)
Get clock frequency for a clock point.
#define _DEVINFO_VDAC0CH1CAL_OFFSETTRIM_SHIFT
#define _VDAC_CTRL_DACCLKMODE_SHIFT
#define _DEVINFO_VDAC0CH1CAL_GAINERRTRIMCH1B_MASK
#define _VDAC_CH1CTRL_RESETVALUE
#define _VDAC_CTRL_PRESC_SHIFT
#define _VDAC_CAL_GAINERRTRIM_SHIFT