arch/stm32: add FDCAN SocketCAN support

This commit is contained in:
raiden00pl 2022-01-22 15:10:27 +01:00 committed by Xiang Xiao
parent e7953d8d9c
commit 341bbe38d5
4 changed files with 3226 additions and 7 deletions

View File

@ -2769,14 +2769,12 @@ config STM32_BKPSRAM
config STM32_CAN1
bool "CAN1"
default n
select CAN
select STM32_CAN
depends on STM32_HAVE_CAN1
config STM32_CAN2
bool "CAN2"
default n
select CAN
select STM32_CAN
depends on STM32_HAVE_CAN2
@ -3391,11 +3389,9 @@ config STM32_I2C
config STM32_CAN
bool
select ARCH_HAVE_CAN_ERRORS
config STM32_FDCAN
bool
select ARCH_HAVE_CAN_ERRORS
config STM32_TIM
bool
@ -10863,6 +10859,7 @@ choice
config STM32_CAN_CHARDRIVER
bool "STM32 CAN character driver support"
select ARCH_HAVE_CAN_ERRORS
select CAN
config STM32_CAN_SOCKET
bool "STM32 CAN SocketCAN support"
@ -10915,11 +10912,12 @@ choice
config STM32_FDCAN_CHARDRIVER
bool "STM32 FDCAN character driver support"
select ARCH_HAVE_FDCAN_ERRORS
select ARCH_HAVE_CAN_ERRORS
select CAN
config STM32_FDCAN_SOCKET
bool "STM32 FDCAN SocketCAN support (not supported yet)"
select NET_FDCAN_HAVE_ERRORS
bool "STM32 FDCAN SocketCAN support"
select NET_CAN_HAVE_ERRORS
endchoice # FDCAN character driver or SocketCAN support

View File

@ -249,6 +249,9 @@ ifeq ($(CONFIG_STM32_FDCAN),y)
ifeq ($(CONFIG_STM32_FDCAN_CHARDRIVER),y)
CHIP_CSRCS += stm32_fdcan.c
endif
ifeq ($(CONFIG_STM32_FDCAN_SOCKET),y)
CHIP_CSRCS += stm32_fdcan_sock.c
endif
endif
ifeq ($(CONFIG_STM32_IWDG),y)

View File

@ -65,6 +65,8 @@ extern "C"
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
/****************************************************************************
* Name: stm32_fdcaninitialize
*
@ -80,6 +82,26 @@ extern "C"
****************************************************************************/
FAR struct can_dev_s *stm32_fdcaninitialize(int port);
#endif
#ifdef CONFIG_STM32_FDCAN_SOCKET
/****************************************************************************
* Name: stm32_fdcansockinitialize
*
* Description:
* Initialize the selected FDCAN port as SocketCAN interface
*
* Input Parameters:
* Port number (for hardware that has multiple FDCAN interfaces)
*
* Returned Value:
* OK on success; Negated errno on failure.
*
****************************************************************************/
int stm32_fdcansockinitialize(int port);
#endif
#undef EXTERN
#if defined(__cplusplus)

File diff suppressed because it is too large Load Diff