删除LVGL,屏幕驱动测试完成
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "platform.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize the LCD device and LVGL display pipeline.
|
||||
*/
|
||||
esp_err_t lcd_init_device(void);
|
||||
|
||||
/**
|
||||
* @brief Enable LCD backlight.
|
||||
*/
|
||||
void lcd_backlight_on(void);
|
||||
|
||||
/**
|
||||
* @brief Start the LVGL render loop and show the default screen.
|
||||
*
|
||||
* This function is blocking and is expected to run in a dedicated task.
|
||||
* Calling it while the render loop is already running is a no-op.
|
||||
*/
|
||||
void lcd_start_render_loop(void);
|
||||
|
||||
/**
|
||||
* @brief Request the running LVGL render loop to stop.
|
||||
*
|
||||
* This API is idempotent; calling it when the render loop is not running is safe.
|
||||
* `timeout_ms < 0` is invalid; `0` requests async stop; positive values wait
|
||||
* up to the bound and force-delete the render task on timeout.
|
||||
*/
|
||||
esp_err_t lcd_stop_render_loop(int timeout_ms);
|
||||
|
||||
/**
|
||||
* @brief Queue a LCD presentation request.
|
||||
*
|
||||
* This API is non-blocking and safe to call from non-LVGL tasks.
|
||||
*/
|
||||
esp_err_t lcd_request_presentation(const platform_lcd_presentation_request_t *request);
|
||||
|
||||
/**
|
||||
* @brief Queue a LCD presentation asset preload.
|
||||
*
|
||||
* This API is non-blocking and safe to call from non-LVGL tasks.
|
||||
*/
|
||||
esp_err_t lcd_preheat_presentation(const platform_lcd_presentation_request_t *request);
|
||||
|
||||
/**
|
||||
* @brief Read the LCD presentation completion counter.
|
||||
*
|
||||
* Incremented each time a finite asset-sequence presentation finishes its
|
||||
* configured cycles. Safe to call from non-LVGL tasks.
|
||||
*/
|
||||
uint32_t lcd_presentation_completion_count(void);
|
||||
|
||||
/**
|
||||
* @brief Block until the completion counter advances past @p since_count or
|
||||
* @p timeout_ms elapses.
|
||||
*
|
||||
* Pair with a lcd_presentation_completion_count() snapshot taken before queuing
|
||||
* a finite asset sequence. Returns ESP_OK on completion, ESP_ERR_TIMEOUT on
|
||||
* timeout, ESP_ERR_INVALID_STATE if the LCD is not running or is stopping. A
|
||||
* zero timeout polls once. Safe to call from non-LVGL tasks; never call from
|
||||
* the LVGL render task.
|
||||
*/
|
||||
esp_err_t lcd_wait_presentation_completion(uint32_t since_count, uint32_t timeout_ms);
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
esp_err_t lcd_direct_init_device(void);
|
||||
void lcd_direct_run_blocking_test(void);
|
||||
void lcd_direct_start_render_loop(void);
|
||||
esp_err_t lcd_direct_stop_render_loop(int timeout_ms);
|
||||
esp_err_t lcd_direct_request_presentation(const platform_lcd_presentation_request_t *request);
|
||||
esp_err_t lcd_direct_preheat_presentation(const platform_lcd_presentation_request_t *request);
|
||||
uint32_t lcd_direct_presentation_completion_count(void);
|
||||
esp_err_t lcd_direct_wait_presentation_completion(uint32_t since_count, uint32_t timeout_ms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint16_t color;
|
||||
uint16_t count;
|
||||
} lcd_direct_rle_run_t;
|
||||
|
||||
typedef struct {
|
||||
const lcd_direct_rle_run_t *runs;
|
||||
uint32_t run_count;
|
||||
} lcd_direct_image_t;
|
||||
|
||||
typedef struct {
|
||||
const lcd_direct_rle_run_t *runs;
|
||||
uint32_t run_count;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
} lcd_direct_icon_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t icon_id;
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
} lcd_direct_icon_draw_t;
|
||||
|
||||
#define LCD_DIRECT_NO_ICON 0xFFFFU
|
||||
#define LCD_DIRECT_DEFAULT_ICON_COUNT 5U
|
||||
|
||||
const lcd_direct_image_t *lcd_direct_default_image(void);
|
||||
const lcd_direct_icon_t *lcd_direct_icon(uint16_t icon_id);
|
||||
const lcd_direct_icon_draw_t *lcd_direct_default_icon_sequence(size_t *out_count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "lvgl.h"
|
||||
|
||||
typedef struct {
|
||||
const char *asset_dir;
|
||||
const uint8_t *frame_order;
|
||||
size_t frame_order_count;
|
||||
uint16_t repeat_count;
|
||||
uint32_t frame_ms;
|
||||
bool return_to_idle;
|
||||
} lcd_face_asset_sequence_t;
|
||||
|
||||
/**
|
||||
* @brief Create the default cat-face idle screen on the active LVGL screen.
|
||||
*/
|
||||
esp_err_t lcd_face_create_idle_screen(lv_obj_t *screen);
|
||||
|
||||
/**
|
||||
* @brief Restore the default cat-face idle screen.
|
||||
*/
|
||||
esp_err_t lcd_face_show_idle(lv_obj_t *screen);
|
||||
|
||||
/**
|
||||
* @brief Play a frame sequence from an animation asset directory.
|
||||
*/
|
||||
esp_err_t lcd_face_play_asset_sequence(lv_obj_t *screen, const lcd_face_asset_sequence_t *sequence);
|
||||
|
||||
/**
|
||||
* @brief Preload a frame sequence into the animation cache.
|
||||
*
|
||||
* `decode_budget` limits how many compressed frames are decoded during this
|
||||
* call. Pass `SIZE_MAX` to finish synchronously.
|
||||
*/
|
||||
esp_err_t lcd_face_preheat_asset_sequence(const lcd_face_asset_sequence_t *sequence,
|
||||
size_t decode_budget,
|
||||
bool *out_complete);
|
||||
|
||||
/**
|
||||
* @brief Consume a completed finite asset-sequence signal.
|
||||
*/
|
||||
bool lcd_face_take_completed(bool *out_return_to_idle);
|
||||
Reference in New Issue
Block a user