mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +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>
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
# Copyright (c) 2021 HAW Hamburg
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
#
|
|
|
|
config MODULE_SERVO
|
|
bool "Servo motor driver"
|
|
depends on TEST_KCONFIG
|
|
select MODULE_SERVO_SAUL if MODULE_SAUL_DEFAULT
|
|
|
|
config MODULE_SERVO_SAUL
|
|
bool "SAUL integration of the servo motor driver"
|
|
depends on TEST_KCONFIG
|
|
|
|
choice SERVO_DRIVER_BACKEND
|
|
bool "Servo motor driver backend"
|
|
depends on MODULE_SERVO
|
|
default MODULE_SERVO_PWM if HAS_PERIPH_PWM
|
|
default MODULE_SERVO_TIMER if !HAS_PERIPH_PWM && HAS_PERIPH_TIMER_PERIODIC
|
|
|
|
config MODULE_SERVO_PWM
|
|
bool "periph_pwm based Servo Motor driver backend (preferred)"
|
|
depends on HAS_PERIPH_PWM
|
|
# PWM prescaler on nRF5x MCUs cannot generate a 50 Hz signal
|
|
depends on !HAS_CPU_NRF51
|
|
depends on !HAS_CPU_NRF52
|
|
depends on !HAS_CPU_NRF9160
|
|
select MODULE_PERIPH_PWM
|
|
select SERVO_DRIVER_BACKEND
|
|
|
|
config MODULE_SERVO_TIMER
|
|
bool "periph_timer based Servo Motor driver backend"
|
|
depends on HAS_PERIPH_TIMER
|
|
depends on HAS_PERIPH_TIMER_PERIODIC
|
|
select MODULE_PERIPH_TIMER
|
|
select MODULE_PERIPH_TIMER_PERIODIC
|
|
select SERVO_DRIVER_BACKEND
|
|
endchoice
|