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
..
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2022-03-02 14:03:28 +01:00
2022-05-23 08:35:27 +02:00
2022-03-02 14:03:29 +01:00
2022-03-02 14:03:29 +01:00
2022-05-23 08:35:27 +02:00
2022-10-16 14:05:31 +02:00
2023-02-17 10:55:21 +01:00
2021-11-29 23:22:23 +01:00
2022-09-14 15:05:25 +02:00
2022-03-04 14:15:32 +01:00
2023-01-30 18:37:58 +01:00
2022-12-14 16:29:01 +01:00
2022-09-14 15:05:25 +02:00
2022-10-25 14:47:13 +02:00
2022-03-04 14:16:01 +01:00
2022-03-04 14:15:32 +01:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:34 +01:00
2020-11-25 12:00:37 +01:00
2021-08-13 19:50:38 +02:00
2022-09-16 22:57:28 +02:00
2022-09-16 22:57:28 +02:00
2022-05-23 08:35:27 +02:00
2022-04-14 11:31:36 +02:00
2022-09-14 15:05:25 +02:00
2022-03-04 14:15:35 +01:00
2022-09-21 09:42:37 +02:00
2022-05-23 08:35:27 +02:00
2022-04-13 12:49:58 +02:00
2022-10-06 17:48:47 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:36 +01:00
2022-12-27 17:21:55 +01:00
2022-03-04 14:15:37 +01:00
2022-03-04 14:15:38 +01:00
2021-08-13 19:50:38 +02:00
2022-03-04 14:15:38 +01:00
2022-09-14 15:05:25 +02:00
2022-09-14 15:05:25 +02:00
2023-01-31 19:50:11 +01:00
2023-01-08 22:26:13 +01:00
2021-12-01 10:06:24 +01:00
2022-01-21 14:13:49 +01:00
2023-01-05 14:25:20 +01:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:11:14 +02:00
2022-06-14 10:23:19 +02:00
2023-01-05 14:25:20 +01:00
2022-03-04 14:15:40 +01:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-04-19 16:22:10 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2023-02-22 09:15:59 +00:00
2022-09-14 15:11:14 +02:00
2022-05-31 17:58:39 +02:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:44 +01:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2022-08-23 10:04:44 +02:00
2022-12-14 16:29:01 +01:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2022-04-19 16:21:42 +02:00
2022-07-21 15:51:01 +02:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2022-09-14 15:05:25 +02:00
2022-03-04 14:15:45 +01:00
2022-05-23 08:35:27 +02:00
2023-01-07 09:47:44 +01:00
2022-10-04 00:28:46 +02:00
2022-09-16 14:00:35 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2023-01-17 11:03:01 +01:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2023-01-31 21:05:07 +01:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2021-12-21 18:23:11 +01:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:47 +01:00
2023-01-19 15:31:06 +01:00
2023-02-16 15:02:19 +00:00
2023-02-16 15:50:52 +01:00
2022-06-03 00:22:06 +02:00
2022-03-31 10:58:52 +02:00
2023-02-05 19:03:09 +01:00
2023-01-07 09:47:44 +01:00
2022-03-04 14:15:47 +01:00
2022-03-04 14:16:01 +01:00
2022-09-16 14:00:35 +02:00
2022-12-15 10:15:31 +00:00
2022-09-14 15:05:25 +02:00
2022-09-16 22:57:28 +02:00
2021-01-18 10:42:35 +01:00
2022-01-18 16:27:44 +01:00
2022-09-14 15:05:25 +02:00
2022-03-04 14:15:48 +01:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:49 +01:00
2022-05-23 08:35:27 +02:00
2023-02-21 16:53:06 +00:00
2022-05-23 08:35:27 +02:00
2023-01-05 14:25:18 +01:00
2022-03-04 14:15:50 +01:00
2023-01-05 14:25:19 +01:00
2022-05-23 08:35:27 +02:00
2021-08-13 19:50:38 +02:00
2022-08-17 12:56:07 +02:00
2022-06-12 15:57:04 +02:00
2023-02-22 10:00:04 +01:00
2022-05-23 08:35:27 +02:00
2022-10-20 00:43:27 +02:00
2022-05-23 08:35:27 +02:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2023-02-22 10:00:04 +01:00
2022-09-26 18:54:40 +02:00
2022-11-22 13:39:35 +01:00
2022-12-14 21:47:32 +01:00
2022-09-16 14:00:35 +02:00
2022-07-20 17:37:33 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2023-01-10 15:44:57 +00:00
2022-09-26 18:54:40 +02:00
2022-12-14 08:18:45 -05:00
2021-11-18 10:14:51 +01:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:15:57 +01:00
2022-09-14 15:11:14 +02:00
2022-03-04 14:15:58 +01:00
2022-05-24 17:45:58 +02:00
2022-09-14 15:05:25 +02:00
2023-01-25 08:47:26 +01:00
2022-09-16 22:57:28 +02:00
2022-09-16 22:57:28 +02:00
2022-05-23 08:35:27 +02:00
2022-03-04 14:16:02 +01:00
2023-01-05 14:25:19 +01:00
2021-05-25 14:21:58 +02:00
2022-03-04 14:15:58 +01:00
2022-05-23 08:35:27 +02:00
2022-05-23 08:35:27 +02:00
2020-12-02 10:13:50 +01:00
2021-11-16 20:16:59 +01:00
2022-12-07 16:34:34 +01:00
2022-09-14 15:05:25 +02:00
2022-05-23 08:35:27 +02:00
2023-02-02 02:04:09 +01:00
2022-09-16 22:57:28 +02:00
2023-01-07 02:27:01 +01:00
2022-09-16 22:57:28 +02:00
2020-06-26 13:09:33 +02:00
2023-02-02 02:04:09 +01:00
2023-02-01 21:57:23 +01:00
2020-03-04 16:13:40 +01:00
2023-02-13 21:09:07 +00:00