Commit 29ac065
committed
Add latch functionality for stepper motor control
This commit introduces the latch functionality for stepper motors in the
Zephyr motor driver framework. The latch feature allows the motor to
hold its position after completing a movement, which is useful in
applications that require precise position control without losing steps
due to external forces.
Changes include:
- Added the `stepper_set_latch()` function to configure whether the motor
should latch (hold position) after movement.
- Added the `stepper_is_latch()` function to check the current latch
configuration.
- Updated the stepper driver API to support latch control.
This functionality helps maintain the motor's position after movement,
preventing unwanted drift when the motor is not in active movement.
However, latching consumes more power as it keeps current flowing through
the motor windings.1 parent 6f64f77 commit 29ac065
File tree
2 files changed
+70
-0
lines changed- drivers/stepper
- include/zephyr/drivers
2 files changed
+70
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
299 | 319 | | |
300 | 320 | | |
301 | 321 | | |
| |||
340 | 360 | | |
341 | 361 | | |
342 | 362 | | |
| 363 | + | |
| 364 | + | |
343 | 365 | | |
344 | 366 | | |
345 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
| |||
199 | 215 | | |
200 | 216 | | |
201 | 217 | | |
| 218 | + | |
| 219 | + | |
202 | 220 | | |
203 | 221 | | |
204 | 222 | | |
| |||
462 | 480 | | |
463 | 481 | | |
464 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
465 | 513 | | |
466 | 514 | | |
467 | 515 | | |
| |||
0 commit comments