跳转到内容

公共函数参考

本页覆盖固件组件随包发布的应用层公共函数。普通应用先包含生成的 <symbol>_gsp.h;只有生成 API 无法表达的运行时能力才直接调用这些函数。

函数声明和返回类型由公共头文件提取,中文摘要说明应用用途。各函数的折叠区直接展示 头文件中的完整英文契约,包含线程、所有权和错误条件,并随头文件更新。 所有未明确标注为 ISR-safe 的入口都不得从 ISR 调用;回调线程、所有权和同步限制见各组说明。

完整使用路径见 API 参考、生命周期与线程和 应用结构与所有权。

目标帧更新回执

组合必需更新,查询目标状态及关联帧实际到达的完成阶段。

esp_gsp_update_capabilities()

查询当前显示后端支持的目标组完成阶段和容量限制。

  • 头文件: include/esp_gsp_updates.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_update_capabilities(esp_gsp_handle_t gsp, esp_gsp_update_capabilities_t *out);

esp_gsp_update_submit()

提交一组必须共同完成的更新,返回关联目标帧的回执。

  • 头文件: include/esp_gsp_updates.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_update_submit(esp_gsp_handle_t gsp, const esp_gsp_update_command_t *commands, size_t count, const esp_gsp_update_options_t *options, esp_gsp_update_receipt_t **out_receipt);
完整接口契约(英文)

Submit one required group without waiting for queue space. Commands and UTF-8 strings are copied; COPY image inputs are copied once. On an immediate error out_receipt is NULL and BORROW/TAKE ownership remains with the caller. Unsupported completion stages are rejected before acceptance. Receipt IDs are not reused; exhaustion rejects admission with INVALID_STATE. out_receipt is installed before an accepted command can notify, including when the render task runs before this function returns.

Pure PROPERTY groups retain the existing atomic property transaction. Mixed groups execute in order and report partial failure without rollback. APPLIED requires every operation, including image publication, to succeed. A target overwritten before its matching frame is SUPERSEDED. An unchanged target may reuse a matching, previously committed frame. A failed render attempt terminates the receipt without stopping ordinary rendering. timeout_ms includes queueing and pauses; expiry is observed on the next UI service, without undoing state or releasing in-flight data.

esp_gsp_update_query()

读取回执的一致状态快照,支持在 UI 停止后查询。

  • 头文件: include/esp_gsp_updates.h
  • 返回类型: bool
bool esp_gsp_update_query(const esp_gsp_update_receipt_t *receipt, esp_gsp_update_status_t *out);
完整接口契约(英文)

Query while owning a receipt reference, including after its UI has stopped. A contended snapshot returns false without changing out; retry later.

esp_gsp_update_cancel()

请求取消尚未完成的目标组,保留已应用的状态。

  • 头文件: include/esp_gsp_updates.h
  • 返回类型: void
void esp_gsp_update_cancel(esp_gsp_update_receipt_t *receipt);
完整接口契约(英文)

Request cancellation. Terminal cancellation is observed through query or notification; it does not undo previously applied state or reclaim data still referenced by a decoder, transfer or display buffer.

esp_gsp_update_release()

释放调用方的回执引用,不取消已接受的更新。

  • 头文件: include/esp_gsp_updates.h
  • 返回类型: void
void esp_gsp_update_release(esp_gsp_update_receipt_t *receipt);
完整接口契约(英文)

Release the caller’s reference. This does not cancel accepted work.

生命周期与同步

实例由平台适配层创建;停止和刷新函数定义应用与渲染任务之间的同步边界。

esp_gsp_config_init()

初始化一份带当前 Schema 和 ABI 信息的配置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_config_t
static inline esp_gsp_config_t esp_gsp_config_init(void);

esp_gsp_config_set()

设置一个单实例运行策略或容量 Override。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_config_set_result_t
static inline esp_gsp_config_set_result_t esp_gsp_config_set(esp_gsp_config_t *config, esp_gsp_config_field_id_t field, uint64_t value);
完整接口契约(英文)

Sets one per-instance runtime policy or capacity. Project-wide defaults remain in Kconfig; GSPB scene requirements are applied automatically. Read-only ESP_GSP_BUILD_CAP_* fields are rejected.

esp_gsp_stop()

停止并销毁平台创建的 UI 实例。仅成功停止后才能释放借用资源;超时后保留资源,待在途工作完成再重试。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_stop(esp_gsp_handle_t gsp);
完整接口契约(英文)

Stops a platform-created UI instance. Creation belongs to a platform backend, for example the ESP-IDF LCD backend or the SDL adapter on host. Release borrowed resources only after ESP_GSP_OK. A timeout leaves the instance and its borrowed resources alive; retry after pending work completes.

esp_gsp_flush()

等待此前提交的命令完成一次渲染尝试和显示提交。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_flush(esp_gsp_handle_t gsp, uint32_t timeout_ms);
完整接口契约(英文)

Wait until all commands submitted before this call have been applied and the display backend has completed the following render attempt.

This is a low-frequency synchronization fence for tests, screenshots and orderly application state changes. Normal UI updates should remain asynchronous. It must not be called from a render- or decode-task callback. ESP-IDF waits on a runtime-owned completion semaphore and leaves the calling task’s notifications intact. Keep the runtime alive throughout this call; stop or replacement must be caller-serialized.

Parameter timeout_ms: Maximum total wait, including command queue admission. Zero performs a non-blocking check/submit. A timeout does not cancel an accepted fence.

esp_gsp_render_error_stats()

读取累计渲染失败次数和最近一次引擎错误。

  • 头文件: include/esp_gsp.h
  • 返回类型: void
void esp_gsp_render_error_stats(esp_gsp_handle_t gsp, uint32_t *out_failures, gsp_err_t *out_last_error);
完整接口契约(英文)

Cumulative render failures and the most recent engine error. The first frame is strict: esp_gsp_start() returns an error instead of publishing a handle when it cannot be rendered. Runtime failures remain recoverable and are counted here rather than silently discarded.

状态与键盘

基于 Bind 的 setter 向渲染任务排队,getter 返回最近已提交的状态;普通应用优先使用生成的类型化包装函数。

esp_gsp_set_value()

设置数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_value(esp_gsp_handle_t gsp, uint16_t bind, int32_t value);

esp_gsp_set_color()

设置颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_color(esp_gsp_handle_t gsp, uint16_t bind, uint32_t color);
完整接口契约(英文)

Color in the scene’s native pixel format (RGB565 scenes take 16-bit colors, RGB888/ARGB8888 scenes take 24/32-bit).

esp_gsp_set_visible()

设置可见状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_visible(esp_gsp_handle_t gsp, uint16_t bind, bool visible);

esp_gsp_set_text()

设置文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_text(esp_gsp_handle_t gsp, uint16_t bind, const char *utf8);
完整接口契约(英文)

Shapes UTF-8 on the render task. The string is copied before return; short values stay inline in the command and longer values use temporary framework-owned storage. Success means the command was accepted, not that shaping or application succeeded; use update transactions and receipts when the final apply result is required.

esp_gsp_get_value()

读取数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_get_value(esp_gsp_handle_t gsp, uint16_t bind, int32_t *out_value);

esp_gsp_get_color()

读取颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_get_color(esp_gsp_handle_t gsp, uint16_t bind, uint32_t *out_color);

esp_gsp_get_visible()

读取可见状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_get_visible(esp_gsp_handle_t gsp, uint16_t bind, bool *out_visible);

esp_gsp_get_toggle()

读取开关状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_get_toggle(esp_gsp_handle_t gsp, uint16_t bind, bool *out_on);
完整接口契约(英文)

Logical state of a toggle’s value bind. Taps publish their target before the knob animation starts. esp_gsp_get_value reads its current 0..100 position. Checkbox/radio use plain 0/1 values.

esp_gsp_keyboard_attach()

把编译键盘的按键事件连接到文字 Bind。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_keyboard_attach(esp_gsp_handle_t gsp, uint16_t action_id, uint16_t text_bind);

esp_gsp_keyboard_attach_ex()

按应用指定的 UTF-8 字节上限连接编译键盘。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_keyboard_attach_ex(esp_gsp_handle_t gsp, uint16_t action_id, uint16_t text_bind, size_t max_bytes);
完整接口契约(英文)

Extended attachment with an application-selected UTF-8 byte limit. Storage is allocated once during attachment and reused for editing. max_bytes excludes the trailing NUL and may use the available address space; allocation failure is reported as ESP_GSP_ERR_NO_MEM. It is ignored when action_id is ESP_GSP_KEYBOARD_NONE.

esp_gsp_keyboard_text()

复制当前键盘编辑缓冲区中的文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_keyboard_text(esp_gsp_handle_t gsp, char *out_text, size_t capacity);
完整接口契约(英文)

Copies the attached keyboard’s current text (NUL terminated). Returns ESP_GSP_ERR_INVALID_SIZE when capacity is too small; in that case out_text still contains a valid UTF-8 prefix.

esp_gsp_keyboard_text_size()

读取复制当前键盘文字所需的缓冲区大小。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_keyboard_text_size(esp_gsp_handle_t gsp, size_t *out_size);
完整接口契约(英文)

Returns the buffer size, including the trailing NUL, required by esp_gsp_keyboard_text().

esp_gsp_set_cursor()

设置输入光标。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_cursor(esp_gsp_handle_t gsp, uint16_t bind);

命名控件

控件 API 使用生成的稳定对象键和属性键;应用仍应优先使用生成的类型化包装函数。

esp_gsp_component_get_motion()

读取组件已提交值、目标值和拖动或缓动状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_motion(esp_gsp_handle_t gsp, gsp_component_key_t key, esp_gsp_component_motion_t *out_state);
完整接口契约(英文)

Query committed and target motion state for PageFlow or Drawer. Like other component getters, use from the UI task or a caller-serialized portable app.

esp_gsp_component_get()

按稳定控件键读取兼容属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get(esp_gsp_handle_t gsp, gsp_component_key_t key, gsp_component_prop_kind_t prop, gsp_value_t *out_value);

esp_gsp_component_set()

按稳定控件键设置兼容属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set(esp_gsp_handle_t gsp, gsp_component_key_t key, gsp_component_prop_kind_t prop, const gsp_value_t *value);

esp_gsp_component_get_property()

读取控件属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_property(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, gsp_value_t *out_value);
完整接口契约(英文)

Open semantic-key API for component-local properties. Generated typed wrappers hide the key and tagged value in ordinary application code.

esp_gsp_component_get_property_info()

读取控件属性元数据。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_property_info(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, gsp_property_info_t *out_info);

esp_gsp_component_get_property_info_at()

按索引枚举控件属性元数据。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_property_info_at(esp_gsp_handle_t gsp, gsp_component_key_t component, size_t index, gsp_property_info_t *out_info);

esp_gsp_component_set_property()

设置控件属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_property(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, const gsp_value_t *value);

esp_gsp_component_set_many()

把一组类型化控件更新作为一个原子事务提交。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_many(esp_gsp_handle_t gsp, const gsp_component_update_t *updates, size_t count);
完整接口契约(英文)

Queues typed updates as one atomic render-task transaction. The array is copied before return and may be stack allocated. Every entry is validated before the batch is queued; repeated component/property pairs are allowed and the last value wins. Large batches use temporary framework-owned heap storage and report ESP_GSP_ERR_NO_MEM if it cannot be allocated.

esp_gsp_component_set_properties()

把一组开放属性键更新作为一个原子事务提交。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_properties(esp_gsp_handle_t gsp, const gsp_component_property_update_t *updates, size_t count);
完整接口契约(英文)

Open-key atomic batch; same validation/copy/lifetime rules as set_many.

esp_gsp_component_set_position()

设置控件位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_position(esp_gsp_handle_t gsp, gsp_component_key_t component, int32_t x, int32_t y);
完整接口契约(英文)

Atomically moves a compiled component subtree. Both x and y must have bounded dynamic declarations; a literal axis has no writable runtime property and returns NOT_FOUND without changing either axis. Use the individual property setter when only one axis is dynamic. X/Y are authored scene pixels stored in runtime SRAM; compiled commands remain read-only. esp_gsp_update_error_stats() in esp_gsp_debug.h can identify the rejected property and asynchronous application failures.

esp_gsp_component_get_position()

读取控件位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_position(esp_gsp_handle_t gsp, gsp_component_key_t component, int32_t *out_x, int32_t *out_y);
完整接口契约(英文)

Reads the last committed authored position.

esp_gsp_component_translate()

相对移动一个已编译控件子树。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_translate(esp_gsp_handle_t gsp, gsp_component_key_t component, int32_t dx, int32_t dy);
完整接口契约(英文)

Queues a relative move from the last committed authored position.

esp_gsp_component_get_info()

读取控件元数据。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_info(esp_gsp_handle_t gsp, gsp_component_key_t key, esp_gsp_component_info_t *out_info);
完整接口契约(英文)

Queries kind and available properties without reading component state.

esp_gsp_component_get_value()

读取控件数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_value(esp_gsp_handle_t gsp, gsp_component_key_t key, int32_t *out_value);
完整接口契约(英文)

Strongly typed convenience APIs over esp_gsp_component_get/set().

esp_gsp_component_set_value()

设置控件数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_value(esp_gsp_handle_t gsp, gsp_component_key_t key, int32_t value);

esp_gsp_component_get_color()

读取控件颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_color(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t *out_native_color);
完整接口契约(英文)

Native scene color: RGB565 uses packed 16-bit values, RGB888 uses 0xRRGGBB.

esp_gsp_component_set_color()

设置控件颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_color(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t native_color);
完整接口契约(英文)

Sets the component’s primary color in the scene’s native format.

esp_gsp_component_set_color_rgb888()

把 RGB888 色值转换为当前场景原生颜色并设置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_color_rgb888(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t rgb888);
完整接口契约(英文)

Sets the primary color from 0xRRGGBB, converting to the scene format. Requires a canonical color property or a legacy color binding. For named colors such as fg_color, use the generated property-specific helper. RGB565 uses 5/6/5-bit truncation; ARGB8888 receives opaque alpha. Values above 0xFFFFFF are rejected. Existing native-color APIs are unchanged.

esp_gsp_component_set_property_color_rgb888()

使用统一 RGB888 颜色设置指定颜色属性,自动转换为场景原生格式。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_property_color_rgb888(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, uint32_t rgb888);
完整接口契约(英文)

Sets a named COLOR property from 0xRRGGBB with scene-format conversion. Uses the same validation, queue and transaction path as set_property(). Does not change component opacity or accept an alpha byte.

esp_gsp_component_get_color_rgb888()

读取控件原生颜色并转换为 RGB888。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_color_rgb888(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t *out_rgb888);
完整接口契约(英文)

Gets the primary color as 0xRRGGBB.

esp_gsp_component_get_visible()

读取控件可见状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_visible(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_visible);

esp_gsp_component_set_visible()

设置控件可见状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_visible(esp_gsp_handle_t gsp, gsp_component_key_t key, bool visible);

esp_gsp_component_set_text()

设置控件文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_text(esp_gsp_handle_t gsp, gsp_component_key_t key, const char *text);
完整接口契约(英文)

Structured content setters resolve the generated property bind by key.

esp_gsp_dropdown_set_options_text()

整体替换启用动态文案的下拉选项文字,保持索引和选择不变。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_dropdown_set_options_text(esp_gsp_handle_t gsp, gsp_component_key_t key, const char *const *options, size_t count);
完整接口契约(英文)

Replaces every label of a Dropdown authored with dynamic_options=true. Count must match its compiled option count; indices, selection and callbacks are unchanged. Strings are strict UTF-8, bounded by option_text_max_bytes (excluding NUL), and copied before return. The render task prepares the entire replacement before publishing; failure preserves the old labels. OK means accepted, as for other queued setters. Asynchronous apply/drop failures are reported by esp_gsp_update_error_stats(). A queued replacement is tied to its submission scene and is dropped if navigation supersedes it. Getters below read committed labels from the UI task or a caller-serialized portable app; they must not race the render task or app destruction.

esp_gsp_dropdown_get_option_count()

读取下拉控件编译时固定的选项数量。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_dropdown_get_option_count(esp_gsp_handle_t gsp, gsp_component_key_t key, size_t *out_count);
完整接口契约(英文)

Reads the fixed option count; also supports static Dropdowns.

esp_gsp_dropdown_get_option_text()

回读一项已提交的 UTF-8 文案,容量不足时保留输出缓冲区。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_dropdown_get_option_text(esp_gsp_handle_t gsp, gsp_component_key_t key, uint16_t index, char *out_text, size_t capacity, size_t *out_size);
完整接口契约(英文)

Copies one committed UTF-8 label, including NUL. out_size, when non-NULL, receives required bytes including NUL. NULL output with capacity=0 queries that size. An insufficient buffer returns INVALID_SIZE without truncation or modifying it. Static Dropdowns return their compiled labels.

esp_gsp_component_set_image()

设置控件图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_image(esp_gsp_handle_t gsp, gsp_component_key_t key, const void *data, size_t size);

esp_gsp_component_get_checked()

读取控件选中状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_checked(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_checked);
完整接口契约(英文)

Toggle on/off by key — CHECKED semantics, no bind ids, no 0..100 rail convention.

esp_gsp_component_set_checked()

设置控件选中状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_checked(esp_gsp_handle_t gsp, gsp_component_key_t key, bool checked);

esp_gsp_component_get_enabled()

读取控件启用状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_get_enabled(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_enabled);
完整接口契约(英文)

Enables or disables a component that opted into authored enabled.

esp_gsp_component_set_enabled()

设置控件启用状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_set_enabled(esp_gsp_handle_t gsp, gsp_component_key_t key, bool enabled);

esp_gsp_component_play_animation()

播放可延迟、重复和往返的属性动画,隐藏时暂停。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_play_animation(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, const gsp_value_t *from, const gsp_value_t *to, const esp_gsp_animation_config_t *config);

esp_gsp_component_stop_animation()

停止指定属性动画并保留当前值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_stop_animation(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property);

esp_gsp_component_stop_position_animation()

停止控件位置动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_stop_position_animation(esp_gsp_handle_t gsp, gsp_component_key_t component);
完整接口契约(英文)

Stops the component’s synchronized position tween, if active. The component stays where the last committed step put it.

导航与保留态容器

场景、PageFlow、StackView 和 Drawer 操作共用运行时的保留态导航与动画规则。

esp_gsp_page_flow_set_page()

设置 PageFlow 当前页面。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_page_flow_set_page(esp_gsp_handle_t gsp, gsp_component_key_t key, uint16_t page, bool animated);
完整接口契约(英文)

Standard PageFlow navigation. Tab clicks and pointer settle use the same driver state machine as this API.

esp_gsp_page_flow_get_page()

读取 PageFlow 当前页面。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_page_flow_get_page(esp_gsp_handle_t gsp, gsp_component_key_t key, uint16_t *out_page);

esp_gsp_page_flow_get_offset()

读取 PageFlow 沿主轴的当前偏移。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_page_flow_get_offset(esp_gsp_handle_t gsp, gsp_component_key_t key, int32_t *out_offset_px);
完整接口契约(英文)

Current transform offset in pixels along the PageFlow axis. Unlike the selected page, this remains precise while dragging and for stop-anywhere.

esp_gsp_page_flow_is_dragging()

读取 PageFlow 当前是否正在拖动。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_page_flow_is_dragging(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_dragging);

esp_gsp_stack_view_push()

推送栈视图。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_stack_view_push(esp_gsp_handle_t gsp, gsp_component_key_t key, uint16_t page, bool animated);
完整接口契约(英文)

In-scene StackView navigation. New push/pop requests can interrupt an active animation; the root page cannot be popped.

esp_gsp_stack_view_pop()

弹出栈视图。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_stack_view_pop(esp_gsp_handle_t gsp, gsp_component_key_t key, bool animated);

esp_gsp_stack_view_get_top()

读取栈视图栈顶。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_stack_view_get_top(esp_gsp_handle_t gsp, gsp_component_key_t key, uint16_t *out_page);

esp_gsp_stack_view_is_animating()

读取 StackView 当前是否正在执行动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_stack_view_is_animating(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_animating);

esp_gsp_drawer_open()

打开 Drawer;动画中可从当前位置反向,重复当前目标不会重启动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_drawer_open(esp_gsp_handle_t gsp, gsp_component_key_t key, bool animated);
完整接口契约(英文)

Overlay Drawer state. Gesture and Close-button actions use this same settle state machine. Animated requests can reverse an active settle from its current position; repeating its target does not restart the animation.

esp_gsp_drawer_close()

关闭 Drawer;与打开操作共用同一动画状态机。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_drawer_close(esp_gsp_handle_t gsp, gsp_component_key_t key, bool animated);

esp_gsp_drawer_is_open()

读取 Drawer 当前是否打开。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_drawer_is_open(esp_gsp_handle_t gsp, gsp_component_key_t key, bool *out_open);

esp_gsp_goto_scene()

切换到指定场景并选择转场方式。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_goto_scene(esp_gsp_handle_t gsp, uint16_t scene_id, esp_gsp_transition_t transition);
完整接口契约(英文)

Switches scenes (multi-scene bundles) with an optional transition. Use ESP_GSP_CROSS_FADE to blend overlapping scenes, or ESP_GSP_FADE_THROUGH_BLACK to dim the old scene fully to black before revealing the new scene. Strip displays can render fade-through-black incrementally without full-screen snapshots; cross-fade still requires both scene snapshots. If no visual path is available, the scene still switches safely. Returns ESP_GSP_ERR_NOT_FOUND if scene_id is outside the loaded Bundle. An invalid transition returns ESP_GSP_ERR_INVALID_ARG. Safe from any task.

esp_gsp_set_swipe_enabled()

设置场景滑动开关。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_swipe_enabled(esp_gsp_handle_t gsp, bool enabled);
完整接口契约(英文)

Enables or disables horizontal swipe scene navigation at runtime. Multi-scene bundles enable swipes by default (disable_swipe=false in esp_gsp_config_t). When the UI task observes the disabled state, it cancels any scene swipe that has not yet committed. The default classifier locks only when horizontal travel clearly dominates vertical travel. Release commits after a one-fifth-screen pull, or after a shorter deliberate fling; tiny fast movements remain below the fling-distance guard. Safe from any task.

esp_gsp_set_swipe_transition()

设置场景滑动效果。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_swipe_transition(esp_gsp_handle_t gsp, esp_gsp_swipe_transition_t transition);
完整接口契约(英文)

Selects the visual that follows horizontal scene-swipe progress. The default is ESP_GSP_SWIPE_SLIDE. The slide-fade option moves the pages directly from gesture distance; the transition layer derives brightness independently from that same raw distance, so no effect-specific calculation lives in the touch path. Safe from any task.

esp_gsp_set_swipe_fade_black_point()

设置滑动渐黑位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_swipe_fade_black_point(esp_gsp_handle_t gsp, uint8_t drag_percent);
完整接口契约(英文)

Sets where a fade-through-black swipe reaches full black. drag_percent is the horizontal drag distance as a percentage of screen width (1..99). The default is 50. A smaller value dims the current scene faster; the target scene still reaches full brightness at 100%. This changes only brightness response, never page position, gesture recognition or commit thresholds. Safe from any task.

运行时图片

COPY、BORROW 和 TAKE 变体具有不同的编码缓冲区所有权;释放或复用缓冲区前必须遵守函数契约。

esp_gsp_image_get_scale()

读取图片缩放比例。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_image_get_scale(esp_gsp_handle_t gsp, gsp_component_key_t image, uint32_t *out_scale_q16);
完整接口契约(英文)

Reads or updates a named scalable image’s unsigned Q16.16 scale.

esp_gsp_image_set_scale()

设置图片缩放比例。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_image_set_scale(esp_gsp_handle_t gsp, gsp_component_key_t image, uint32_t scale_q16);

esp_gsp_set_image()

复制编码图片并异步提交到图片 Bind。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_image(esp_gsp_handle_t gsp, uint16_t bind, const void *data, size_t size);
完整接口契约(英文)

Shows a runtime-provided encoded image (JPEG/PNG/QOI, e.g. a network download) on an image bind. The container is sniffed from the data — no metadata needed. The encoded payload is copied before this function returns and decoded by a background worker, so the caller may immediately release or reuse data.

esp_gsp_set_image_ex()

按照指定所有权和完成回调提交编码图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_image_ex(esp_gsp_handle_t gsp, uint16_t bind, const void *data, size_t size, const esp_gsp_image_options_t *options);
完整接口契约(英文)

Complete runtime-image submission contract. NULL options select COPY. BORROW returns the immutable source through on_release. TAKE transfers the source only when this function returns ESP_GSP_OK; on immediate submission failure the caller still owns it. on_complete is called only for accepted submissions.

esp_gsp_set_image_borrowed()

借用不可变编码图片,直到释放回调归还缓冲区。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_image_borrowed(esp_gsp_handle_t gsp, uint16_t bind, const void *data, size_t size, esp_gsp_image_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Borrowing variant of esp_gsp_set_image(). The encoded bytes are never copied; data must remain immutable until on_release is called. For accepted submissions, replacement, cancellation, decode failure and shutdown release the payload exactly once. on_release is required.

Note that a published image holds its payload for as long as it is the one on screen, not just until it decodes: the decode cache may drop the pixels under memory pressure and re-decode from these bytes. So a borrowed buffer may remain held while a replacement is queued or decoded. Budget for the active image and accepted replacements, including in-flight decode references; reuse each buffer only after its release callback.

This removes only the encoded-input copy. Decode and framebuffer composition still follow the target image/cache policy.

esp_gsp_set_image_owned()

把 malloc 兼容的编码图片所有权转交给框架。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_image_owned(esp_gsp_handle_t gsp, uint16_t bind, void *data, size_t size);
完整接口契约(英文)

Transfers malloc-compatible encoded storage without copying. Ownership is transferred only when ESP_GSP_OK is returned; the framework calls free() once the image is replaced, cancelled or shut down — same lifetime as the borrowed variant, without the callback.

esp_gsp_asset_image_target()

构造页面 Image 目标,用于状态和停止操作。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_asset_target_t
static inline esp_gsp_asset_target_t esp_gsp_asset_image_target(uint16_t bind);

esp_gsp_asset_row_target()

构造携带复用令牌的 Row 图片目标。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_asset_target_t
static inline esp_gsp_asset_target_t esp_gsp_asset_row_target(esp_gsp_row_t row, uint16_t slot);

esp_gsp_asset_widget_target()

构造 Widget 图片资源槽目标。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_asset_target_t
static inline esp_gsp_asset_target_t esp_gsp_asset_widget_target(esp_gsp_widget_t widget, uint16_t slot);

esp_gsp_assets_open()

打开已挂载文件系统中的预处理资源包,校验索引并创建后台读取任务。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_open(const char *path, uint32_t index_crc, const esp_gsp_assets_config_t *config, esp_gsp_assets_t **out_assets);
完整接口契约(英文)

Open a seekable package file on a mounted filesystem using the generated open helper. index_crc comes from its generated header. A matching index takes the fast path; a replacement package (or index_crc=0) is fully CRC-checked in bounded chunks at open. Each requested member is CRC-checked when read. No whole-pack RAM copy. Call from an application task; open performs IO. File contents must stay immutable until close. Close before unmount/update. NULL config selects defaults. On failure *out_assets is NULL.

esp_gsp_assets_show()

异步显示资源包中的图片或逐帧播放动画;加载失败保留旧图。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, uint16_t bind, esp_gsp_asset_ref_t asset, bool once);
完整接口契约(英文)

Queue an image or animation for an authored Image bind. Asset names come from the generated header. Submission returns without file IO or decoding. once plays one animation cycle; false follows the authored loop count. Existing content stays visible until a complete replacement is ready. Each target has at most one in-flight frame. New requests coalesce per bind. Animation memory follows ANIM_FRAME_MEMORY / ANIM_MAX_FRAME_BYTES and is separate from the encoded read budget. JPEG animations also work with the image cache disabled; measure playback performance on the target device. The target placeholder must match the exported pixel/alpha form and native dimensions (opaque image-fit binds can vary dimensions). Export to the same RGB565/RGB888 profile as the UI. Show targets the active scene. Leaving it restores the file-service targets to their placeholders and releases their image slots. Resubmit on re-entry. Hiding a page/group does not stop file IO or decoding. Stop its targets when hidden and show them again when visible; show restarts playback. gsp must remain alive until this service is closed. Use one service owner per target; do not concurrently replace it with another image producer.

esp_gsp_assets_show_name()

按清单名称异步显示资源,支持独立更新资源包中新增的素材。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show_name(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, uint16_t bind, const char *name, bool once);
完整接口契约(英文)

Resolve an asset by its manifest name, including newly added assets. Names are copied as a stable key; the caller may release name on return. Same asynchronous result and lifetime contract as esp_gsp_assets_show().

esp_gsp_assets_show_row()

异步加载 Row 图片,校验复用行令牌。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show_row(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t slot, esp_gsp_asset_ref_t asset, bool once);
完整接口契约(英文)

Same ownership and scene rules as show; a recycled row token is checked again on the UI task, so delayed data cannot replace a newly assigned row.

esp_gsp_assets_show_widget()

异步加载 Widget 图片资源槽。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show_widget(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t slot, esp_gsp_asset_ref_t asset, bool once);

esp_gsp_assets_show_target()

通过目标描述异步加载外部资源。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show_target(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_asset_target_t target, esp_gsp_asset_ref_t asset, bool once);
完整接口契约(英文)

Generic target forms for Image, Row and Widget destinations.

esp_gsp_assets_show_target_name()

通过清单名称向指定目标异步加载外部资源。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_show_target_name(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_asset_target_t target, const char *name, bool once);

esp_gsp_assets_get_status()

读取请求编号、处理阶段、错误原因和所需字节数。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_get_status(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_asset_target_t target, esp_gsp_asset_status_t *out_status);

esp_gsp_assets_get_publication()

读取当前请求的首帧发布状态,后续读取期间仍可判断是否已加载。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_get_publication(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_asset_target_t target, esp_gsp_asset_publication_t *out_publication);
完整接口契约(英文)

Snapshot the current request’s first successful UI publication. has_frame remains true during later reads and after a later frame fails. A new show, stop or scene change clears it; request_id distinguishes a replacement request even while the previous image remains visible. Unlike the transient READY state, this can drive loading placeholders. Publication means the UI accepted the complete image, not LCD scanout. On error the output is zeroed; a target not yet submitted is NOT_FOUND.

esp_gsp_assets_stop_target()

停止指定目标的后续帧,保留已显示内容。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_stop_target(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_asset_target_t target);

esp_gsp_assets_get_stats()

按需读取编码缓冲、解码缓存和加载开销概况。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_get_stats(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, esp_gsp_assets_stats_t *out_stats);
完整接口契约(英文)

On-demand overview: encoded bytes belong to this package; optional gsp contributes all live scene decoded caches, including non-external images. Decoded counters also include this service’s animation canvases/patch scratch. Peaks are conservative sums, not simultaneous samples. Display buffers and codec-internal scratch are not included.

esp_gsp_assets_status()

读取目标最近的加载结果和是否仍在处理。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: gsp_err_t
gsp_err_t esp_gsp_assets_status(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, uint16_t bind, bool *out_pending);
完整接口契约(英文)

Last load/decode result for this target; out_pending reports unfinished work. Returns GSP_ERR_NOT_FOUND before the target has been submitted.

esp_gsp_assets_stop()

停止目标的后续帧调度,保留已显示的图片。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_stop(esp_gsp_assets_t *assets, esp_gsp_handle_t gsp, uint16_t bind);
完整接口契约(英文)

Stop scheduling this target; its last published image remains visible. An already accepted frame may finish. Call show again to restart/replace.

esp_gsp_assets_close()

最多等待五秒关闭资源包;超时保留有效句柄,恢复处理后重试。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_close(esp_gsp_assets_t *assets);
完整接口契约(英文)

Stop new work and wait at most 5000 ms. On ESP_GSP_ERR_TIMEOUT the handle remains valid and closing; resume UI/IO progress and retry close. Never unmount storage or destroy the UI until close returns ESP_GSP_OK.

esp_gsp_assets_close_wait()

在指定超时内关闭服务;超时后保留有效句柄供重试。

  • 头文件: include/esp_gsp_assets.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_assets_close_wait(esp_gsp_assets_t *assets, uint32_t timeout_ms);
完整接口契约(英文)

Explicit wait budget; zero polls. Does not forcibly cancel a driver read. On timeout status/publication/stats and another close are allowed; show is rejected. Call from an application task, not a render/decode callback. Other callers must be quiescent before successful close frees the handle. Published source buffers survive close until replacement, scene exit or UI shutdown. NULL succeeds.

esp_gsp_font_file_open()

在显式文件大小上限内加载动态字体或预编译字体目录包。

  • 头文件: include/esp_gsp_font_file.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_font_file_open(const char *path, size_t max_bytes, esp_gsp_font_file_t **out_font);
完整接口契约(英文)

Loads a TTF/OTF/TTC or a GSPB font catalog from a mounted filesystem. max_bytes is a required, nonzero limit on the file size. Oversized files fail before allocation. The entire file stays in RAM (PSRAM preferred on ESP-IDF); this is not on-demand glyph IO. Catalogs are CRC-checked; dynamic fonts are checked by FreeType when the UI starts. Their signature is checked here. TTC uses its first face. Supported outlines depend on the FreeType build’s drivers; CFF/CFF2 requires the CFF driver. Dynamic fonts require gsp_enable_freetype() in source and prebuilt builds. With dynamic fallback, each static GFB must contain at most 32768 glyphs; UI startup rejects larger packs with NOT_SUPPORTED. Call from an application task: open performs blocking file IO. On failure *out_font is NULL. Glyph caches and FreeType working memory are separate.

esp_gsp_font_file_open_stream()

以按需流式读取方式打开动态字体或预编译字体目录包,仅常驻有限缓存。

  • 头文件: include/esp_gsp_font_file.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_font_file_open_stream(const char *path, size_t io_cache_bytes, esp_gsp_font_file_t **out_font);
完整接口契约(英文)

Opens a TTF/OTF/TTC or a GSPB font catalog for on-demand streaming IO instead of loading the full file into RAM.

  • For TTF/OTF/TTC: FreeType reads outline data through a buffered file stream sized to io_cache_bytes (0 selects the 8 KiB default).
  • For GSPB font catalogs: verifies package CRC incrementally, keeps only compact glyph/cmap tables in RAM, and loads glyph bitmaps on demand into a bounded LRU cache sized to io_cache_bytes (0 selects the 64 KiB default). UIs can share a catalog handle. Each render context reserves scratch equal to its largest glyph bitmap (one byte per pixel). Keep the filesystem mounted and the file unmodified until every UI borrowing this handle has stopped and esp_gsp_font_file_close() has returned.

esp_gsp_font_file_get_stats()

查询已打开字体句柄的常驻内存、缓存大小与按需读取统计。

  • 头文件: include/esp_gsp_font_file.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_font_file_get_stats(const esp_gsp_font_file_t *font, esp_gsp_font_file_stats_t *out_stats);
完整接口契约(英文)

Queries file size, handle residency, and streaming cache counters. Streamed catalog counters can be read while UIs are active. The snapshot excludes render-context scratch. Call from an application task.

esp_gsp_font_file_apply()

将已加载字体应用到启动前的 UI 配置,保留另一类字体来源。

  • 头文件: include/esp_gsp_font_file.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_font_file_apply(const esp_gsp_font_file_t *font, esp_gsp_config_t *config);
完整接口契约(英文)

Applies a loaded font to an initialized configuration before UI startup. Sets ttf/ttf_size for a dynamic font, or font_catalog for a linked catalog; the other font source is preserved. No ownership is transferred. Keep the handle alive until every UI using this configuration has stopped successfully. A catalog resolves missing GFB assets by ID, not missing codepoints. Embedded GFBs take priority; dynamic fonts supply glyphs absent from the resolved GFB. Changing this configuration does not replace a font in a running UI.

esp_gsp_font_file_close()

在所有引用它的 UI 停止后释放字体文件及目录。

  • 头文件: include/esp_gsp_font_file.h
  • 返回类型: void
void esp_gsp_font_file_close(esp_gsp_font_file_t *font);
完整接口契约(英文)

Frees a loaded font after all borrowing UIs have stopped, or startup failed. NULL is accepted. Configurations that borrowed it must not be reused without applying another font or clearing the corresponding font source fields.

esp_gsp_bidi_contains_rtl()

快速扫描 UTF-8 字符串是否包含希伯来语、阿拉伯语等从右到左字符。

  • 头文件: include/esp_gsp_bidi.h
  • 返回类型: bool
bool esp_gsp_bidi_contains_rtl(const char *utf8);
完整接口契约(英文)

Fast UTF-8 scan reporting whether utf8 contains any RTL character (Hebrew, Arabic, Syriac, Thaana, or Arabic Presentation Forms). Pure ASCII and LTR strings return false without allocation.

esp_gsp_bidi_detect_dir()

按首个强方向字符检测 UTF-8 段落的主阅读方向(LTR 或 RTL)。

  • 头文件: include/esp_gsp_bidi.h
  • 返回类型: esp_gsp_bidi_dir_t
esp_gsp_bidi_dir_t esp_gsp_bidi_detect_dir(const char *utf8);
完整接口契约(英文)

Detects the paragraph base direction of utf8 using the first strong directional codepoint (UAX #9 P2/P3). Returns ESP_GSP_BIDI_DIR_LTR when utf8 is NULL or has no strong RTL character before a strong LTR one.

esp_gsp_bidi_visual_utf8()

零堆分配执行阿拉伯语上下文连写、轻量双向视觉重排与括号镜像,输出视觉序 UTF-8。

  • 头文件: include/esp_gsp_bidi.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_bidi_visual_utf8(const char *utf8, esp_gsp_bidi_dir_t base_dir, char *out_utf8, size_t out_capacity, size_t *out_len);
完整接口契约(英文)

Converts logical-order UTF-8 text into visual-order UTF-8 ready for direct rendering with esp_gsp_set_text() or gsp_text_shape(). Performs zero-allocation Arabic contextual joining (isolated/initial/medial/ final, mandatory Lam-Alef ligatures, Persian/Urdu extensions, transparent combining marks), lightweight UAX #9 bidirectional run reordering so embedded numbers and Latin runs stay left-to-right inside RTL paragraphs, and paired bracket mirroring on RTL runs. Each newline-delimited line is reordered independently using the paragraph base direction. Returns ESP_GSP_ERR_INVALID_SIZE if out_capacity cannot hold the full NUL-terminated result (the output remains valid NUL-terminated UTF-8).

esp_gsp_bidi_set_text_auto()

启停运行时动态文本整形器的 RTL/BiDi 自动视觉重排;未调用时该模块可完全裁剪。

  • 头文件: include/esp_gsp_bidi.h
  • 返回类型: void
void esp_gsp_bidi_set_text_auto(bool enable);
完整接口契约(英文)

Enables or disables automatic BiDi/Arabic visual reordering inside the runtime dynamic text shaper. Applications that never call any esp_gsp_bidi_* function do not pull the BiDi module into the final link (0 bytes Flash/RAM overhead). When enabled, pure ASCII/LTR strings still bypass reordering on a zero-copy fast path.

事件、输入与覆盖层

回调必须遵守公共头文件标明的执行上下文;在渲染任务中执行的回调应保持短小且不阻塞。

esp_gsp_on_event()

注册应用事件回调。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_event(esp_gsp_handle_t gsp, esp_gsp_event_cb_t cb, void *user_ctx);
完整接口契约(英文)

Registers one application event callback through the render-task command path. NULL clears it; a later registration replaces the previous one. Callbacks run on the render task; keep them short. Setters are allowed, but do not wait for the queue or stop the application from a callback. On ESP-IDF, success from another task confirms queue admission, not that registration has taken effect. After clearing/replacing, keep the old user_ctx alive until esp_gsp_flush() succeeds from an application task on the same active runtime (or esp_gsp_stop() succeeds). A failed clear or flush does not allow freeing it. Serialize registrations with teardown; a bare portable core requires callers to serialize with app stepping.

esp_gsp_on_pinch()

注册由应用决定是否接管的双点 Pinch 回调。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_pinch(esp_gsp_handle_t gsp, esp_gsp_pinch_cb_t cb, void *user_ctx);
完整接口契约(英文)

Registers the independent pinch observer through the render-task queue.

BEGIN is emitted once with scale 1.0. Return true to accept the pinch and cancel the current single-pointer route; false leaves that touch sequence on the single-pointer route. Later accepted samples emit UPDATE. END means the contacts were released normally and CANCEL means recognition was interrupted. Passing NULL unregisters the observer. The callback runs in render-task context and must not block.

esp_gsp_set_pointer_observer()

注册映射后的指针采样观察器。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_pointer_observer(esp_gsp_handle_t gsp, esp_gsp_pointer_observer_cb_t cb, void *user_ctx);
完整接口契约(英文)

Registers one pointer observer through the render-task command path. Pass NULL to clear. Observes platform samples not consumed by the input interceptor; it does not consume input. The execution and user_ctx lifetime rules are the same as esp_gsp_on_event().

esp_gsp_set_overlay_contributor()

设置覆盖层贡献者。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_overlay_contributor(esp_gsp_handle_t gsp, esp_gsp_overlay_contributor_cb_t cb, void *user_ctx);
完整接口契约(英文)

Registers one application-owned overlay contributor through the render-task queue (like esp_gsp_on_pinch): the registration and the resulting overlay rebuild are applied on the render task, never inline in the calling task. Passing NULL clears it. The callback runs on the render task during overlay rebuild.

esp_gsp_set_input_interceptor()

设置输入拦截器。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_input_interceptor(esp_gsp_handle_t gsp, esp_gsp_input_interceptor_cb_t cb, void *user_ctx);
完整接口契约(英文)

Registers one top-level input interceptor through the render-task queue. Passing NULL clears it. The callback runs in render-task context and must not block.

esp_gsp_overlay_builder_round_rect()

向当前覆盖层追加一个圆角矩形。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_overlay_builder_round_rect(esp_gsp_overlay_builder_t *builder, int32_t x, int32_t y, uint16_t width, uint16_t height, uint32_t color, uint16_t radius, uint8_t opacity);

esp_gsp_overlay_builder_glyph_a8()

向当前覆盖层追加一个 A8 字形。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_overlay_builder_glyph_a8(esp_gsp_overlay_builder_t *builder, int32_t x, int32_t y, uint16_t width, uint16_t height, uint32_t color, const uint8_t *a8, size_t a8_size, size_t stride_bytes);
完整接口契约(英文)

The a8 bitmap is borrowed, not copied: it must stay alive until the next overlay rebuild (any state change that repaints chrome, or the next esp_gsp_set_overlay_contributor call).

列表、网格与消息

集合 API 只保留可见行或单元格;Binder 回调在渲染任务执行,回调结束后不得继续持有 Row Token。

esp_gsp_grid_bind_component()

按稳定控件键绑定生成的 Grid。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_grid_t
esp_gsp_grid_t esp_gsp_grid_bind_component(esp_gsp_handle_t gsp, gsp_component_key_t key, esp_gsp_grid_bind_cb_t bind_item, void *user_ctx);
完整接口契约(英文)

Binds a generated Grid component. The framework owns row/column mapping, recycling, tail cells and scrolling; the callback only fills one item.

esp_gsp_grid_cell_set_image()

设置Grid单元格图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_cell_set_image(esp_gsp_handle_t gsp, esp_gsp_grid_cell_t cell, const void *data, size_t size);
完整接口契约(英文)

Slot-free convenience setters for the Grid cell’s first dynamic image or text field. They return ESP_GSP_ERR_NOT_SUPPORTED when the template has no matching dynamic field.

esp_gsp_grid_cell_set_image_ex()

按照指定所有权设置 Grid 单元格图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_cell_set_image_ex(esp_gsp_handle_t gsp, esp_gsp_grid_cell_t cell, const void *data, size_t size, const esp_gsp_image_options_t *options);

esp_gsp_grid_cell_set_image_borrowed()

设置 Grid 单元格借用图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_cell_set_image_borrowed(esp_gsp_handle_t gsp, esp_gsp_grid_cell_t cell, const void *data, size_t size, esp_gsp_image_release_cb_t on_release, void *release_ctx);

esp_gsp_grid_cell_set_image_owned()

把 Grid 单元格图片所有权交给框架。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_cell_set_image_owned(esp_gsp_handle_t gsp, esp_gsp_grid_cell_t cell, void *data, size_t size);

esp_gsp_grid_cell_set_text()

设置Grid单元格文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_cell_set_text(esp_gsp_handle_t gsp, esp_gsp_grid_cell_t cell, const char *utf8);

esp_gsp_grid_set_total()

设置Grid总数。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_set_total(esp_gsp_handle_t gsp, esp_gsp_grid_t grid, uint32_t total);
完整接口契约(英文)

Grid-named aliases keep application code at the cell abstraction.

esp_gsp_grid_refresh()

刷新Grid。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_grid_refresh(esp_gsp_handle_t gsp, esp_gsp_grid_t grid);

esp_gsp_row_text()

设置回收行中的第一个文字 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_text(esp_gsp_handle_t gsp, esp_gsp_row_t row, const char *utf8);
完整接口契约(英文)

Shapes UTF-8 into the row’s TEXT slot (FreeType fallback and multi-line wrap apply as for esp_gsp_set_text).

esp_gsp_row_set_text()

设置行文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_text(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t text_slot, const char *utf8);
完整接口契约(英文)

Shapes UTF-8 into an explicit TEXT slot of a composite row.

esp_gsp_row_value()

设置回收行中的第一个数值 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_value(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint32_t value);
完整接口契约(英文)

Drives the row’s first VALUE slot (0..100).

esp_gsp_row_set_value()

设置行数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_value(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t value_slot, uint32_t value);
完整接口契约(英文)

Drives an explicit VALUE slot of a composite row.

esp_gsp_row_color()

设置回收行中的第一个颜色 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_color(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint32_t color);
完整接口契约(英文)

Drives the row’s first COLOR slot (native format).

esp_gsp_row_set_color()

设置行颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_color(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t color_slot, uint32_t color);
完整接口契约(英文)

Drives an explicit COLOR slot of a composite row.

esp_gsp_row_set_image()

设置行图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_image(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t resource_slot, const void *data, size_t size);
完整接口契约(英文)

Replaces one RESOURCE slot in a recycled row from encoded JPEG/PNG/QOI bytes. The input is copied before return. A stale row token cancels the accepted request before publication, so an asynchronous loader cannot publish into a slot that has since been recycled for another item.

esp_gsp_row_set_image_ex()

按照指定所有权设置回收行图片 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_image_ex(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t resource_slot, const void *data, size_t size, const esp_gsp_image_options_t *options);

esp_gsp_row_set_image_borrowed()

设置回收行的借用图片 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_image_borrowed(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t resource_slot, const void *data, size_t size, esp_gsp_image_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Borrowed/owned variants of esp_gsp_row_set_image().

esp_gsp_row_set_image_owned()

把回收行图片 Slot 的所有权交给框架。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_row_set_image_owned(esp_gsp_handle_t gsp, esp_gsp_row_t row, uint16_t resource_slot, void *data, size_t size);

esp_gsp_list_bind_component()

按稳定控件键绑定生成的 List 或 Wheel。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_list_t
esp_gsp_list_t esp_gsp_list_bind_component(esp_gsp_handle_t gsp, gsp_component_key_t key, esp_gsp_list_bind_cb_t bind_item, void *user_ctx);
完整接口契约(英文)

Creates the list/wheel by its stable component key: template, viewport and initial total (the authored item count) come from the generated directory — nothing to re-pair by hand. Requires config.directories. A NULL bind_item serves the authored item texts directly (fixed lists: zero application assembly). Adjust the count later with esp_gsp_list_set_total when data is dynamic. The returned binding remains valid until the UI instance is destroyed.

esp_gsp_bind_list()

绑定List。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_list_t
esp_gsp_list_t esp_gsp_bind_list(esp_gsp_handle_t gsp, uint16_t template_id, int16_t x, int16_t y, uint16_t width, uint16_t height, uint32_t total, esp_gsp_list_bind_cb_t bind_item, void *user_ctx);
完整接口契约(英文)

ADVANCED: manual template/viewport pairing (prefer the component-key form above).

esp_gsp_list_set_total()

设置List总数。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_set_total(esp_gsp_handle_t gsp, esp_gsp_list_t list, uint32_t total);

esp_gsp_list_refresh()

刷新List。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_refresh(esp_gsp_handle_t gsp, esp_gsp_list_t list);
完整接口契约(英文)

Re-binds visible rows after the backing data changed.

esp_gsp_list_set_item_heights()

原子替换可变高度列表的完整高度索引。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_set_item_heights(esp_gsp_handle_t gsp, esp_gsp_list_t list, const uint16_t *heights, uint32_t count, uint32_t prepended_count, bool stick_to_end);
完整接口契约(英文)

Enables variable-height rows and atomically replaces the complete height index. There is no logical item limit other than memory and the signed 31-bit pixel extent. Existing fixed-height lists do not allocate this index and keep their arithmetic fast path.

prepended_count maps the old first visible item onto its new index when older records were inserted at the front. If stick_to_end is true, a viewport already at the end remains attached to the end (new live messages do not pull a user who is browsing older history).

esp_gsp_message_list_bind_component()

绑定生成的 Message List 和应用数据源。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_list_t
esp_gsp_list_t esp_gsp_message_list_bind_component(esp_gsp_handle_t gsp, gsp_component_key_t key, const esp_gsp_message_source_t *source);
完整接口契约(英文)

Binds a generated message_list component and loads its current source. The source is application-owned; its callbacks execute on the render task.

esp_gsp_message_list_changed()

重新读取 Message List 数据源并更新布局。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_message_list_changed(esp_gsp_handle_t gsp, esp_gsp_list_t list, uint32_t prepended_count);
完整接口契约(英文)

Re-reads count/messages and updates layout. Pass the number inserted before the previous item zero to preserve the visible history anchor. Appends keep a viewport already at the end attached to the new end, without pulling a user who is browsing older history.

esp_gsp_list_snap()

启用或关闭 List/Wheel 的行边界吸附。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_snap(esp_gsp_handle_t gsp, esp_gsp_list_t list, bool enable);
完整接口契约(英文)

Wheel-style behavior: released drags settle on a row boundary.

esp_gsp_list_fling()

以指定像素速度启动列表惯性滚动。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_fling(esp_gsp_handle_t gsp, esp_gsp_list_t list, int32_t velocity_px_s);
完整接口契约(英文)

Programmatic momentum: starts coasting at velocity_px_s (signed; positive scrolls toward higher items). Friction and row snapping behave exactly as a released drag. A newly bound visible list is activated when this command is applied, so callers need not wait for a UI tick between binding and requesting the fling.

esp_gsp_list_scroll_to()

跳转到列表的绝对像素偏移。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_scroll_to(esp_gsp_handle_t gsp, esp_gsp_list_t list, int32_t offset_px);
完整接口契约(英文)

Jumps to an absolute scroll offset in pixels (clamped to content; cancels any coasting). Fixed-height row N starts at N * row_height; variable-height lists use cumulative item heights.

esp_gsp_list_fade()

设置 Wheel 风格的上下边缘淡出带。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_list_fade(esp_gsp_handle_t gsp, esp_gsp_list_t list, uint32_t native_color, bool enable);
完整接口契约(英文)

Roller-style fade: translucent native_color bands dim the rows toward the viewport’s top and bottom edges. Pass the wheel’s background color. The bands render above the row instances, which disables the scroll-blit shortcut over this viewport — scrolling repaints the viewport instead.

esp_gsp_on_scroll()

注册指定矩形内的纵向滚动回调。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_scroll(esp_gsp_handle_t gsp, gsp_rect_t region, esp_gsp_scroll_cb_t cb, void *user_ctx);

Canvas

Canvas 帧采用借用语义;每个已接受帧恰好收到一次释放回调,立即返回错误时所有权仍属于调用者。

esp_gsp_canvas_set_draw_cb()

注册直接绘制回调并请求首次完整重绘。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_set_draw_cb(esp_gsp_handle_t gsp, uint16_t bind, esp_gsp_canvas_draw_cb_t draw_cb, void *user_ctx);
完整接口契约(英文)

Registers a direct draw callback and requests the first full repaint. The authored bind must target an unscaled profile-native opaque image whose runtime resource view is not shared with another element. With an asynchronous adapter success confirms command admission only; unsupported targets are diagnosed on the render task and remain unchanged. Pushing a frame to the same bind replaces the callback. user_ctx must remain valid until the callback is replaced or Canvas stop/destruction has completed; use esp_gsp_flush() before releasing it after esp_gsp_canvas_stop(). A repaint may invoke the callback more than once; render one coherent generation for all regions belonging to that repaint.

esp_gsp_canvas_invalidate()

请求重绘Canvas。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_invalidate(esp_gsp_handle_t gsp, uint16_t bind);
完整接口契约(英文)

Requests a full repaint of a callback-backed Canvas.

esp_gsp_canvas_invalidate_dirty()

请求重绘Canvas脏区。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_invalidate_dirty(esp_gsp_handle_t gsp, uint16_t bind, gsp_rect_t dirty);
完整接口契约(英文)

Requests repaint of a non-empty Canvas-local rectangle.

esp_gsp_canvas_push()

发布一个借用的 Canvas 完整帧。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_push(esp_gsp_handle_t gsp, uint16_t bind, const void *pixels, size_t stride_bytes, esp_gsp_canvas_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Publishes a borrowed frame. Eligible renderer copies automatically use the available PPA/DMA2D backend and otherwise fall back to software.

esp_gsp_canvas_try_push()

以非阻塞方式尝试发布 Canvas 完整帧。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_try_push(esp_gsp_handle_t gsp, uint16_t bind, const void *pixels, size_t stride_bytes, esp_gsp_canvas_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Non-blocking variant of esp_gsp_canvas_push(). Returns ESP_GSP_ERR_TIMEOUT when the render queue cannot accept the frame immediately; ownership remains with the caller in that case.

esp_gsp_canvas_push_dirty()

发布借用帧并只重绘指定脏区。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_push_dirty(esp_gsp_handle_t gsp, uint16_t bind, const void *pixels, size_t stride_bytes, gsp_rect_t dirty, esp_gsp_canvas_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Publishes a borrowed Canvas frame while repainting only dirty, in resource-local pixels with an exclusive x2/y2 edge. Pixels outside dirty must match the previously displayed frame. The dirty rectangle must be non-empty and fit the authored placeholder. Ownership and release ordering are identical to esp_gsp_canvas_push().

esp_gsp_canvas_try_push_dirty()

以非阻塞方式尝试发布 Canvas 脏区帧。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_try_push_dirty(esp_gsp_handle_t gsp, uint16_t bind, const void *pixels, size_t stride_bytes, gsp_rect_t dirty, esp_gsp_canvas_release_cb_t on_release, void *release_ctx);
完整接口契约(英文)

Non-blocking variant of esp_gsp_canvas_push_dirty().

esp_gsp_canvas_frame_init()

初始化带结构大小和缓冲区长度的 Canvas 帧描述符。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_canvas_frame_t
static inline esp_gsp_canvas_frame_t esp_gsp_canvas_frame_init(void);
完整接口契约(英文)

Initialize a zeroed, sized Canvas frame descriptor.

esp_gsp_canvas_submit_frame()

提交显式长度的借用帧,校验 stride 覆盖范围后再发布像素。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_submit_frame(esp_gsp_handle_t gsp, uint16_t bind, const esp_gsp_canvas_frame_t *frame);
完整接口契约(英文)

Submit a length-checked borrowed Canvas frame. The core validates stride_bytes * authored_height <= size_bytes without overflowing before publishing or reading pixels; row padding must also fit, including the final row. Target compatibility and dirty bounds still apply. ESP-IDF success confirms queue admission. A later rejection preserves the previous drawing and invokes on_release once if supplied; an immediate API error transfers no ownership and invokes no callback. Stop/producer rules are identical to esp_gsp_canvas_push(). Native bridge may validate at upload time; it never reads beyond the supplied extent.

esp_gsp_canvas_try_submit_frame()

非阻塞提交显式长度的借用帧,入队失败不转移所有权。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_try_submit_frame(esp_gsp_handle_t gsp, uint16_t bind, const esp_gsp_canvas_frame_t *frame);
完整接口契约(英文)

Non-blocking queue-admission variant of esp_gsp_canvas_submit_frame(). A full queue returns ESP_GSP_ERR_TIMEOUT without ownership transfer.

esp_gsp_canvas_stop()

停止Canvas。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_stop(esp_gsp_handle_t gsp, uint16_t bind);
完整接口契约(英文)

Queues restoration of the placeholder image. The release callback is the completion signal for each borrowed frame; do not free accepted frames immediately after this function returns.

定时器、模板与动画

运行时对象消耗有界资源池并在渲染任务应用;模板配额来自场景需求和工程覆盖值。

esp_gsp_on_component_event()

注册 PageFlow 和 Drawer 状态及运动完成事件回调。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_component_event(esp_gsp_handle_t gsp, esp_gsp_component_event_cb_t cb, void *user_ctx);
完整接口契约(英文)

Subscribe to PageFlow/Drawer changes without polling. Registration is serialized like setters; NULL unsubscribes. No initial event is emitted. Notifications are coalesced per component per UI step and dispatched after driver updates, outside driver iteration. The event contains final committed state; intermediate requests within a step are not an event history. MOTION_FINISHED also covers a return to the original value and an effective non-animated change. An idle same-value request emits nothing. Scene teardown discards pending notifications. Existing esp_gsp_on_event is unaffected. Callbacks may use setters but must not block, flush or destroy the app. With a continuously attached ESP-IDF runtime, an external task can unsubscribe and successfully flush before freeing user_ctx. Do not concurrently tear down or replace the runtime. Portable apps require caller serialization instead.

esp_gsp_scale_q16_from_percent()

把整数百分比转换为无符号 Q16.16 缩放值。

  • 头文件: include/esp_gsp.h
  • 返回类型: uint32_t
static inline uint32_t esp_gsp_scale_q16_from_percent(uint32_t percent);
完整接口契约(英文)

Converts an integer percentage to unsigned Q16.16 scale.

esp_gsp_scale_q16_multiply()

组合图片缩放值与相对 Pinch 缩放值,并进行饱和处理。

  • 头文件: include/esp_gsp.h
  • 返回类型: uint32_t
static inline uint32_t esp_gsp_scale_q16_multiply(uint32_t scale_q16, uint32_t relative_q16);
完整接口契约(英文)

Combines an image scale and a relative pinch scale, with saturation.

esp_gsp_scale_q16_clamp()

把 Q16.16 缩放值限制在指定范围内。

  • 头文件: include/esp_gsp.h
  • 返回类型: uint32_t
static inline uint32_t esp_gsp_scale_q16_clamp(uint32_t scale_q16, uint32_t minimum_q16, uint32_t maximum_q16);
完整接口契约(英文)

Clamps an unsigned Q16.16 scale to an authored or application range.

esp_gsp_chart_set_series()

按业务数值一次提交整条曲线,返回前复制输入数组。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_chart_set_series(esp_gsp_handle_t gsp, const esp_gsp_chart_series_t *series, const int32_t *values, size_t count);
完整接口契约(英文)

Replaces every point in a fixed-capacity series in one render transaction. Values use the authored business range and are copied before return. count must equal the series capacity (at most ESP_GSP_CHART_MAX_POINTS). Small batches stay inline; larger batches use temporary framework-owned storage and return ESP_GSP_ERR_NO_MEM if allocation fails.

esp_gsp_chart_append()

丢弃最旧采样点并按顺序追加一个业务数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_chart_append(esp_gsp_handle_t gsp, const esp_gsp_chart_series_t *series, int32_t value);
完整接口契约(英文)

Appends one business value, dropping the oldest point from the fixed window. Consecutive queued appends are applied in order on the render task.

esp_gsp_set_press_feedback_enabled()

启用或关闭默认按下遮罩,不改变点击路由。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_set_press_feedback_enabled(esp_gsp_handle_t gsp, bool enabled);
完整接口契约(英文)

Enable/disable the default press shade; processed on the render task.

esp_gsp_query_visibility()

查询活动场景中对象布局与屏幕及父视口的有效可见交集。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_query_visibility(esp_gsp_handle_t gsp, const esp_gsp_visibility_target_t *target, bool *out_visible);
完整接口契约(英文)

True when the active scene, visibility gates and transformed layout bounds intersect the screen/ancestor viewport. Does not test pixel alpha or occlusion by unrelated siblings. Prefer the generated get_effective_visible() helper.

esp_gsp_timer_create()

创建定时器。

  • 头文件: include/esp_gsp.h
  • 返回类型: void *
void *esp_gsp_timer_create(esp_gsp_handle_t gsp, uint32_t period_ms, esp_gsp_timer_cb_t cb, void *user_ctx);
完整接口契约(英文)

Periodic callback in render-task context (lv_timer equivalent). Returns a handle usable with esp_gsp_timer_delete, or NULL on failure. Check the return value. Capacity defaults to ESP_GSP_MAX_TIMERS in Kconfig and can be overridden with ESP_GSP_FIELD_MAX_TIMERS before start. A full timer table logs the effective capacity once until registration succeeds again. ESP-IDF schedules the first callback one period after registration using its monotonic clock and wakes an idle service. Callback execution can still be delayed by rendering or other task work; this is not a real-time deadline. With the ESP-IDF runtime attached, creation and deletion may be called from application tasks or timer callbacks, but not from an ISR. Keep the app and runtime alive throughout these calls. Unattached portable apps require caller serialization with app stepping and other timer operations. The caller owns user_ctx and must keep it alive until callbacks have exited.

esp_gsp_timer_delete()

删除定时器。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timer_delete(esp_gsp_handle_t gsp, void *timer);
完整接口契约(英文)

Stops future scheduling; a callback already selected for execution may still run. This call does not wait for that callback to return. The handle must belong to this app and must not be used after deletion (timer slots may be reused). Callbacks may delete their own timer.

An external task using a continuously attached ESP-IDF runtime can wait for an in-flight callback by successfully deleting the timer and then successfully calling esp_gsp_flush(). Keep user_ctx alive if flush fails or times out. Do not use this wait from a timer callback, concurrently with app/runtime teardown or replacement, or while holding a lock needed by the callback. This does not cover asynchronous work launched by the callback or other timers sharing/re-registering user_ctx. Unattached portable apps do not provide this cross-task flush barrier.

esp_gsp_widget_create()

在当前场景创建一个已声明模板的运行时实例。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_widget_t
esp_gsp_widget_t esp_gsp_widget_create(esp_gsp_handle_t gsp, uint16_t template_id, int16_t x, int16_t y);
完整接口契约(英文)

Instantiates template_id at (x, y) in the CURRENT scene. Creation is asynchronous; the handle is immediately usable with the widget setters. Returns ESP_GSP_WIDGET_NONE when the widget quota is used up.

esp_gsp_widget_create_template()

创建模板实例模板。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_widget_t
static inline esp_gsp_widget_t esp_gsp_widget_create_template(esp_gsp_handle_t gsp, const esp_gsp_template_desc_t *template_desc, int16_t x, int16_t y);
完整接口契约(英文)

Named-descriptor form; avoids exposing the compiled template id.

esp_gsp_widget_destroy()

销毁模板实例。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_destroy(esp_gsp_handle_t gsp, esp_gsp_widget_t widget);

esp_gsp_widget_set_value()

设置模板实例数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_value(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t slot, uint32_t value);
完整接口契约(英文)

Drives a VALUE slot (progress members), value in 0..100.

esp_gsp_widget_set_color()

设置模板实例颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_color(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t slot, uint32_t color);
完整接口契约(英文)

Drives a COLOR slot, native pixel format (see esp_gsp_set_color).

esp_gsp_widget_set_text()

设置模板实例文字。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_text(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t slot, const char *utf8);
完整接口契约(英文)

Shapes UTF-8 into a TEXT slot; the string is copied before return.

esp_gsp_widget_set_image()

设置模板实例图片。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_image(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t resource_slot, const void *data, size_t size);
完整接口契约(英文)

Replaces a template RESOURCE slot from copied encoded image bytes.

esp_gsp_widget_set_image_borrowed()

设置模板实例的借用图片 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_image_borrowed(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t resource_slot, const void *data, size_t size, esp_gsp_image_release_cb_t on_release, void *release_ctx);

esp_gsp_widget_set_image_owned()

把模板实例图片 Slot 的所有权交给框架。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_image_owned(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint16_t resource_slot, void *data, size_t size);

esp_gsp_widget_value()

设置模板实例的第一个数值 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_value(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint32_t value);

esp_gsp_widget_color()

设置模板实例的第一个颜色 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_color(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, uint32_t color);

esp_gsp_widget_text()

设置模板实例的第一个文字 Slot。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_text(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, const char *utf8);

esp_gsp_widget_set_visible()

设置模板实例可见状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_visible(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, bool visible);

esp_gsp_widget_set_position()

设置模板实例位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_set_position(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, int16_t x, int16_t y);

esp_gsp_play()

在图片占位资源上播放 EAF 帧动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_play(esp_gsp_handle_t gsp, const void *eaf, size_t size, bool once);
完整接口契约(英文)

Plays an EAF frame animation into a profile-native RGB565/RGB888 placeholder image resource. The framework ticks it on the render task — no app-side loop. eaf is NOT copied. once = stop on the last frame. Returns ESP_GSP_ERR_NOT_SUPPORTED when the build left the EAF player out of the firmware.

esp_gsp_play_file()

从已挂载文件系统按帧播放 EAF4 动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_play_file(esp_gsp_handle_t gsp, const char *path, bool once);
完整接口契约(英文)

Queue streaming playback of a file from a mounted filesystem into the current scene’s first image placeholder. Use a static placeholder with the intended dimensions and a compatible color and alpha profile. Requires the EAF player.

The path is copied. ESP_GSP_OK means the request was accepted. The render task opens and attaches the file. Keep the file and mount valid during playback. Switching scenes, replacing playback, or stopping the UI releases the player. With once=true, playback closes the file and keeps the last frame.

esp_gsp_timeline_play()

按名称启动时间线,可选择循环播放。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_play(esp_gsp_handle_t gsp, const char *name, bool loop);
完整接口契约(英文)

Controls a named component-property timeline compiled into the active scene. Commands are applied on the render task and expire when the scene changes. Calls may be made from any task except an ISR. The name is consumed on submit. Play restarts at 0 ms (applying compiled alternate flags if authored). Zero- duration poses complete once their optional blend finishes. Seek clamps to the clip duration and holds the sampled pose. Pause holds the current pose, resume continues from it (reclaiming any yielded tracks), and stop discards the playhead while retaining the last pose. Resume restarts an idle or completed clip once. Starting or seeking a clip displaces playing clips with overlapping tracks (or masks only overlapping tracks when options->mask_conflicts is true) and cancels conflicting single-property animations. Direct application writes or single-property animations to a property driven by a playing timeline yield only that track so disjoint parts keep animating.

esp_gsp_timeline_play_ex()

按名称启动时间线,设置方向、速度和轨道冲突策略。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_play_ex(esp_gsp_handle_t gsp, const char *name, const esp_gsp_timeline_play_options_t *options);

esp_gsp_timeline_seek()

按毫秒采样指定时间线并保持该姿态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_seek(esp_gsp_handle_t gsp, const char *name, uint32_t position_ms);

esp_gsp_timeline_pause()

暂停指定时间线,保留当前姿态和播放位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_pause(esp_gsp_handle_t gsp, const char *name);

esp_gsp_timeline_resume()

从保存的位置恢复指定时间线。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_resume(esp_gsp_handle_t gsp, const char *name);

esp_gsp_timeline_stop()

停止指定时间线,释放播放状态并保留画面。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_stop(esp_gsp_handle_t gsp, const char *name);

esp_gsp_timeline_play_key()

使用生成的时间线键启动播放,可选择循环。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_play_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key, bool loop);
完整接口契约(英文)

Key-addressed variants used by generated scene *_actions.h wrappers.

esp_gsp_timeline_play_key_ex()

使用时间线键和播放选项启动时间线。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_play_key_ex(esp_gsp_handle_t gsp, gsp_timeline_key_t key, const esp_gsp_timeline_play_options_t *options);

esp_gsp_timeline_seek_key()

使用时间线键采样指定毫秒位置并保持姿态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_seek_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key, uint32_t position_ms);

esp_gsp_timeline_pause_key()

暂停时间线键指定的播放。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_pause_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key);

esp_gsp_timeline_resume_key()

继续时间线键指定的播放。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_resume_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key);

esp_gsp_timeline_stop_key()

停止时间线键指定的播放并保留画面。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_stop_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key);

esp_gsp_timeline_pause_all()

暂停当前场景的全部时间线。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_pause_all(esp_gsp_handle_t gsp);
完整接口契约(英文)

Pause or stop all timelines in the active scene.

esp_gsp_timeline_stop_all()

停止当前场景的全部时间线。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_stop_all(esp_gsp_handle_t gsp);

esp_gsp_timeline_get_state()

按名称查询已提交的时间线播放状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_get_state(esp_gsp_handle_t gsp, const char *name, esp_gsp_timeline_state_info_t *out_state);
完整接口契约(英文)

Query the committed playback state of a timeline in the active scene. Like component getters, call from the render task or a caller-serialized portable app.

esp_gsp_timeline_get_state_key()

按时间线键查询已提交的播放状态。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_timeline_get_state_key(esp_gsp_handle_t gsp, gsp_timeline_key_t key, esp_gsp_timeline_state_info_t *out_state);

esp_gsp_on_timeline_event()

注册或清除时间线事件回调,回调在渲染任务中执行。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_timeline_event(esp_gsp_handle_t gsp, esp_gsp_timeline_event_cb_t cb, void *user_ctx);
完整接口契约(英文)

Subscribe to timeline lifecycle events (started, looped, completed, paused, stopped, displaced). Registration is serialized like setters; NULL unsubscribes. Notifications are coalesced per clip per UI step and dispatched on the render task after stepping. Callbacks may start or stop timelines but must not block, flush or destroy the app. Scene exit discards pending events.

esp_gsp_rig_get_joint_world()

读取关节的世界坐标与角度,角度单位为 0.1 度。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_get_joint_world(esp_gsp_handle_t gsp, gsp_component_key_t joint_key, int32_t *out_x, int32_t *out_y, int32_t *out_angle_deci);
完整接口契约(英文)

Query the current world-space pivot position and angle (in tenths of a degree) of a compiled 2D rig joint in the active scene. Like component getters, call from the render task or a caller-serialized portable app.

esp_gsp_rig_solve_ik_2bone()

解算两段关节并原子提交局部角度。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_solve_ik_2bone(esp_gsp_handle_t gsp, gsp_component_key_t upper_joint, gsp_component_key_t lower_joint, int16_t end_x, int16_t end_y, int32_t target_x, int32_t target_y, int8_t bend_sign, int32_t *out_upper_deci, int32_t *out_lower_deci);
完整接口契约(英文)

Solve 2-bone analytical inverse kinematics (e.g. shoulder + elbow) so that the local tip (end_x, end_y) on lower_joint reaches (target_x, target_y). bend_sign (+1 or -1) selects the bend direction. Joint limits are clamped and updated atomically.

When out_upper_deci and out_lower_deci are both NULL, this call is serialized through the command queue like other setters and may be called safely from any task. When either output pointer is non-NULL, call only from the render task or a caller-serialized portable app.

esp_gsp_deci_degrees()

将角度四舍五入为十分之一度,供关节和旋转接口使用。

  • 头文件: include/esp_gsp.h
  • 返回类型: int32_t
static inline int32_t esp_gsp_deci_degrees(double degrees);
完整接口契约(英文)

Round a finite angle in the authored range to tenths of a degree. Use for rig joints and images with deci_deg rotation precision. Images with deg precision take whole degrees directly.

esp_gsp_rig_ik_config_init()

通过末端偏移、目标位置和弯曲方向创建双关节 IK 配置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_rig_ik_config_t
static inline esp_gsp_rig_ik_config_t esp_gsp_rig_ik_config_init(int16_t end_x, int16_t end_y, int32_t target_x, int32_t target_y, int8_t bend);
完整接口契约(英文)

Initialize a stateful 2-bone IK configuration with smooth defaults (180 ms weight cross-fade, 6 Hz / 0.96 target-space spring, full weight).

esp_gsp_rig_set_ik_2bone()

设置两段关节的目标、弯曲方向、平滑和混合权重。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_set_ik_2bone(esp_gsp_handle_t gsp, gsp_component_key_t upper_joint, gsp_component_key_t lower_joint, const esp_gsp_rig_ik_config_t *config);
完整接口契约(英文)

Smoothly drive a 2-bone IK chain toward target_x/target_y using target-space spring smoothing and weight cross-fade against active timelines. Thread-safe: serialized through the command queue like other setters.

esp_gsp_rig_release_ik_2bone()

释放指定关节对的持续逆运动学控制。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_release_ik_2bone(esp_gsp_handle_t gsp, gsp_component_key_t upper_joint, gsp_component_key_t lower_joint, uint16_t blend_ms);
完整接口契约(英文)

Smoothly release a stateful 2-bone IK chain back to timelines/rest pose over blend_ms milliseconds. Thread-safe from any task.

esp_gsp_rig_set_look_at()

设置当前场景关注的目标方向与混合时间。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_set_look_at(esp_gsp_handle_t gsp, int32_t target_x, int32_t target_y, uint32_t weight_q16, uint16_t blend_ms);
完整接口契约(英文)

Set or update the scene’s shared Look-At target point for compiled rig aim constraints (e.g. head/torso/eye tracking) with smooth weight blending. weight_q16 is 0..65536 (0 defaults to 65536). Thread-safe from any task.

esp_gsp_rig_clear_look_at()

在指定时间内淡出当前场景的注视控制。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_rig_clear_look_at(esp_gsp_handle_t gsp, uint16_t blend_ms);
完整接口契约(英文)

Smoothly fade out the active Look-At target over blend_ms milliseconds. Thread-safe from any task.

esp_gsp_animate()

执行动画。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_animate(esp_gsp_handle_t gsp, uint16_t bind, int32_t from, int32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Animates a value bind from from to to (0..100 domain) over duration_ms. A new animation on the same bind replaces the running one.

esp_gsp_animate_color()

执行动画颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_animate_color(esp_gsp_handle_t gsp, uint16_t bind, uint32_t from, uint32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Tweens a color bind between two native colors (per-channel interpolation, RGB565 scenes).

esp_gsp_component_animate_value()

执行动画控件数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_value(esp_gsp_handle_t gsp, gsp_component_key_t key, int32_t from, int32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Component-key animations use semantic VALUE/COLOR properties and the same authored-unit conversion as component get/set.

esp_gsp_component_animate_value_to()

执行动画控件数值。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_value_to(esp_gsp_handle_t gsp, gsp_component_key_t key, int32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);

esp_gsp_component_animate_color()

执行动画控件颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_color(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t from, uint32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);

esp_gsp_component_animate_color_to()

执行动画控件颜色。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_color_to(esp_gsp_handle_t gsp, gsp_component_key_t key, uint32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);

esp_gsp_component_animate_property()

执行动画控件属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_property(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, const gsp_value_t *from, const gsp_value_t *to, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Open-key animation for any scalar semantic property.

esp_gsp_component_animate_property_to()

执行动画控件属性。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_property_to(esp_gsp_handle_t gsp, gsp_component_key_t component, gsp_property_key_t property, const gsp_value_t *to, uint32_t duration_ms, esp_gsp_ease_t ease);

esp_gsp_component_animate_position_to()

执行动画控件位置。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_component_animate_position_to(esp_gsp_handle_t gsp, gsp_component_key_t component, int32_t x, int32_t y, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Starts one synchronized x/y tween from the committed position. Both axes are committed together on every step, so no frame shows the component at a position between the two. Animating x and y as two separate properties does not give that guarantee.

esp_gsp_widget_animate()

执行动画模板实例。

  • 头文件: include/esp_gsp.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_widget_animate(esp_gsp_handle_t gsp, esp_gsp_widget_t widget, int32_t from, int32_t to, uint32_t duration_ms, esp_gsp_ease_t ease);
完整接口契约(英文)

Animates a widget’s first VALUE slot. Endpoints are percentages 0..100. Pass ESP_GSP_ANIM_CURRENT as from to start from its committed value.

ESP-LCD 生命周期

这些函数管理 ESP-IDF 渲染任务,并协调显示提交、暂停、挂起和保留 Session 的切换。

esp_gsp_esp_lcd_config_init()

初始化一份 ESP-LCD 平台配置。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_gsp_esp_lcd_config_t
static inline esp_gsp_esp_lcd_config_t esp_gsp_esp_lcd_config_init(void);

esp_gsp_esp_lcd_session_result_init()

初始化 Session 所有权结果并设置结构大小。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_gsp_esp_lcd_session_result_t
static inline esp_gsp_esp_lcd_session_result_t esp_gsp_esp_lcd_session_result_init(void);

esp_gsp_esp_lcd_set_event_driven_idle()

启用静态界面的事件和期限等待。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_set_event_driven_idle(esp_gsp_handle_t gsp, bool enable);
完整接口契约(英文)

Let a quiet ESP-LCD runtime wait for events or its next deadline.

Disabled by default. Polling touch, in-flight work and render recovery keep their service cadence. This configures GSP’s waits only. The app owns ESP-IDF power management and hardware wakeup configuration. Call from the same application task that serializes display lifecycle changes.

esp_gsp_esp_lcd_pause()

静默活动 UI,并等待共享显示提交完成。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_pause(esp_gsp_handle_t gsp, uint32_t timeout_ms, esp_gsp_esp_lcd_pause_t **out_pause);
完整接口契约(英文)

Quiesce the active GSP render task without destroying its UI state.

On success no new GSP frame can be submitted until esp_gsp_esp_lcd_resume_paused() is called. The function also waits for the shared presenter transfer/present fences to retire. Decoded image caches are released while the scene and source ownership are retained. Resume prepares the current scene again before rendering; a paused UI is not a prepared image-cache snapshot for direct renderer calls. On ESP_ERR_TIMEOUT the original UI remains active and *out_pause is NULL. ESP_ERR_NOT_FINISHED means pause rollback could not restore the original app: *out_pause contains a valid token for retry with resume_paused(). This does not certify quiescence; do not hand the display to another producer. Other failures do not transfer a pause token. A non-NULL out_pause is cleared before argument validation; any previously stored token is not freed.

esp_gsp_esp_lcd_resume_paused()

恢复 Pause Token 对应的同一个 UI。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_resume_paused(esp_gsp_esp_lcd_pause_t *pause, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Resume the exact UI paused by esp_gsp_esp_lcd_pause(), including a temporary app running on a retained hub session. The pause token is consumed on success and the first resumed frame is forced to redraw in full. On failure the token retains the original app for another resume attempt; do not free its borrowed resources or discard the token.

esp_gsp_esp_lcd_resume_paused_prepared()

恢复暂停的 UI,并在首帧前运行准备回调。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_resume_paused_prepared(esp_gsp_esp_lcd_pause_t *pause, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Like resume_paused(), with a render-task callback before the first redraw.

The callback may run even if the first frame fails. It must be safe to call again on retry, and its context must remain valid until recovery completes.

esp_gsp_esp_lcd_prepare_sleep()

暂停 UI 并完成应用待机所需的渲染、显示和解码收尾。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_prepare_sleep(esp_gsp_handle_t gsp, uint32_t timeout_ms, esp_gsp_esp_lcd_pause_t **out_pause);
完整接口契约(英文)

Prepare a retained UI for application-managed standby. This pauses the UI, then parks its decoder, drains accelerator work and cancels active gestures. The application must quiesce its own producers and services.

Call from the application lifecycle task and suspend application producers until resume succeeds. Only ESP_OK certifies that the UI is ready for standby. ESP_ERR_NOT_FINISHED with a token requires a resume retry. Other failures leave the original UI active and clear *out_pause.

Board power and wakeup remain the caller’s responsibility. Posting and acknowledging the render pause, presenter fences and decoder parking share timeout_ms. Dispatching the final callback, accelerator synchronization and rollback may extend the call.

esp_gsp_esp_lcd_detach_paused()

从暂停的 UI 解绑显示与触摸硬件。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_detach_paused(esp_gsp_esp_lcd_pause_t *pause, uint32_t timeout_ms);
完整接口契约(英文)

Detach LCD and touch hardware from a paused UI. On success the BSP may release the panel and touch handles. A borrowed presenter remains owned by its caller, which must stop and delete it before removing its hardware.

Outstanding frame receipts are cancelled on detach. If teardown starts but fails, retain the token and hardware and retry detach. Rebind before resuming a detached UI. Serialize these operations from one task.

timeout_ms budgets the decode and presenter fence waits. Driver teardown may extend the call.

esp_gsp_esp_lcd_rebind_paused()

为暂停的 UI 绑定已初始化的硬件。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_rebind_paused(esp_gsp_esp_lcd_pause_t *pause, const esp_gsp_esp_lcd_config_t *config);
完整接口契约(英文)

Bind newly initialized hardware to a detached UI. Uses the display, presenter, touch and alignment fields of config. The resident task and UI configuration come from the original start. The caller retains ownership of supplied handles and must keep them valid through resume and use.

esp_gsp_esp_lcd_stop_paused()

停止暂停中的独立 UI,成功时消费暂停令牌。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_stop_paused(esp_gsp_esp_lcd_pause_t *pause);
完整接口契约(英文)

Stop a standalone paused UI. Success consumes the token. A temporary app must be resumed before handing back to its hub.

esp_gsp_esp_lcd_suspend()

挂起 UI,同时保留场景和控件状态。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_suspend(esp_gsp_handle_t hub, esp_gsp_esp_lcd_session_t **out_session);
完整接口契约(英文)

Pause a UI while retaining its scenes and component state. Its render task and LCD host remain resident; decoded image surfaces are released. ESP_ERR_NOT_FINISHED means rollback to the hub also failed: *out_session contains a valid session with no temporary app. Retain it and retry with esp_gsp_esp_lcd_resume(session, NULL, …) or destroy it. Other failures do not transfer a session to the caller.

esp_gsp_esp_lcd_trim_session()

回收挂起 Hub 的非活动快照图集,保留 Session 与 UI 所有权。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_trim_session(esp_gsp_esp_lcd_session_t *session, uint32_t timeout_ms, size_t *out_released_bytes);
完整接口契约(英文)

Opt-in release of the inactive viewport snapshot atlas on a suspended Hub. Call before start_on_session(), while the session has no temporary app. Scenes, component state, borrowed sources, fonts and display buffers remain owned as before. Ordinary pause/suspend retain their existing cache policy.

Runs on the resident render task after Presenter transfer/present and accelerator fences. timeout_ms bounds the Presenter wait; task dispatch and accelerator synchronization can take longer. Call from an application task, serializing all lifecycle calls on the session/runtime. Zero timeout is invalid.

Optional out_released_bytes counts atlas payload, excluding allocator overhead; it is set to zero before validation and on failure. Repeated successful calls release zero bytes. Every result retains the session/token and UI ownership; retry or resume after failure. ESP_ERR_NOT_FINISHED means accelerator reads could not be confirmed retired; no atlas is freed. Success invalidates cached pixels and forces a complete resumed frame; later gestures recapture normally.

esp_gsp_esp_lcd_trim_paused()

回收暂停 UI 的非活动快照图集,保留 Pause Token 与 UI 所有权。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_trim_paused(esp_gsp_esp_lcd_pause_t *pause, uint32_t timeout_ms, size_t *out_released_bytes);
完整接口契约(英文)

Same atlas-only operation for the exact UI retained by pause(). The pause token is never consumed; resume_paused() is still required. A token returned with ESP_ERR_NOT_FINISHED is accepted only if its runtime is actually paused and all fences can now retire. See trim_session() for context and timeouts.

esp_gsp_esp_lcd_start_on_session()

在挂起 Hub 的显示宿主上启动应用 Bundle。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start_on_session(esp_gsp_esp_lcd_session_t *session, const esp_gsp_config_t *app_config, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Start an app bundle on a suspended hub’s LCD host. The bundle must match the display width, height and pixel format. A startup failure attempts to resume the hub. Successful recovery consumes the session and returns the startup error; ESP_ERR_NOT_FINISHED means recovery also failed and the session remains owned by the caller with no temporary app. Retry with esp_gsp_esp_lcd_resume(session, NULL, …) or destroy the session. ESP_ERR_INVALID_SIZE means the resident task stack cannot accommodate the new app; create a larger session. Calls rejected by initial argument or session-state validation do not consume the session.

esp_gsp_esp_lcd_start_on_session_prepared()

启动应用,并在第一帧前由驻留渲染任务执行准备回调。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start_on_session_prepared(esp_gsp_esp_lcd_session_t *session, const esp_gsp_config_t *app_config, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Start an app and invoke prepare on the resident render task before the first frame. This is intended for installing generic runtime contributors, event handlers and timers without racing the initial render. Session ownership and failure recovery follow start_on_session().

esp_gsp_esp_lcd_replace_on_session_prepared()

替换临时应用,期间不重新显示 Hub。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_replace_on_session_prepared(esp_gsp_esp_lcd_session_t *session, esp_gsp_handle_t current_app, const esp_gsp_config_t *next_config, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Replace the active temporary app while retaining the suspended hub. Unlike esp_gsp_esp_lcd_resume(), this never reactivates or presents the hub between the two Apps. Startup failure follows start_on_session(): successful hub recovery consumes the session; ESP_ERR_NOT_FINISHED retains an empty session for resume(session, NULL, …) or destruction. Failure to suspend the current app leaves that app and session intact.

esp_gsp_esp_lcd_resume()

停止临时应用并恢复保留的 Hub。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_resume(esp_gsp_esp_lcd_session_t *session, esp_gsp_handle_t app, esp_gsp_handle_t *out_hub);
完整接口契约(英文)

Stop the temporary app, then resume the retained hub and force its first frame to redraw. The session is consumed only on success. Pass NULL for app when no temporary app is active, including recovery after ESP_ERR_NOT_FINISHED. A pause failure leaves the temporary app alive and returns that error. ESP_ERR_NOT_FINISHED means the temporary app is gone but hub recovery failed; retain the session and retry with app=NULL.

esp_gsp_esp_lcd_start_on_session_ex()

在挂起 Hub 上启动应用,并回写 Session 所有权与操作结果。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start_on_session_ex(esp_gsp_esp_lcd_session_t **inout_session, const esp_gsp_config_t *app_config, esp_gsp_handle_t *out_gsp, esp_gsp_esp_lcd_session_result_t *result);
完整接口契约(英文)

Ownership-aware alternatives to the legacy session operations. *inout_session is set to NULL exactly when the SDK consumes the Token; otherwise it remains owned by the caller. Optional result must be initialized with ESP_GSP_ESP_LCD_SESSION_RESULT_INIT() and the exact struct_size. A size mismatch rejects the call before any effects and leaves result intact. With a valid size every return resets/populates result, including validation failure. A NULL result keeps the same error codes and pointer ownership update.

Error codes alone are insufficient for legacy replace(): pause failure and startup failure followed by successful Hub recovery can return the same code. Use outcome and the public App/Hub handles, never probe a consumed Token. On EMPTY after replace/resume clear the destroyed old App Handle before retry. All lifecycle calls on the runtime still require application-task serialization.

esp_gsp_esp_lcd_start_on_session_prepared_ex()

在首帧前准备应用,并回写 Session 所有权与操作结果。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start_on_session_prepared_ex(esp_gsp_esp_lcd_session_t **inout_session, const esp_gsp_config_t *app_config, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp, esp_gsp_esp_lcd_session_result_t *result);
完整接口契约(英文)

Start an App with a prepare callback before its first frame and report Session ownership.

esp_gsp_esp_lcd_replace_on_session_prepared_ex()

替换临时应用,并回写 Session 所有权与新旧应用结果。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_replace_on_session_prepared_ex(esp_gsp_esp_lcd_session_t **inout_session, esp_gsp_handle_t current_app, const esp_gsp_config_t *next_config, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp, esp_gsp_esp_lcd_session_result_t *result);
完整接口契约(英文)

Replace the temporary App, prepare the replacement before its first frame and report Session ownership.

esp_gsp_esp_lcd_resume_ex()

恢复 Hub,并明确报告 Session 是否已被消费。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_resume_ex(esp_gsp_esp_lcd_session_t **inout_session, esp_gsp_handle_t app, esp_gsp_handle_t *out_hub, esp_gsp_esp_lcd_session_result_t *result);
完整接口契约(英文)

Stop the temporary App, resume the Hub and report Session ownership.

esp_gsp_esp_lcd_session_destroy()

销毁没有活动临时应用的挂起 Session。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_session_destroy(esp_gsp_esp_lcd_session_t *session);
完整接口契约(英文)

Destroy a suspended hub and its LCD host when no temporary app is active. Failure retains the session and its resources for destruction retry; after requesting destruction, do not start or resume an app on it. Release borrowed bundle/font/display data only after ESP_OK.

esp_gsp_esp_lcd_start()

创建 ESP-LCD 后端并启动 UI。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start(const esp_gsp_config_t *app_config, const esp_gsp_esp_lcd_config_t *esp_config, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Creation and resource validation use the caller’s stack before the render task starts. See getting-started: the example starts with a 20 KiB main stack; measure the caller’s high-water mark with the actual asset/font workload.

esp_gsp_esp_lcd_start_prepared()

启动 LCD 应用并在渲染任务首帧前执行准备回调。

  • 头文件: include/esp_gsp_esp_lcd.h
  • 返回类型: esp_err_t
esp_err_t esp_gsp_esp_lcd_start_prepared(const esp_gsp_config_t *app_config, const esp_gsp_esp_lcd_config_t *esp_config, esp_gsp_esp_lcd_prepare_cb_t prepare, void *prepare_ctx, esp_gsp_handle_t *out_gsp);
完整接口契约(英文)

Like start(), with an optional callback on the render task before its first frame. Use it to install contributors, event handlers and timers without racing the initial render. A NULL callback is equivalent to start(). If invoked, the callback completes before this function returns, including first-frame failure. Its void return cannot report preparation failures; the returned error covers framework startup and the first render attempt. A context retained by a registered callback must outlive that registration.

Deployable Bundle

Deployable 元数据从借用的 GSPB 字节解析;关闭元数据句柄之前,这些字节必须保持有效。

esp_gsp_deployable_bundle_open()

解析自描述 Deployable GSPB 元数据。

  • 头文件: include/esp_gsp_deployable.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_deployable_bundle_open(const void *data, size_t size, bool verify_crc, esp_gsp_deployable_bundle_t **out_bundle);
完整接口契约(英文)

Opens a borrowed GSPB containing one GMD member for every GSB scene.

The input bytes must be 64-byte aligned and remain immutable and valid until the handle is closed. Pass true to verify CRC (the recommended default). When false, structural validation still runs, and make_config preserves this CRC opt-out for subsequent runtime creation.

esp_gsp_deployable_bundle_get_info()

读取 Deployable Bundle 的尺寸、像素格式和场景信息。

  • 头文件: include/esp_gsp_deployable.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_deployable_bundle_get_info(const esp_gsp_deployable_bundle_t *bundle, esp_gsp_deployable_info_t *out_info);
完整接口契约(英文)

Returns immutable package requirements discovered during open.

esp_gsp_deployable_bundle_make_config()

从 Deployable Bundle 元数据构造运行时配置。

  • 头文件: include/esp_gsp_deployable.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_deployable_bundle_make_config(const esp_gsp_deployable_bundle_t *bundle, esp_gsp_config_t *out_config);
完整接口契约(英文)

Builds an application configuration backed by the opened bundle. disable_bundle_crc reflects the verify_crc argument used when opening; callers may override it before creating the UI.

The deployable handle and its borrowed bytes must outlive the UI instance. Stop the UI before calling esp_gsp_deployable_bundle_close().

esp_gsp_deployable_bundle_action_key()

把场景内数字 CALL ID 解析为稳定动作键。

  • 头文件: include/esp_gsp_deployable.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_deployable_bundle_action_key(const esp_gsp_deployable_bundle_t *bundle, uint16_t scene_id, uint16_t action_id, uint32_t *out_key);
完整接口契约(英文)

Resolves a scene-local numeric CALL id to its stable authored-name key.

esp_gsp_deployable_bundle_close()

释放解析后的 Deployable 元数据。

  • 头文件: include/esp_gsp_deployable.h
  • 返回类型: void
void esp_gsp_deployable_bundle_close(esp_gsp_deployable_bundle_t *bundle);
完整接口契约(英文)

Releases parsed metadata. The borrowed GSPB bytes are never freed.

诊断

诊断计数器用于分析渲染、输入和资源使用;产品状态由应用代码维护。

esp_gsp_heap_stats()

按需读取设备内部 RAM 与 PSRAM 的空闲字节和最大连续块;不支持时返回 false 并清零。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: bool
bool esp_gsp_heap_stats(esp_gsp_heap_stats_t *out_stats);
完整接口契约(英文)

Read device-wide internal/PSRAM heaps on demand, including non-GSP users. Does not allocate or change budgets. Call from task context, not an ISR or every frame: heap inspection traverses allocator metadata. The two heaps are sampled separately; concurrent allocations can change the result. Returns false and zeroes the output on hosts without heap capabilities; also returns false for NULL. An absent PSRAM heap has zero values. These values are not DMA guarantees or a complete scene memory budget.

esp_gsp_image_memory_stats()

读取跨实例的图片缓冲当前值和峰值,区分内部 RAM、PSRAM 和其他内存;传入 sizeof(*out_stats),大小不匹配时返回 false 且不修改输出。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: bool
bool esp_gsp_image_memory_stats(esp_gsp_image_memory_stats_t *out_stats, size_t stats_size);
完整接口契约(英文)

Coherent process-wide snapshot across all GSP instances, including detached decode jobs. Peaks are simultaneous tracked payload high-water marks since process start, not sums of per-scene peaks. Excludes borrowed inputs, custom cache allocators, codec-library private allocations, animation frame buffers, region-decoder buffers, display buffers, stacks and allocator overhead. Input counts each owned submission once; callers must not TAKE one allocation twice. No allocation or heap traversal. Task context only. Pass sizeof(*out_stats). Returns false without modifying output for NULL or a size mismatch; otherwise returns true, including on portable hosts.

esp_gsp_update_error_stats()

读取组件批量更新的失败计数及最近保留的失败阶段、对象和属性;无需开启 profiling,并发遇忙时返回 false 且不修改输出。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: bool
bool esp_gsp_update_error_stats(esp_gsp_handle_t gsp, esp_gsp_update_error_stats_t *out_stats, size_t stats_size);
完整接口契约(英文)

Snapshot set_many/set_properties failures and wrappers routed through them (including set_position), plus Dropdown option-text apply/drop errors. Dropdown errors identify the component; property=0 denotes the option group. Legacy bind setters and other API families are not included. Available in ordinary builds without profiling. Successful setters do not clear the last error. A property absent from the compiled runtime directory cannot be distinguished from an unsupported property: consult the compiler’s schema and declare supported x/y fields dynamic before calling set_position.

The detail record is coherent and best-effort: concurrent readers/writers never wait; a contending writer increments details_dropped instead. Counters are atomic but can include failures newer than the retained detail. This is diagnostic history, not an acknowledgement for a particular command or task. esp_gsp_flush() still waits for a render attempt, not successful updates.

Pass sizeof(*out_stats). On success the known prefix is copied, any extra bytes are zeroed, and struct_size is the copied size. Returns false without touching the output for NULL, a size below sizeof(uint32_t), or a busy record (retry later). Call while the handle is alive, outside ISR context.

esp_gsp_frame_count()

读取启动后的非空闲渲染帧数。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: uint32_t
uint32_t esp_gsp_frame_count(esp_gsp_handle_t gsp);
完整接口契约(英文)

Monotonic count of rendered non-idle frames since startup.

esp_gsp_render_stats()

读取累计渲染帧数和渲染路径耗时;耗时不含 UI 步进中的快照合成。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_render_stats(esp_gsp_handle_t gsp, uint32_t *out_frames, uint64_t *out_busy_us);
完整接口契约(英文)

Read rendered frames and cumulative render-path busy time. With sim_bridge, the frame count tracks host frame publications and busy time is zero. On ESP LCD, the frame count includes viewport snapshots, but busy time excludes their UI-step composition and idle time. Their ratio is not total rendering capacity or CPU utilization.

esp_gsp_transition_stats()

读取各转场路径的累计统计。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_transition_stats(esp_gsp_handle_t gsp, esp_gsp_transition_stats_t *out_stats);

esp_gsp_drag_snapshot_stats()

读取拖拽快照启用、复用及各类跳过原因的累计计数。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_drag_snapshot_stats(esp_gsp_handle_t gsp, esp_gsp_drag_snapshot_stats_t *out_stats);
完整接口契约(英文)

Cumulative List/Grid/MessageList and viewport drag snapshot accounting. Read from a serialized app callback, like the other debug counters.

esp_gsp_region_stats()

读取脏区规划和合并统计。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_region_stats(esp_gsp_handle_t gsp, esp_gsp_region_stats_t *out_stats);

esp_gsp_render_phases()

读取普通渲染路径的光栅化和显示提交时间;提交时间包含硬件同步等待。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_render_phases(esp_gsp_handle_t gsp, uint64_t *out_render_us, uint64_t *out_submit_us);
完整接口契约(英文)

Cumulative rasterization and submission time in the ordinary render path. UI-step viewport snapshots bypass these timers. Submission time includes hardware synchronization waits.

esp_gsp_service_stats()

读取渲染任务服务循环统计。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_service_stats(esp_gsp_handle_t gsp, uint32_t *out_iterations, uint64_t *out_service_us, uint32_t *out_commands);
完整接口契约(英文)

Render-task service-loop profile. Values are zero unless the integration enables the lightweight GSP_PROFILE_SERVICE build instrumentation.

esp_gsp_property_stats()

读取组件属性更新的批次、条目与分层计时统计。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: bool
bool esp_gsp_property_stats(esp_gsp_handle_t gsp, esp_gsp_property_stats_t *out_stats, size_t stats_size);
完整接口契约(英文)

Snapshot the component update counters. Pass sizeof(esp_gsp_property_stats_t) as stats_size; the library fills the common prefix and reports it in struct_size, so a caller built against a different header revision still reads the fields it knows.

Returns true only when this library carries the GSP_PROFILE_SERVICE instrumentation and gsp is valid. An ordinary build has no counters at all: the call then writes stats_size zeroed bytes, sets struct_size, leaves counters_available at 0 and returns false, so a zeroed reading is never mistaken for measured traffic.

Two cases write nothing at all and return false: out_stats is NULL, or stats_size is under sizeof(uint32_t) and so cannot hold even the struct_size and availability prefix. In both the caller’s buffer is left exactly as it was. Every other stats_size is fully written.

Counters are cumulative and wrap; take two snapshots and subtract. Every field is read with a single atomic load, so snapshots do not race with counter updates or report torn values. Fields are sampled one after another and may belong to slightly different moments; this is not an atomic snapshot of the entire pipeline.

Atomic operations use the target toolchain’s implementation. On targets without native support, including 64-bit totals on supported 32-bit SoCs, ESP-IDF helpers use brief interrupt-disabled critical sections or spinlocks. Reads and updates can therefore delay another task; the overhead depends on the target and contention. These helpers do not acquire UI/state mutexes, and this cost only exists in an instrumented build.

esp_gsp_media_stats()

读取图片、动画和 Canvas 流水线统计。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: void
void esp_gsp_media_stats(esp_gsp_handle_t gsp, esp_gsp_media_stats_t *out_stats);

esp_gsp_inject_touch()

注入一条逻辑指针样本,仅用于测试和诊断。

  • 头文件: include/esp_gsp_debug.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_inject_touch(esp_gsp_handle_t gsp, int16_t x, int16_t y, bool pressed);
完整接口契约(英文)

Inject one logical pointer sample. Intended for tests and diagnostics.

高级集成

扩展观察者和专用集成接口支持应用自定义行为与绘制。

esp_gsp_on_extension_event()

通过命令路径注册每实例扩展观察回调,注销后同步再释放上下文。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_extension_event(esp_gsp_handle_t gsp, esp_gsp_extension_cb_t callback, void *user_ctx);
完整接口契约(英文)

Register one per-instance extension observer through the command path. NULL clears it; replacement follows esp_gsp_on_event() lifetime rules. Success confirms queue admission. Keep old contexts alive until a successful unregister/replacement followed by flush on the same active runtime, or successful stop. No replay: APP_CREATED precedes observer registration. This observer is independent of the ordinary business event callback. It runs after the corresponding global hook. Native sim_bridge returns ESP_GSP_ERR_NOT_SUPPORTED for these core extension APIs.

esp_gsp_on_extension_event_ex()

按事件种类和 Canvas 操作过滤实例通知,保持全局钩子独立。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_on_extension_event_ex(esp_gsp_handle_t gsp, esp_gsp_extension_cb_t callback, void *user_ctx, uint32_t event_mask, uint32_t canvas_operation_mask);
完整接口契约(英文)

Filtered variant of esp_gsp_on_extension_event(). event_mask selects ESP_GSP_EXTENSION_MASK_* kinds; canvas_operation_mask further selects ESP_GSP_CANVAS_MASK_* operations within CANVAS_RESULT. Zero masks mute those notifications without freeing the registered context. Unknown bits return ESP_GSP_ERR_INVALID_ARG and leave the old registration intact. Masks and callback/context are copied in one registration command. These filters apply only to this instance observer; global hooks are independent. The ordinary registration function continues to subscribe to all events and Canvas operations known to the runtime. Lifetime/thread rules are identical. Native sim_bridge returns ESP_GSP_ERR_NOT_SUPPORTED.

esp_gsp_canvas_check()

提交带请求编号的直接绘制兼容性检查,不改变目标内容。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_check(esp_gsp_handle_t gsp, uint16_t bind, uint32_t request_id);
完整接口契约(英文)

Queue a non-mutating check of direct-draw target compatibility. The tagged result is delivered to the extension observer/global Canvas hook when the command executes. A successful check is a snapshot, not a reservation. This is an observation stream: commands discarded at shutdown and coalesced frame submissions do not each produce results. Stop producers and flush while the runtime is active when results must be observed.

esp_gsp_canvas_set_draw_cb_ex()

提交带请求编号的绘制注册,通过扩展事件报告执行结果。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: esp_gsp_err_t
esp_gsp_err_t esp_gsp_canvas_set_draw_cb_ex(esp_gsp_handle_t gsp, uint16_t bind, esp_gsp_canvas_draw_cb_t draw_cb, void *user_ctx, uint32_t request_id);
完整接口契约(英文)

Tagged variant of esp_gsp_canvas_set_draw_cb(). Submission returns an ESP_GSP_ERR_* queue result; the extension Canvas result carries GSP_OK or GSP_ERR_* from application on the UI task. The tag is copied, not allocated. Install an observer first (or supply the global hook). No callback/context ownership transfers on submission. A rejected registration leaves the previous drawing intact; its context must remain alive. Like existing bind setters, it addresses the current scene when executed, not a pinned scene at submission. The result reports that actual scene; serialize navigation and producer changes when scene identity matters.

esp_gsp_hook_app_created()

观察内核实例成功初始化,平台显示此时可能尚未接入。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_app_created(esp_gsp_handle_t gsp);
完整接口契约(英文)

Global lifecycle hook after successful core initialization, before platform attachment. A later platform-start failure still destroys this core. Default no-op; observer-only rules above apply. Do not use this notification to start a worker accessing GSP before the public platform start succeeds. On ELF GCC/Clang, override with an ordinary strong definition including this header. Definitions in a static archive need a separately named strong link anchor in the same object or explicit direct/whole-archive linking; -u on the hook alone is insufficient because the default implementation already defines it. All hooks use C linkage. Other toolchains retain defaults and can use instance observers.

esp_gsp_hook_app_destroying()

在成功初始化的实例开始销毁时观察,不转移资源所有权。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_app_destroying(esp_gsp_handle_t gsp);
完整接口契约(英文)

Global hook once before a successfully initialized core is destroyed. The handle is borrowed for this call; do not store it for later use. Partial initialization failures that never emitted APP_CREATED emit neither hook. Resource release callbacks may still follow; free shared application state only after the whole stop/destroy operation has completed.

esp_gsp_hook_scene_changed()

观察已提交的场景切换,不能否决导航。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_scene_changed(esp_gsp_handle_t gsp, uint16_t previous_scene, uint16_t current_scene);
完整接口契约(英文)

Global hook after the scene is committed and before its business event. The change cannot be vetoed; it does not certify that pixels were presented.

esp_gsp_hook_action()

在普通业务回调之前观察声明的 CALL 动作。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_action(esp_gsp_handle_t gsp, const esp_gsp_event_t *event);
完整接口契约(英文)

Global observer of authored CALL actions reaching business dispatch, before the ordinary application handler (also when none is installed). Internally consumed keyboard edits do not reach this hook. It cannot consume or change the borrowed event.

esp_gsp_hook_canvas_result()

观察 Canvas 命令的执行结果,不代表屏幕已经呈现。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_canvas_result(esp_gsp_handle_t gsp, const esp_gsp_canvas_result_t *result);
完整接口契约(英文)

Global observer of Canvas commands processed by the UI core. Not an exactly-once completion API for all queued frames; see canvas_check().

esp_gsp_hook_render_error()

观察受管理渲染入口报告的错误,保留原错误返回和计数。

  • 头文件: include/esp_gsp_extension.h
  • 返回类型: void
void esp_gsp_hook_render_error(esp_gsp_handle_t gsp, gsp_err_t error);
完整接口契约(英文)

Global hook for errors reported by the managed ESP-IDF render loop or the managed simulator session render entry. Direct low-level renderer calls are outside this contract. Reporting supplements existing counters and return values.

esp_gsp_context()

取得当前底层渲染上下文。

  • 头文件: include/esp_gsp_advanced.h
  • 返回类型: gsp_context_t *
gsp_context_t *esp_gsp_context(esp_gsp_handle_t gsp);
完整接口契约(英文)

Return the active low-level rendering context.

可移植 Core 与框架集成

这些底层头文件面向平台适配器、Launcher 和生成的控件目录;普通 ESP-IDF 应用应使用 esp_gsp.h。

gsp_app_create()

创建一个可移植 GSP 应用实例。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_app_create(const gsp_app_config_t *config, gsp_app_t **out_app);

gsp_app_effective_config()

读取应用解析完成后的不可变配置。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: const esp_gsp_effective_config_t *
const esp_gsp_effective_config_t *gsp_app_effective_config(const gsp_app_t *app);

gsp_app_destroy()

销毁可移植 GSP 应用实例。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: void
void gsp_app_destroy(gsp_app_t *app);

gsp_app_apply()

向可移植应用提交一条命令。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_app_apply(gsp_app_t *app, const gsp_app_command_t *command);
完整接口契约(英文)

A goto command returns GSP_ERR_NOT_FOUND for an unloaded scene ID.

gsp_app_step()

让可移植应用推进到指定时间。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: void
void gsp_app_step(gsp_app_t *app, int64_t now_us);

gsp_app_next_deadline_us()

读取应用下一次必须处理的时间点。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: int64_t
int64_t gsp_app_next_deadline_us(const gsp_app_t *app);

gsp_app_feed_pointer()

向可移植应用注入单指指针状态。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: void
void gsp_app_feed_pointer(gsp_app_t *app, int32_t x, int32_t y, bool pressed);
完整接口契约(英文)

Scripted pointer injection (tests, simulators, demos): feeds the classifier directly, bypassing the input interceptor and observer that platform runners route through.

gsp_app_feed_touch()

向可移植应用输入一个多点触摸 Contact。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: void
void gsp_app_feed_touch(gsp_app_t *app, int32_t id, int32_t x, int32_t y, bool pressed);
完整接口契约(英文)

Feeds one contact from a multi-touch source. The portable app keeps the active contact set and routes its centroid through the pointer classifier; platform pinch-aware builds may consume the same contact stream directly.

gsp_app_current_scene()

读取应用当前场景 ID。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: uint16_t
uint16_t gsp_app_current_scene(const gsp_app_t *app);

gsp_app_scene_count()

读取应用包含的场景数量。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: uint16_t
uint16_t gsp_app_scene_count(const gsp_app_t *app);

gsp_app_current_context()

取得当前场景的底层 Context。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: gsp_context_t *
gsp_context_t *gsp_app_current_context(gsp_app_t *app);

gsp_app_scene_context()

取得指定场景的底层 Context。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: gsp_context_t *
gsp_context_t *gsp_app_scene_context(gsp_app_t *app, uint16_t scene);

gsp_app_transition()

读取当前活动转场状态。

  • 头文件: include/gsp/gsp_app.h
  • 返回类型: bool
bool gsp_app_transition(const gsp_app_t *app, gsp_app_transition_t *out_transition);

gsp_drawer_axis_is_y()

判断 Drawer 是否沿 Y 轴移动。

  • 头文件: include/gsp/gsp_component.h
  • 返回类型: bool
static inline bool gsp_drawer_axis_is_y(const gsp_drawer_config_t *config);
完整接口契约(英文)

True when the drawer travels along Y, so callers know which axis of the transform group carries its offset.

gsp_drawer_closed_offset()

计算 Drawer 靠指定边缘关闭时的偏移。

  • 头文件: include/gsp/gsp_component.h
  • 返回类型: int32_t
static inline int32_t gsp_drawer_closed_offset(const gsp_drawer_config_t *config);
完整接口契约(英文)

Transform-group offset that parks the drawer off-screen against its edge; open is always offset zero.

The compiler bakes this same value into the scene’s initial state and the gesture layer measures drag progress against it, so it has to be one definition — a driver and an input layer that disagree about where “closed” is produce a drawer that snaps to the wrong end.

gsp_component_find()

在生成目录中按稳定键解析控件 View。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_find(const gsp_component_directory_t *directory, gsp_runtime_t *runtime, gsp_component_key_t key, gsp_component_view_t *out_view);

gsp_component_get()

从底层控件 View 读取兼容属性。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_get(const gsp_component_view_t *view, gsp_component_prop_kind_t prop, gsp_value_t *out_value);

gsp_component_get_property()

读取控件属性。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_get_property(const gsp_component_view_t *view, gsp_property_key_t property, gsp_value_t *out_value);

gsp_component_get_property_info()

读取控件属性元数据。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_get_property_info(const gsp_component_view_t *view, gsp_property_key_t property, gsp_property_info_t *out_info);

gsp_component_get_property_info_at()

按索引枚举底层控件属性元数据。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_get_property_info_at(const gsp_component_view_t *view, size_t index, gsp_property_info_t *out_info);

gsp_component_set()

在更新事务中设置底层控件兼容属性。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_set(gsp_update_transaction_t *transaction, const gsp_component_view_t *view, gsp_component_prop_kind_t prop, const gsp_value_t *value);

gsp_component_set_property()

设置控件属性。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_set_property(gsp_update_transaction_t *transaction, const gsp_component_view_t *view, gsp_property_key_t property, const gsp_value_t *value);

gsp_component_set_many()

在一个底层更新事务中批量设置兼容属性。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_set_many(gsp_update_transaction_t *transaction, const gsp_component_directory_t *directory, const gsp_component_update_t *updates, size_t count);

gsp_component_set_properties()

在一个底层更新事务中批量设置开放属性键。

  • 头文件: include/gsp/gsp_component_advanced.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_component_set_properties(gsp_update_transaction_t *transaction, const gsp_component_directory_t *directory, const gsp_component_property_update_t *updates, size_t count);

gsp_font_catalog_create()

创建字体目录。

  • 头文件: include/gsp/gsp_font_catalog.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_font_catalog_create(const void *data, size_t size, bool verify_crc, gsp_font_catalog_t **out_catalog);
完整接口契约(英文)

Opens a borrowed GSPB containing GFB members keyed by content_id.

gsp_font_catalog_destroy()

销毁字体目录。

  • 头文件: include/gsp/gsp_font_catalog.h
  • 返回类型: void
void gsp_font_catalog_destroy(gsp_font_catalog_t *catalog);

gsp_font_catalog_find()

在外部字体目录中查找指定字体。

  • 头文件: include/gsp/gsp_font_catalog.h
  • 返回类型: gsp_err_t
gsp_err_t gsp_font_catalog_find(const gsp_font_catalog_t *catalog, uint32_t asset_id, const void **out_data, size_t *out_size);
完整接口契约(英文)

Finds a GFB member by Asset ID (GSP_ERR_NOT_FOUND when absent).

gsp_renderer_profile_snapshot()

读取当前渲染器 Profile 快照。

  • 头文件: include/gsp/gsp_render_profile.h
  • 返回类型: void
void gsp_renderer_profile_snapshot(uint64_t *out_us, uint32_t *out_calls, size_t cap);
完整接口契约(英文)

Copies the per-opcode cumulative render time / call counters (zeros unless the benchmark enables GSP_PROFILE_RENDER). Index = opcode value.

gsp_esp_touch_interrupt_available()

判断 ESP-IDF Touch 适配器能否使用中断。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: bool
static inline bool gsp_esp_touch_interrupt_available(esp_lcd_touch_handle_t handle);

gsp_esp_touch_init()

初始化 ESP-IDF Touch 适配器。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: void
void gsp_esp_touch_init(gsp_esp_touch_t *touch, esp_lcd_touch_handle_t handle, bool interrupt_mode, bool interrupt_required, uint8_t release_confirm_polls, gsp_esp_touch_wake_from_isr_t external_wake_from_isr, void *external_wake_ctx);

gsp_esp_touch_start()

启动ESP-IDF Touch 适配器。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: esp_err_t
esp_err_t gsp_esp_touch_start(gsp_esp_touch_t *touch, gsp_esp_touch_wake_from_isr_t wake_from_isr, void *wake_ctx);

gsp_esp_touch_stop()

停止ESP-IDF Touch 适配器。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: void
void gsp_esp_touch_stop(gsp_esp_touch_t *touch);

gsp_esp_touch_detach()

等待触摸中断退出并解除注册,失败时保留绑定以便重试。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: esp_err_t
esp_err_t gsp_esp_touch_detach(gsp_esp_touch_t *touch);
完整接口契约(英文)

Wait for any owned touch interrupt before giving its handle back to the BSP.

gsp_esp_touch_poll_frame()

轮询一帧多点触摸样本。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: esp_err_t
esp_err_t gsp_esp_touch_poll_frame(gsp_esp_touch_t *touch, gsp_platform_touch_frame_t *out_frame, bool *out_has_sample);

gsp_esp_touch_poll()

轮询一个兼容单指触摸样本。

  • 头文件: include/gsp/platform/esp_gsp_idf_touch.h
  • 返回类型: esp_err_t
esp_err_t gsp_esp_touch_poll(gsp_esp_touch_t *touch, gsp_platform_pointer_t *out_pointer, bool *out_has_sample);