Skip to content

Commit 2976ac3

Browse files
Alexander Wachtercarlescufi
authored andcommitted
drivers: can: Add CAN driver support for STM32
This commit adds low level driver support for STM32 micro controllers. It is tested on stm32f072b in loopback and normal mode. Signed-off-by: Alexander Wachter <[email protected]>
1 parent 50f8296 commit 2976ac3

File tree

5 files changed

+905
-0
lines changed

5 files changed

+905
-0
lines changed

drivers/can/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
zephyr_sources_ifdef(CONFIG_CAN_STM32 stm32_can.c)
12
zephyr_sources_ifdef(CONFIG_USERSPACE can_handlers.c)

drivers/can/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ config CAN_1
6767
help
6868
Enable CAN controller 1
6969

70+
source "drivers/can/Kconfig.stm32"
7071

7172
endif # CAN

drivers/can/Kconfig.stm32

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Kconfig.stm32 - STM32 CAN configuration options
2+
3+
#
4+
# Copyright (c) 2018 Alexander Wachter
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
config CAN_STM32
10+
bool "STM32 CAN Driver"
11+
default n
12+
select USE_STM32_HAL_CAN
13+
help
14+
Enable STM32 CAN Driver (tested on stm32F0 series)
15+
16+
config CAN_MAX_FILTER
17+
int "Maximum number of concurrent active filters"
18+
depends on CAN_STM32
19+
default 5
20+
range 1 56
21+
help
22+
Defines the array size of the callback/msgq pointers.
23+
Must be at least the size of concurrent reads.

0 commit comments

Comments
 (0)