Skip to content

Commit

Permalink
Add a stepper generic upperhalf driver
Browse files Browse the repository at this point in the history
Add a stepper A4988 lowerhalf driver
  • Loading branch information
leducp authored and acassis committed Oct 14, 2023
1 parent 1989749 commit 095c32b
Show file tree
Hide file tree
Showing 11 changed files with 1,096 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,39 @@ config DEBUG_MOTOR_INFO

endif # DEBUG_MOTOR

config DEBUG_STEPPER
bool "Stepper Motor Debug Features"
default n
depends on STEPPER
---help---
Enable motor debug features.

if DEBUG_STEPPER

config DEBUG_STEPPER_ERROR
bool "Stepper Motor Error Output"
default n
depends on DEBUG_ERROR
---help---
Enable motor error output to SYSLOG.

config DEBUG_STEPPER_WARN
bool "Stepper Motor Warnings Output"
default n
depends on DEBUG_WARN
---help---
Enable motor warning output to SYSLOG.

config DEBUG_STEPPER_INFO
bool "Stepper Motor Informational Output"
default n
depends on DEBUG_INFO
---help---
Enable motor informational output to SYSLOG.

endif # DEBUG_STEPPER


config DEBUG_VIDEO
bool "Video Debug Features"
default n
Expand Down
8 changes: 8 additions & 0 deletions drivers/motor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ endif()
if(CONFIG_MOTOR_UPPER)
target_sources(drivers PRIVATE motor.c)
endif()

if(CONFIG_STEPPER_UPPER)
target_sources(drivers PRIVATE stepper.c)
endif()

if(CONFIG_STEPPER_A4988)
target_sources(drivers PRIVATE a4988.c)
endif()
20 changes: 20 additions & 0 deletions drivers/motor/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,23 @@ endif
source "drivers/motor/foc/Kconfig"

endif # MOTOR

menuconfig STEPPER
bool "Stepper control drivers"
default n

if STEPPER

config STEPPER_UPPER
bool "Stepper Motor Generic upper-half driver"
default n
---help---
Enables building of a stepper generic upper half driver.

config STEPPER_A4988
bool "A4988 Stepper Motor Driver"
default n
---help---
Enables A4988 stepper driver.

endif # STEPPER
11 changes: 11 additions & 0 deletions drivers/motor/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ ifeq ($(CONFIG_MOTOR_UPPER),y)
CSRCS += motor.c
endif

# Stepper upper half and lower halfs

ifeq ($(CONFIG_STEPPER_UPPER),y)
CSRCS += stepper.c
endif

ifeq ($(CONFIG_STEPPER_A4988),y)
CSRCS += a4988.c
endif


# Include motor drivers in the build

MOTOR_DEPPATH := --dep-path motor
Expand Down
Loading

0 comments on commit 095c32b

Please sign in to comment.