drivers: stepper: add tmc51xx support#88350
Conversation
6840750 to
0463fc0
Compare
|
This is first attempt at supporting the tmc5160. I have tried to do it as simple as possible while still reusing the tmc50xx code, but there may be a better way of doing this. For instance the following config changes would simplify the code, but offer less flexibility in configuring the drivers. CONFIG_STEPPER_ADI_TMC50XX_RAMPSTAT_POLL -> CONFIG_STEPPER_ADI_TMC5XXX_RAMPSTAT_POLL |
These configs are per driver basis, if you have both the drivers on your board, you should be able to select these features individually for both the drivers. Suggestion: In the first attempt, we can just have tmc51xx driver, without refactoring common code out and then refactoring common code out could be done as a subsequent PR? |
That was also my thoughts when doing this, but I wonder if there will ever be a setup using both drivers. If one of the drivers uses the feature most of the code will be pulled in so not at lot is saved by having two defines. A common define combined with runtime check would be almost as good.
I actually started with that, but almost all the code ended up being shared. Therefore I think it would be better to start with a PR splitting tmc50xx into common and specific parts and adding tmc51xx in a separate PR. |
0463fc0 to
8395d14
Compare
|
The PR has been refactored making it simpler to follow the code changes in each commit. |
8395d14 to
bb4bd9c
Compare
|
For SPI status logging see: apni2@c691701 |
bb4bd9c to
5d7943b
Compare
|
Hi @apni2 under the reviews list, there is an option called |
There was a problem hiding this comment.
We are really close, just couple of minor Nits and you need to have a build-all entry
Ping @dipakgmx can you have a look at this as well :)
Following todos are left and then we can get this merged
- build all entry https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/build_all/stepper/spi.dtsi.
- squash all the tmc51xx specific commits would have to be squashed into one. The changes to tmc50xx can be a separate commit.
66603fa to
c123cab
Compare
c123cab to
9f26581
Compare
Hi @dipakgmx |
acf5f77 to
6468dd3
Compare
Hi, sorry. Missed out the comment. I will have a look at it. |
No problem, thank you :-) |
dipakgmx
left a comment
There was a problem hiding this comment.
Some minor comments, else looks good to me.
|
Just out of curiosity, did you use the tmc50xx sample or tests while developing the driver? Asking for feedback so that these tools(samples,tests) or documentation can be made improved :) |
e84b642 to
c06a4f6
Compare
I used the shell functions for testing the driver. |
c06a4f6 to
5e2ff8f
Compare
Add Kconfig option. Find common regs. Update ramp generator data. Signed-off-by: Anders Nielsen <anders.nielsen@prevas.dk>
Add tmc51xx support based on tmc50xx implementation. Signed-off-by: Anders Nielsen <anders.nielsen@prevas.dk>
5e2ff8f to
854eb27
Compare
Add tmc51xx (tmc5160) support. Most of the code can be shared with the current tmc50xx (tmc5041) implementation.