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

Function ACMP_GPIOSetup

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

/ * @brief * Sets up GPIO output from the ACMP. * * @note * GPIO must be enabled in the CMU before this function call, i.e. * @verbatim CMU_ClockEnable(cmuClock_GPIO, true); @endverbatim * * @param[in] acmp * Pointer to the ACMP peripheral register block. * * @param location * The pin location to use. See the datasheet for location to pin mappings. * * @param enable * Enab

Source from the content-addressed store, hash-verified

214 * Invert output.
215 ******************************************************************************/
216void ACMP_GPIOSetup(ACMP_TypeDef *acmp, uint32_t location, bool enable, bool invert)
217{
218 /* Sanity checking of location */
219 EFM_ASSERT(location < 4);
220
221 /* Set GPIO inversion */
222 SET_BIT_FIELD(acmp->CTRL, _ACMP_CTRL_GPIOINV_MASK, invert,
223 _ACMP_CTRL_GPIOINV_SHIFT);
224
225 acmp->ROUTE = (location << _ACMP_ROUTE_LOCATION_SHIFT)
226 | (enable << _ACMP_ROUTE_ACMPPEN_SHIFT);
227}
228
229/***************************************************************************//**
230 * @brief

Callers 1

rt_acmp_controlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected