Fix issue where stepper callbacks were not being called when
using work_q. This was due to the steps being counted down before
the work_q was rescheduled.
Signed-off-by: Josselin Bunt <josselin@sensible.health>
Refactored stepper move_to calls and move_by calls.
Now, relative movement required or absolute target position
is calculated and then redirected to move_by or move_to calls
respectively.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
Renamed fault event to be more in line with other events and added it to
the stepper shell.
Makes the event callback trigger function of the step-dir implementation
non-static so that step-dir stepper drivers can use it to trigger events
themself.
Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
Change the stepper API to instead of changing the stepper speed based on
the velocity in microsteps per second to use the delay in usec between
successive steps. Also remove the velocity from the `stepper_run` function
as typical API usage is enable -> set step interval -> run.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Address issue where the timing source is not stopped upon step completion
and not adjusting the actual position after performing a step.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Adds a fallback for the dual-edge-step property in the step dir common
code. Without this drivers using the common code would have to declare the
dual-edge-step property so it can default to false when not set, even if
the IC does not support adjusting it.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Adds a timing source api which is used by the step-dir stepper common code.
This allows the reusable common code to configure different timing sources,
since the initial delayable work implementation was inacurate for higher
maximum velocities.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>