Skip to content

Commit 8151836

Browse files
committed
Merge branch 'feature/add_esp32p4_eye_support' into 'main'
Add ESP32P4_EYE support for doorbell_local See merge request adf/esp-webrtc-solution!53
2 parents 530e920 + f0ea344 commit 8151836

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

components/codec_board/board_cfg.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,17 @@ i2c: {sda: 40, scl: 39}
117117
i2s: {mclk: -1, bclk: 42, din: 41, dout: -1}
118118
in: {codec: DUMMY}
119119
camera: {type: dvp, xclk: 10, pclk: 13, vsync: 38, href: 47, d0: 15, d1: 17, d2: 18, d3: 16, d4: 14, d5: 12, d6: 11, d7: 48}
120+
121+
Board: ESP32_P4_EYE
122+
i2c: {sda: 14, scl: 13}
123+
i2s: {mclk: -1, bclk: 22, ws: -1, dout: -1, din: 21}
124+
in: {codec: DUMMY}
125+
sdcard: {clk: 43, cmd: 44, d0: 39, d1: 40, d2: 41, d3: 42}
126+
camera: {type: mipi, xclk: 11, pwr: 12, reset: 26}
127+
lcd: {
128+
bus: spi, extend_io: tca9554, controller: st7789, spi_bus: 2,
129+
mirror_x: 1, mirror_y: 1, swap_xy: 0, color_inv: 0,
130+
width: 240, height: 240,
131+
ctrl: -1, rst: 15,
132+
cs: 18, dc: 19, clk: 17, mosi: 16, cmd_bits: 8, param_bits: 8
133+
}

components/codec_board/cfg_parse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ static int fill_camera_cfg(board_cfg_attr_t *attr)
478478
}
479479
camera_cfg->pwr = -1;
480480
camera_cfg->reset = -1;
481+
camera_cfg->xclk = -1;
481482
while (attr) {
482483
if (str_same(attr->attr, "type")) {
483484
camera_cfg->type = get_camera_type(attr->value);

solutions/doorbell_local/main/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ void init_board()
2323
set_codec_board_type(TEST_BOARD_NAME);
2424
// Notes when use playback and record at same time, must set reuse_dev = false
2525
codec_init_cfg_t cfg = {.reuse_dev = false};
26+
if (strcmp(TEST_BOARD_NAME, "ESP32_P4_EYE") == 0) {
27+
cfg.in_mode = CODEC_I2S_MODE_PDM;
28+
}
2629
init_codec(&cfg);
2730
}

solutions/doorbell_local/main/media_sys.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ static esp_capture_video_src_if_t *create_video_source(void)
7474
csi_config.pwdn_pin = cam_pin_cfg.pwr;
7575
ESP_LOGI(TAG, "Use i2c handle %p", csi_config.sccb_config.i2c_handle);
7676
cam_config.csi = &csi_config;
77+
if (cam_pin_cfg.xclk != -1) {
78+
esp_cam_sensor_xclk_handle_t xclk_handle = NULL;
79+
esp_cam_sensor_xclk_config_t xclk_config = {
80+
.esp_clock_router_cfg = {
81+
.xclk_pin = cam_pin_cfg.xclk,
82+
.xclk_freq_hz = 24000000,
83+
}
84+
};
85+
ESP_ERROR_CHECK(esp_cam_sensor_xclk_allocate(ESP_CAM_SENSOR_XCLK_ESP_CLOCK_ROUTER, &xclk_handle));
86+
ESP_ERROR_CHECK(esp_cam_sensor_xclk_start(xclk_handle, &xclk_config));
87+
}
7788
} else if (cam_pin_cfg.type == CAMERA_TYPE_DVP) {
7889
dvp_config.reset_pin = cam_pin_cfg.reset;
7990
dvp_config.pwdn_pin = cam_pin_cfg.pwr;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Flash setting
2+
CONFIG_FLASHMODE_QIO=y
3+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
4+
5+
CONFIG_SPIRAM_SPEED_200M=y
6+
7+
# If you use serial JTAG turn on this option
8+
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
9+
10+
# Use camera SC2336
11+
CONFIG_CAMERA_OV2710=y
12+
CONFIG_CAMERA_OV2710_MIPI_RAW10_1920X1080_25FPS=y
13+
14+
# Enable ISP pipelines
15+
CONFIG_ESP_VIDEO_ENABLE_ISP_PIPELINE_CONTROLLER=y
16+
17+
# Set Slave target type
18+
CONFIG_IDF_SLAVE_TARGET="esp32c6"
19+
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
20+
21+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_1=27
22+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_1=28
23+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_1=29
24+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_1=30
25+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_1=31
26+
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_1=32
27+
CONFIG_ESP_HOSTED_SDIO_GPIO_RESET_SLAVE=9
28+
CONFIG_ESP_HOSTED_SDIO_PIN_CMD=27
29+
CONFIG_ESP_HOSTED_SDIO_PIN_CLK=28
30+
CONFIG_ESP_HOSTED_SDIO_PIN_D0=29
31+
CONFIG_ESP_HOSTED_SDIO_PIN_D2=31
32+
CONFIG_ESP_HOSTED_SDIO_PIN_D3=32
33+
CONFIG_ESP_HOSTED_SDIO_PIN_D1=30
34+
35+
36+
# Enable following configuration if support C5 Slave, make sure GPIO matched
37+
# CONFIG_SLAVE_IDF_TARGET_ESP32C5=y
38+
# CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE=y
39+
# CONFIG_ESP_SPI_HD_GPIO_CS=4
40+
# CONFIG_ESP_SPI_HD_GPIO_CLK=5
41+
# CONFIG_ESP_SPI_HD_GPIO_D0=20
42+
# CONFIG_ESP_SPI_HD_GPIO_D1=21
43+
# CONFIG_ESP_SPI_HD_GPIO_D2=22
44+
# CONFIG_ESP_SPI_HD_GPIO_D3=23
45+
# CONFIG_ESP_SPI_HD_GPIO_DATA_READY=32
46+
# CONFIG_ESP_SPI_HD_GPIO_RESET_SLAVE=33
47+
# CONFIG_ESP_SPI_HD_FREQ_ESP32XX=40
48+
# CONFIG_ESP_HOSTED_SPI_HD_PRIV_INTERFACE_4_DATA_LINES=y

0 commit comments

Comments
 (0)