/** * @brief Configures and activates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_start(EXTDriver *extp) { int i; /* Configure all pins as edge sensitive */ #if LPC122x_EXT_USE_EXT0 if (extp == &EXTD0) { LPC_GPIO0->IS = 0; ext_lld_exti_irq_enable(EXTI0_IRQ); } #endif #if LPC122x_EXT_USE_EXT1 if (extp == &EXTD1) { LPC_GPIO1->IS = 0; ext_lld_exti_irq_enable(EXTI1_IRQ); } #endif #if LPC122x_EXT_USE_EXT2 if (extp == &EXTD2) { LPC_GPIO2->IS = 0; ext_lld_exti_irq_enable(EXTI2_IRQ); } #endif /* Configuration of autostart channels.*/ for (i = 0; i < EXT_MAX_CHANNELS; i++) if (extp->config->channels[i].mode & EXT_CH_MODE_AUTOSTART) ext_lld_channel_enable(extp, i); else ext_lld_channel_disable(extp, i); }
/** * @brief Configures and activates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_start(EXTDriver *extp) { int i; LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6); /* Configuration of automatic channels.*/ for (i = 0; i < EXT_MAX_CHANNELS; i++) if (extp->config->channels[i].mode & EXT_CH_MODE_AUTOSTART) ext_lld_channel_enable(extp, i); else ext_lld_channel_disable(extp, i); }
/** * @brief Configures and activates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_start(EXTDriver *extp) { expchannel_t line; if (extp->state == EXT_STOP) osalSysUnlock(); /* Configuration of automatic channels. */ for (line = 0; line < EXT_MAX_CHANNELS; line++) { if (extp->config->channels[line].mode & EXT_CH_MODE_AUTOSTART) ext_lld_channel_enable(extp, line); else ext_lld_channel_disable(extp, line); } }
/** * @brief Configures and activates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_start(EXTDriver *extp) { if (extp->state == EXT_STOP) ext_lld_exti_irq_enable(); /* Configuration of automatic channels.*/ for (expchannel_t channel = 0; channel < EXT_MAX_CHANNELS; channel++) { uint32_t mode = extp->config->channels[channel].mode; PORT_TypeDef *port = extp->config->channels[channel].port; uint32_t pin = extp->config->channels[channel].pin; /* Initialize the channel map */ #if KINETIS_EXT_PORTA_WIDTH > 0 if (port == PORTA) porta_channel_map[pin] = channel; else #endif #if KINETIS_EXT_PORTB_WIDTH > 0 if (port == PORTB) portb_channel_map[pin] = channel; else #endif #if KINETIS_EXT_PORTC_WIDTH > 0 if (port == PORTC) portc_channel_map[pin] = channel; else #endif #if KINETIS_EXT_PORTD_WIDTH > 0 if (port == PORTD) portd_channel_map[pin] = channel; else #endif #if KINETIS_EXT_PORTE_WIDTH > 0 if (port == PORTE) porte_channel_map[pin] = channel; else #endif {} if (mode & EXT_CH_MODE_AUTOSTART) ext_lld_channel_enable(extp, channel); else if (port != NULL) ext_lld_channel_disable(extp, channel); } }
/** * @brief Configures and activates the EXT peripheral. * * @param[in] extp pointer to the @p EXTDriver object * * @notapi */ void ext_lld_start(EXTDriver *extp) { uint8_t i; if (extp->state == EXT_STOP) { ext_lld_irq_enable(); } /* Configuration of automatic channels.*/ for (i = 0; i < EXT_MAX_CHANNELS; i++) { if (extp->config->channels[i].mode & EXT_CH_MODE_AUTOSTART) { ext_lld_channel_enable(extp, i); } else { ext_lld_channel_disable(extp, i); } } }