MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ACMP_ChannelSet

Function ACMP_ChannelSet

bsp/efm32/Libraries/emlib/src/em_acmp.c:242–254  ·  view source on GitHub ↗

/ * @brief * Sets which channels should be used in ACMP comparisons. * * @param[in] acmp * Pointer to the ACMP peripheral register block. * * @param negSel * Channel to use on the negative input to the ACMP. * * @param posSel * Channel to use on the positive input to the ACMP. ******************************************************************************/

Source from the content-addressed store, hash-verified

240 * Channel to use on the positive input to the ACMP.
241 ******************************************************************************/
242void ACMP_ChannelSet(ACMP_TypeDef *acmp, ACMP_Channel_TypeDef negSel,
243 ACMP_Channel_TypeDef posSel)
244{
245 /* Make sure that only external channels are used as ACMP positive input */
246 EFM_ASSERT(posSel < _ACMP_INPUTSEL_NEGSEL_1V25);
247 /* Sanity checking of ACMP negative input */
248 EFM_ASSERT(negSel <= _ACMP_INPUTSEL_NEGSEL_VDD);
249
250 acmp->INPUTSEL = (acmp->INPUTSEL & ~(_ACMP_INPUTSEL_POSSEL_MASK |
251 _ACMP_INPUTSEL_NEGSEL_MASK))
252 | (negSel << _ACMP_INPUTSEL_NEGSEL_SHIFT)
253 | (posSel << _ACMP_INPUTSEL_POSSEL_SHIFT);
254}
255
256/***************************************************************************//**
257 * @brief

Callers 1

rt_acmp_controlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected