Initial potentiometer support

This commit is contained in:
zvecr
2023-12-13 03:19:33 +00:00
parent e2472ee8f1
commit 929da00c2f
21 changed files with 251 additions and 37 deletions
+1
View File
@@ -123,6 +123,7 @@
* [LED Indicators](feature_led_indicators.md)
* [MIDI](feature_midi.md)
* [Pointing Device](feature_pointing_device.md)
* [Potentiometer](feature_potentiometers.md)
* [PS/2 Mouse](feature_ps2_mouse.md)
* [Split Keyboard](feature_split_keyboard.md)
* [Stenography](feature_stenography.md)
+35
View File
@@ -0,0 +1,35 @@
# Potentiometers
Add this to your `rules.mk`:
```make
POTENTIOMETER_ENABLE = yes
```
and this to your `config.h`:
```c
#define POTENTIOMETER_PINS { B0 }
```
## Callbacks
The callback functions can be inserted into your `<keyboard>.c`:
```c
bool potentiometer_update_kb(uint8_t index, uint16_t value) {
if (!potentiometer_update_user(index, value)) {
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + value);
}
return true;
}
```
or `keymap.c`:
```c
bool potentiometer_update_user(uint8_t index, uint16_t value) {
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + value);
return false;
}
```
+11
View File
@@ -480,6 +480,17 @@ Configures [One Shot keys](one_shot_keys.md).
* `timeout`
* The amount of time before the key is released in milliseconds.
## Potentiometer :id=potentiometer
Configures the [Potentiometer](feature_Potentiometers.md) feature.
* `potentiometer`
* `enabled`
* Enable the Potentiometer feature.
* Default: `false`
* `pins` (Required)
* The GPIO pin(s) connected to the Potentiometer(s).
## PS/2 :id=ps2
Configures the [PS/2](feature_ps2_mouse.md) feature.