nrf51 인터럽트1 nRF51 DK 예제 8 - Pin change interrupt 이번 예제는 interrupt 예제입니다. main.c 123456789int main(void){ gpio_init(); while (true) { // Do nothing. }}cs 이번 예제는 Line 3의 gpio_init()으로 끝입니다. 123456789101112static void gpio_init(void){ nrf_gpio_cfg_output(PIN_OUT); nrf_gpio_cfg_input(PIN_IN, NRF_GPIO_PIN_PULLUP); nrf_gpio_pin_clear(PIN_OUT); // Enable interrupt: NVIC_EnableIRQ(GPIOTE_IRQn); NRF_GPIOTE->CONFIG[0] = (GPIOTE_CONFIG_POLARITY_Toggle 2015. 3. 3. 이전 1 다음 인기글