1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/drivers
bors[bot] 41b54d8594
Merge #18392
18392: drivers/servo: reimplement with high level interface r=benpicco a=maribu

### Contribution description

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.

### Testing procedure

The test application provides access to the servo driver via the `saul` shell command.

```
> saul
2022-08-02 22:12:31,826 # saul
2022-08-02 22:12:31,827 # ID	Class		Name
2022-08-02 22:12:31,830 # #0	ACT_SWITCH	LD1(green)
2022-08-02 22:12:31,832 # #1	ACT_SWITCH	LD2(blue)
2022-08-02 22:12:31,834 # #2	ACT_SWITCH	LD3(red)
2022-08-02 22:12:31,837 # #3	SENSE_BTN	B1(User button)
2022-08-02 22:12:31,838 # #4	ACT_SERVO	servo
> saul write 4 0
2022-08-02 22:12:41,443 # saul write 4 0
2022-08-02 22:12:41,445 # Writing to device #4 - servo
2022-08-02 22:12:41,447 # Data:	             0 
2022-08-02 22:12:41,450 # [servo] setting 0 to 2949 (0 / 255)
2022-08-02 22:12:41,453 # data successfully written to device #4
> saul write 4 256
2022-08-02 22:12:45,343 # saul write 4 256
2022-08-02 22:12:45,346 # Writing to device #4 - servo
2022-08-02 22:12:45,347 # Data:	           256 
2022-08-02 22:12:45,351 # [servo] setting 0 to 6865 (255 / 255)
2022-08-02 22:12:45,354 # data successfully written to device #4
```

Each write resulted in the MG90S servo that I connected to move to the corresponding position.

### Issues/PRs references

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-02-22 09:15:59 +00:00
..
ad7746 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
adcxx1c drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ads101x doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
adt7310 drivers/adt7310: Update kconfig model 2022-03-02 14:03:28 +01:00
adxl345 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
aip31068 drivers/aip31068: Update kconfig model 2022-03-02 14:03:29 +01:00
apa102 drivers/apa102: Update kconfig model 2022-03-02 14:03:29 +01:00
apds99xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
at drivers/at: add a function read a response plus the OK 2022-10-16 14:05:31 +02:00
at24cxxx drivers/at24cxxx: merge mtd driver with at24cxxx.c 2023-02-17 10:55:21 +01:00
at24mac Merge pull request #17255 from MrKevinWeiss/pr/kconfig/sam54 2021-11-29 23:22:23 +01:00
at25xxx doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
at30tse75x drivers/at30tse75x: Update kconfig model 2022-03-04 14:15:32 +01:00
at86rf2xx drivers/at86rf2xx: set netdev channel on init 2023-01-30 18:37:58 +01:00
at86rf215 at86rf215: respect ack request option 2022-12-14 16:29:01 +01:00
ata8520e doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
atwinc15x0 drivers/atwinc15x0: don't disable interrupts 2022-10-25 14:47:13 +02:00
bh1750fvi drivers/bh1750fvi: Update kconfig model 2022-03-04 14:16:01 +01:00
bh1900nux drivers/bh1900nux: Update kconfig model 2022-03-04 14:15:32 +01:00
bme680 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmp180 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmx055 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmx280 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bq2429x drivers/bq2429x: Update kconfig model 2022-03-04 14:15:34 +01:00
can_trx drivers/can_trx: add module to Kconfig 2020-11-25 12:00:37 +01:00
cc1xxx_common treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
cc110x netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
cc2420 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
ccs811 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
cst816s drivers/cst816s: use gpio_is_valid where appropriate 2022-04-14 11:31:36 +02:00
dac_dds doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
dcf77 drivers/dcf77: Update kconfig model 2022-03-04 14:15:35 +01:00
dfplayer treewide: fix conditionals on deprecated module 2022-09-21 09:42:37 +02:00
dht drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
disp_dev drivers/disp_dev: use struct to store display area coordinates 2022-04-13 12:49:58 +02:00
dose drivers/dose: make use of checksum module 2022-10-06 17:48:47 +02:00
ds18 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ds75lx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ds1307 drivers/ds1307: Update kconfig model 2022-03-04 14:15:36 +01:00
ds3231 drivers/ds3231 fix docs, alarms are supported 2022-12-27 17:21:55 +01:00
ds3234 drivers/ds3234: Update kconfig model 2022-03-04 14:15:37 +01:00
dsp0401 drivers/dsp0401: Update kconfig model 2022-03-04 14:15:38 +01:00
dynamixel treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
edbg_eui drivers/edbg_eui: Update kconfig model 2022-03-04 14:15:38 +01:00
enc28j60 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
encx24j600 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
epd_bw_spi epd_bw_spi: add implementation for disp_dev 2023-01-31 19:50:11 +01:00
ethos core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
feetech drivers/feetech: remove useless xtimer include 2021-12-01 10:06:24 +01:00
ft5x06 drivers/ft5x06: remove unnecessary pseudomodules 2022-01-21 14:13:49 +01:00
fxos8700 drivers/fxos8700: Add missing doc and fix doccheck 2023-01-05 14:25:20 +01:00
gp2y10xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
grove_ledbar boards: add some missing whitespaces for static tests 2022-09-14 15:11:14 +02:00
hd44780 Merge pull request #12665 from gschorcht/drivers/hd44780_i2c_pcf857x 2022-06-14 10:23:19 +02:00
hdc1000 drivers/hdc1000: Add missing doc and fix doccheck 2023-01-05 14:25:20 +01:00
hih6130 drivers/hih6130: Update kconfig model 2022-03-04 14:15:40 +01:00
hm330x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hmc5883l doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
hsc drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hts221 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ili9341 drivers/lcd: rework rotation modes and enable it with st7735 2022-04-19 16:22:10 +02:00
ina2xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ina3221 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
include Merge #18392 2023-02-22 09:15:59 +00:00
io1_xplained boards: add some missing whitespaces for static tests 2022-09-14 15:11:14 +02:00
ir_nec drivers/ir_nec: ir remote implementation 2022-05-31 17:58:39 +02:00
isl29020 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
isl29125 drivers/isl29125: Update kconfig model 2022-03-04 14:15:44 +01:00
itg320x doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
jc42 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
kw2xrf drivers/kw2xrd/Kconfig: fix kconfig model 2022-08-23 10:04:44 +02:00
kw41zrf kw41zrf: respect ack request option 2022-12-14 16:29:01 +01:00
l3g4200d doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
l3gxxxx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lc709203f doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
lcd Merge pull request #17925 from aabadie/pr/drivers/lcd_params_rework 2022-04-19 16:21:42 +02:00
lis2dh12 drivers/lis2dh12: release instead of acquire 2022-07-21 15:51:01 +02:00
lis3dh drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lis3mdl doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
lm75 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
lpd8808 drivers/lpd8808: Update kconfig model 2022-03-04 14:15:45 +01:00
lpsxxx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lsm6dsl core/lib: Add macros/utils.h header 2023-01-07 09:47:44 +01:00
lsm303agr rust: Update dependencies 2022-10-04 00:28:46 +02:00
lsm303dlhc codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
ltc4150 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mag3110 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
matrix_keypad matrix_keypad: use gpio_is_valid 2023-01-17 11:03:01 +01:00
mcp47xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mcp2515 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
mfrc522 drivers/mfrc522: add new driver 2023-01-31 21:05:07 +01:00
mhz19 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
mma8x5x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mma7660 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
motor_driver drivers/motor_driver: Use irq_restore 2021-12-21 18:23:11 +01:00
mpl3115a2 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mpu9x50 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mq3 drivers/mq3: Update kconfig model 2022-03-04 14:15:47 +01:00
mrf24j40 drivers/mrf24j40: add support for IEEE 802.15.4 Radio HAL 2023-01-19 15:31:06 +01:00
mtd Merge #19258 2023-02-16 15:02:19 +00:00
mtd_flashpage drivers/mtd_flashpage: drop legacy API 2023-02-16 15:50:52 +01:00
mtd_mapper drivers/mtd_mapper: inherit physical properties 2022-06-03 00:22:06 +02:00
mtd_mci drivers/mtd_{mci,sdcard}: Pages need to be written at once 2022-03-31 10:58:52 +02:00
mtd_sdcard drivers/mtd_sdcard: add mtd_sdcard_default module 2023-02-05 19:03:09 +01:00
mtd_spi_nor core/lib: Add macros/utils.h header 2023-01-07 09:47:44 +01:00
my9221 drivers/my9221: Update kconfig model 2022-03-04 14:15:47 +01:00
ncv7356 drivers/ncv7356: Update kconfig model 2022-03-04 14:16:01 +01:00
netdev codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
netdev_ieee802154_submac Merge #19053 2022-12-15 10:15:31 +00:00
nrf24l01p doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
nrf24l01p_ng netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
nvram drivers/nvram: add module to Kconfig 2021-01-18 10:42:35 +01:00
nvram_spi drivers/nvmram_spi: convert to ztimer_usec 2022-01-18 16:27:44 +01:00
opt3001 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
pca9633 drivers/pca9633: Update kconfig model 2022-03-04 14:15:48 +01:00
pca9685 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pcd8544 drivers/pcd8544: Update kconfig model 2022-03-04 14:15:49 +01:00
pcf857x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
periph_common Merge #19256 2023-02-21 16:53:06 +00:00
ph_oem drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pir drivers/pir: Add missing doc and fix doccheck 2023-01-05 14:25:18 +01:00
pn532 drivers/pn532: Update kconfig model 2022-03-04 14:15:50 +01:00
pulse_counter drivers/pulse_counter: Add missing doc and fix doccheck 2023-01-05 14:25:19 +01:00
qmc5883l drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
rgbled treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
rn2xx3 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
rtt_rtc drivers/rtt_rtc: normalize tm struct in rtc_set_alarm 2022-06-12 15:57:04 +02:00
saul drivers/servo: reimplement with high level interface 2023-02-22 10:00:04 +01:00
scd30 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sdcard_spi drivers/sdcard_spi: make use of crc16_ccitt_false_update() 2022-10-20 00:43:27 +02:00
sdp3x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sds011 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
seesaw_soil drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
servo drivers/servo: reimplement with high level interface 2023-02-22 10:00:04 +01:00
sgp30 drivers/sgp30: add missing include 2022-09-26 18:54:40 +02:00
sht1x drivers/sht1x: add missing include for ARRAY_SIZE 2022-11-22 13:39:35 +01:00
sht2x drivers/sht2x: use sys/checksum/crc8 2022-12-14 21:47:32 +01:00
sht3x codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
shtcx drivers/shtcx: releases I2C-line properly 2022-07-20 17:37:33 +02:00
si70xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
si114x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
si1133 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
slipdev Merge #17810 #18348 #19120 2023-01-10 15:44:57 +00:00
sm_pwm_01c drivers/sm_pwm_01c: add missing include 2022-09-26 18:54:40 +02:00
soft_spi drivers/soft_spi: fix device validation bug 2022-12-14 08:18:45 -05:00
soft_uart drivers/soft_uart: fix type usage 2021-11-18 10:14:51 +01:00
sps30 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
srf02 drivers/srf02: Update kconfig model 2022-03-04 14:15:57 +01:00
srf04 boards: add some missing whitespaces for static tests 2022-09-14 15:11:14 +02:00
srf08 drivers/srf08: Update kconfig model 2022-03-04 14:15:58 +01:00
st7735 drivers/st7735/kconfig: add hardware feature symbol 2022-05-24 17:45:58 +02:00
stmpe811 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
sx126x boards/sx126x: make MODULE_SX126X_RF_SWITCH hidden in kconfig 2023-01-25 08:47:26 +01:00
sx127x netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
sx1280 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
tcs37727 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
tja1042 drivers/tja1042: Update kconfig model 2022-03-04 14:16:02 +01:00
tmp00x drivers/tmp00x: Add missing doc and fix doccheck 2023-01-05 14:25:19 +01:00
touch_dev drivers/{disp,touch}_dev: pull auto_init_screen by default 2021-05-25 14:21:58 +02:00
tps6274x drivers/tps6274x: Update kconfig model 2022-03-04 14:15:58 +01:00
tsl2561 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
tsl4531x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
uart_half_duplex drivers/uart_half_duplex: add module to Kconfig 2020-12-02 10:13:50 +01:00
usbdev_mock usbdev_mock: Adapt to xmit API 2021-11-16 20:16:59 +01:00
usbdev_synopsys_dwc2 drivers/usbdev_synopsys_dwc2: add EFM32 support 2022-12-07 16:34:34 +01:00
vcnl40x0 doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
veml6070 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
vl6180x Kconfig: integration of VL6180X driver and test app 2023-02-02 02:04:09 +01:00
w5100 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
ws281x drivers/ws281x: fix out-of-bounds read on native 2023-01-07 02:27:01 +01:00
xbee netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
doc.txt drivers: Added doc group drivers_multimedia 2020-06-26 13:09:33 +02:00
Kconfig Kconfig: integration of VL6180X driver and test app 2023-02-02 02:04:09 +01:00
Kconfig.net drivers/netdev: add tinyUSB netdev 2023-02-01 21:57:23 +01:00
Makefile sys/auto_init: allow delayed initialisation of SAUL 2020-03-04 16:13:40 +01:00
Makefile.dep Merge #18257 2023-02-13 21:09:07 +00:00