Example #1
0
/*
 *	@fn		nm_bsp_interrupt_ctrl
 *	@brief	Enable/Disable interrupts
 *	@param[IN]	u8Enable
 *				'0' disable interrupts. '1' enable interrupts
 */
void nm_bsp_interrupt_ctrl(uint8 u8Enable)
{
	if (u8Enable) {
		extint_chan_enable_callback(CONF_WINC_SPI_INT_EIC,
				EXTINT_CALLBACK_TYPE_DETECT);
	} else {
		extint_chan_disable_callback(CONF_WINC_SPI_INT_EIC,
				EXTINT_CALLBACK_TYPE_DETECT);
	}
}
Example #2
0
/**
 * \internal
 * \brief Cleanup function for callback mode test.
 *
 * This function disables the callback & external interrupt channel.
 *
 * \param test Current test case.
 */
static void cleanup_extint_callback_mode_test(const struct test_case *test)
{
	eic_conf.detection_criteria = EXTINT_DETECT_NONE;
	extint_chan_set_config(EIC_TEST_CHANNEL, &eic_conf);
	/* Unregister and disable the callback function */
	extint_unregister_callback(extint_user_callback,
			EIC_TEST_CHANNEL,
			EXTINT_CALLBACK_TYPE_DETECT);
	extint_chan_disable_callback(EIC_TEST_CHANNEL,
			EXTINT_CALLBACK_TYPE_DETECT);
}
Example #3
0
/**
 * \brief Deinitialize the dual role driver
 */
void usb_dual_disable(void)
{
	if (!_initialized) {
		return; // Dual role not initialized
	}
	_initialized = false;

#if USB_ID_EIC
	extint_chan_disable_callback(USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
#endif
}
Example #4
0
/**
 * USB ID pin change handler
 */
static void usb_id_handler(void)
{
	extint_chan_disable_callback(USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
	if (_usb_is_id_device()) {
		uhc_stop(false);
		UHC_MODE_CHANGE(false);
		udc_start();
	} else {
		udc_stop();
		UHC_MODE_CHANGE(true);
		uhc_start();
	}
	extint_chan_enable_callback(USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
}
Example #5
0
/**
 * USB ID pin configuration
 */
static void usb_id_config(void)
{
	struct extint_chan_conf eint_chan_conf;
	extint_chan_get_config_defaults(&eint_chan_conf);

	eint_chan_conf.gpio_pin           = USB_ID_PIN;
	eint_chan_conf.gpio_pin_mux       = USB_ID_EIC_MUX;
	eint_chan_conf.detection_criteria = EXTINT_DETECT_BOTH;
	eint_chan_conf.filter_input_signal = true;

	extint_chan_disable_callback(USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
	extint_chan_set_config(USB_ID_EIC_LINE, &eint_chan_conf);
	extint_register_callback(usb_id_handler,
			USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
	extint_chan_enable_callback(USB_ID_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
}
Example #6
0
void cph_deca_reset(void) {
	struct port_config config_port = DW_RST_PIN_CONFIG;

	// Safety
	extint_chan_disable_callback(DW_RST_LINE, EXTINT_CALLBACK_TYPE_DETECT);

	// Pull the pin low
	config_port.direction = PORT_PIN_DIR_OUTPUT;
	config_port.input_pull = PORT_PIN_PULL_NONE;
	port_pin_set_output_level(DW_RST_PIN, false);
	port_pin_set_config(DW_RST_PIN, &config_port);

	// Now release it
	config_port.direction = PORT_PIN_DIR_INPUT;
	config_port.input_pull = PORT_PIN_PULL_NONE;
	port_pin_set_config(DW_RST_PIN, &config_port);


	// Why sleep here?  Left over from original code.
	cph_millis_delay(1);
}
Example #7
0
/*---------------------------------------------------------------------------*/
static int
configure(int type, int value)
{
  switch(type) {
  case SENSORS_HW_INIT:
    configure_button();
    return 1;
  case SENSORS_ACTIVE:
    if(value) {
      if(!interrupt_enabled) {
        timer_set(&debouncetimer, 0);
        extint_chan_enable_callback(BUTTON_0_EIC_LINE,
                                    EXTINT_CALLBACK_TYPE_DETECT);
        interrupt_enabled = 1;
      }
    } else {
      extint_chan_disable_callback(BUTTON_0_EIC_LINE,
                                   EXTINT_CALLBACK_TYPE_DETECT);
      interrupt_enabled = 0;
    }
    return 1;
  }
  return 0;
}
Example #8
0
/**
 * \brief Disables interrupt pin change
 */
static void ui_disable_asynchronous_interrupt(void)
{
	extint_chan_disable_callback(BUTTON_0_EIC_LINE,
			EXTINT_CALLBACK_TYPE_DETECT);
}
Example #9
0
void cph_deca_isr_disable(void) {
	extint_chan_disable_callback(DW_IRQ_LINE, EXTINT_CALLBACK_TYPE_DETECT);
}
Example #10
0
File: ui.c Project: InSoonPark/asf
void ui_wakeup_disable(void)
{
	extint_chan_disable_callback(BUTTON_0_EIC_LINE,EXTINT_CALLBACK_TYPE_DETECT);
}