Skip to content

Added TMC5160 support#725

Merged
deadprogram merged 10 commits into
tinygo-org:devfrom
amken3d:add-tmc5160
Jan 18, 2025
Merged

Added TMC5160 support#725
deadprogram merged 10 commits into
tinygo-org:devfrom
amken3d:add-tmc5160

Conversation

@amken3d

@amken3d amken3d commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

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.

@amken3d amken3d mentioned this pull request Dec 9, 2024
@deadprogram deadprogram changed the base branch from release to dev December 10, 2024 11:05
Comment thread go.mod
@deadprogram

Copy link
Copy Markdown
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

amken3d commented Dec 11, 2024

Copy link
Copy Markdown
Contributor Author

@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

Comment thread go.mod Outdated
go 1.18
go 1.22.1

toolchain go1.23.3

Copy link
Copy Markdown
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

amken3d commented Dec 11, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

amken3d commented Dec 11, 2024

Copy link
Copy Markdown
Contributor Author

@deadprogram : Updated

Comment thread tmc5160/tmc5160.go Outdated
Comment thread tmc5160/SPIcomm.go Outdated
Comment thread examples/tmc5160/main.go Outdated
Comment thread tmc5160/tmc5160.go
@deadprogram

Copy link
Copy Markdown
Member

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

Comment thread tmc5160/func_test.go Outdated
Comment thread tmc5160/spicomm.go Outdated
@deadprogram

Copy link
Copy Markdown
Member

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

@deadprogram deadprogram merged commit 4869496 into tinygo-org:dev Jan 18, 2025
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