2017-05-12 16:23:16 +02:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
|
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
|
|
#
|
|
|
|
|
2020-02-08 08:30:09 +01:00
|
|
|
config ARCH_HAVE_CAN_ERRORS
|
|
|
|
bool
|
|
|
|
default n
|
|
|
|
|
2020-02-15 14:38:35 +01:00
|
|
|
menuconfig CAN
|
|
|
|
bool "CAN Driver Support"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
This selection enables building of the "upper-half" CAN driver.
|
|
|
|
See include/nuttx/can/can.h for further CAN driver information.
|
|
|
|
|
2020-02-08 08:30:09 +01:00
|
|
|
if CAN
|
|
|
|
|
2017-05-12 16:23:16 +02:00
|
|
|
config CAN_EXTID
|
|
|
|
bool "CAN extended IDs"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Enables support for the 29-bit extended ID. Default Standard 11-bit
|
|
|
|
IDs.
|
|
|
|
|
|
|
|
config CAN_ERRORS
|
|
|
|
bool "CAN error reporting"
|
|
|
|
default n
|
|
|
|
depends on ARCH_HAVE_CAN_ERRORS
|
|
|
|
---help---
|
|
|
|
Support CAN error reporting. If this option is selected then CAN
|
|
|
|
error reporting is enabled. In the event of an error, the ch_error
|
|
|
|
bit will be set in the CAN message and the following message payload
|
|
|
|
will include a more detailed description of certain errors.
|
|
|
|
|
|
|
|
config CAN_FD
|
|
|
|
bool "CAN FD"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Enables support for the CAN_FD mode.
|
|
|
|
|
2024-06-19 08:41:34 +02:00
|
|
|
config CAN_TXFIFOSIZE
|
|
|
|
int "CAN driver I/O tx buffer size"
|
2017-05-12 16:23:16 +02:00
|
|
|
default 8
|
2024-06-19 08:41:34 +02:00
|
|
|
range 1 255
|
2017-05-12 16:23:16 +02:00
|
|
|
---help---
|
2024-06-19 08:41:34 +02:00
|
|
|
The size of the circular tx buffer of CAN messages. Default: 8
|
|
|
|
|
|
|
|
config CAN_RXFIFOSIZE
|
|
|
|
int "CAN driver I/O rx buffer size"
|
|
|
|
default 8
|
|
|
|
range 1 255
|
|
|
|
---help---
|
|
|
|
The size of the circular rx buffer of CAN messages. Default: 8
|
2017-05-12 16:23:16 +02:00
|
|
|
|
|
|
|
config CAN_NPENDINGRTR
|
|
|
|
int "Number of pending RTRs"
|
|
|
|
default 4
|
|
|
|
---help---
|
|
|
|
The size of the list of pending RTR requests. Default: 4
|
|
|
|
|
2024-06-17 17:03:59 +02:00
|
|
|
config CAN_TXCONFIRM
|
|
|
|
bool "can txconfirm ability"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
this section enables the can txconfirm ability.
|
|
|
|
|
|
|
|
Enabling this feature adds support for the can txconfirm
|
|
|
|
ability, the ability is used from CAN interrupt handler
|
|
|
|
when the transfer is complete, the ability will notify all
|
|
|
|
readers that the canid has been transferred.
|
|
|
|
|
2017-05-12 16:23:16 +02:00
|
|
|
config CAN_TXREADY
|
|
|
|
bool "can_txready interface"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
This selection enables the can_txready() interface. This interface
|
2020-02-23 09:50:23 +01:00
|
|
|
is needed only for CAN hardware that supports queueing of outgoing
|
2017-05-12 16:23:16 +02:00
|
|
|
messages in a H/W FIFO.
|
|
|
|
|
|
|
|
The CAN upper half driver also supports a queue of output messages
|
|
|
|
in a S/W FIFO. Messages are added to that queue when when
|
|
|
|
can_write() is called and removed from the queue in can_txdone()
|
|
|
|
when each TX message is complete.
|
|
|
|
|
|
|
|
After each message is added to the S/W FIFO, the CAN upper half
|
|
|
|
driver will attempt to send the message by calling into the lower
|
|
|
|
half driver. That send will not be performed if the lower half
|
|
|
|
driver is busy, i.e., if dev_txready() returns false. In that
|
|
|
|
case, the number of messages in the S/W FIFO can grow. If the
|
|
|
|
S/W FIFO becomes full, then can_write() will wait for space in
|
|
|
|
the S/W FIFO.
|
|
|
|
|
|
|
|
If the CAN hardware does not support a H/W FIFO then busy means
|
|
|
|
that the hardware is actively sending the message and is
|
|
|
|
guaranteed to become non busy (i.e, dev_txready()) when the
|
|
|
|
send transfer completes and can_txdone() is called. So the call
|
|
|
|
to can_txdone() means that the transfer has completed and also
|
|
|
|
that the hardware is ready to accept another transfer.
|
|
|
|
|
|
|
|
If the CAN hardware supports a H/W FIFO, can_txdone() is not
|
2020-02-22 19:31:14 +01:00
|
|
|
called when the transfer is complete, but rather when the
|
2017-05-12 16:23:16 +02:00
|
|
|
transfer is queued in the H/W FIFO. When the H/W FIFO becomes
|
|
|
|
full, then dev_txready() will report false and the number of
|
|
|
|
queued messages in the S/W FIFO will grow.
|
|
|
|
|
|
|
|
There is no mechanism in this case to inform the upper half
|
|
|
|
driver when the hardware is again available, when there is
|
|
|
|
again space in the H/W FIFO. can_txdone() will not be called
|
|
|
|
again. If the S/W FIFO becomes full, then the upper half
|
|
|
|
driver will wait for space to become available, but there is
|
|
|
|
no event to awaken it and the driver will hang.
|
|
|
|
|
|
|
|
Enabling this feature adds support for the can_txready()
|
|
|
|
interface. This function is called from the lower half
|
|
|
|
driver's CAN interrupt handler each time a TX transfer
|
|
|
|
completes. This is a sure indication that the H/W FIFO is
|
|
|
|
no longer full. can_txready() will then awaken the
|
|
|
|
can_write() logic and the hang condition is avoided.
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "TX Ready Work Queue"
|
|
|
|
default CAN_TXREADY_HIPRI
|
|
|
|
depends on CAN_TXREADY
|
|
|
|
|
|
|
|
config CAN_TXREADY_LOPRI
|
|
|
|
bool "Low-priority work queue"
|
|
|
|
select SCHED_LPWORK
|
|
|
|
|
|
|
|
config CAN_TXREADY_HIPRI
|
|
|
|
bool "High-priority work queue"
|
|
|
|
select SCHED_HPWORK
|
|
|
|
|
|
|
|
endchoice # TX Ready Work Queue
|
|
|
|
|
|
|
|
config CAN_LOOPBACK
|
|
|
|
bool "CAN loopback mode"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
A CAN driver may or may not support a loopback mode for testing. If the
|
|
|
|
driver does support loopback mode, the setting will enable it. (If the
|
|
|
|
driver does not, this setting will have no effect).
|
|
|
|
|
|
|
|
config CAN_NPOLLWAITERS
|
|
|
|
int "Number of poll waiters"
|
|
|
|
default 2
|
|
|
|
---help---
|
|
|
|
The maximum number of threads that may be waiting on the
|
|
|
|
poll method.
|
2020-11-28 04:48:10 +01:00
|
|
|
|
2020-05-25 10:29:42 +02:00
|
|
|
config CAN_USE_RTR
|
|
|
|
bool "Include RTR in CAN header"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
This selection includes RTR bitfield in the CAN header.
|
2017-05-12 16:23:16 +02:00
|
|
|
|
2017-05-23 19:28:52 +02:00
|
|
|
comment "CAN Bus Controllers:"
|
|
|
|
|
|
|
|
config CAN_MCP2515
|
2017-05-23 20:22:49 +02:00
|
|
|
bool "Microchip MCP2515 CAN Bus Controller over SPI"
|
|
|
|
default n
|
|
|
|
depends on SPI
|
|
|
|
select ARCH_HAVE_CAN_ERRORS
|
|
|
|
---help---
|
|
|
|
Enable driver support for Microchip MCP2515.
|
2017-05-23 19:28:52 +02:00
|
|
|
|
|
|
|
if CAN_MCP2515
|
|
|
|
|
|
|
|
config MCP2515_BITRATE
|
2017-05-23 20:22:49 +02:00
|
|
|
int "MCP2515 bitrate"
|
|
|
|
default 500000
|
|
|
|
---help---
|
|
|
|
MCP2515 bitrate in bits per second.
|
2017-05-23 19:28:52 +02:00
|
|
|
|
|
|
|
config MCP2515_PROPSEG
|
2017-05-23 20:22:49 +02:00
|
|
|
int "MCP2515 Propagation Segment TQ"
|
|
|
|
default 2
|
|
|
|
range 1 8
|
|
|
|
---help---
|
|
|
|
The length of the bit time is Tquanta * (SyncSeg + PropSeg + PhaseSeg1 + PhaseSeg2).
|
2017-05-23 19:28:52 +02:00
|
|
|
|
|
|
|
config MCP2515_PHASESEG1
|
2017-05-23 20:22:49 +02:00
|
|
|
int "MCP2515 Phase Segment 1"
|
|
|
|
default 2
|
|
|
|
range 1 8
|
|
|
|
---help---
|
|
|
|
The length of the bit time is Tquanta * (SyncSeg + PropSeg + PhaseSeg1 + PhaseSeg2).
|
2017-05-23 19:28:52 +02:00
|
|
|
|
|
|
|
config MCP2515_PHASESEG2
|
2017-05-23 20:22:49 +02:00
|
|
|
int "MCP2515 Phase Segment 2"
|
|
|
|
default 3
|
|
|
|
range 2 8
|
|
|
|
---help---
|
|
|
|
The length of the bit time is Tquanta * (SyncSeg + PropSeg + PhaseSeg1 + PhaseSeg2).
|
2017-05-23 19:28:52 +02:00
|
|
|
|
|
|
|
config MCP2515_SJW
|
2017-05-23 20:22:49 +02:00
|
|
|
int "MCP2515 Synchronization Jump Width"
|
|
|
|
default 1
|
|
|
|
range 1 4
|
|
|
|
---help---
|
|
|
|
The duration of a synchronization jump is SJW.
|
2017-05-23 19:28:52 +02:00
|
|
|
|
2019-03-20 14:49:59 +01:00
|
|
|
config MCP2515_CLK_FREQUENCY
|
|
|
|
int "MCP2515 on-board clock frequency"
|
|
|
|
default 8000000
|
|
|
|
range 1 25000000
|
|
|
|
|
2019-04-12 19:37:08 +02:00
|
|
|
config MCP2515_SPI_SCK_FREQUENCY
|
|
|
|
int "MCP2515 SPI SCK Frequency"
|
|
|
|
default 1000000
|
|
|
|
range 100000 10000000
|
|
|
|
|
2017-05-23 19:28:52 +02:00
|
|
|
endif # CAN_MCP2515
|
2020-02-08 08:30:09 +01:00
|
|
|
|
2024-02-29 04:22:46 +01:00
|
|
|
menuconfig CAN_SJA1000
|
|
|
|
tristate "Philips/NXP SJA1000 devices"
|
|
|
|
|
|
|
|
if CAN_SJA1000
|
|
|
|
|
|
|
|
config CAN_SJA1000_BITRATE
|
|
|
|
int "SJA1000 bitrate"
|
|
|
|
default 1000000
|
|
|
|
---help---
|
|
|
|
SJA1000 bit rate.
|
|
|
|
|
|
|
|
config CAN_SJA1000_SJW
|
|
|
|
int "SJA1000 Synchronization Jump Width"
|
|
|
|
default 1
|
|
|
|
range 1 4
|
|
|
|
---help---
|
|
|
|
The duration of a synchronization jump is SJW.
|
|
|
|
|
|
|
|
config CAN_SJA1000_SAM
|
|
|
|
bool "The CAN bus is sampled 3 times"
|
|
|
|
default false
|
|
|
|
---help---
|
|
|
|
Recommended for low to medium speed buses
|
|
|
|
to filter spikes on the bus-line.
|
|
|
|
|
|
|
|
config CAN_SJA1000_SAMPLEP
|
|
|
|
int "SJA1000 CAN sample point (Percentage)"
|
|
|
|
default 87
|
|
|
|
range 0 100
|
|
|
|
|
|
|
|
config CANBUS_REGDEBUG
|
|
|
|
bool "CAN BUS register debug enable."
|
|
|
|
default false
|
|
|
|
|
|
|
|
config CAN_SJA1000_DEBUG
|
|
|
|
bool "SJA1000 CAN BUS trace debug enable."
|
|
|
|
default false
|
|
|
|
|
|
|
|
endif # CAN_SJA1000
|
|
|
|
|
|
|
|
endif # CAN
|