forked from xiaozhi/xiaozhi-esp32
Enable camera configs and update button/camera logic (#1561)
Added camera-related sdkconfig options to esp32s3-korvo2-v3 and kevin-sp-v4-dev config.json files. Updated esp32s3_korvo2_v3_board.cc to implement button actions for WiFi config and chat state toggling. Refactored kevin-sp-v4_board.cc to unify I2C bus usage for codec and camera, and adjusted SCCB initialization logic.
This commit is contained in:
@@ -3,7 +3,15 @@
|
|||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"name": "esp32s3-korvo2-v3",
|
"name": "esp32s3-korvo2-v3",
|
||||||
"sdkconfig_append": []
|
"sdkconfig_append": [
|
||||||
|
"CONFIG_CAMERA_OV2640=y",
|
||||||
|
"CONFIG_CAMERA_OV3660=y",
|
||||||
|
"CONFIG_CAMERA_OV3660_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||||
|
"CONFIG_CAMERA_OV3660_DVP_RGB565_240X240_24FPS=y",
|
||||||
|
"CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||||
|
"CONFIG_CAMERA_OV2640_DVP_RGB565_240X240_25FPS=y",
|
||||||
|
"CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -230,12 +230,12 @@ private:
|
|||||||
|
|
||||||
auto set_button = adc_button_[BSP_ADC_BUTTON_SET];
|
auto set_button = adc_button_[BSP_ADC_BUTTON_SET];
|
||||||
set_button->OnClick([this]() {
|
set_button->OnClick([this]() {
|
||||||
ESP_LOGI(TAG, "TODO %s:%d\n", __func__, __LINE__);
|
EnterWifiConfigMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto rec_button = adc_button_[BSP_ADC_BUTTON_REC];
|
auto rec_button = adc_button_[BSP_ADC_BUTTON_REC];
|
||||||
rec_button->OnClick([this]() {
|
rec_button->OnClick([this]() {
|
||||||
ESP_LOGI(TAG, "TODO %s:%d\n", __func__, __LINE__);
|
Application::GetInstance().ToggleChatState();
|
||||||
});
|
});
|
||||||
boot_button_.OnClick([this]() {});
|
boot_button_.OnClick([this]() {});
|
||||||
boot_button_.OnClick([this]() {
|
boot_button_.OnClick([this]() {
|
||||||
|
|||||||
@@ -3,7 +3,15 @@
|
|||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"name": "kevin-sp-v4-dev",
|
"name": "kevin-sp-v4-dev",
|
||||||
"sdkconfig_append": []
|
"sdkconfig_append": [
|
||||||
|
"CONFIG_CAMERA_OV2640=y",
|
||||||
|
"CONFIG_CAMERA_OV3660=y",
|
||||||
|
"CONFIG_CAMERA_OV3660_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||||
|
"CONFIG_CAMERA_OV3660_DVP_RGB565_240X240_24FPS=y",
|
||||||
|
"CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||||
|
"CONFIG_CAMERA_OV2640_DVP_RGB565_240X240_25FPS=y",
|
||||||
|
"CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -16,10 +16,9 @@
|
|||||||
|
|
||||||
class KEVIN_SP_V4Board : public WifiBoard {
|
class KEVIN_SP_V4Board : public WifiBoard {
|
||||||
private:
|
private:
|
||||||
i2c_master_bus_handle_t display_i2c_bus_;
|
|
||||||
Button boot_button_;
|
Button boot_button_;
|
||||||
LcdDisplay* display_;
|
LcdDisplay* display_;
|
||||||
i2c_master_bus_handle_t codec_i2c_bus_;
|
i2c_master_bus_handle_t i2c_bus_;
|
||||||
Esp32Camera* camera_;
|
Esp32Camera* camera_;
|
||||||
|
|
||||||
void InitializeCodecI2c() {
|
void InitializeCodecI2c() {
|
||||||
@@ -36,7 +35,7 @@ private:
|
|||||||
.enable_internal_pullup = 1,
|
.enable_internal_pullup = 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_cfg, &codec_i2c_bus_));
|
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_cfg, &i2c_bus_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeSpi() {
|
void InitializeSpi() {
|
||||||
@@ -118,12 +117,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
esp_video_init_sccb_config_t sccb_config = {
|
esp_video_init_sccb_config_t sccb_config = {
|
||||||
.init_sccb = true,
|
.init_sccb = false,
|
||||||
.i2c_config = {
|
.i2c_handle = i2c_bus_,
|
||||||
.port = 1,
|
|
||||||
.scl_pin = CAMERA_PIN_SIOC,
|
|
||||||
.sda_pin = GPIO_NUM_NC,
|
|
||||||
},
|
|
||||||
.freq = 100000,
|
.freq = 100000,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,7 +154,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual AudioCodec* GetAudioCodec() override {
|
virtual AudioCodec* GetAudioCodec() override {
|
||||||
static Es8311AudioCodec audio_codec(codec_i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
static Es8311AudioCodec audio_codec(i2c_bus_, I2C_NUM_0, AUDIO_INPUT_SAMPLE_RATE, AUDIO_OUTPUT_SAMPLE_RATE,
|
||||||
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
AUDIO_I2S_GPIO_MCLK, AUDIO_I2S_GPIO_BCLK, AUDIO_I2S_GPIO_WS, AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN,
|
||||||
AUDIO_CODEC_PA_PIN, AUDIO_CODEC_ES8311_ADDR);
|
AUDIO_CODEC_PA_PIN, AUDIO_CODEC_ES8311_ADDR);
|
||||||
return &audio_codec;
|
return &audio_codec;
|
||||||
|
|||||||
Reference in New Issue
Block a user