mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-31 21:59:43 +03:00
Compare commits
7 Commits
SqueezeAmp
...
I2S-4MFlas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac9ad2eee2 | ||
|
|
f38840bbe0 | ||
|
|
fd56f649ab | ||
|
|
c4bd320afe | ||
|
|
5e8978d1af | ||
|
|
6e082a5654 | ||
|
|
5af3250aea |
@@ -95,7 +95,7 @@ for AC101
|
|||||||
- dac_config: model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32
|
- dac_config: model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32
|
||||||
|
|
||||||
for ES8388
|
for ES8388
|
||||||
- dac_config model=ES8388,bck=5,ws=26,do=25,sda=18,scl=23,i2c=16
|
- dac_config: model=ES8388,bck=5,ws=25,do=26,sda=18,scl=23,i2c=16
|
||||||
### T-WATCH2020 by LilyGo
|
### T-WATCH2020 by LilyGo
|
||||||
This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters
|
This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ The NVS parameter "dac_config" set the gpio used for i2s communication with your
|
|||||||
```
|
```
|
||||||
bck=<gpio>,ws=<gpio>,do=<gpio>[,mck][,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,i2c=<addr>]]
|
bck=<gpio>,ws=<gpio>,do=<gpio>[,mck][,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,i2c=<addr>]]
|
||||||
```
|
```
|
||||||
if "model" is not set or is not recognized, then default "I2S" is used. The option "mck" is used for some codecs that require a master clock (although they should not). Only GPIO can be used as MCLK. I2C parameters are optional an only needed if your dac requires an I2C control (See 'dac_controlset' below). Note that "i2c" parameters are decimal, hex notation is not allowed.
|
if "model" is not set or is not recognized, then default "I2S" is used. The option "mck" is used for some codecs that require a master clock (although they should not). Only GPIO0 can be used as MCLK. I2C parameters are optional an only needed if your dac requires an I2C control (See 'dac_controlset' below). Note that "i2c" parameters are decimal, hex notation is not allowed.
|
||||||
|
|
||||||
So far, TAS75xx, TAS5714, AC101 and ES8388 are recognized models where the proper init sequence/volume/power controls are sent. For other codecs that might require an I2C commands, please use the parameter "dac_controlset" that allows definition of simple commands to be sent over i2c for init, power on and off using a JSON syntax:
|
So far, TAS75xx, TAS5714, AC101 and ES8388 are recognized models where the proper init sequence/volume/power controls are sent. For other codecs that might require an I2C commands, please use the parameter "dac_controlset" that allows definition of simple commands to be sent over i2c for init, power on and off using a JSON syntax:
|
||||||
```
|
```
|
||||||
@@ -307,10 +307,11 @@ Where (all parameters are optionals except gpio)
|
|||||||
Where \<action\> is either the name of another configuration to load (remap) or one amongst
|
Where \<action\> is either the name of another configuration to load (remap) or one amongst
|
||||||
|
|
||||||
```
|
```
|
||||||
ACTRLS_NONE, ACTRLS_VOLUP, ACTRLS_VOLDOWN, ACTRLS_TOGGLE, ACTRLS_PLAY,
|
ACTRLS_NONE, ACTRLS_POWER, ACTRLS_VOLUP, ACTRLS_VOLDOWN, ACTRLS_TOGGLE, ACTRLS_PLAY,
|
||||||
ACTRLS_PAUSE, ACTRLS_STOP, ACTRLS_REW, ACTRLS_FWD, ACTRLS_PREV, ACTRLS_NEXT,
|
ACTRLS_PAUSE, ACTRLS_STOP, ACTRLS_REW, ACTRLS_FWD, ACTRLS_PREV, ACTRLS_NEXT,
|
||||||
BCTRLS_UP, BCTRLS_DOWN, BCTRLS_LEFT, BCTRLS_RIGHT,
|
BCTRLS_UP, BCTRLS_DOWN, BCTRLS_LEFT, BCTRLS_RIGHT,
|
||||||
KNOB_LEFT, KNOB_RIGHT, KNOB_PUSH
|
BCTRLS_PS1, BCTRLS_PS2, BCTRLS_PS3, BCTRLS_PS4, BCTRLS_PS5, BCTRLS_PS6,
|
||||||
|
KNOB_LEFT, KNOB_RIGHT, KNOB_PUSH,
|
||||||
```
|
```
|
||||||
|
|
||||||
One you've created such a string, use it to fill a new NVS parameter with any name below 16(?) characters. You can have as many of these configs as you can. Then set the config parameter "actrls_config" with the name of your default config
|
One you've created such a string, use it to fill a new NVS parameter with any name below 16(?) characters. You can have as many of these configs as you can. Then set the config parameter "actrls_config" with the name of your default config
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ static int do_bt_source_cmd(int argc, char **argv){
|
|||||||
}
|
}
|
||||||
if(nerrors >0){
|
if(nerrors >0){
|
||||||
arg_print_errors(f,bt_source_args.end,desc_bt_source);
|
arg_print_errors(f,bt_source_args.end,desc_bt_source);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,6 +417,7 @@ static int do_audio_cmd(int argc, char **argv){
|
|||||||
}
|
}
|
||||||
if(nerrors >0){
|
if(nerrors >0){
|
||||||
arg_print_errors(f,audio_args.end,desc_audio);
|
arg_print_errors(f,audio_args.end,desc_audio);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,6 +481,7 @@ static int do_spdif_cmd(int argc, char **argv){
|
|||||||
}
|
}
|
||||||
if(nerrors >0){
|
if(nerrors >0){
|
||||||
arg_print_errors(f,spdif_args.end,desc_dac);
|
arg_print_errors(f,spdif_args.end,desc_dac);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
nerrors+=is_output_gpio(spdif_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
nerrors+=is_output_gpio(spdif_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
||||||
@@ -517,6 +520,7 @@ static int do_rotary_cmd(int argc, char **argv){
|
|||||||
}
|
}
|
||||||
if(nerrors >0){
|
if(nerrors >0){
|
||||||
arg_print_errors(f,rotary_args.end,desc_rotary);
|
arg_print_errors(f,rotary_args.end,desc_rotary);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
nerrors+=is_gpio(rotary_args.A, f, &rotary.A, true,false);
|
nerrors+=is_gpio(rotary_args.A, f, &rotary.A, true,false);
|
||||||
@@ -584,6 +588,7 @@ static int do_i2s_cmd(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if(nerrors >0){
|
if(nerrors >0){
|
||||||
arg_print_errors(f,i2s_args.end,desc_dac);
|
arg_print_errors(f,i2s_args.end,desc_dac);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
nerrors+=is_output_gpio(i2s_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
nerrors+=is_output_gpio(i2s_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
||||||
@@ -805,6 +810,7 @@ cJSON * squeezelite_cb(){
|
|||||||
argv = (char **) calloc(22, sizeof(char *));
|
argv = (char **) calloc(22, sizeof(char *));
|
||||||
if (argv == NULL) {
|
if (argv == NULL) {
|
||||||
FREE_AND_NULL(nvs_config);
|
FREE_AND_NULL(nvs_config);
|
||||||
|
fclose(f);
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
size_t argc = esp_console_split_argv(nvs_config, argv,22);
|
size_t argc = esp_console_split_argv(nvs_config, argv,22);
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ static int do_i2c_set_display(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if(nerrors>0){
|
if(nerrors>0){
|
||||||
arg_print_errors(f,i2cdisp_args.end,desc_display);
|
arg_print_errors(f,i2cdisp_args.end,desc_display);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* Check "--type" option */
|
/* Check "--type" option */
|
||||||
@@ -446,6 +447,7 @@ static int do_spiconfig_cmd(int argc, char **argv){
|
|||||||
}
|
}
|
||||||
if(nerrors>0){
|
if(nerrors>0){
|
||||||
arg_print_errors(f,spiconfig_args.end,desc_spiconfig);
|
arg_print_errors(f,spiconfig_args.end,desc_spiconfig);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* Check "--clk" option */
|
/* Check "--clk" option */
|
||||||
@@ -520,6 +522,7 @@ static int do_i2cconfig_cmd(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if(nerrors>0){
|
if(nerrors>0){
|
||||||
arg_print_errors(f,i2cconfig_args.end,desc_i2c);
|
arg_print_errors(f,i2cconfig_args.end,desc_i2c);
|
||||||
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* Check "--port" option */
|
/* Check "--port" option */
|
||||||
|
|||||||
@@ -657,6 +657,13 @@ void draw_VU(struct GDS_Device * display, const uint8_t *data, int level, int x,
|
|||||||
* Process graphic display data
|
* Process graphic display data
|
||||||
*/
|
*/
|
||||||
static void grfe_handler( u8_t *data, int len) {
|
static void grfe_handler( u8_t *data, int len) {
|
||||||
|
struct grfe_packet *pkt = (struct grfe_packet*) data;
|
||||||
|
|
||||||
|
// we don't support transition, simply claim we're done
|
||||||
|
if (pkt->transition != 'c') {
|
||||||
|
LOG_INFO("Transition %c requested with offset %hu, param %d", pkt->transition, pkt->offset, pkt->param);
|
||||||
|
sendANIC(ANIM_TRANSITION);
|
||||||
|
}
|
||||||
|
|
||||||
xSemaphoreTake(displayer.mutex, portMAX_DELAY);
|
xSemaphoreTake(displayer.mutex, portMAX_DELAY);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user