Display Panel Interface
Public header: #include "brookesia/hal_interface/interfaces/display/panel.hpp"
API Reference
Header File
Classes
-
class PanelIface : 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
-
enumerator RGB565
Public Functions
-
inline PanelIface(Info info)
Construct a display panel interface.
- Parameters
info -- [in] Static panel capability information.
-
virtual ~PanelIface() = 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).- Parameters
x1 -- [in] Left coordinate.
y1 -- [in] Top coordinate.
x2 -- [in] Right coordinate (exclusive).
y2 -- [in] Bottom coordinate (exclusive).
data -- [in] Pixel buffer pointer.
- Returns
trueon success; otherwisefalse.
-
inline virtual bool draw_bitmap_sync(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, const uint8_t *data, uint32_t timeout_ms = DEFAULT_SYNC_DRAW_TIMEOUT_MS)
Draw a bitmap and optionally wait until the panel backend has finished using the input buffer.
The default implementation falls back to
draw_bitmap(). Backends that perform asynchronous transfers should override this method and only return after the transfer completion signal has been observed, or aftertimeout_msexpires. Whentimeout_msis0, the call only submits the draw and does not wait for a completion signal.- Parameters
x1 -- [in] Left coordinate.
y1 -- [in] Top coordinate.
x2 -- [in] Right coordinate (exclusive).
y2 -- [in] Bottom coordinate (exclusive).
data -- [in] Pixel buffer pointer.
timeout_ms -- [in] Maximum time to wait in milliseconds.
0means no wait.
- Returns
trueon completion or no-wait submission; otherwisefalse.
-
inline virtual bool get_driver_specific(DriverSpecific &specific)
Get the driver-specific data.
- Parameters
specific -- [out] The driver-specific data.
- Returns
trueon success; otherwisefalse.
Public Static Attributes
-
static constexpr uint32_t DEFAULT_SYNC_DRAW_TIMEOUT_MS = 5000
Default timeout for synchronous draws.
-
struct DriverSpecific
Driver-specific data.
Public Members
-
void *io_handle = nullptr
Handle of the IO.
-
void *panel_handle = nullptr
Handle of the panel.
-
uint8_t frame_buffer_count = 0
Number of panel frame buffers.
-
uint8_t draw_x_align_bytes = 1
X-axis coordinate alignment bytes.
-
uint8_t draw_y_align_bytes = 1
Y-axis coordinate alignment bytes.
-
EventDispatcher event_dispatcher
Optional LCD event dispatcher.
-
void *io_handle = nullptr
-
struct EventDispatcher
Driver event dispatcher for sharing backend LCD callbacks.
Public Members
-
void *ctx = nullptr
Dispatcher owner context.
-
void *ctx = nullptr
-
struct Info
Static panel capability information.
Public Functions
-
inline uint8_t get_pixel_bits() const
Get the number of bits per pixel.
- Returns
Number of bits per pixel.
-
inline bool is_valid() const
Check if the panel information is valid.
- Returns
trueif the panel information is valid; otherwisefalse.
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.
-
std::string group_id
Stable physical display group identifier.
-
inline uint8_t get_pixel_bits() const
-
enum class PixelFormat : uint8_t