radek-pesina commented on code in PR #11868: URL: https://github.com/apache/nuttx/pull/11868#discussion_r1520546877
########## drivers/can/Kconfig: ########## @@ -193,4 +193,44 @@ config MCP2515_SPI_SCK_FREQUENCY endif # CAN_MCP2515 -endif +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 + Review Comment: This is carrying-over the existing TWAI method of calculating bitrate, where instead of defining Propagation Delay, Phase Segment 1, Phase Segment 2 and Sync Jump Width to determine the sample point, the values of TSEG1 and TSEG 2 are automatically calculated based on SJW, sample point and the requested baud rate. They both achieve the same function, but one is programatically while the other is a more explicit setting of each parameter (e.g. setting PD, PS1, PS2 and SJW determines the resulting sample point, else by defining the sample point and SJW you can determine PD, PS1 and PS2). Happy to go either way. Let me know your thoughts. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org