/** * @brief Deactivates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_stop(EXTDriver *extp) { LPC_GPIO_TypeDef * gp = extp->gpio; if (extp->state == EXT_ACTIVE) { #if LPC11xx_EXT_USE_EXT0 if (extp == &EXTD0) { ext_lld_exti_irq_disable(EXTI0_IRQ); } #endif #if LPC11xx_EXT_USE_EXT1 if (extp == &EXTD1) { ext_lld_exti_irq_disable(EXTI1_IRQ); } #endif #if LPC11xx_EXT_USE_EXT2 if (extp == &EXTD2) { ext_lld_exti_irq_disable(EXTI2_IRQ); } #endif #if LPC11xx_EXT_USE_EXT3 if (extp == &EXTD3) { ext_lld_exti_irq_disable(EXTI3_IRQ); } #endif } gp->IE = 0; gp->IC = 0xFFFFFFFF; __NOP(); __NOP(); }
/** * @brief Disables an EXT channel. * * @param[in] extp pointer to the @p EXTDriver object * @param[in] channel channel to be disabled * * @notapi */ void ext_lld_channel_disable(EXTDriver *extp, expchannel_t channel) { (void)extp; ext_lld_exti_irq_disable(channel); LPC_PIN_INT->ISEL &= ~(1 << channel); LPC_PIN_INT->CIENR = (1 << channel); LPC_PIN_INT->RISE = (1 << channel); LPC_PIN_INT->FALL = (1 << channel); LPC_PIN_INT->IST = (1 << channel); }
/** * @brief Deactivates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_stop(EXTDriver *extp) { int i; if (extp->state == EXT_ACTIVE) for (i = 0; i < EXT_MAX_CHANNELS; i++) ext_lld_exti_irq_disable(i); LPC_GPIO_PIN_INT->ISEL = 0; LPC_GPIO_PIN_INT->CIENR = EXT_CHANNELS_MASK; LPC_GPIO_PIN_INT->RISE = EXT_CHANNELS_MASK; LPC_GPIO_PIN_INT->FALL = EXT_CHANNELS_MASK; LPC_GPIO_PIN_INT->IST = EXT_CHANNELS_MASK; LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<19); }
/** * @brief Deactivates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_stop(EXTDriver *extp) { int i; if (extp->state == EXT_ACTIVE) for (i = 0; i < EXT_MAX_CHANNELS; i++) ext_lld_exti_irq_disable(i); LPC_PIN_INT->ISEL = 0; LPC_PIN_INT->CIENR = EXT_CHANNELS_MASK; LPC_PIN_INT->RISE = EXT_CHANNELS_MASK; LPC_PIN_INT->FALL = EXT_CHANNELS_MASK; LPC_PIN_INT->IST = EXT_CHANNELS_MASK; /* Leave clock enabled, its shared with GPIO */ /*LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<6);*/ }
/** * @brief Deactivates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_stop(EXTDriver *extp) { if (extp->state == EXT_ACTIVE) ext_lld_exti_irq_disable(); }