stm32: Add support for FDCAN peripheral, exposed as pyb.CAN.

The new fdcan.c file provides the low-level C interface to the FDCAN
peripheral, and pyb_can.c is updated to support both traditional CAN and
FDCAN, depending on the MCU being compiled for.
This commit is contained in:
iabdalkader
2019-09-16 01:56:38 +02:00
committed by Damien George
parent d06fd384c2
commit f7a07b3605
7 changed files with 604 additions and 52 deletions

View File

@@ -275,6 +275,9 @@
// Enable CAN if there are any peripherals defined
#if defined(MICROPY_HW_CAN1_TX) || defined(MICROPY_HW_CAN2_TX) || defined(MICROPY_HW_CAN3_TX)
#define MICROPY_HW_ENABLE_CAN (1)
#if defined(STM32H7)
#define MICROPY_HW_ENABLE_FDCAN (1) // define for MCUs with FDCAN
#endif
#else
#define MICROPY_HW_ENABLE_CAN (0)
#define MICROPY_HW_MAX_CAN (0)