37 #if defined(VCMP_COUNT) && (VCMP_COUNT > 0)
64 vcmpWarmTime4Cycles = _VCMP_CTRL_WARMTIME_4CYCLES,
66 vcmpWarmTime8Cycles = _VCMP_CTRL_WARMTIME_8CYCLES,
68 vcmpWarmTime16Cycles = _VCMP_CTRL_WARMTIME_16CYCLES,
70 vcmpWarmTime32Cycles = _VCMP_CTRL_WARMTIME_32CYCLES,
72 vcmpWarmTime64Cycles = _VCMP_CTRL_WARMTIME_64CYCLES,
74 vcmpWarmTime128Cycles = _VCMP_CTRL_WARMTIME_128CYCLES,
76 vcmpWarmTime256Cycles = _VCMP_CTRL_WARMTIME_256CYCLES,
78 vcmpWarmTime512Cycles = _VCMP_CTRL_WARMTIME_512CYCLES
79 } VCMP_WarmTime_TypeDef;
89 } VCMP_Hysteresis_TypeDef;
108 VCMP_WarmTime_TypeDef warmup;
110 VCMP_Hysteresis_TypeDef hyst;
123 #define VCMP_INIT_DEFAULT \
129 vcmpWarmTime4Cycles, \
141 void VCMP_Init(
const VCMP_Init_TypeDef *vcmpInit);
142 void VCMP_LowPowerRefSet(
bool enable);
143 void VCMP_TriggerSet(
int level);
149 __STATIC_INLINE
void VCMP_Enable(
void)
151 VCMP->CTRL |= VCMP_CTRL_EN;
159 __STATIC_INLINE
void VCMP_Disable(
void)
161 VCMP->CTRL &= ~VCMP_CTRL_EN;
175 __STATIC_INLINE uint32_t VCMP_VoltageToLevel(
float v)
177 return (uint32_t)((v - (float)1.667) / (float)0.034);
186 __STATIC_INLINE
bool VCMP_VDDLower(
void)
188 if (VCMP->STATUS & VCMP_STATUS_VCMPOUT)
204 __STATIC_INLINE
bool VCMP_VDDHigher(
void)
206 if (VCMP->STATUS & VCMP_STATUS_VCMPOUT)
221 __STATIC_INLINE
bool VCMP_Ready(
void)
223 if (VCMP->STATUS & VCMP_STATUS_VCMPACT)
243 __STATIC_INLINE
void VCMP_IntClear(uint32_t flags)
258 __STATIC_INLINE
void VCMP_IntSet(uint32_t flags)
273 __STATIC_INLINE
void VCMP_IntDisable(uint32_t flags)
288 __STATIC_INLINE
void VCMP_IntEnable(uint32_t flags)
305 __STATIC_INLINE uint32_t VCMP_IntGet(
void)
329 __STATIC_INLINE uint32_t VCMP_IntGetEnabled(
void)
338 return VCMP->IF & tmp;
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.