-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Description
Problem Description
Problem Statement
The original stepper driver class was split into two driver classes namely stepper_driver_api (stepper motor motion control APIs)and stepper_drv_driver_api (stepper motor driver APIs) in #91979, leading to two similiar sounding driver classes in stepper.h.
Couple of issues which have been noted after the split w.r.t code structure are:
- We have now two driver classes in stepper.h.
- stepper_driver_api and stepper_drv_driver_api sound pretty similiar & can be confusing.
- TMC5XXX devices are modeled as MFDs but are not structured accordingly, in contrast to other MFDs.
Why was the API Split necessary?
Fig 1: Depiction of different combinations of stepper motion control and stepper_driverdevices.
Fig 2: TMC429 Application example using Step/Dir driver interface
The images above show that stepper motion controller and stepper driver are actually two seperate devices.
Proposed Change (Summary)
Split stepper.h in
include/zephyr/drivers
|_____ stepper.h (for stepper drivers only)
|_____ stepper_motor.h (for stepper motor motion controller driver only)
Split stepper_motor_drivers and stepper_drivers in:
drivers/
|_____ stepper/ (for stepper drivers only)
|_____ stepper_motor/ (for stepper motor motion controller driver only)
Proposed Change (Detailed)
Step 1: (achieveable till 4.4)
Linked PR: #101001
- Rename
stepper_driver_api-->stepper_motor_driver_api. - Rename
stepper_drv_driver_api-->stepper_driver_api. - Create a new header file called
stepper_motor.hin drivers.
include/zephyr/drivers
|_____ stepper.h (for stepper drivers only)
|_____ stepper_motor.h (for stepper motor motion controller driver only)
Step 1.1: (achieveable till 4.4)
- Split
stepper_shellinstepper_motor_shellandstepper_shell
Step 2: (~ achieveable till 4.4) (latest by 4.5)
- Refactor stepper motor drivers in
stepper_motor/under:
Note:stepper_motor_driver_apiwill scale tomotor_driver_apiover time.
drivers/
|_____ stepper/ (for stepper drivers only)
|_____ stepper_motor/ (for stepper motor motion controller driver only)
- TMC5XXX devices are to be restructured as:
mfd
|_____ mfd_tmc50xx.c
stepper
|_____ tmc50xx_stepper_driver.c
stepper_motor
|_____ tmc50xx_stepper_motor.c
Dependencies
None that I can think of at the moment.
Concerns and Unresolved Questions
How would the versioning of the new driver api class look like?
- unstable, since 4.0 ? These APIs have been there since 4.0 are now named differently.
Alternatives Considered
Linked PR: #101120
- Replace
_drvfromstepper_drv_driver_apiwith_amp, resulting instepper_amp_driver_apiand place the newstepper_amp_driver_apiclass as:
include/zephyr/drivers
|_____ stepper/stepper_amp.h (for stepper drivers only)
|_____ stepper.h (for stepper motor driver only)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status