The Waveshare 2-Ch Isolated CAN Expansion HAT for Raspberry Pi, Dual Chips Solution comes with manual and examples in C / Python.
This HAT is designed for the Raspberry Pi series and adopts MCP2515 and SN65HVD230 dual chips combined solution, Breakout SPI control pins for connecting with host control boards like STM32/Arduino.