esp-idf/components/hal/include/hal/lcd_hal.h

55 wiersze
1.4 KiB
C
Czysty Zwykły widok Historia

2021-09-27 03:32:29 +00:00
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
2021-09-27 03:32:29 +00:00
*
* SPDX-License-Identifier: Apache-2.0
*/
2021-02-26 05:58:04 +00:00
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "hal/hal_utils.h"
2021-02-26 05:58:04 +00:00
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief LCD peripheral SOC layer handle
*/
2021-08-20 03:48:33 +00:00
typedef struct lcd_cam_dev_t *lcd_soc_handle_t;
2021-02-26 05:58:04 +00:00
/**
* @brief LCD HAL layer context
*/
2021-02-26 05:58:04 +00:00
typedef struct {
lcd_soc_handle_t dev; // SOC layer handle
2021-02-26 05:58:04 +00:00
} lcd_hal_context_t;
/**
* @brief LCD HAL layer initialization
*
* @param hal LCD HAL layer context
* @param id LCD peripheral ID
*/
2021-02-26 05:58:04 +00:00
void lcd_hal_init(lcd_hal_context_t *hal, int id);
#define LCD_HAL_PCLK_FLAG_ALLOW_EQUAL_SYSCLK (1 << 0)
/**
* @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_flags Extra flags to control LCD PCLK clock calculation, supported flags are prefixed with LCD_HAL_PCLK_FLAG_
* @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, int lcd_clk_flags, hal_utils_clk_div_t* lcd_clk_div);
2021-02-26 05:58:04 +00:00
#ifdef __cplusplus
}
#endif