Hi marcin99
You could check any of the examples provided with the software package SDK. They are located under the path SDK_2.3.0_FRDM-K66F_PATH\boards\frdmk66f\driver_examples\flexcan
Also, I recommend you to check the SDK API Reference Manual:
Kinetis SDK 2.0 API Reference Manual: FlexCAN Driver
You need to add some lines to implement FIFO and filter functionality:
uint32_t rxFifoFilter[] = {FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(0x123, 0, 0),
FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(0x123, 1, 0)};
rxFifoConfig.idFilterNum = sizeof(rxFifoFilter) / sizeof(rxFifoFilter[0]);
rxFifoConfig.idFilterTable = rxFifoFilter;
rxFifoConfig.idFilterType = kFLEXCAN_RxFifoFilterTypeA;
rxFifoConfig.priority = kFLEXCAN_RxFifoPrioHigh;
FLEXCAN_SetRxFifoConfig(EXAMPLE_CAN, &rxFifoConfig, true);
rxfifoXfer.frame = &rxFrame;
FLEXCAN_TransferReceiveFifoNonBlocking(EXAMPLE_CAN,&flexcanHandle, &rxfifoXfer);Hope this could help you.
Best regards
Jorge Alcala