1# CAN configuration options
2
3# Copyright (c) 2018 Alexander Wachter
4# SPDX-License-Identifier: Apache-2.0
5
6#
7# CAN options
8#
9menuconfig CAN
10	bool "Controller Area Network (CAN) drivers"
11	help
12	  Enable CAN Driver Configuration
13
14if CAN
15
16module = CAN
17module-str = CAN
18source "subsys/logging/Kconfig.template.log_config"
19
20config CAN_INIT_PRIORITY
21	int "CAN driver init priority"
22	default 80
23	help
24	  CAN driver device initialization priority.
25
26config CAN_DEFAULT_BITRATE
27	int "Default CAN bitrate"
28	default 125000
29	help
30	  Default initial CAN bitrate in bits/s. This can be overridden per CAN controller using the
31	  "bitrate" devicetree property.
32
33config CAN_DEFAULT_BITRATE_DATA
34	int "Default CAN data phase bitrate"
35	default 1000000
36	depends on CAN_FD_MODE
37	help
38	  Default initial CAN data phase bitrate in bits/s. This can be overridden per CAN controller
39	  using the "bitrate-data" devicetree property.
40
41config CAN_SAMPLE_POINT_MARGIN
42	int "Maximum acceptable sample point location deviation"
43	default 50
44	range 0 1000
45	help
46	  Maximum acceptable deviation in sample point location (permille). A value of 50 means +/-
47	  5 percentage points margin allowed.
48
49config CAN_SHELL
50	bool "CAN shell"
51	depends on SHELL
52	select POLL
53	help
54	  Enable CAN Shell for testing.
55
56if CAN_SHELL
57
58config CAN_SHELL_TX_QUEUE_SIZE
59	int "CAN shell transmit queue size"
60	default 5
61	range 1 256
62	help
63	  Maximum number of events in the CAN shell transmit queue.
64
65config CAN_SHELL_RX_QUEUE_SIZE
66	int "CAN shell receive queue size"
67	default 5
68	range 1 256
69	help
70	  Maximum number of CAN frames in the CAN shell receive queue.
71
72config CAN_SHELL_SCRIPTING_FRIENDLY
73	bool "Produce scripting-friendly output"
74	help
75	  Enable scripting-friendly/machine-readable output from the CAN shell. Enabling this
76	  bypasses the shell when printing certain outputs to ensure the output is not interleaved
77	  with the shell prompt.
78
79endif # CAN_SHELL
80
81config CAN_STATS
82	bool "CAN controller device statistics"
83	depends on STATS
84	help
85	  Enable CAN controller device statistics.
86
87config CAN_ACCEPT_RTR
88	bool "Accept Remote Transmission Requests (RTR) frames"
89	help
90	  Accept incoming Remote Transmission Request (RTR) frames matching CAN RX filters. Unless
91	  enabled, all incoming Remote Transmission Request (RTR) frames are rejected at the driver
92	  level.
93
94config CAN_FD_MODE
95	bool "CAN FD support"
96	help
97	  Enable CAN FD support. Not all CAN controllers support CAN FD.
98
99config CAN_MANUAL_RECOVERY_MODE
100	bool "Manual bus-off recovery support"
101	help
102	  Enable support for manual (non-automatic) recovery from bus-off state. Not all CAN
103	  controllers support manual recovery mode.
104
105config CAN_RX_TIMESTAMP
106	bool "Receiving timestamps"
107	help
108	  This option enables a timestamp value of the CAN free running timer.
109	  The value is incremented every bit time and starts when the controller
110	  is initialized. Not all CAN controllers support timestamps.
111
112config CAN_QEMU_IFACE_NAME
113	string "SocketCAN interface name for QEMU"
114	default ""
115	depends on QEMU_TARGET
116	help
117	  The SocketCAN interface name for QEMU. This value, if set, is given as "if" parameter to
118	  the "-object can-host-socketcan" qemu command line option. The CAN interface must be
119	  configured before starting QEMU.
120
121source "drivers/can/transceiver/Kconfig"
122
123# zephyr-keep-sorted-start
124source "drivers/can/Kconfig.esp32"
125source "drivers/can/Kconfig.fake"
126source "drivers/can/Kconfig.kvaser"
127source "drivers/can/Kconfig.loopback"
128source "drivers/can/Kconfig.max32"
129source "drivers/can/Kconfig.mcan"
130source "drivers/can/Kconfig.mcp2515"
131source "drivers/can/Kconfig.mcp251xfd"
132source "drivers/can/Kconfig.mcux"
133source "drivers/can/Kconfig.native_linux"
134source "drivers/can/Kconfig.nrf"
135source "drivers/can/Kconfig.numaker"
136source "drivers/can/Kconfig.nxp_s32"
137source "drivers/can/Kconfig.rcar"
138source "drivers/can/Kconfig.renesas_ra"
139source "drivers/can/Kconfig.renesas_rz"
140source "drivers/can/Kconfig.sam"
141source "drivers/can/Kconfig.sam0"
142source "drivers/can/Kconfig.sja1000"
143source "drivers/can/Kconfig.stm32"
144source "drivers/can/Kconfig.tcan4x5x"
145source "drivers/can/Kconfig.xmc4xxx"
146# zephyr-keep-sorted-stop
147
148endif # CAN
149