mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 20:17:04 +03:00
Add GPIO config for Infrared on SqueezeAMP 3.20
This commit is contained in:
@@ -259,7 +259,7 @@ CONFIG_CSPOT_SINK=y
|
|||||||
# Various I/O
|
# Various I/O
|
||||||
#
|
#
|
||||||
CONFIG_I2C_CONFIG=""
|
CONFIG_I2C_CONFIG=""
|
||||||
CONFIG_SET_GPIO=""
|
CONFIG_SET_GPIO="0=ir"
|
||||||
CONFIG_ROTARY_ENCODER=""
|
CONFIG_ROTARY_ENCODER=""
|
||||||
# end of Various I/O
|
# end of Various I/O
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ bool create_rotary(void *id, int A, int B, int SW, int long_press, rotary_handle
|
|||||||
// create companion button if rotary has a switch
|
// create companion button if rotary has a switch
|
||||||
if (SW != -1) button_create(id, SW, BUTTON_LOW, true, 0, rotary_button_handler, long_press, -1);
|
if (SW != -1) button_create(id, SW, BUTTON_LOW, true, 0, rotary_button_handler, long_press, -1);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Creating rotary encoder A:%d B:%d, SW:%d", A, B, SW);
|
ESP_LOGI(TAG, "Created rotary encoder A:%d B:%d, SW:%d", A, B, SW);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -432,5 +432,7 @@ bool create_infrared(int gpio, infrared_handler handler) {
|
|||||||
common_task_init();
|
common_task_init();
|
||||||
xRingbufferAddToQueueSetRead(infrared.rb, common_queue_set);
|
xRingbufferAddToQueueSetRead(infrared.rb, common_queue_set);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "Created infrared receiver using GPIO %u", gpio);
|
||||||
|
|
||||||
return (infrared.rb != NULL);
|
return (infrared.rb != NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,6 +168,9 @@ menu "Squeezelite-ESP32"
|
|||||||
int
|
int
|
||||||
default 13 if SQUEEZEAMP
|
default 13 if SQUEEZEAMP
|
||||||
default -1
|
default -1
|
||||||
|
config SET_GPIO
|
||||||
|
string
|
||||||
|
default "0=ir" if SQUEEZEAMP
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Audio settings"
|
menu "Audio settings"
|
||||||
@@ -342,14 +345,15 @@ menu "Squeezelite-ESP32"
|
|||||||
data=<gpio>,clk=<gpio>[,d/c=<num>][,host=<0|1|2>]
|
data=<gpio>,clk=<gpio>[,d/c=<num>][,host=<0|1|2>]
|
||||||
config SET_GPIO
|
config SET_GPIO
|
||||||
string "Special GPIO configuration"
|
string "Special GPIO configuration"
|
||||||
default ""
|
|
||||||
help
|
help
|
||||||
Set parameters of shared GPIO with special values.
|
Set parameters of shared GPIO with special values.
|
||||||
<gpio_1>=Vcc|GND|amp[:0|1]|jack[:0|1][,<gpio_n>=Vcc|GND|amp[:0|1]|jack[:0|1]]
|
<gpio_1>=Vcc|GND|amp[:0|1]|jack[:0|1][ir][spkfault[:0|1][,<gpio_n>=Vcc|GND|amp[:0|1]|jack[:0|1]]
|
||||||
'amp' => GPIO that is set when playback starts
|
'amp' => GPIO that is set when playback starts
|
||||||
'jack' => GPIO used for audio jack detection
|
'jack' => GPIO used for audio jack detection
|
||||||
'green', 'red' => GPIO for status LED
|
'green', 'red' => GPIO for status LED
|
||||||
'[:0|1] means set the active value for that GPIO can be low or high
|
'spkfault' => GPIO used for speaker fault detection
|
||||||
|
'ir' => GPIO used for Infrared Receiver
|
||||||
|
[:0|1] means set the active value for that GPIO can be low or high
|
||||||
config ROTARY_ENCODER
|
config ROTARY_ENCODER
|
||||||
string "Rotary Encoder configuration"
|
string "Rotary Encoder configuration"
|
||||||
default ""
|
default ""
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ CONFIG_AIRPLAY_PORT="5000"
|
|||||||
# Various I/O
|
# Various I/O
|
||||||
#
|
#
|
||||||
CONFIG_I2C_CONFIG=""
|
CONFIG_I2C_CONFIG=""
|
||||||
CONFIG_SET_GPIO=""
|
# CONFIG_SET_GPIO= is not set
|
||||||
CONFIG_ROTARY_ENCODER=""
|
CONFIG_ROTARY_ENCODER=""
|
||||||
# end of Various I/O
|
# end of Various I/O
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user