forked from espressif/esp-idf
change(isp): rename isp_af example to isp example
This commit is contained in:
@@ -127,7 +127,7 @@ examples/peripherals/i2s/i2s_recorder:
|
|||||||
- esp_driver_spi
|
- esp_driver_spi
|
||||||
- esp_driver_i2s
|
- esp_driver_i2s
|
||||||
|
|
||||||
examples/peripherals/isp/auto_focus:
|
examples/peripherals/isp/multi_pipelines:
|
||||||
disable:
|
disable:
|
||||||
- if: SOC_MIPI_CSI_SUPPORTED != 1 or SOC_MIPI_DSI_SUPPORTED != 1 or SOC_ISP_SUPPORTED != 1
|
- if: SOC_MIPI_CSI_SUPPORTED != 1 or SOC_MIPI_DSI_SUPPORTED != 1 or SOC_ISP_SUPPORTED != 1
|
||||||
depends_components:
|
depends_components:
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
project(isp_af_dsi)
|
project(isp_multi_pipelines)
|
@@ -2,11 +2,14 @@
|
|||||||
| ----------------- | -------- |
|
| ----------------- | -------- |
|
||||||
|
|
||||||
|
|
||||||
# Camera display via DSI example
|
# Camera display plus ISP via DSI example
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This example demonstrates how to use the ISP (image signal processor) to work with esp_driver_cam component. This example will capture camera sensor signals via CSI interface and display it via DSI interface. This example also enables the ISP AF (auto-focus) feature and ISP BF (bayer denoise) feature.
|
This example demonstrates how to use the ISP (image signal processor) to work with esp_driver_cam component. This example will capture camera sensor signals via CSI interface and display it via DSI interface. This example enables
|
||||||
|
- ISP AF (auto-focus) feature
|
||||||
|
- ISP BF (bayer denoise) feature
|
||||||
|
- ISP Sharpen feature
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
idf_component_register(SRCS "isp_af_dsi_main.c"
|
idf_component_register(SRCS "isp_dsi_main.c"
|
||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
REQUIRES esp_mm esp_driver_isp esp_driver_cam esp_driver_i2c esp_lcd dsi_init
|
REQUIRES esp_mm esp_driver_isp esp_driver_cam esp_driver_i2c esp_lcd dsi_init
|
||||||
)
|
)
|
@@ -4,6 +4,6 @@ dependencies:
|
|||||||
idf:
|
idf:
|
||||||
version: ">=5.3.0"
|
version: ">=5.3.0"
|
||||||
isp_af_schemes:
|
isp_af_schemes:
|
||||||
path: ${IDF_PATH}/examples/peripherals/isp/auto_focus/components/isp_af_schemes
|
path: ${IDF_PATH}/examples/peripherals/isp/multi_pipelines/components/isp_af_schemes
|
||||||
dsi_init:
|
dsi_init:
|
||||||
path: ${IDF_PATH}/examples/peripherals/camera/camera_dsi/components/dsi_init
|
path: ${IDF_PATH}/examples/peripherals/camera/camera_dsi/components/dsi_init
|
@@ -16,7 +16,6 @@
|
|||||||
#include "esp_cache.h"
|
#include "esp_cache.h"
|
||||||
#include "driver/i2c_master.h"
|
#include "driver/i2c_master.h"
|
||||||
#include "driver/isp.h"
|
#include "driver/isp.h"
|
||||||
#include "driver/isp_bf.h"
|
|
||||||
#include "isp_af_scheme_sa.h"
|
#include "isp_af_scheme_sa.h"
|
||||||
#include "esp_cam_ctlr_csi.h"
|
#include "esp_cam_ctlr_csi.h"
|
||||||
#include "esp_cam_ctlr.h"
|
#include "esp_cam_ctlr.h"
|
||||||
@@ -33,6 +32,9 @@ static const char *TAG = "isp_dsi";
|
|||||||
static bool s_camera_get_new_vb(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
|
static bool s_camera_get_new_vb(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
|
||||||
static bool s_camera_get_finished_trans(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
|
static bool s_camera_get_finished_trans(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------
|
||||||
|
AF
|
||||||
|
---------------------------------------------------------------*/
|
||||||
typedef union {
|
typedef union {
|
||||||
struct {
|
struct {
|
||||||
uint16_t s : 4;
|
uint16_t s : 4;
|
||||||
@@ -47,7 +49,7 @@ typedef union {
|
|||||||
uint16_t val;
|
uint16_t val;
|
||||||
} dw9714_reg_t;
|
} dw9714_reg_t;
|
||||||
|
|
||||||
static bool IRAM_ATTR s_env_change_cb(isp_af_ctlr_t af_ctrlr, const esp_isp_af_env_detector_evt_data_t *edata, void *user_data)
|
static bool IRAM_ATTR s_af_env_change_cb(isp_af_ctlr_t af_ctrlr, const esp_isp_af_env_detector_evt_data_t *edata, void *user_data)
|
||||||
{
|
{
|
||||||
BaseType_t mustYield = pdFALSE;
|
BaseType_t mustYield = pdFALSE;
|
||||||
TaskHandle_t task_handle = (TaskHandle_t)user_data;
|
TaskHandle_t task_handle = (TaskHandle_t)user_data;
|
||||||
@@ -141,7 +143,7 @@ static void af_task(void *arg)
|
|||||||
ESP_ERROR_CHECK(esp_isp_af_controller_set_env_detector(af_ctrlr, &env_config));
|
ESP_ERROR_CHECK(esp_isp_af_controller_set_env_detector(af_ctrlr, &env_config));
|
||||||
|
|
||||||
esp_isp_af_env_detector_evt_cbs_t cbs = {
|
esp_isp_af_env_detector_evt_cbs_t cbs = {
|
||||||
.on_env_change = s_env_change_cb,
|
.on_env_change = s_af_env_change_cb,
|
||||||
};
|
};
|
||||||
ESP_ERROR_CHECK(esp_isp_af_env_detector_register_event_callbacks(af_ctrlr, &cbs, task_handle));
|
ESP_ERROR_CHECK(esp_isp_af_env_detector_register_event_callbacks(af_ctrlr, &cbs, task_handle));
|
||||||
|
|
||||||
@@ -293,6 +295,29 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(esp_isp_bf_configure(isp_proc, &bf_config));
|
ESP_ERROR_CHECK(esp_isp_bf_configure(isp_proc, &bf_config));
|
||||||
ESP_ERROR_CHECK(esp_isp_bf_enable(isp_proc));
|
ESP_ERROR_CHECK(esp_isp_bf_enable(isp_proc));
|
||||||
|
|
||||||
|
esp_isp_sharpen_config_t sharpen_config = {
|
||||||
|
.h_freq_coeff = {
|
||||||
|
.integer = 2,
|
||||||
|
.decimal = 0,
|
||||||
|
},
|
||||||
|
.m_freq_coeff = {
|
||||||
|
.integer = 2,
|
||||||
|
.decimal = 0,
|
||||||
|
},
|
||||||
|
.h_thresh = 255,
|
||||||
|
.l_thresh = 0,
|
||||||
|
.padding_mode = ISP_SHARPEN_EDGE_PADDING_MODE_SRND_DATA,
|
||||||
|
.sharpen_template = {
|
||||||
|
{1, 2, 1},
|
||||||
|
{2, 4, 2},
|
||||||
|
{1, 2, 1},
|
||||||
|
},
|
||||||
|
.padding_line_tail_valid_start_pixel = 0,
|
||||||
|
.padding_line_tail_valid_end_pixel = 0,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_isp_sharpen_configure(isp_proc, &sharpen_config));
|
||||||
|
ESP_ERROR_CHECK(esp_isp_sharpen_enable(isp_proc));
|
||||||
|
|
||||||
typedef struct af_task_param_t {
|
typedef struct af_task_param_t {
|
||||||
isp_proc_handle_t isp_proc;
|
isp_proc_handle_t isp_proc;
|
||||||
esp_sccb_io_handle_t dw9714_io_handle;
|
esp_sccb_io_handle_t dw9714_io_handle;
|
Reference in New Issue
Block a user