當前位置: 首頁>>代碼示例>>C++>>正文


C++ DEVICE_GET函數代碼示例

本文整理匯總了C++中DEVICE_GET函數的典型用法代碼示例。如果您正苦於以下問題:C++ DEVICE_GET函數的具體用法?C++ DEVICE_GET怎麽用?C++ DEVICE_GET使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DEVICE_GET函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: i2c_stm32_irq_config_func_4

static void i2c_stm32_irq_config_func_4(struct device *dev)
{
	IRQ_CONNECT(DT_I2C_4_EVENT_IRQ, DT_I2C_4_EVENT_IRQ_PRI,
		   stm32_i2c_event_isr, DEVICE_GET(i2c_stm32_4), 0);
	irq_enable(DT_I2C_4_EVENT_IRQ);

	IRQ_CONNECT(DT_I2C_4_ERROR_IRQ, DT_I2C_4_ERROR_IRQ_PRI,
		   stm32_i2c_error_isr, DEVICE_GET(i2c_stm32_4), 0);
	irq_enable(DT_I2C_4_ERROR_IRQ);
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:10,代碼來源:i2c_ll_stm32.c

示例2: dma_qmsi_config

static void dma_qmsi_config(struct device *dev)
{
	ARG_UNUSED(dev);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_0), CONFIG_DMA_0_IRQ_PRI,
			qm_dma_0_isr_0, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_0));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_0_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_1), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_1, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_1));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_1_mask);

#if (CONFIG_SOC_QUARK_SE_C1000)

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_2), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_2, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_2));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_2_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_3), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_3, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_3));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_3_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_4), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_4, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_4));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_4_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_5), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_5, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_5));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_5_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_6), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_6, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_6));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_6_mask);

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_7), CONFIG_DMA_0_IRQ_PRI,
				qm_dma_0_isr_7, DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_INT_7));
	QM_IR_UNMASK_INTERRUPTS(QM_INTERRUPT_ROUTER->dma_0_int_7_mask);

#endif /* CONFIG_SOC_QUARK_SE_C1000 */

	IRQ_CONNECT(IRQ_GET_NUMBER(QM_IRQ_DMA_0_ERROR_INT),
		    CONFIG_DMA_0_IRQ_PRI, qm_dma_0_error_isr,
		    DEVICE_GET(dma_qmsi), 0);
	irq_enable(IRQ_GET_NUMBER(QM_IRQ_DMA_0_ERROR_INT));
#if (QM_LAKEMONT)
	QM_INTERRUPT_ROUTER->dma_0_error_int_mask &= ~QM_IR_DMA_ERROR_HOST_MASK;
#elif (QM_SENSOR)
	QM_INTERRUPT_ROUTER->dma_0_error_int_mask &= ~QM_IR_DMA_ERROR_SS_MASK;
#endif

}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:59,代碼來源:dma_qmsi.c

示例3: usart_gecko_config_func_3

static void usart_gecko_config_func_3(struct device *dev)
{
	IRQ_CONNECT(DT_SILABS_GECKO_USART_3_IRQ_RX,
		    DT_SILABS_GECKO_USART_3_IRQ_RX_PRIORITY,
		    uart_gecko_isr, DEVICE_GET(usart_3), 0);
	IRQ_CONNECT(DT_SILABS_GECKO_USART_3_IRQ_TX,
		    DT_SILABS_GECKO_USART_3_IRQ_TX_PRIORITY,
		    uart_gecko_isr, DEVICE_GET(usart_3), 0);

	irq_enable(DT_SILABS_GECKO_USART_3_IRQ_RX);
	irq_enable(DT_SILABS_GECKO_USART_3_IRQ_TX);
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:12,代碼來源:uart_gecko.c

示例4: uart_mcux_config_func_5

static void uart_mcux_config_func_5(struct device *dev)
{
	IRQ_CONNECT(CONFIG_UART_MCUX_5_IRQ_STATUS,
		    CONFIG_UART_MCUX_5_IRQ_STATUS_PRI,
		    uart_mcux_isr, DEVICE_GET(uart_5), 0);

	irq_enable(CONFIG_UART_MCUX_5_IRQ_STATUS);

	IRQ_CONNECT(CONFIG_UART_MCUX_5_IRQ_ERROR,
		    CONFIG_UART_MCUX_5_IRQ_ERROR_PRI,
		    uart_mcux_isr, DEVICE_GET(uart_5), 0);

	irq_enable(CONFIG_UART_MCUX_5_IRQ_ERROR);
}
開發者ID:rsalveti,項目名稱:zephyr,代碼行數:14,代碼來源:uart_mcux.c

示例5: mcux_igpio_4_init

static int mcux_igpio_4_init(struct device *dev)
{
	IRQ_CONNECT(CONFIG_MCUX_IGPIO_4_IRQ_0, CONFIG_MCUX_IGPIO_4_IRQ_0_PRI,
		    mcux_igpio_port_isr, DEVICE_GET(mcux_igpio_4), 0);

	irq_enable(CONFIG_MCUX_IGPIO_4_IRQ_0);

	IRQ_CONNECT(CONFIG_MCUX_IGPIO_4_IRQ_1, CONFIG_MCUX_IGPIO_4_IRQ_1_PRI,
		    mcux_igpio_port_isr, DEVICE_GET(mcux_igpio_4), 0);

	irq_enable(CONFIG_MCUX_IGPIO_4_IRQ_1);

	return 0;
}
開發者ID:zmole945,項目名稱:zephyr,代碼行數:14,代碼來源:gpio_mcux_igpio.c

示例6: mcux_igpio_5_init

static int mcux_igpio_5_init(struct device *dev)
{
	IRQ_CONNECT(DT_MCUX_IGPIO_5_IRQ_0, DT_MCUX_IGPIO_5_IRQ_0_PRI,
		    mcux_igpio_port_isr, DEVICE_GET(mcux_igpio_5), 0);

	irq_enable(DT_MCUX_IGPIO_5_IRQ_0);

	IRQ_CONNECT(DT_MCUX_IGPIO_5_IRQ_1, DT_MCUX_IGPIO_5_IRQ_1_PRI,
		    mcux_igpio_port_isr, DEVICE_GET(mcux_igpio_5), 0);

	irq_enable(DT_MCUX_IGPIO_5_IRQ_1);

	return 0;
}
開發者ID:loicpoulain,項目名稱:zephyr,代碼行數:14,代碼來源:gpio_mcux_igpio.c

示例7: uart_mcux_config_func_5

static void uart_mcux_config_func_5(struct device *dev)
{
	IRQ_CONNECT(IRQ_UART5_STATUS, CONFIG_UART_MCUX_5_IRQ_PRI,
		    uart_mcux_isr, DEVICE_GET(uart_5), 0);

	irq_enable(IRQ_UART5_STATUS);

#ifdef IRQ_UART5_ERROR
	IRQ_CONNECT(IRQ_UART5_ERROR, CONFIG_UART_MCUX_5_IRQ_PRI,
		    uart_mcux_isr, DEVICE_GET(uart_5), 0);

	irq_enable(IRQ_UART5_ERROR);
#endif
}
開發者ID:01org,項目名稱:zephyr,代碼行數:14,代碼來源:uart_mcux.c

示例8: qdec_nrfx_event_handler

static void qdec_nrfx_event_handler(nrfx_qdec_event_t event)
{
	sensor_trigger_handler_t handler;
	unsigned int key;

	switch (event.type) {
	case NRF_QDEC_EVENT_REPORTRDY:
		accumulate(&qdec_nrfx_data, event.data.report.acc);

		key = irq_lock();
		handler = qdec_nrfx_data.data_ready_handler;
		irq_unlock(key);

		if (handler) {
			struct sensor_trigger trig = {
				.type = SENSOR_TRIG_DATA_READY,
				.chan = SENSOR_CHAN_ROTATION,
			};

			handler(DEVICE_GET(qdec_nrfx), &trig);
		}
		break;

	default:
		LOG_ERR("unhandled event (0x%x)", event.type);
		break;
	}
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:28,代碼來源:qdec_nrfx.c

示例9: uart_cmsdk_apb_irq_config_func_4

static void uart_cmsdk_apb_irq_config_func_4(struct device *dev)
{
	IRQ_CONNECT(DT_ARM_CMSDK_UART_4_IRQ_TX,
		    DT_ARM_CMSDK_UART_4_IRQ_TX_PRIORITY,
		    uart_cmsdk_apb_isr,
		    DEVICE_GET(uart_cmsdk_apb_4),
		    0);
	irq_enable(DT_ARM_CMSDK_UART_4_IRQ_TX);

	IRQ_CONNECT(DT_ARM_CMSDK_UART_4_IRQ_RX,
		    DT_ARM_CMSDK_UART_4_IRQ_RX_PRIORITY,
		    uart_cmsdk_apb_isr,
		    DEVICE_GET(uart_cmsdk_apb_4),
		    0);
	irq_enable(DT_ARM_CMSDK_UART_4_IRQ_RX);
}
開發者ID:loicpoulain,項目名稱:zephyr,代碼行數:16,代碼來源:uart_cmsdk_apb.c

示例10: i2c_stm32_irq_config_func_2

static void i2c_stm32_irq_config_func_2(struct device *dev)
{
#ifdef CONFIG_I2C_STM32_COMBINED_INTERRUPT
	IRQ_CONNECT(DT_I2C_2_COMBINED_IRQ, DT_I2C_2_COMBINED_IRQ_PRI,
		   stm32_i2c_combined_isr, DEVICE_GET(i2c_stm32_2), 0);
	irq_enable(DT_I2C_2_COMBINED_IRQ);
#else
	IRQ_CONNECT(DT_I2C_2_EVENT_IRQ, DT_I2C_2_EVENT_IRQ_PRI,
		   stm32_i2c_event_isr, DEVICE_GET(i2c_stm32_2), 0);
	irq_enable(DT_I2C_2_EVENT_IRQ);

	IRQ_CONNECT(DT_I2C_2_ERROR_IRQ, DT_I2C_2_ERROR_IRQ_PRI,
		   stm32_i2c_error_isr, DEVICE_GET(i2c_stm32_2), 0);
	irq_enable(DT_I2C_2_ERROR_IRQ);
#endif
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:16,代碼來源:i2c_ll_stm32.c

示例11: mcux_wdog_config_func_0

static void mcux_wdog_config_func_0(struct device *dev)
{
	IRQ_CONNECT(CONFIG_WDT_0_IRQ, CONFIG_WDT_0_IRQ_PRI,
		    mcux_wdog_isr, DEVICE_GET(mcux_wdog_0), 0);

	irq_enable(CONFIG_WDT_0_IRQ);
}
開發者ID:nordic-krch,項目名稱:zephyr,代碼行數:7,代碼來源:wdt_mcux_wdog.c

示例12: i2c_mcux_config_func_1

static void i2c_mcux_config_func_1(struct device *dev)
{
	IRQ_CONNECT(CONFIG_I2C_MCUX_1_IRQ, CONFIG_I2C_MCUX_1_IRQ_PRI,
		    i2c_mcux_isr, DEVICE_GET(i2c_mcux_1), 0);

	irq_enable(CONFIG_I2C_MCUX_1_IRQ);
}
開發者ID:kraj,項目名稱:zephyr,代碼行數:7,代碼來源:i2c_mcux.c

示例13: imx_gpio_7_init

static int imx_gpio_7_init(struct device *dev)
{
	IRQ_CONNECT(DT_GPIO_IMX_PORT_7_IRQ_0,
		    DT_GPIO_IMX_PORT_7_IRQ_0_PRI,
		    imx_gpio_port_isr, DEVICE_GET(imx_gpio_7), 0);

	irq_enable(DT_GPIO_IMX_PORT_7_IRQ_0);

	IRQ_CONNECT(DT_GPIO_IMX_PORT_7_IRQ_1,
		    DT_GPIO_IMX_PORT_7_IRQ_1_PRI,
		    imx_gpio_port_isr, DEVICE_GET(imx_gpio_7), 0);

	irq_enable(DT_GPIO_IMX_PORT_7_IRQ_1);

	return 0;
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:16,代碼來源:gpio_imx.c

示例14: mcux_adc16_config_func_1

static void mcux_adc16_config_func_1(struct device *dev)
{
	IRQ_CONNECT(CONFIG_ADC_1_IRQ, CONFIG_ADC_1_IRQ_PRI,
		    mcux_adc16_isr, DEVICE_GET(mcux_adc16_1), 0);

	irq_enable(CONFIG_ADC_1_IRQ);
}
開發者ID:agatti,項目名稱:zephyr,代碼行數:7,代碼來源:adc_mcux_adc16.c

示例15: timer_cmsdk_apb_config_1

static void timer_cmsdk_apb_config_1(struct device *dev)
{
	IRQ_CONNECT(CMSDK_APB_TIMER_1_IRQ, CONFIG_TIMER_TMR_CMSDK_APB_1_IRQ_PRI,
		    timer_tmr_cmsdk_apb_isr,
		    DEVICE_GET(timer_tmr_cmsdk_apb_0), 0);
	irq_enable(CMSDK_APB_TIMER_1_IRQ);
}
開發者ID:01org,項目名稱:zephyr,代碼行數:7,代碼來源:timer_tmr_cmsdk_apb.c


注:本文中的DEVICE_GET函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。