mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 10:30:58 +02:00
feat(isp): Update hue for esp32p4eco5
This commit is contained in:
@@ -27,8 +27,8 @@ typedef struct {
|
|||||||
* Range 0 ~ 1, decimal value should be 0~127, default 1
|
* Range 0 ~ 1, decimal value should be 0~127, default 1
|
||||||
*/
|
*/
|
||||||
uint32_t color_hue; /*!< The color hue value, based on the color wheel.
|
uint32_t color_hue; /*!< The color hue value, based on the color wheel.
|
||||||
* 0 degrees represents red, 120 degrees represents green, and 240 degrees represents blue. 360 degrees overlaps with 0 degrees
|
* 0 degrees represents red, 120 degrees represents green, and 240 degrees represents blue.
|
||||||
* Range 0 ~ 360, default 0.
|
* Range 0 ~ 359, default 0.
|
||||||
*/
|
*/
|
||||||
int color_brightness; /*!< The color brightness value.
|
int color_brightness; /*!< The color brightness value.
|
||||||
* Range -128 ~ 127, default 0.
|
* Range -128 ~ 127, default 0.
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
#include "hal/misc.h"
|
#include "hal/misc.h"
|
||||||
#include "hal/assert.h"
|
#include "hal/assert.h"
|
||||||
|
#include "hal/config.h"
|
||||||
#include "hal/hal_utils.h"
|
#include "hal/hal_utils.h"
|
||||||
#include "hal/isp_types.h"
|
#include "hal/isp_types.h"
|
||||||
#include "hal/color_types.h"
|
#include "hal/color_types.h"
|
||||||
@@ -109,7 +110,7 @@ extern "C" {
|
|||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
#define ISP_LL_COLOR_CONTRAST_MAX 0xff
|
#define ISP_LL_COLOR_CONTRAST_MAX 0xff
|
||||||
#define ISP_LL_COLOR_SATURATION_MAX 0xff
|
#define ISP_LL_COLOR_SATURATION_MAX 0xff
|
||||||
#define ISP_LL_COLOR_HUE_MAX 360
|
#define ISP_LL_COLOR_HUE_MAX 359
|
||||||
#define ISP_LL_COLOR_BRIGNTNESS_MIN -128
|
#define ISP_LL_COLOR_BRIGNTNESS_MIN -128
|
||||||
#define ISP_LL_COLOR_BRIGNTNESS_MAX 127
|
#define ISP_LL_COLOR_BRIGNTNESS_MAX 127
|
||||||
|
|
||||||
@@ -958,7 +959,10 @@ static inline void isp_ll_color_set_saturation(isp_dev_t *hw, isp_color_saturati
|
|||||||
*/
|
*/
|
||||||
static inline void isp_ll_color_set_hue(isp_dev_t *hw, uint32_t color_hue)
|
static inline void isp_ll_color_set_hue(isp_dev_t *hw, uint32_t color_hue)
|
||||||
{
|
{
|
||||||
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->color_ctrl, color_hue, color_hue);
|
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->color_ctrl, color_hue, color_hue & 0xFF);
|
||||||
|
#if HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300
|
||||||
|
hw->color_hue_ctrl.color_hue_h = (color_hue >> 8) & 0x01;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -90,7 +90,7 @@ void isp_hal_init(isp_hal_context_t *hal, int isp_id);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
isp_color_contrast_t color_contrast; ///< The color contrast value, range 0~1, decimal value should be 0~127
|
isp_color_contrast_t color_contrast; ///< The color contrast value, range 0~1, decimal value should be 0~127
|
||||||
isp_color_saturation_t color_saturation; ///< The color saturation value, range 0~1, decimal value should be 0~127
|
isp_color_saturation_t color_saturation; ///< The color saturation value, range 0~1, decimal value should be 0~127
|
||||||
uint32_t color_hue; ///< The color hue angle value, range 0-360
|
uint32_t color_hue; ///< The color hue angle value, range 0-359
|
||||||
int color_brightness; ///< The color brightness value, range -128~127
|
int color_brightness; ///< The color brightness value, range -128~127
|
||||||
} isp_hal_color_cfg_t;
|
} isp_hal_color_cfg_t;
|
||||||
|
|
||||||
|
@@ -196,7 +196,11 @@ void isp_hal_color_config(isp_hal_context_t *hal, const isp_hal_color_cfg_t *con
|
|||||||
if (config) {
|
if (config) {
|
||||||
isp_ll_color_set_contrast(hal->hw, config->color_contrast);
|
isp_ll_color_set_contrast(hal->hw, config->color_contrast);
|
||||||
isp_ll_color_set_saturation(hal->hw, config->color_saturation);
|
isp_ll_color_set_saturation(hal->hw, config->color_saturation);
|
||||||
|
#if HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300
|
||||||
|
isp_ll_color_set_hue(hal->hw, config->color_hue);
|
||||||
|
#else
|
||||||
isp_ll_color_set_hue(hal->hw, (config->color_hue * 256) / 360);
|
isp_ll_color_set_hue(hal->hw, (config->color_hue * 256) / 360);
|
||||||
|
#endif
|
||||||
isp_ll_color_set_brigntness(hal->hw, (int8_t)config->color_brightness);
|
isp_ll_color_set_brigntness(hal->hw, (int8_t)config->color_brightness);
|
||||||
} else {
|
} else {
|
||||||
isp_color_contrast_t color_contrast_default = {
|
isp_color_contrast_t color_contrast_default = {
|
||||||
|
@@ -1642,7 +1642,7 @@ typedef union {
|
|||||||
*/
|
*/
|
||||||
uint32_t color_saturation:8;
|
uint32_t color_saturation:8;
|
||||||
/** color_hue : R/W; bitpos: [15:8]; default: 0;
|
/** color_hue : R/W; bitpos: [15:8]; default: 0;
|
||||||
* this field configures the color hue angle
|
* this field configures the color hue angle lower 8 bits
|
||||||
*/
|
*/
|
||||||
uint32_t color_hue:8;
|
uint32_t color_hue:8;
|
||||||
/** color_contrast : R/W; bitpos: [23:16]; default: 128;
|
/** color_contrast : R/W; bitpos: [23:16]; default: 128;
|
||||||
|
@@ -565,7 +565,7 @@ Calling :cpp:func:`esp_isp_color_configure` to configure color function, you can
|
|||||||
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_MAX:default="1.0", esp32p4="1.0"}
|
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_MAX:default="1.0", esp32p4="1.0"}
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_DEFAULT:default="1.0", esp32p4="1.0"}
|
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_DEFAULT:default="1.0", esp32p4="1.0"}
|
||||||
|
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_HUE_MAX:default="360", esp32p4="360"}
|
{IDF_TARGET_SOC_ISP_COLOR_HUE_MAX:default="359", esp32p4="359"}
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_HUE_DEFAULT:default="0", esp32p4="0"}
|
{IDF_TARGET_SOC_ISP_COLOR_HUE_DEFAULT:default="0", esp32p4="0"}
|
||||||
|
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_BRIGHTNESS_MIN:default="-127", esp32p4="-127"}
|
{IDF_TARGET_SOC_ISP_COLOR_BRIGHTNESS_MIN:default="-127", esp32p4="-127"}
|
||||||
|
@@ -565,7 +565,7 @@ ISP 色彩控制器
|
|||||||
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_MAX:default="1.0", esp32p4="1.0"}
|
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_MAX:default="1.0", esp32p4="1.0"}
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_DEFAULT:default="1.0", esp32p4="1.0"}
|
{IDF_TARGET_SOC_ISP_COLOR_SATURATION_DEFAULT:default="1.0", esp32p4="1.0"}
|
||||||
|
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_HUE_MAX:default="360", esp32p4="360"}
|
{IDF_TARGET_SOC_ISP_COLOR_HUE_MAX:default="359", esp32p4="359"}
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_HUE_DEFAULT:default="0", esp32p4="0"}
|
{IDF_TARGET_SOC_ISP_COLOR_HUE_DEFAULT:default="0", esp32p4="0"}
|
||||||
|
|
||||||
{IDF_TARGET_SOC_ISP_COLOR_BRIGHTNESS_MIN:default="-127", esp32p4="-127"}
|
{IDF_TARGET_SOC_ISP_COLOR_BRIGHTNESS_MIN:default="-127", esp32p4="-127"}
|
||||||
|
@@ -3,3 +3,4 @@ CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
|||||||
CONFIG_SPIRAM_SPEED_200M=y
|
CONFIG_SPIRAM_SPEED_200M=y
|
||||||
CONFIG_CAMERA_SC2336=y
|
CONFIG_CAMERA_SC2336=y
|
||||||
CONFIG_CAMERA_OV5647=y
|
CONFIG_CAMERA_OV5647=y
|
||||||
|
CONFIG_CAMERA_OV5647_ENABLE_MOTOR_BY_GPIO0=y
|
||||||
|
Reference in New Issue
Block a user