feat(isp): supported byte endianness swap

This commit is contained in:
armando
2025-03-11 17:11:43 +08:00
committed by Armando (Dou Yiwen)
parent 4abe226cf3
commit f31a5dc543
3 changed files with 16 additions and 1 deletions

View File

@ -34,7 +34,8 @@ typedef struct {
color_raw_element_order_t bayer_order; ///< Bayer order
int intr_priority; ///< The interrupt priority, range 0~3, if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3)
struct {
uint32_t bypass_isp: 1; ///< Bypass ISP pipelines
uint32_t bypass_isp : 1; ///< Bypass ISP pipelines
uint32_t byte_swap_en : 1; ///< Enable byte swap
} flags; ///< Flags
} esp_isp_processor_cfg_t;

View File

@ -166,6 +166,9 @@ esp_err_t esp_isp_new_processor(const esp_isp_processor_cfg_t *proc_config, isp_
if (out_color_format.color_space == COLOR_SPACE_RGB && proc_config->input_data_source == ISP_INPUT_DATA_SOURCE_DVP) {
isp_ll_color_enable(proc->hal.hw, true); // workaround for DIG-474
}
if (proc_config->flags.byte_swap_en) {
isp_ll_set_byte_swap(proc->hal.hw, true);
}
proc->in_color_format = in_color_format;
proc->out_color_format = out_color_format;

View File

@ -499,6 +499,17 @@ static inline void isp_ll_set_bayer_mode(isp_dev_t *hw, color_raw_element_order_
hw->frame_cfg.bayer_mode = bayer_order;
}
/**
* @brief Swap the data endianness order in bytes
*
* @param[in] hw Hardware instance address
* @param[in] byte_swap_en byte swap enable or not
*/
static inline void isp_ll_set_byte_swap(isp_dev_t *hw, bool byte_swap_en)
{
hw->cntl.byte_endian_order = byte_swap_en;
}
/*---------------------------------------------------------------
AF
---------------------------------------------------------------*/