显示面板接口

[English]

公共头文件: #include "brookesia/hal_interface/display/panel.hpp"

API 参考

Header File

Classes

class DisplayPanelIface : public esp_brookesia::hal::Interface

Display panel interface for rendering pixel data.

Public Types

enum class PixelFormat : uint8_t

Pixel format enum.

Values:

enumerator RGB565
enumerator RGB888
enumerator Max
enum class BusType : uint8_t

Driver-specific bus type enum.

Values:

enumerator Generic
enumerator RGB

< Generic bus type, such as SPI, I80, QSPI, etc.

enumerator MIPI

< RGB bus type.

enumerator Max

< MIPI bus type.

Public Functions

inline DisplayPanelIface(Info info)

Construct a display panel interface.

参数

info[in] Static panel capability information.

virtual ~DisplayPanelIface() = default

Virtual destructor for polymorphic panel interfaces.

virtual bool draw_bitmap(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, const uint8_t *data) = 0

Draw a bitmap into a rectangular panel region.

The region follows half-open bounds semantics: [x1, x2) and [y1, y2).

参数
  • x1[in] Left coordinate.

  • y1[in] Top coordinate.

  • x2[in] Right coordinate (exclusive).

  • y2[in] Bottom coordinate (exclusive).

  • data[in] Pixel buffer pointer.

返回

true on success; otherwise false.

inline virtual bool get_driver_specific(DriverSpecific &specific)

Get the driver-specific data.

参数

specific[out] The driver-specific data.

返回

true on success; otherwise false.

inline const Info &get_info() const

Get static panel capability information.

返回

Panel information.

Public Static Attributes

static constexpr const char *NAME = "DisplayPanel"

Interface registry name.

struct DriverSpecific

Driver-specific data.

Public Members

void *io_handle = nullptr

Handle of the IO.

void *panel_handle = nullptr

Handle of the panel.

BusType bus_type = BusType::Max

Bus type.

struct Info

Static panel capability information.

Public Functions

inline uint8_t get_pixel_bits() const

Get the number of bits per pixel.

返回

Number of bits per pixel.

inline bool is_valid() const

Check if the panel information is valid.

返回

true if the panel information is valid; otherwise false.

Public Members

uint16_t h_res = 0

Horizontal resolution in pixels.

uint16_t v_res = 0

Vertical resolution in pixels.

PixelFormat pixel_format = PixelFormat::Max

Pixel format.