|
@@ -250,6 +250,23 @@ Syntax is:
|
|
|
```
|
|
|
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for well-known configurations where these are forced at runtime.
|
|
|
**Note that gpio 36 and 39 are input only and cannot use interrupt. When set to jack or speaker fault, a 100ms polling checks their value but that's expensive**
|
|
|
+### GPIO expander (not fully validated yet)
|
|
|
+It is possible to add GPIO expanders using I2C bus. They should mainly be used for buttons but they can support generic-purpose outputs as well (NOT YET). These additional GPIOs can be numbered starting from an arbitrary value (100 min). Then these new "virtual" GPIOs from (e.g) 100 to 115 can be used in button configuration, set_GPIO or other config settings.
|
|
|
+
|
|
|
+Each expander (ONLY ONE FOR NOW) can support up to 32 GPIO. To use an expander for buttons, an interrupt must be provided, polling mode is not acceptable. An expander w/o interruption can still be configured, but only output will be usable.
|
|
|
+
|
|
|
+The parameter "gpio_exp_config" supports the following syntax:
|
|
|
+```
|
|
|
+model=<model>,addr=<addr>,[,port=<system|dac>][,base=<n|100>][,count=<n|16>][,intr=<gpio>]
|
|
|
+```
|
|
|
+- model: pca9535 (only tested today), pca85xx (untested) and mcp23017 (soon)
|
|
|
+- addr: inthe i2c address decimal
|
|
|
+- port: use either "system" port (shared with display for example) or "dac" port (system is default)
|
|
|
+- base: GPIO numbering offset to use everywhere else (default 100)
|
|
|
+- count: number of GPIO of expander (default 16 - might be obsolted if model if sufficient)
|
|
|
+- intr: real GPIO to use as interrupt.
|
|
|
+
|
|
|
+Note that PWM ("led_brightness" below) is not supported for expanded GPIOs, neither connecting them to a rotary encoder (for speed reason). Depending on the actual chipset, pullup or pulldown might be supported
|
|
|
### LED
|
|
|
See §**set_GPIO** for how to set the green and red LEDs. In addition, their brightness can be controlled using the "led_brigthness" parameter. The syntax is
|
|
|
```
|
|
@@ -257,6 +274,7 @@ See §**set_GPIO** for how to set the green and red LEDs. In addition, their bri
|
|
|
```
|
|
|
NB: For well-known configuration, this is ignored
|
|
|
### Rotary Encoder
|
|
|
+
|
|
|
One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software.
|
|
|
|
|
|
Encoder is normally hard-coded to respectively knob left, right and push on LMS and to volume down/up/play toggle on BT and AirPlay. Using the option 'volume' makes it hard-coded to volume down/up/play toggle all the time (even in LMS). The option 'longpress' allows an alternate mode when SW is long-pressed. In that mode, left is previous, right is next and press is toggle. Every long press on SW alternates between modes (the main mode actual behavior depends on 'volume').
|