Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TMC5160 support #725

Merged
merged 10 commits into from
Jan 18, 2025
Merged

Added TMC5160 support #725

merged 10 commits into from
Jan 18, 2025

Conversation

amken3d
Copy link

@amken3d amken3d commented Dec 9, 2024

Requesting review of the the PR to add support for TMC5160. The TMC5160 is a popular stepper driver and is feature packed. This implementation add support to using the TMC5160 using either the UART mode or the SPI mode. The code has been tested to work on rp2040. The smoke tests passed using "make test". The code is not fully tested for all available features of the TMC5160 as it is a pretty complicated piece of silicon.

@deadprogram deadprogram changed the base branch from release to dev December 10, 2024 11:05
go.mod Show resolved Hide resolved
@deadprogram
Copy link
Member

Hello @amken3d this is a very impressive PR! Thank you for working on it.

I changed the branch for it to dev as mentioned here:
https://github.com/tinygo-org/drivers/blob/release/CONTRIBUTING.md#how-to-use-our-github-repository

Also, I made a comment, although did not have time to look deeply in the new code.

Also, wondering if you could please add a smoketest/example?

Thanks!

@amken3d
Copy link
Author

amken3d commented Dec 11, 2024

@deadprogram, thank you for the kind words.
I have added example code and smoke test as per your suggestion. I hope this adds some value to users. Looking forward to many more adventures with Tinygo.
My go and tinygo journey started about a 2 months ago and I am loving it. My primary reason for switching to go/tinygo is because I am building a Pick and Place machine using go (gocv). I initially wrote the microcontroller code in c++(platformio), but I found it much more ergonomic to use tinygo instead. I do have a couple of gripes we can discuss offline, but overall, I feel like Tinygo is much easier alternative to Arduino/C/C++.

Regards
H Keni

go.mod Outdated
go 1.18
go 1.22.1

toolchain go1.23.3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as above.

@amken3d
Copy link
Author

amken3d commented Dec 11, 2024

When i do go mod tidy, it automatically upgrades to
go 1.22.1

toolchain go1.23.1

Is there a way to pin it to 1.21? I've tried everything that google suggested and failed

@deadprogram
Copy link
Member

I think the toolchain here does not matter to user, so you were fine to run go mod tidy and commit the result. I was incorrect.

The toolchain directive only has an effect when the module is the main module and the default toolchain’s version is less than the suggested toolchain’s version.

via https://go.dev/ref/mod#go-mod-file-toolchain

@amken3d
Copy link
Author

amken3d commented Dec 11, 2024

@deadprogram : Updated

tmc5160/tmc5160.go Outdated Show resolved Hide resolved
tmc5160/SPIcomm.go Outdated Show resolved Hide resolved
@deadprogram
Copy link
Member

The file named SPIcomm.go might better named spicomm.go to avoid capitals and also to match uartcomm.go naming.

tmc5160/func_test.go Outdated Show resolved Hide resolved
tmc5160/spicomm.go Outdated Show resolved Hide resolved
@deadprogram
Copy link
Member

Thanks very much for this addition @amken3d now squash/merging.

@deadprogram deadprogram merged commit 4869496 into tinygo-org:dev Jan 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants