GD32VF103 User Manual
433
by the arriving sequence of the frames. First arrived frame can be accessed by application
firstly.
The number of frames in the receive FIFO and the status can be accessed by the register
CAN_RFIFO0 and CAN_RFIFO1.
If at least one frame has been stored in the receive FIFO0. The frame data is placed in the
registers
(CAN_RFIFOMI0,
CAN_RFIFOMP0,
CAN_RFIFOMDATA00,
CAN_RFIFOMDATA10). After read the current frame, set RFD bit in CAN_RFIFO0 to release
a frame in the receive FIFO and the software can read the next frame.
Receive FIFO status
RFL bit in CAN_RFIFOx register: receive FIFO length. It is 0 when no frame is stored in the
reception FIFO and 3 when FIFOx is full.
RFF bit in CAN_RFIFOx register: the FIFO holds three frames. It indicates FIFOx is full.
RFO bit in CAN_RFIFOx register: one new frame arrived while the FIFO has hold three frames.
It indicates FIFOx is overfull. If the RFOD bit in CAN_CTL register is set, the new frame is
discarded. If the RFOD bit in CAN_CTL register is reset, the new frame is stored into the
receive FIFO and the last frame in the receive FIFO is discarded.
Steps of receiving a message
Step 1: Check the number of frames in the receive FIFO.
Step 2: Reading CAN_RFIFOMIx, CAN_RFIFOMPx, CAN_RFIFOMDATA0x and CAN_
RFIFOMDATA1x if there is data pending.
Step 3: Set the RFD bit in CAN_RFIFOx register.
20.3.5.
Filtering function
The CAN would receive frames from the CAN bus. If the frame is passed through the filter, it
is stored into the receive FIFOs. Otherwise, the frame will be discarded without intervention
by the software.
The identifier of frame from the CAN bus takes part in the matching of the filter.
Scale
The filter consists of 28 banks: bank0 to bank27. Each bank has two 32-bit registers:
CAN_FxDATA0 and CAN_FxDATA1.
Each filter bank can be configured to 32-bit or 16-bit.
32-bit: SFID[10:0], EFID[17:0], FF and FT bits. As shown in