Added TMC5160 support (#725)

TMC5160: Added TMC5160 support

* Added example code for tmc5160 and smoke test
* Update go.mod
* Updated mod file
* Cleaned up commented out code and updated readme.
* ran go fmt
* Fixed setrampspeed func
* Removed spi1 pin setup in example.go. Renamed SPIComm to spicomm.go
* Removed unused test file
* Removed commented line
This commit is contained in:
Amken USA
2025-01-18 01:49:00 -05:00
committed by GitHub
parent 00578a3a81
commit 486949686c
13 changed files with 3050 additions and 5 deletions
+13
View File
@@ -0,0 +1,13 @@
package tmc5160
func ToHex(value uint32) string {
hexChars := "0123456789ABCDEF"
result := ""
for i := 0; i < 8; i++ { // 8 nibbles for a 32-bit number
nibble := (value >> (28 - i*4)) & 0xF
result += string(hexChars[nibble])
}
return "0x" + result
}