mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-27 18:32:54 +00:00
feat(cam): add cam sensor handle and deinit api
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -223,7 +223,10 @@ void app_main(void)
|
||||
};
|
||||
|
||||
//--------Camera Sensor and SCCB Init-----------//
|
||||
i2c_master_bus_handle_t i2c_bus_handle = NULL;
|
||||
example_sensor_handle_t sensor_handle = {
|
||||
.sccb_handle = NULL,
|
||||
.i2c_bus_handle = NULL,
|
||||
};
|
||||
example_sensor_config_t cam_sensor_config = {
|
||||
.i2c_port_num = I2C_NUM_0,
|
||||
.i2c_sda_io_num = EXAMPLE_MIPI_CSI_CAM_SCCB_SDA_IO,
|
||||
@@ -231,7 +234,7 @@ void app_main(void)
|
||||
.port = ESP_CAM_SENSOR_MIPI_CSI,
|
||||
.format_name = EXAMPLE_CAM_FORMAT,
|
||||
};
|
||||
example_sensor_init(&cam_sensor_config, &i2c_bus_handle);
|
||||
example_sensor_init(&cam_sensor_config, &sensor_handle);
|
||||
|
||||
//---------------VCM SCCB Init------------------//
|
||||
esp_sccb_io_handle_t dw9714_io_handle = NULL;
|
||||
@@ -240,7 +243,7 @@ void app_main(void)
|
||||
.device_address = EXAMPLE_DW9714_DEV_ADDR,
|
||||
.dev_addr_length = I2C_ADDR_BIT_LEN_7,
|
||||
};
|
||||
ESP_ERROR_CHECK(sccb_new_i2c_io(i2c_bus_handle, &i2c_config, &dw9714_io_handle));
|
||||
ESP_ERROR_CHECK(sccb_new_i2c_io(sensor_handle.i2c_bus_handle, &i2c_config, &dw9714_io_handle));
|
||||
|
||||
//---------------CSI Init------------------//
|
||||
esp_cam_ctlr_csi_config_t csi_config = {
|
||||
|
Reference in New Issue
Block a user