improve cam driver header files

This commit is contained in:
Lv Xin Yue
2025-10-09 16:28:36 +08:00
parent c76d25edc1
commit 31700298ed
5 changed files with 202 additions and 199 deletions
@@ -16,36 +16,36 @@ extern "C" {
#endif
/**
* @brief ESP CAM CSI controller configurations
* @brief ESP CAM CSI controller configurations.
*/
typedef struct {
int ctlr_id; ///< CSI controller ID
mipi_csi_phy_clock_source_t clk_src; ///< CSI phy clock source
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
uint8_t data_lane_num; ///< Data lane num
int lane_bit_rate_mbps; ///< Lane bit rate in Mbps
cam_ctlr_color_t input_data_color_type; ///< Input color type
cam_ctlr_color_t output_data_color_type; ///< Output color type
int queue_items; ///< Queue items
int ctlr_id; /*!< CSI controller ID. */
mipi_csi_phy_clock_source_t clk_src; /*!< CSI PHY clock source. */
uint32_t h_res; /*!< Input horizontal resolution. Measurement unit: pixels per line. */
uint32_t v_res; /*!< Input vertical resolution. Measurement unit: lines per frame. */
uint8_t data_lane_num; /*!< Number of data lanes. */
int lane_bit_rate_mbps; /*!< Lane bit rate. Measurement unit: Mbps. */
cam_ctlr_color_t input_data_color_type; /*!< Input color type. */
cam_ctlr_color_t output_data_color_type; /*!< Output color type. */
int queue_items; /*!< Number of queue items. */
struct {
uint32_t byte_swap_en : 1; ///< Enable byte swap
uint32_t bk_buffer_dis : 1; ///< Disable backup buffer
}; ///< Boolean Flags
uint32_t byte_swap_en : 1; /*!< Set to 1 to enable byte swap. */
uint32_t bk_buffer_dis : 1; /*!< Set to 1 to disable backup buffer. */
}; /*!< Boolean flags. */
} esp_cam_ctlr_csi_config_t;
/**
* @brief New ESP CAM CSI controller
* @brief Create a new ESP CAM CSI controller.
*
* @param[in] config CSI controller configurations
* @param[out] ret_handle Returned ESP CAM controller handle
* @param[in] config CSI controller configurations.
* @param[out] ret_handle Returned ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_NO_MEM: Out of memory
* - ESP_ERR_NOT_SUPPORTED: Currently not support modes or types
* - ESP_ERR_NOT_FOUND: CSI is registered already
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_NO_MEM: Out of memory.
* - ESP_ERR_NOT_SUPPORTED: Currently unsupported modes or types.
* - ESP_ERR_NOT_FOUND: CSI is already registered.
*/
esp_err_t esp_cam_new_csi_ctlr(const esp_cam_ctlr_csi_config_t *config, esp_cam_ctlr_handle_t *ret_handle);
@@ -18,152 +18,152 @@ extern "C" {
#endif
/**
* @brief Enable ESP CAM controller
* @brief Enable the ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_enable(esp_cam_ctlr_handle_t handle);
/**
* @brief Start ESP CAM controller
* @brief Start the ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_start(esp_cam_ctlr_handle_t handle);
/**
* @brief Stop ESP CAM controller
* @brief Stop the ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_stop(esp_cam_ctlr_handle_t handle);
/**
* @brief Disable ESP CAM controller
* @brief Disable the ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_disable(esp_cam_ctlr_handle_t handle);
/**
* @brief Receive data to the given transaction
* @brief Receive data for the given transaction.
*
* @param[in] handle ESP CAM controller handle
* @param[in] trans ESP CAM controller transaction type
* @param[in] timeout_ms Timeout in ms
* @param[in] handle ESP CAM controller handle.
* @param[in] trans ESP CAM controller transaction type.
* @param[in] timeout_ms Timeout. Measurement unit: milliseconds.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_receive(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, uint32_t timeout_ms);
/**
* @brief Delete ESP CAM controller handle
* @brief Delete the ESP CAM controller handle.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_del(esp_cam_ctlr_handle_t handle);
/**
* @brief Register ESP CAM controller event callbacks
* @brief Register ESP CAM controller event callbacks.
*
* @param[in] handle ESP CAM controller handle.
* @param[in] cbs ESP CAM controller event callbacks.
* @param[in] user_data User data.
*
* @param[in] handle ESP CAM controller handle
* @param[in] cbs ESP CAM controller event callbacks
* @param[in] user_data User data
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t esp_cam_ctlr_register_event_callbacks(esp_cam_ctlr_handle_t handle, const esp_cam_ctlr_evt_cbs_t *cbs, void *user_data);
/**
* @brief Get ESP CAM controller internal malloced backup buffer(s) addr
* @brief Get the ESP CAM controller internal allocated backup buffer(s) address.
*
* @note Generally, data in internal buffer is ready when `on_trans_finished` event
* @note Data in the internal buffer is generally ready when the `on_trans_finished` event occurs.
*
* @param[in] handle ESP CAM controller handle
* @param[in] fb_num Number of frame buffer(s) to get. This value must be the same as the number of the followed fbN parameters
* @param[out] fb0 Address of the frame buffer 0 (first frame buffer)
* @param[out] ... List of other frame buffers if any
* @param[in] handle ESP CAM controller handle.
* @param[in] fb_num Number of frame buffers to get. This value must match the number of subsequent fbN parameters.
* @param[out] fb0 Address of the first frame buffer.
* @param[out] ... List of other frame buffers, if any.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid driver state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid driver state.
*/
esp_err_t esp_cam_ctlr_get_frame_buffer(esp_cam_ctlr_handle_t handle, uint32_t fb_num, const void **fb0, ...);
/**
* @brief Get ESP CAM controller internal backup buffer length
* @brief Get the length of the ESP CAM controller internal backup buffer.
*
* @param[in] handle ESP CAM controller handle
* @param[out] ret_fb_len Optional, The size of each frame buffer, in bytes.
* @param[in] handle ESP CAM controller handle.
* @param[out] ret_fb_len Optional. The size of each frame buffer. Measurement unit: bytes.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: NULL ptr
* - ESP_ERR_INVALID_STATE: Invalid driver state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: NULL pointer.
* - ESP_ERR_INVALID_STATE: Invalid driver state.
*/
esp_err_t esp_cam_ctlr_get_frame_buffer_len(esp_cam_ctlr_handle_t handle, size_t *ret_fb_len);
/**
* @brief Allocate camera buffer for ESP CAM controller
* @brief Allocate a camera buffer for the ESP CAM controller.
*
* @note This function must be called after esp_cam_new_*_ctlr
* @note This function must be called after `esp_cam_new_*_ctlr`.
*
* @param[in] handle ESP CAM controller handle
* @param[in] size Buffer size in bytes
* @param[in] buf_caps Buffer allocation capabilities:
* - MALLOC_CAP_SPIRAM || MALLOC_CAP_DMA: Memory in external SPI RAM
* - MALLOC_CAP_INTERNAL || MALLOC_CAP_DMA: Memory in internal SRAM
* @param[in] handle ESP CAM controller handle.
* @param[in] size Buffer size. Measurement unit: bytes.
* @param[in] buf_caps Buffer allocation capabilities:
* - `MALLOC_CAP_SPIRAM` || `MALLOC_CAP_DMA`: Memory in external SPI RAM.
* - `MALLOC_CAP_INTERNAL` || `MALLOC_CAP_DMA`: Memory in internal SRAM.
*
* @return
* - Buffer pointer on success
* - NULL on failure
* - Buffer pointer on success.
* - NULL on failure.
*/
void *esp_cam_ctlr_alloc_buffer(esp_cam_ctlr_handle_t handle, size_t size, uint32_t buf_caps);
/**
* @brief Configure format conversion
* @brief Configure format conversion.
*
* @param[in] handle ESP CAM controller handle
* @param[in] conv_cfg Color conversion configuration, contains source and destination formats
* @param[in] handle ESP CAM controller handle.
* @param[in] conv_cfg Color conversion configuration, containing source and destination formats.
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_NOT_SUPPORTED: Format conversion not supported by this controller
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_NOT_SUPPORTED: Format conversion not supported by this controller.
*/
esp_err_t esp_cam_ctlr_format_conversion(esp_cam_ctlr_handle_t handle,
const cam_ctlr_format_conv_config_t *conv_cfg);
esp_err_t esp_cam_ctlr_format_conversion(esp_cam_ctlr_handle_t handle, const cam_ctlr_format_conv_config_t *conv_cfg);
#ifdef __cplusplus
}
@@ -15,47 +15,47 @@ extern "C" {
#endif
/**
* @brief ESP CAM controller max timeout value
* @brief Maximum timeout value in ticks for the ESP CAM controller.
*/
#define ESP_CAM_CTLR_MAX_DELAY UINT32_MAX
/**
* @brief ESP CAM controller handle
* @brief Handle for the ESP CAM controller.
*/
typedef struct esp_cam_ctlr_t *esp_cam_ctlr_handle_t;
/**
* @brief ESP CAM controller transaction type
* @brief Transaction type for the ESP CAM controller.
*/
typedef struct {
void *buffer; ///< Transaction buffer
size_t buflen; ///< Len of the transaction buffer
size_t received_size; ///< Received size, this received_size will be written by the driver, indicating the real received size
void *buffer; /*!< Transaction buffer. */
size_t buflen; /*!< Length of the transaction buffer. */
size_t received_size; /*!< Received size. This value is written by the driver and indicates the actual received size. */
} esp_cam_ctlr_trans_t;
/**
* @brief ESP CAM controller event callbacks
* @brief Event callbacks for the ESP CAM controller.
*/
typedef struct {
/**
* @brief On get new transaction callback
* @brief Callback for receiving a new transaction.
*
* @param[in] handle ESP CAM controller handle
* @param[in] trans New transaction
* @param[in] user_data User registered data
* @param[in] handle ESP CAM controller handle.
* @param[in] trans New transaction.
* @param[in] user_data User-registered data.
*
* @return Whether a high priority task is woken up by this function
* @return Whether a high-priority task is woken up by this function.
*/
bool (*on_get_new_trans)(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
/**
* @brief On transaction finish callback
* @brief Callback for a finished transaction.
*
* @param[in] handle ESP CAM controller handle
* @param[out] trans Finished transaction
* @param[in] user_data User registered data
* @param[in] handle ESP CAM controller handle.
* @param[out] trans Finished transaction.
* @param[in] user_data User-registered data.
*
* @return Whether a high priority task is woken up by this function
* @return Whether a high-priority task is woken up by this function.
*/
bool (*on_trans_finished)(esp_cam_ctlr_handle_t handle, esp_cam_ctlr_trans_t *trans, void *user_data);
@@ -14,153 +14,156 @@
extern "C" {
#endif
typedef struct esp_cam_ctlr_t esp_cam_ctlr_t; /*!< Type of CAM controller */
/**
* @brief Type of CAM controller.
*/
typedef struct esp_cam_ctlr_t esp_cam_ctlr_t;
/**
* @brief Cam controller interface
* @brief CAM controller interface.
*/
struct esp_cam_ctlr_t {
/**
* @brief Enable ESP CAM controller
* @brief Enable ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*enable)(esp_cam_ctlr_t *ctlr);
/**
* @brief Start ESP CAM controller
* @brief Start ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*start)(esp_cam_ctlr_t *ctlr);
/**
* @brief Stop ESP CAM controller
* @brief Stop ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*stop)(esp_cam_ctlr_t *ctlr);
/**
* @brief Disable ESP CAM controller
* @brief Disable ESP CAM controller.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*disable)(esp_cam_ctlr_t *ctlr);
/**
* @brief Receive data to the given transaction
* @brief Receive data to the given transaction.
*
* @param[in] handle ESP CAM controller handle
* @param[in] trans ESP CAM controller transaction type
* @param[in] timeout_ms Timeout in ms
* @param[in] handle ESP CAM controller handle.
* @param[in] trans ESP CAM controller transaction type.
* @param[in] timeout_ms Timeout. Measurement unit: milliseconds.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*receive)(esp_cam_ctlr_t *ctlr, esp_cam_ctlr_trans_t *trans, uint32_t timeout_ms);
/**
* @brief Delete ESP CAM controller handle
* @brief Delete ESP CAM controller handle.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*del)(esp_cam_ctlr_t *ctlr);
/**
* @brief Register ESP CAM controller event callbacks
* @brief Register ESP CAM controller event callbacks.
*
* @param[in] handle ESP CAM controller handle
* @param[in] handle ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid state.
*/
esp_err_t (*register_event_callbacks)(esp_cam_ctlr_t *ctlr, const esp_cam_ctlr_evt_cbs_t *cbs, void *user_ctx);
/**
* @brief Get ESP CAM controller internal malloced backup buffer(s) addr
* @brief Get ESP CAM controller internal malloced backup buffer(s) address.
*
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle
* @param[in] uint32_t Number of frame buffer(s) to get. This value must be the same as the number of the followed fbN parameters
* @param[out] const void ** Address of the frame buffer 0 (first frame buffer)
* @param[out] ... List of other frame buffers if any
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle.
* @param[in] uint32_t Number of frame buffer(s) to get. This value must match the number of the following fbN parameters.
* @param[out] const void ** Address of the frame buffer 0 (first frame buffer).
* @param[out] ... List of other frame buffers if any.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_INVALID_STATE: Invalid driver state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_INVALID_STATE: Invalid driver state.
*/
esp_err_t (*get_internal_buffer)(esp_cam_ctlr_t *, uint32_t, const void **, ...);
/**
* @brief Get ESP CAM controller internal backup buffer length
* @brief Get ESP CAM controller internal backup buffer length.
*
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle
* @param[out] size_t * The size of each frame buffer, in bytes.
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle.
* @param[out] size_t * The size of each frame buffer. Measurement unit: bytes.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: NULL ptr
* - ESP_ERR_INVALID_STATE: Invalid driver state
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: NULL pointer.
* - ESP_ERR_INVALID_STATE: Invalid driver state.
*/
esp_err_t (*get_buffer_len)(esp_cam_ctlr_t *, size_t *);
/**
* @brief Allocate aligned camera buffer for ESP CAM controller
* @brief Allocate aligned camera buffer for ESP CAM controller.
*
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle
* @param[in] size_t Buffer size in bytes
* @param[in] uint32_t Buffer allocation capabilities
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle.
* @param[in] size_t Buffer size. Measurement unit: bytes.
* @param[in] uint32_t Buffer allocation capabilities.
*
* @return
* - Buffer pointer on success
* - NULL on failure
* - Buffer pointer on success.
* - NULL on failure.
*/
void *(*alloc_buffer)(esp_cam_ctlr_t *, size_t, uint32_t);
/**
* @brief Configure format conversion
* @brief Configure format conversion.
*
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle
* @param[in] const cam_ctlr_format_conv_config_t * Color conversion configuration
* @param[in] esp_cam_ctlr_t * ESP CAM controller handle.
* @param[in] const cam_ctlr_format_conv_config_t * Color conversion configuration.
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_NOT_SUPPORTED: Format conversion not supported by this controller
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_NOT_SUPPORTED: Format conversion not supported by this controller.
*/
esp_err_t (*format_conversion)(esp_cam_ctlr_t *, const cam_ctlr_format_conv_config_t *);
void *user_data; ///< User data
void *user_data; /*!< User data. */
};
#ifdef __cplusplus
@@ -17,41 +17,41 @@ extern "C" {
#endif
/**
* @brief ESP CAM ISP DVP controller configurations
* @brief ESP CAM ISP DVP controller configurations.
*/
typedef struct {
cam_ctlr_data_width_t data_width; ///< Number of data lines
int data_io[ISP_DVP_DATA_SIG_NUM]; ///< ISP DVP data-in IO numbers
int pclk_io; ///< ISP DVP pclk IO numbers
int hsync_io; ///< ISP DVP hsync IO numbers
int vsync_io; ///< ISP DVP vsync IO numbers
int de_io; ///< ISP DVP de IO numbers
cam_ctlr_data_width_t data_width; /*!< Number of data lines. */
int data_io[ISP_DVP_DATA_SIG_NUM]; /*!< ISP DVP data-in IO numbers. */
int pclk_io; /*!< ISP DVP pclk IO number. */
int hsync_io; /*!< ISP DVP hsync IO number. */
int vsync_io; /*!< ISP DVP vsync IO number. */
int de_io; /*!< ISP DVP de IO number. */
struct {
uint32_t pclk_invert: 1; ///< The pclk is inverted
uint32_t hsync_invert: 1; ///< The hsync signal is inverted (i.e. active low)
uint32_t vsync_invert: 1; ///< The vsync signal is inverted (i.e. active high)
uint32_t de_invert: 1; ///< The de signal is inverted (i.e. active low)
} io_flags; ///< ISP DVP IO flags
int queue_items; ///< Queue items
uint32_t pclk_invert: 1; /*!< Set to 1 to invert the pclk signal. */
uint32_t hsync_invert: 1; /*!< Set to 1 to invert the hsync signal (i.e., active low). */
uint32_t vsync_invert: 1; /*!< Set to 1 to invert the vsync signal (i.e., active high). */
uint32_t de_invert: 1; /*!< Set to 1 to invert the de signal (i.e., active low). */
} io_flags; /*!< ISP DVP IO flags. */
int queue_items; /*!< Queue items. */
struct {
uint32_t byte_swap_en : 1; ///< Enable byte swap
uint32_t bk_buffer_dis : 1; ///< Disable backup buffer
uint32_t byte_swap_en : 1; /*!< Set to 1 to enable byte swap. */
uint32_t bk_buffer_dis : 1; /*!< Set to 1 to disable backup buffer. */
};
} esp_cam_ctlr_isp_dvp_cfg_t;
/**
* @brief New ESP CAM ISP DVP controller
* @brief Create a new ESP CAM ISP DVP controller.
*
* @param[in] isp_proc Processor handle
* @param[in] ctlr_config ISP DVP controller configurations
* @param[out] ret_handle Returned ESP CAM controller handle
* @param[in] isp_proc Processor handle.
* @param[in] ctlr_config ISP DVP controller configurations.
* @param[out] ret_handle Returned ESP CAM controller handle.
*
* @return
* - ESP_OK
* - ESP_ERR_INVALID_ARG: Invalid argument
* - ESP_ERR_NO_MEM: Out of memory
* - ESP_ERR_NOT_SUPPORTED: Currently not support modes or types
* - ESP_ERR_NOT_FOUND: ISP DVP is registered already
* - ESP_OK: Success.
* - ESP_ERR_INVALID_ARG: Invalid argument.
* - ESP_ERR_NO_MEM: Out of memory.
* - ESP_ERR_NOT_SUPPORTED: Currently not supported modes or types.
* - ESP_ERR_NOT_FOUND: ISP DVP is already registered.
*/
esp_err_t esp_cam_new_isp_dvp_ctlr(isp_proc_handle_t isp_proc, const esp_cam_ctlr_isp_dvp_cfg_t *ctlr_config, esp_cam_ctlr_handle_t *ret_handle);