GD32F20x User Manual
753
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 reading the current frame, set RFD0
bit in CAN_RFIFO0 to release a frame in the receive FIFO and the software can read the next
frame.
Receive FIFO status
RFLx 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.
RFFx bit in CAN_RFIFOx register: the FIFO holds three frames. It indicates FIFOx is full.
RFOx 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 RFDx bit in CAN_RFIFOx register.
26.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
In GD32F205 and GD32F207, 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
Figure 26-5. 32-bit filter
FDATA[31:21]
FDATA[20:3]
FDATA[2:0]
SFID[10:0]
EFID[17:0]
FF
FT
0
16-bit: SFID [10:0], FT, FF and EFID[17:15] bits. As shown in
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...