forked from espressif/esp-idf
change(isp): added eco2 check
This commit is contained in:
@@ -58,6 +58,7 @@ esp_err_t esp_isp_lsc_allocate_gain_array(isp_proc_handle_t isp_proc, esp_isp_ls
|
|||||||
* - ESP_OK On success
|
* - ESP_OK On success
|
||||||
* - ESP_ERR_INVALID_STATE Not allowed to be called under current state
|
* - ESP_ERR_INVALID_STATE Not allowed to be called under current state
|
||||||
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid
|
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid
|
||||||
|
* - ESP_ERR_NOT_SUPPORTED Not supported
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_isp_lsc_configure(isp_proc_handle_t isp_proc, const esp_isp_lsc_config_t *config);
|
esp_err_t esp_isp_lsc_configure(isp_proc_handle_t isp_proc, const esp_isp_lsc_config_t *config);
|
||||||
|
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
#include "driver/isp_bf.h"
|
#include "driver/isp_bf.h"
|
||||||
#include "driver/isp_lsc.h"
|
#include "driver/isp_lsc.h"
|
||||||
#include "esp_private/isp_private.h"
|
#include "esp_private/isp_private.h"
|
||||||
|
#include "hal/efuse_hal.h"
|
||||||
|
#include "soc/chip_revision.h"
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
LSC
|
LSC
|
||||||
@@ -51,6 +53,13 @@ esp_err_t esp_isp_lsc_allocate_gain_array(isp_proc_handle_t isp_proc, esp_isp_ls
|
|||||||
|
|
||||||
esp_err_t esp_isp_lsc_configure(isp_proc_handle_t isp_proc, const esp_isp_lsc_config_t *config)
|
esp_err_t esp_isp_lsc_configure(isp_proc_handle_t isp_proc, const esp_isp_lsc_config_t *config)
|
||||||
{
|
{
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
unsigned chip_version = efuse_hal_chip_revision();
|
||||||
|
if (!ESP_CHIP_REV_ABOVE(chip_version, 100)) {
|
||||||
|
ESP_RETURN_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, TAG, "LSC is not supported on ESP32P4 chips prior than ECO2");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ESP_RETURN_ON_FALSE(isp_proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
ESP_RETURN_ON_FALSE(isp_proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
||||||
|
|
||||||
int num_grids_x_max = ISP_LSC_GET_GRIDS(ISP_LL_HSIZE_MAX);
|
int num_grids_x_max = ISP_LSC_GET_GRIDS(ISP_LL_HSIZE_MAX);
|
||||||
|
@@ -347,6 +347,7 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(esp_isp_color_configure(isp_proc, &color_config));
|
ESP_ERROR_CHECK(esp_isp_color_configure(isp_proc, &color_config));
|
||||||
ESP_ERROR_CHECK(esp_isp_color_enable(isp_proc));
|
ESP_ERROR_CHECK(esp_isp_color_enable(isp_proc));
|
||||||
|
|
||||||
|
#if CONFIG_ESP32P4_REV_MIN_FULL >= 100
|
||||||
esp_isp_lsc_gain_array_t gain_array = {};
|
esp_isp_lsc_gain_array_t gain_array = {};
|
||||||
esp_isp_lsc_config_t lsc_config = {
|
esp_isp_lsc_config_t lsc_config = {
|
||||||
.gain_array = &gain_array,
|
.gain_array = &gain_array,
|
||||||
@@ -366,6 +367,7 @@ void app_main(void)
|
|||||||
}
|
}
|
||||||
ESP_ERROR_CHECK(esp_isp_lsc_configure(isp_proc, &lsc_config));
|
ESP_ERROR_CHECK(esp_isp_lsc_configure(isp_proc, &lsc_config));
|
||||||
ESP_ERROR_CHECK(esp_isp_lsc_enable(isp_proc));
|
ESP_ERROR_CHECK(esp_isp_lsc_enable(isp_proc));
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct af_task_param_t {
|
typedef struct af_task_param_t {
|
||||||
isp_proc_handle_t isp_proc;
|
isp_proc_handle_t isp_proc;
|
||||||
|
Reference in New Issue
Block a user