Added TMC2209 support (#727)

TMC2209: Added TMC2209 support
This commit is contained in:
Amken USA
2025-01-28 06:42:18 -05:00
committed by GitHub
parent f57b5ecee9
commit 87c205fd65
12 changed files with 1975 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
package tmc2209
func SetMicrostepsPerStep(microsteps uint16) uint8 {
exponent := uint8(0)
microstepsShifted := microsteps >> 1
for microstepsShifted > 0 {
microstepsShifted = microstepsShifted >> 1
exponent++
}
SetMicrostepsPerStepPowerOfTwo(exponent)
return exponent
}
func SetMicrostepsPerStepPowerOfTwo(exponent uint8) {
switch exponent {
case 0:
// Set MRES_001
case 1:
// Set MRES_002
case 2:
// Set MRES_004
case 3:
// Set MRES_008
case 4:
// Set MRES_016
case 5:
// Set MRES_032
case 6:
// Set MRES_064
case 7:
// Set MRES_128
default:
// Set MRES_256
}
}