Merge branch 'feature/p4_lcdcam_dvp_cam_driver' into 'master'

feat(cam): add esp32-p4 lcd_cam dvp driver

Closes IDF-10029

See merge request espressif/esp-idf!31085
This commit is contained in:
Armando (Dou Yiwen)
2024-06-12 10:44:44 +08:00
28 changed files with 2420 additions and 2 deletions

View File

@@ -0,0 +1,73 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "hal/cam_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct lcd_cam_dev_t cam_dev_t; // CAM SOC layer handle
/**
* @brief CAM hardware interface object data
*/
typedef struct cam_hal_context {
cam_dev_t *hw; /*!< Beginning address of the CAM peripheral registers. */
} cam_hal_context_t;
/**
* @brief CAM HAL driver configuration
*/
typedef struct cam_hal_config {
int port; /*!< CAM port */
bool byte_swap_en; /*!< CAM enable byte swap */
} cam_hal_config_t;
/**
* @brief Initialize CAM hardware
*
* @param hal CAM object data pointer
* @param config CAM configuration
*
* @return None
*/
void cam_hal_init(cam_hal_context_t *hal, const cam_hal_config_t *config);
/**
* @brief De-initialize CAM hardware
*
* @param hal CAM object data pointer
*
* @return None
*/
void cam_hal_deinit(cam_hal_context_t *hal);
/**
* @brief Start CAM to receive frame data
*
* @param hal CAM object data pointer
*
* @return None
*/
void cam_hal_start_streaming(cam_hal_context_t *hal);
/**
* @brief Stop CAM receiving frame data
*
* @param hal CAM object data pointer
*
* @return None
*/
void cam_hal_stop_streaming(cam_hal_context_t *hal);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,34 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/clk_tree_defs.h"
#include "hal/color_types.h"
#include "hal/cam_ctlr_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#if SOC_LCDCAM_CAM_DATA_WIDTH_MAX
#define CAP_DVP_PERIPH_NUM SOC_LCDCAM_CAM_PERIPH_NUM /*!< DVP port number */
#define CAM_DVP_DATA_SIG_NUM SOC_LCDCAM_CAM_DATA_WIDTH_MAX /*!< DVP data bus width of CAM */
#else
#define CAP_DVP_PERIPH_NUM 0 /*!< Default value */
#define CAM_DVP_DATA_SIG_NUM 0 /*!< Default value */
#endif
#if SOC_LCDCAM_CAM_SUPPORTED
typedef soc_periph_cam_clk_src_t cam_clock_source_t; /*!< Clock source type of CAM */
#else
typedef int cam_clock_source_t; /*!< Default type */
#endif
#ifdef __cplusplus
}
#endif