Lines Matching refs:inst
159 #define CAN_SAM_IRQ_CFG_FUNCTION(inst) \ argument
160 static void config_can_##inst##_irq(void) \
163 IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, int0, irq), \
164 DT_INST_IRQ_BY_NAME(inst, int0, priority), can_mcan_line_0_isr, \
165 DEVICE_DT_INST_GET(inst), 0); \
166 irq_enable(DT_INST_IRQ_BY_NAME(inst, int0, irq)); \
167 IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, int1, irq), \
168 DT_INST_IRQ_BY_NAME(inst, int1, priority), can_mcan_line_1_isr, \
169 DEVICE_DT_INST_GET(inst), 0); \
170 irq_enable(DT_INST_IRQ_BY_NAME(inst, int1, irq)); \
173 #define CAN_SAM_CFG_INST(inst) \ argument
174 CAN_MCAN_DT_INST_CALLBACKS_DEFINE(inst, can_sam_cbs_##inst); \
175 CAN_MCAN_DT_INST_MRAM_DEFINE(inst, can_sam_mram_##inst); \
177 static const struct can_sam_config can_sam_cfg_##inst = { \
178 .base = CAN_MCAN_DT_INST_MCAN_ADDR(inst), \
179 .mram = (mem_addr_t)POINTER_TO_UINT(&can_sam_mram_##inst), \
180 .clock_cfg = SAM_DT_INST_CLOCK_PMC_CFG(inst), \
181 .divider = DT_INST_PROP(inst, divider), \
182 .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
183 .config_irq = config_can_##inst##_irq, \
184 .dma_base = (mm_reg_t) DT_INST_REG_ADDR_BY_NAME(inst, dma_base) \
187 static const struct can_mcan_config can_mcan_cfg_##inst = \
188 CAN_MCAN_DT_CONFIG_INST_GET(inst, &can_sam_cfg_##inst, \
190 &can_sam_cbs_##inst);
192 #define CAN_SAM_DATA_INST(inst) \ argument
193 static struct can_mcan_data can_mcan_data_##inst = \
196 #define CAN_SAM_DEVICE_INST(inst) \ argument
197 CAN_DEVICE_DT_INST_DEFINE(inst, can_sam_init, NULL, \
198 &can_mcan_data_##inst, \
199 &can_mcan_cfg_##inst, \
203 #define CAN_SAM_INST(inst) \ argument
204 CAN_MCAN_DT_INST_BUILD_ASSERT_MRAM_CFG(inst); \
205 PINCTRL_DT_INST_DEFINE(inst); \
206 CAN_SAM_IRQ_CFG_FUNCTION(inst) \
207 CAN_SAM_CFG_INST(inst) \
208 CAN_SAM_DATA_INST(inst) \
209 CAN_SAM_DEVICE_INST(inst)