mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
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:
73
components/hal/include/hal/cam_hal.h
Normal file
73
components/hal/include/hal/cam_hal.h
Normal 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
|
34
components/hal/include/hal/cam_types.h
Normal file
34
components/hal/include/hal/cam_types.h
Normal 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
|
Reference in New Issue
Block a user