/***************************************************************************//** * @brief * Disable/enable reset for various peripherals and signal sources * * @param[in] reset Reset types to enable/disable * * @param[in] enable * @li false - Disable reset signal or flag * @li true - Enable reset signal or flag ******************************************************************************/ void RMU_ResetControl(RMU_Reset_TypeDef reset, RMU_ResetMode_TypeDef mode) { /* Note that the RMU supports bit-band access, but not peripheral bit-field set/clear */ #if defined(_RMU_CTRL_PINRMODE_MASK) uint32_t val; #endif uint32_t shift; shift = EFM32_CTZ((uint32_t)reset); #if defined(_RMU_CTRL_PINRMODE_MASK) val = (uint32_t)mode << shift; RMU->CTRL = (RMU->CTRL & ~reset) | val; #else BUS_RegBitWrite(&RMU->CTRL, (uint32_t)shift, mode); #endif }
/***************************************************************************//** * @brief * Function calls users callback for registered pin interrupts. * * @details * This function is called when GPIO interrupts are handled by the dispatcher. * Function gets even or odd interrupt flags and calls user callback * registered for that pin. Function iterates on flags starting from MSB. * * @param iflags * Interrupt flags which shall be handled by the dispatcher. * ******************************************************************************/ static void GPIOINT_IRQDispatcher(uint32_t iflags) { uint32_t irqIdx; GPIOINT_IrqCallbackPtr_t callback; /* check for all flags set in IF register */ while(iflags) { irqIdx = EFM32_CTZ(iflags); /* clear flag*/ iflags &= ~(1 << irqIdx); callback = gpioCallbacks[irqIdx]; if (callback) { /* call user callback */ callback(irqIdx); } } }