rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
display.h
Go to the documentation of this file.
1
46
47#pragma once
48
49#include <stdbool.h>
50#include <stdint.h>
51
52#include "esp_err.h"
53
54#include "gfx.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
61typedef struct {
64
66#define DISPLAY_CONFIG_DEFAULT() \
67 (display_config_t) { \
68 .backlight_on = true, \
69 }
70
78esp_err_t display_init(const display_config_t *cfg);
79
85esp_err_t display_deinit(void);
86
95
104esp_err_t display_flip(void);
105
112esp_err_t display_wait_vsync(uint32_t timeout_ms);
113
118int display_width(void);
119
124int display_height(void);
125
136int display_back_index(void);
137
142uint32_t display_last_wait_us(void);
143
148uint32_t display_frame_count(void);
153float display_fps(void);
154
160uint32_t display_vsync_count(void);
161
167void display_set_turned(bool turned);
168
174bool display_turned(void);
175
182bool display_take_repaint(void);
183
189bool display_take_turn_alert(void);
190
195uint32_t display_last_turn_us(void);
196
202esp_err_t display_backlight(bool on);
203
204#ifdef __cplusplus
205}
206#endif
void display_set_turned(bool turned)
Screen rotation: 180°, or NORMAL, from the next display_flip() on. May be called from any task,...
Definition display.c:763
esp_err_t display_deinit(void)
Stop the video stream and release the panel, the bus and the PHY supply.
Definition display.c:616
int display_height(void)
The canvas's height: the UI's area.
Definition display.c:733
uint32_t display_last_turn_us(void)
The time the last display_flip() spent copying turned blocks.
Definition display.c:783
int display_back_index(void)
Which frame buffer display_canvas() points at.
Definition display.c:738
int display_width(void)
The canvas's width: the UI's area.
Definition display.c:728
esp_err_t display_init(const display_config_t *cfg)
Bring up the DSI PHY supply, the bus, the panel and the video stream, and the board's I2C bus and bac...
Definition display.c:580
gfx_canvas_t * display_canvas(void)
The canvas the application draws into. The returned pointer is stable for the lifetime of the driver;...
Definition display.c:625
uint32_t display_last_wait_us(void)
How long the last display_flip() spent blocked.
Definition display.c:743
esp_err_t display_flip(void)
Present the back buffer and block until the buffer it replaces is no longer scanned out,...
Definition display.c:666
bool display_take_repaint(void)
Whether the UI must repaint everything before it draws the next frame: the canvas changed between a l...
Definition display.c:773
float display_fps(void)
Rolling frames per second, measured over the last 500ms.
Definition display.c:753
bool display_turned(void)
Whether the picture on the glass is turned by 180°: the flag the touch map turns by (gfx_turn_shown()...
Definition display.c:768
bool display_take_turn_alert(void)
Whether the alert that Screen rotation 180° fell back to NORMAL is due. Clears it....
Definition display.c:778
esp_err_t display_wait_vsync(uint32_t timeout_ms)
Block until the next VSYNC (vertical sync) event.
Definition display.c:630
uint32_t display_vsync_count(void)
VSYNC events since display_init(): the panel's own refresh, whatever the flips do.
Definition display.c:758
uint32_t display_frame_count(void)
Frames presented since display_init().
Definition display.c:748
esp_err_t display_backlight(bool on)
Backlight at 100% or 0%.
Definition display.c:788
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
How display_init() sets the display up.
Definition display.h:61
bool backlight_on
Definition display.h:62
Definition gfx.h:129