/* Obtains value of FIFO entry length. This value covers both fixed-size frame header block and payload buffer. User can configure payload buffer size individually for each FIFO and designated RX buffer. */
unsigned fdcan_get_fifo_element_size(uint32_t canport, unsigned fifo_id)
/* Obtains value of FIFO entry length. This value covers both fixed-size frame header block and payload buffer. User can configure payload buffer size individually for each FIFO and designated RX buffer. */
unsigned fdcan_get_fifo_element_size(uint32_t canport, unsigned fifo_id)
{
	unsigned element_size;
	if (fifo_id == 0) {
		element_size = FDCAN_RXESC(canport) >> FDCAN_RXESC_F0DS_SHIFT;
	} else {
		element_size = FDCAN_RXESC(canport) >> FDCAN_RXESC_F1DS_SHIFT;
	}
	return 8 + fdcan_dlc_to_length((element_size & FDCAN_RXESC_F0DS_MASK) | 0x8);
}