mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-12 21:37:16 +00:00
refactor(isp): refactor the interrupt and callback solution
- Added async API - Replaced the polling API - Supported one more callback and event data
This commit is contained in:
@@ -4,84 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ISP peripheral contains many submodules, whose drivers are scattered in different header files.
|
||||
* This header file serves as a prelude, contains every thing that is needed to work with the ISP peripheral.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
#include "driver/isp_types.h"
|
||||
#include "driver/isp_core.h"
|
||||
#include "driver/isp_af.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief ISP configurations
|
||||
*/
|
||||
typedef struct {
|
||||
isp_clk_src_t clk_src; ///< Clock source
|
||||
uint32_t clk_hz; ///< Clock frequency in Hz, suggest twice higher than cam sensor speed
|
||||
isp_input_data_source_t input_data_source; ///< Input data source
|
||||
isp_color_t input_data_color_type; ///< Input color type
|
||||
isp_color_t output_data_color_type; ///< Output color type
|
||||
bool has_line_start_packet; ///< Enable line start packet
|
||||
bool has_line_end_packet; ///< Enable line end packet
|
||||
uint32_t h_res; ///< Input horizontal resolution, i.e. the number of pixels in a line
|
||||
uint32_t v_res; ///< Input vertical resolution, i.e. the number of lines in a frame
|
||||
} esp_isp_processor_cfg_t;
|
||||
|
||||
/**
|
||||
* @brief New an ISP processor
|
||||
*
|
||||
* @param[in] proc_config Pointer to ISP config. Refer to ``esp_isp_processor_cfg_t``.
|
||||
* @param[out] ret_proc Processor handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK On success
|
||||
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid.
|
||||
* - ESP_ERR_NOT_FOUND No free interrupt found with the specified flags
|
||||
* - ESP_ERR_NOT_SUPPORTED Not supported mode
|
||||
* - ESP_ERR_NO_MEM If out of memory
|
||||
*/
|
||||
esp_err_t esp_isp_new_processor(const esp_isp_processor_cfg_t *proc_config, isp_proc_handle_t *ret_proc);
|
||||
|
||||
/**
|
||||
* @brief Delete an ISP processor
|
||||
*
|
||||
* @param[in] proc Processor handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK On success
|
||||
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid.
|
||||
* - ESP_ERR_INVALID_STATE Driver state is invalid.
|
||||
*/
|
||||
esp_err_t esp_isp_del_processor(isp_proc_handle_t proc);
|
||||
|
||||
/**
|
||||
* @brief Enable an ISP processor
|
||||
*
|
||||
* @param[in] proc Processor handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK On success
|
||||
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid.
|
||||
* - ESP_ERR_INVALID_STATE Driver state is invalid.
|
||||
*/
|
||||
esp_err_t esp_isp_enable(isp_proc_handle_t proc);
|
||||
|
||||
/**
|
||||
* @brief Disable an ISP processor
|
||||
*
|
||||
* @param[in] proc Processor handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK On success
|
||||
* - ESP_ERR_INVALID_ARG If the combination of arguments is invalid.
|
||||
* - ESP_ERR_INVALID_STATE Driver state is invalid.
|
||||
*/
|
||||
esp_err_t esp_isp_disable(isp_proc_handle_t proc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user