pub fn num_available_messages(&self) -> u8 {
        self.regs()
            .rx_message_cnt()
            .read()
            .rx_message_counter()
            .bits()
    }
Get the number of messages that the peripheral has available in the
receive FIFO.

Note that this may not be the number of valid messages in the receive
FIFO due to fifo overflow/overrun.
esp-hal/src/twai/mod.rs