Lines Matching refs:mo
150 CAN_MO_TypeDef *mo; in can_xmc4xxx_send() local
196 mo = dev_data->tx_mo[mailbox_idx]; in can_xmc4xxx_send()
197 mo->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk; in can_xmc4xxx_send()
201 mo->MOAR = FIELD_PREP(CAN_MO_MOAR_PRI_Msk, 1) | in can_xmc4xxx_send()
204 mo->MOAR = FIELD_PREP(CAN_MO_MOAR_PRI_Msk, 1) | in can_xmc4xxx_send()
208 mo->MOFCR &= ~CAN_MO_MOFCR_DLC_Msk; in can_xmc4xxx_send()
209 mo->MOFCR |= FIELD_PREP(CAN_MO_MOFCR_DLC_Msk, msg->dlc); in can_xmc4xxx_send()
212 mo->MOCTR = CAN_MO_MOCTR_RESDIR_Msk; in can_xmc4xxx_send()
214 mo->MOCTR = CAN_MO_MOCTR_SETDIR_Msk; in can_xmc4xxx_send()
215 memcpy((void *)&mo->MODATAL, &msg->data[0], sizeof(uint32_t)); in can_xmc4xxx_send()
216 memcpy((void *)&mo->MODATAH, &msg->data[4], sizeof(uint32_t)); in can_xmc4xxx_send()
219 mo->MOCTR = CAN_MO_MOCTR_SETTXEN0_Msk | CAN_MO_MOCTR_SETTXEN1_Msk | in can_xmc4xxx_send()
222 mo->MOCTR = CAN_MO_MOCTR_SETTXRQ_Msk; in can_xmc4xxx_send()
248 CAN_MO_TypeDef *mo = fifo->base; in can_xmc4xxx_deinit_fifo() local
250 while (mo != NULL) { in can_xmc4xxx_deinit_fifo()
255 mo->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk; in can_xmc4xxx_deinit_fifo()
257 next_index = FIELD_GET(CAN_MO_MOSTAT_PNEXT_Msk, mo->MOSTAT); in can_xmc4xxx_deinit_fifo()
258 index = ((uint32_t)mo - (uint32_t)&CAN_MO->MO[0]) / sizeof(*mo); in can_xmc4xxx_deinit_fifo()
260 if ((uint32_t)mo == (uint32_t)fifo->top) { in can_xmc4xxx_deinit_fifo()
261 mo = NULL; in can_xmc4xxx_deinit_fifo()
263 mo = &CAN_MO->MO[next_index]; in can_xmc4xxx_deinit_fifo()
279 CAN_MO_TypeDef *mo; in can_xmc4xxx_init_fifo() local
287 mo = can_xmc4xxx_get_mo(&mo_index); in can_xmc4xxx_init_fifo()
288 __ASSERT_NO_MSG(mo != NULL); in can_xmc4xxx_init_fifo()
291 fifo->base = mo; in can_xmc4xxx_init_fifo()
292 fifo->tail = mo; in can_xmc4xxx_init_fifo()
298 mo->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk; in can_xmc4xxx_init_fifo()
299 mo->MOAMR &= ~(CAN_MO_MOAMR_AM_Msk | CAN_MO_MOAMR_MIDE_Msk); in can_xmc4xxx_init_fifo()
300 mo->MOAR = 0; in can_xmc4xxx_init_fifo()
303 mo->MOAMR |= FIELD_PREP(CAN_MO_MOAMR_AM_Msk, filter->mask) | CAN_MO_MOAMR_MIDE_Msk; in can_xmc4xxx_init_fifo()
304 mo->MOAR |= FIELD_PREP(CAN_MO_MOAR_ID_Msk, filter->id) | CAN_MO_MOAR_IDE_Msk; in can_xmc4xxx_init_fifo()
306 mo->MOAMR |= FIELD_PREP(XMC_CAN_MO_MOAR_STDID_Msk, filter->mask); in can_xmc4xxx_init_fifo()
307 mo->MOAR |= FIELD_PREP(XMC_CAN_MO_MOAR_STDID_Msk, filter->id); in can_xmc4xxx_init_fifo()
310 mo->MOFCR = FIELD_PREP(CAN_MO_MOFCR_MMC_Msk, 1) | CAN_MO_MOFCR_RXIE_Msk; in can_xmc4xxx_init_fifo()
312 mo->MOFCR |= CAN_MO_MOFCR_RMM_Msk; in can_xmc4xxx_init_fifo()
313 mo->MOCTR = CAN_MO_MOCTR_SETDIR_Msk; in can_xmc4xxx_init_fifo()
315 mo->MOCTR = CAN_MO_MOCTR_RESDIR_Msk; in can_xmc4xxx_init_fifo()
319 mo->MOCTR = CAN_MO_MOCTR_RESTXEN0_Msk | CAN_MO_MOCTR_RESTXEN1_Msk | in can_xmc4xxx_init_fifo()
323 mo->MOIPR = FIELD_PREP(CAN_MO_MOIPR_RXINP_Msk, dev_cfg->service_request); in can_xmc4xxx_init_fifo()
327 mo = can_xmc4xxx_get_mo(&mo_index); in can_xmc4xxx_init_fifo()
328 __ASSERT_NO_MSG(mo != NULL); in can_xmc4xxx_init_fifo()
333 mo->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk; in can_xmc4xxx_init_fifo()
334 mo->MOCTR = CAN_MO_MOCTR_SETMSGVAL_Msk | CAN_MO_MOCTR_RESRXEN_Msk; in can_xmc4xxx_init_fifo()
337 mo->MOFGPR = FIELD_PREP(CAN_MO_MOFGPR_CUR_Msk, base_index); in can_xmc4xxx_init_fifo()
347 fifo->top = mo; in can_xmc4xxx_init_fifo()
544 CAN_MO_TypeDef *mo = dev_data->tx_mo[i]; in can_xmc4xxx_tx_handler() local
546 if ((mo->MOSTAT & XMC_CAN_MO_STATUS_TX_PENDING) != 0) { in can_xmc4xxx_tx_handler()
550 mo->MOCTR = XMC_CAN_MO_RESET_STATUS_TX_PENDING; in can_xmc4xxx_tx_handler()
791 CAN_MO_TypeDef *mo; in can_xmc4xxx_init() local
841 mo = can_xmc4xxx_get_mo(&mo_index); in can_xmc4xxx_init()
842 if (mo == NULL) { in can_xmc4xxx_init()
846 dev_data->tx_mo[i] = mo; in can_xmc4xxx_init()
851 mo->MOIPR = FIELD_PREP(CAN_MO_MOIPR_TXINP_Msk, dev_cfg->service_request); in can_xmc4xxx_init()
852 mo->MOFCR = FIELD_PREP(CAN_MO_MOFCR_MMC_Msk, 0) | CAN_MO_MOFCR_TXIE_Msk; in can_xmc4xxx_init()