-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: stepper: Add timing source API #83342
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 Fabian Blatz | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
zephyr_library_property(ALLOW_EMPTY TRUE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is probably not needed since there's some files enabled unconditionally |
||
|
||
zephyr_library_sources(step_dir_stepper_common.c) | ||
zephyr_library_sources(step_dir_stepper_work_timing.c) | ||
zephyr_library_sources_ifdef(CONFIG_STEP_DIR_STEPPER_COUNTER_TIMING step_dir_stepper_counter_timing.c) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) 2024 Fabian Blatz <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config STEP_DIR_STEPPER | ||
bool | ||
help | ||
Enable library used for step direction stepper drivers. | ||
|
||
config STEP_DIR_STEPPER_GENERATE_ISR_SAFE_EVENTS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this feature could be used by other drivers as well, hence could be probably refactored out to Kconfig.stepper_event_template There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be then included over here with module called step_dir |
||
bool "Guarantee non ISR callbacks upon stepper events" | ||
depends on STEP_DIR_STEPPER | ||
help | ||
Enable the dispatch of stepper generated events via | ||
a message queue to guarantee that the event handler | ||
code is not run inside of an ISR. Can be disabled, but | ||
then registered stepper event callback must be ISR safe. | ||
|
||
config STEP_DIR_STEPPER_EVENT_QUEUE_LEN | ||
int "Maximum number of pending stepper events" | ||
default 4 | ||
depends on STEP_DIR_STEPPER_GENERATE_ISR_SAFE_EVENTS | ||
help | ||
The maximum number of stepper events that can be pending before new events | ||
are dropped. | ||
|
||
config STEP_DIR_STEPPER_COUNTER_TIMING | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the idea was to go via device tree instead of Kconfig, in order to be able to select on per instance basis. #82843 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I added the Kconfig to remove the source file from compilation if you are sure you only need the delayed work. |
||
bool "Counter use for stepping" | ||
depends on STEP_DIR_STEPPER | ||
depends on COUNTER | ||
default y | ||
help | ||
Enable usage of a counter device for accurate stepping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: probably let's just keep this area only for drivers and place all the lib functionalities above
comment "Stepper Drivers"