Skip to content

Commit

Permalink
drivers: stepper: tmc: create rampstat Kconfig template
Browse files Browse the repository at this point in the history
create rampstat Kconfig template to enable respective tmc drivers to
reuse the common configurations

Signed-off-by: Jilay Pandya <[email protected]>
  • Loading branch information
jilaypandya committed Dec 16, 2024
1 parent e8a5e97 commit a08ccfe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
20 changes: 3 additions & 17 deletions drivers/stepper/adi_tmc/Kconfig.tmc5041
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ config STEPPER_ADI_TMC5041
help
Stepper driver for TMC5041.

config STEPPER_ADI_TMC5041_RAMPSTAT_POLL
bool "TMC5041 poll ramp status"
depends on STEPPER_ADI_TMC5041
default y
help
When enabled, the ramp status will be polled on TMC5041, to check for events:
- TMC5041_POS_REACHED_EVENT
- TMC5041_STOP_SG_EVENT
- TMC5041_STOP_LEFT_EVENT
- TMC5041_STOP_RIGHT_EVENT

config STEPPER_ADI_TMC5041_RAMPSTAT_POLL_INTERVAL_IN_MSEC
int "TMC5041 poll ramp status interval in ms"
depends on STEPPER_ADI_TMC5041_RAMPSTAT_POLL
default 100
help
The interval in ms to poll the ramp status on TMC5041.
module = TMC5041
module-str = tmc5041
rsource "Kconfig.tmc_rampgen_template"
20 changes: 20 additions & 0 deletions drivers/stepper/adi_tmc/Kconfig.tmc_rampgen_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

config STEPPER_ADI_$(module)_RAMPSTAT_POLL
bool "$(module-str) poll ramp status"
depends on STEPPER_ADI_$(module)
default y
help
When enabled, the ramp status will be polled on TMC, to check for events:
- TMC_POS_REACHED_EVENT
- TMC_STOP_SG_EVENT
- TMC_STOP_LEFT_EVENT
- TMC_STOP_RIGHT_EVENT

config STEPPER_ADI_$(module)_RAMPSTAT_POLL_INTERVAL_IN_MSEC
int "$(module-str) poll ramp status interval in ms"
depends on STEPPER_ADI_$(module)_RAMPSTAT_POLL
default 100
help
The interval in ms to poll the ramp status on TMC.

0 comments on commit a08ccfe

Please sign in to comment.