test(isp): added isp csi share test

This commit is contained in:
Armando 2024-01-16 17:05:26 +08:00
parent ff9b88d827
commit a26ab5118c
3 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include "sdkconfig.h"
#include "unity.h"
#include "esp_private/mipi_csi_share_hw_ctrl.h"
TEST_CASE("ISP CSI share usage test", "[isp]")
{
int csi_brg_id = 0;
TEST_ESP_OK(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_CSI, &csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_SHARE, &csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_declaim(csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_declaim(csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_ISP_DVP, &csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_SHARE, &csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_declaim(csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_declaim(csi_brg_id));
TEST_ESP_OK(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_ISP_DVP, &csi_brg_id));
TEST_ASSERT(mipi_csi_brg_claim(MIPI_CSI_BRG_USER_CSI, &csi_brg_id) == ESP_ERR_NOT_FOUND);
TEST_ESP_OK(mipi_csi_brg_declaim(csi_brg_id));
TEST_ASSERT(mipi_csi_brg_declaim(csi_brg_id) == ESP_ERR_INVALID_STATE);
}

View File

@ -18,11 +18,10 @@ TEST_CASE("ISP processor exhausted allocation", "[isp]")
.input_data_color_type = ISP_COLOR_RAW8,
.output_data_color_type = ISP_COLOR_RGB565,
};
isp_proc_t isp_proc[SOC_ISP_NUMS + 1] = {};
isp_proc_handle_t isp_proc[SOC_ISP_NUMS + 1] = {};
for (int i = 0; i < SOC_ISP_NUMS; i++) {
TEST_ESP_OK(esp_isp_new_processor(&isp_config, &isp_proc[i]));
esp_rom_printf("first alloc ok\n");
}
TEST_ASSERT(esp_isp_new_processor(&isp_config, &isp_proc[SOC_ISP_NUMS]) == ESP_ERR_NOT_FOUND);
@ -40,7 +39,7 @@ TEST_CASE("ISP AF controller exhausted allocation", "[isp]")
.input_data_color_type = ISP_COLOR_RAW8,
.output_data_color_type = ISP_COLOR_RGB565,
};
isp_proc_t isp_proc = NULL;
isp_proc_handle_t isp_proc = NULL;
TEST_ESP_OK(esp_isp_new_processor(&isp_config, &isp_proc));
esp_isp_af_config_t af_config = {
@ -67,7 +66,7 @@ TEST_CASE("ISP AF env detector exhausted allocation", "[isp]")
.input_data_color_type = ISP_COLOR_RAW8,
.output_data_color_type = ISP_COLOR_RGB565,
};
isp_proc_t isp_proc = NULL;
isp_proc_handle_t isp_proc = NULL;
TEST_ESP_OK(esp_isp_new_processor(&isp_config, &isp_proc));
esp_isp_af_config_t af_config = {

View File

@ -112,12 +112,6 @@ examples/peripherals/i2s/i2s_recorder:
- esp_driver_spi
- esp_driver_i2s
examples/peripherals/jpeg/jpeg_decode:
disable:
- if: SOC_JPEG_CODEC_SUPPORTED != 1
depends_components:
- esp_driver_jpeg
examples/peripherals/isp/auto_focus:
disable:
- if: INCLUDE_DEFAULT == 1
@ -126,6 +120,12 @@ examples/peripherals/isp/auto_focus:
depends_components:
- esp_driver_isp
examples/peripherals/jpeg/jpeg_decode:
disable:
- if: SOC_JPEG_CODEC_SUPPORTED != 1
depends_components:
- esp_driver_jpeg
examples/peripherals/lcd/i2c_oled:
disable:
- if: SOC_I2C_SUPPORTED != 1