mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 08:52:45 +01:00
6dc2a60597
The previous servo driver didn't provide any benefit over using PWM directly, as users controlled the servo in terms of PWM duty cycles. This changes the interface to provide a high level interface that abstracts the gory PWM details. In addition, a SAUL layer and auto-initialization is provided. Co-authored-by: benpicco <benpicco@googlemail.com>
24 lines
625 B
Makefile
24 lines
625 B
Makefile
include ../Makefile.tests_common
|
|
|
|
USEMODULE += servo
|
|
USEMODULE += shell
|
|
USEMODULE += shell_cmds_default
|
|
USEMODULE += saul_default
|
|
|
|
include $(RIOTBASE)/Makefile.include
|
|
|
|
SERVO_PIN ?= GPIO_PIN(0, 0)
|
|
|
|
TIMER ?= TIMER_DEV(0)
|
|
TIMER_FREQ ?= CLOCK_CORECLOCK/8
|
|
|
|
ifneq (,$(filter atmega_common,$(USEMODULE)))
|
|
# The ATmega PWM driver has no support for 16 bit timers (as of now). Hence,
|
|
# limit the PWM resolution to what a 8 bit timer can handle.
|
|
CFLAGS += -DSERVO_PWM_PARAM_RES=256
|
|
endif
|
|
|
|
CFLAGS += '-DSERVO_PARAM_PIN=$(SERVO_PIN)'
|
|
CFLAGS += '-DSERVO_TIMER_PARAM_DEV=$(TIMER)'
|
|
CFLAGS += '-DSERVO_TIMER_PARAM_FREQ=$(TIMER_FREQ)'
|