can: add ncv7356 SW transceiver driver#6927
Conversation
|
needs rebase |
|
Rebased since #6925 has been merged |
aabadie
left a comment
There was a problem hiding this comment.
Looks good but I can't test since I don't have the hardware. See my style comments below.
drivers/Makefile.dep
Outdated
| FEATURES_REQUIRED += periph_gpio | ||
| endif | ||
|
|
||
| ifneq (,$(filter nvc7356,$(USEMODULE))) |
There was a problem hiding this comment.
Please rebase and follow alphabetical order
drivers/include/ncv7356.h
Outdated
|
|
||
| /** | ||
| * @defgroup drivers_ncv7356 NCV7356 | ||
| * @ingroup drivers |
There was a problem hiding this comment.
Not sure, but is there a drivers_can group ?
| int ret; | ||
|
|
||
| switch (mode) { | ||
| case TRX_NORMAL_MODE: |
There was a problem hiding this comment.
there are some places where cases are not indented, so I guess we can keep it like that.
tests/can_trx/Makefile
Outdated
| endif | ||
|
|
||
| ifneq (,$(filter ncv7356,$(TRX_TO_BUILD))) | ||
| USEMODULE += ncv7356 |
There was a problem hiding this comment.
use 2 spaces indent in makefile
|
Who has hardware to test this? @PeterKietzmann maybe we ask @Musteblume ? |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
|
@aabadie I addressed your comments. |
aabadie
left a comment
There was a problem hiding this comment.
This still looks good. I checked the set mode function against the datasheet and the implementation is correct.
Unfortunately I cannot test but if it's fine for another maintainer (@PeterKietzmann ?) to give an untested ACK to this PR then it can be merged.
aabadie
left a comment
There was a problem hiding this comment.
I compared this PR with the tja1042 and they are very similar (in term of design), the one in this PR just provides more modes (with 2 configuration pins). I don't see why one will work the other not.
I take on me to give an un-tested ACK and finally merge this :)
Could we not do this again, please? |
|
@vincent-d Where can I find the initialization of mode0_pin and mode1_pin? Or am I missing something? |
|
@JannesVolkens the pins are initialized in the init function, then the initial value is set with a call to |
|
I guess the question was more about where the pins are configured. Usually, drivers provide a |
|
oops, sorry for the misunderstanding. Indeed, one needs to initialize an I have this kind of code in my board config: Then in the So the transceiver is used by the CAN stack automatically. |
|
Thanks for sharing! |
|
I tested the driver for the NCV7356 transceiver using the existing test class can_trx and was able to verify the actual setting and clearing of the two mode pins. I have attached a screenshot from a logic analyzer showing the two lines connected to MODE0 and MODE1, where Channel 0 is MODE0 and Channel 1 is MODE1. You can see the initialization of the device and setting of the sleep mode, high-speed mode, high voltage wake-up mode and normal mode in the given order. The other screenshot shows the terminal and the different printouts of the can_trx test class. |


Follow up, based on #5793
This is the NCV7356 (https://www.onsemi.com/pub/Collateral/NCV7356-D.PDF) single wire CAN transceiver driver.