simplefoc / Arduino-FOC-drivers

Drivers and support code for SimpleFOC
https://docs.simplefoc.com/drivers_library
MIT License
146 stars 63 forks source link

Add TMC6200 Driver #23

Closed YaseenTwati closed 1 year ago

YaseenTwati commented 1 year ago

Added a driver for the TMC6200 in SPI Mode. Followed the same structure used in the DRV driver. This was only tested on STM32 but should work on any hardware.

runger1101001 commented 1 year ago

I love it, thank you so much!

runger1101001 commented 1 year ago

We merge new changes to the dev branch, so I have changed the base of this PR to be simplefoc:dev Since your changes are additive only, it still applies cleanly.

runger1101001 commented 1 year ago

There is a small problem when compiling for AVR (Arduino UNO)

/home/runner/Arduino/libraries/Arduino-FOC-drivers/src/drivers/tmc6200/TMC6200_Registers.hpp:3:10: fatal error: cstdint: No such file or directory
[347](https://github.com/simplefoc/Arduino-FOC-drivers/actions/runs/5409668668/jobs/9830138817?pr=23#step:3:349)
 #include <cstdint>

Looks like this header doesn't exist on that platform. I'll merge it and fix it afterwards.

YaseenTwati commented 1 year ago

Thanks, just noticed that as well, seems like cstdint isn't included on AVR for some reason

runger1101001 commented 1 year ago

I've merged it, I'll fix the UNO compile problem before the next release.

Thank you so much! What a great contribution, including documentation and nice clean code.

I know there are others using the TMC6200, so I'm sure this will help some people!