Skip to content

Commit 023e451

Browse files
Alexander Wachtercarlescufi
authored andcommitted
drivers: can: Add Kconfig for CAN driver
This commit adds the Kconfig for generic CAN drivers. Signed-off-by: Alexander Wachter <[email protected]>
1 parent 9e12807 commit 023e451

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

drivers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_subdirectory_if_kconfig(spi)
2828
add_subdirectory_if_kconfig(usb)
2929
add_subdirectory_if_kconfig(watchdog)
3030
add_subdirectory_if_kconfig(wifi)
31+
add_subdirectory_if_kconfig(can)
3132

3233
add_subdirectory_ifdef(CONFIG_AIO_COMPARATOR aio)
3334
add_subdirectory_ifdef(CONFIG_BT bluetooth)

drivers/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ source "drivers/wifi/Kconfig"
7777

7878
source "drivers/led/Kconfig"
7979

80+
source "drivers/can/Kconfig"
81+
8082
endmenu

drivers/can/Kconfig

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Kconfig - CAN configuration options
2+
3+
#
4+
# Copyright (c) 2018 Alexander Wachter
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
#
10+
# CAN options
11+
#
12+
menuconfig CAN
13+
bool "CAN Drivers"
14+
default n
15+
help
16+
Enable CAN Driver Configuration
17+
18+
if CAN
19+
20+
config SYS_LOG_CAN_LEVEL
21+
int "CAN driver log level"
22+
depends on SYS_LOG
23+
default 0
24+
range 0 4
25+
help
26+
Sets log level for CAN Device Drivers.
27+
Levels are:
28+
0 OFF, do not write
29+
1 ERROR, only write SYS_LOG_ERR
30+
2 WARNING, write SYS_LOG_WRN in addition to previous level
31+
3 INFO, write SYS_LOG_INF in addition to previous levels
32+
4 DEBUG, write SYS_LOG_DBG in addition to previous levels
33+
34+
config CAN_INIT_PRIORITY
35+
int "CAN driver init priority"
36+
default 80
37+
help
38+
CAN device driver initialization priority.
39+
Do not mess with it unless you know what you are doing.
40+
Note that the priority needs to be lower than the net stack
41+
so that it can start before the networking sub-system.
42+
43+
config CAN_PHASE_SEG1_PROP_SEG
44+
int "Phase_Seg1_Prop_Seg"
45+
default 5
46+
range 1 16
47+
help
48+
Time quantums of phase buffer 1 segment + propagation segment (ISO 11898-1)
49+
50+
config CAN_PHASE_SEG2
51+
int "Phase_Seg2"
52+
default 6
53+
range 1 8
54+
help
55+
Time quantums of phase buffer 2 segment (ISO 11898-1)
56+
57+
config CAN_SJW
58+
int "SJW"
59+
default 1
60+
range 1 4
61+
help
62+
Resynchronization jump width (ISO 11898-1)
63+
64+
config CAN_1
65+
bool "Enable CAN 1"
66+
default y
67+
help
68+
Enable CAN controller 1
69+
70+
71+
endif # CAN

0 commit comments

Comments
 (0)