Lines Matching refs:fifo
246 static void can_xmc4xxx_deinit_fifo(const struct device *dev, struct can_xmc4xxx_rx_fifo *fifo) in can_xmc4xxx_deinit_fifo() argument
248 CAN_MO_TypeDef *mo = fifo->base; in can_xmc4xxx_deinit_fifo()
260 if ((uint32_t)mo == (uint32_t)fifo->top) { in can_xmc4xxx_deinit_fifo()
276 struct can_xmc4xxx_rx_fifo *fifo, bool is_rtr) in can_xmc4xxx_init_fifo() argument
291 fifo->base = mo; in can_xmc4xxx_init_fifo()
292 fifo->tail = mo; in can_xmc4xxx_init_fifo()
346 fifo->base->MOFGPR = reg; in can_xmc4xxx_init_fifo()
347 fifo->top = mo; in can_xmc4xxx_init_fifo()
565 static inline void can_xmc4xxx_increment_fifo_tail(struct can_xmc4xxx_rx_fifo *fifo) in can_xmc4xxx_increment_fifo_tail() argument
569 if ((uint32_t)fifo->tail == (uint32_t)fifo->top) { in can_xmc4xxx_increment_fifo_tail()
570 fifo->tail = fifo->base; in can_xmc4xxx_increment_fifo_tail()
574 next_index = FIELD_GET(CAN_MO_MOSTAT_PNEXT_Msk, fifo->tail->MOSTAT); in can_xmc4xxx_increment_fifo_tail()
575 fifo->tail = &CAN_MO->MO[next_index]; in can_xmc4xxx_increment_fifo_tail()
578 static inline bool can_xmc4xxx_is_fifo_empty(struct can_xmc4xxx_rx_fifo *fifo) in can_xmc4xxx_is_fifo_empty() argument
580 if (fifo->tail->MOSTAT & XMC_CAN_MO_STATUS_RX_PENDING) { in can_xmc4xxx_is_fifo_empty()
587 static inline void can_xmc4xxx_update_fifo_head(struct can_xmc4xxx_rx_fifo *fifo) in can_xmc4xxx_update_fifo_head() argument
589 uint32_t reg = fifo->base->MOFGPR; in can_xmc4xxx_update_fifo_head()
593 fifo->head = &CAN_MO->MO[head_index]; in can_xmc4xxx_update_fifo_head()
601 static void can_xmc4xxx_rx_fifo_handler(const struct device *dev, struct can_xmc4xxx_rx_fifo *fifo, in can_xmc4xxx_rx_fifo_handler() argument
604 bool is_rtr = (fifo->base->MOSTAT & CAN_MO_MOSTAT_DIR_Msk) != 0; in can_xmc4xxx_rx_fifo_handler()
606 while (!can_xmc4xxx_is_fifo_empty(fifo)) { in can_xmc4xxx_rx_fifo_handler()
608 CAN_MO_TypeDef *mo_tail = fifo->tail; in can_xmc4xxx_rx_fifo_handler()
635 can_xmc4xxx_increment_fifo_tail(fifo); in can_xmc4xxx_rx_fifo_handler()