add STM32F042x6

This commit is contained in:
Johnny Hsu 2024-11-02 17:31:54 +01:00
parent 80068a98fa
commit 6f6cbf1d1e
1 changed files with 17 additions and 10 deletions

View File

@ -2,7 +2,7 @@
#define CAN_HALAL_H
// Define family macros if none are defined and we recognize a chip macro
#if !defined(STM32F3) && !defined(STM32H7)
#if !defined(STM32F3) && !defined(STM32H7) && !defined(STM32F0)
#if defined(STM32F302x6) || defined(STM32F302x8) || defined(STM32F302xB) || \
defined(STM32F302xC)
#define STM32F3
@ -10,20 +10,27 @@
#if defined(STM32H7A3xx)
#define STM32H7
#endif
#if defined(STM32F042x6)
#define STM32F0
#endif
#endif
#if defined(STM32F3)
#include "stm32f3xx_hal.h"
#define FTCAN_IS_BXCAN
#define FTCAN_NUM_FILTERS 13
#include "stm32f3xx_hal.h"
#define FTCAN_IS_BXCAN
#define FTCAN_NUM_FILTERS 13
#elif defined(STM32H7)
#include "stm32h7xx_hal.h"
#define FTCAN_IS_FDCAN
#ifndef FTCAN_NUM_FILTERS
#error "Please configure the number of filters in CubeMX, and then add a compiler define for FTCAN_NUM_FILTERS"
#endif
#include "stm32h7xx_hal.h"
#define FTCAN_IS_FDCAN
#ifndef FTCAN_NUM_FILTERS
#error "Please configure the number of filters in CubeMX, and then add a compiler define for FTCAN_NUM_FILTERS"
#endif
#elif defined(STM32F0)
#include "stm32f0xx_hal.h"
#define FTCAN_IS_BXCAN
#define FTCAN_NUM_FILTERS 13
#else
#error "Couldn't detect STM family"
#error "Couldn't detect STM family"
#endif
#if defined(FTCAN_IS_BXCAN)