Files
esp-idf/components/esp_hal_lcd/include/hal/lcd_hal.h
T
morris d4d8b09ced feat(hal):graudate the LCD hal driver into a new component
- Introduced new HAL components for LCD and MIPI DSI, including:
  - `lcd_hal.c` and `lcd_hal.h` for LCD hardware abstraction layer.
  - `mipi_dsi_hal.c` and `mipi_dsi_hal.h` for MIPI DSI hardware
abstraction layer.
  - Peripheral connection definitions in `lcd_periph.c` and
`lcd_periph.h`.
  - Added necessary types and utility functions in `lcd_types.h` and
`mipi_dsi_types.h`.

- Updated CMakeLists to include the new HAL components in the build
system.
- Removed legacy references to LCD and MIPI DSI in the HAL and SOC
CMakeLists.
2025-10-22 17:00:18 +08:00

52 lines
1.2 KiB
C

/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "hal/hal_utils.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief LCD peripheral SOC layer handle
*/
typedef struct lcd_cam_dev_t *lcd_soc_handle_t;
/**
* @brief LCD HAL layer context
*/
typedef struct {
lcd_soc_handle_t dev; // SOC layer handle
} lcd_hal_context_t;
/**
* @brief LCD HAL layer initialization
*
* @param hal LCD HAL layer context
* @param id LCD peripheral ID
*/
void lcd_hal_init(lcd_hal_context_t *hal, int id);
/**
* @brief LCD PCLK clock calculation
* @note Currently this function is only used by RGB LCD driver, I80 driver still uses a fixed clock division
*
* @param hal LCD HAL layer context
* @param src_freq_hz LCD source clock frequency in Hz
* @param expect_pclk_freq_hz Expected LCD PCLK frequency in Hz
* @param lcd_clk_div Returned LCD clock divider parameter
* @return Actual LCD PCLK frequency in Hz
*/
uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uint32_t expect_pclk_freq_hz, hal_utils_clk_div_t* lcd_clk_div);
#ifdef __cplusplus
}
#endif