Add active buzzer test with SoftSPI touch and LVGL.

GPIO22 digital on/off toggle (default off) and flashable firmware/cyd package.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 13:25:19 +08:00
commit d71ee19edd
23 changed files with 1769 additions and 0 deletions

5
include/buzzer.h Normal file
View File

@@ -0,0 +1,5 @@
#pragma once
void buzzer_init();
void buzzer_set_on(bool on);
bool buzzer_is_on();

1127
include/lv_conf.h Normal file

File diff suppressed because it is too large Load Diff

19
include/pins.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
// CYD ESP32-2432S028R — 触控/屏脚与 tftest 一致
#define TFT_BL_PIN 21
#define CYD_TOUCH_IRQ 36
#define CYD_TOUCH_MOSI 32
#define CYD_TOUCH_MISO 39
#define CYD_TOUCH_CLK 25
#define CYD_TOUCH_CS 33
// 有源蜂鸣器信号脚(高电平响)
#define BUZZER_PIN 22
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
#define UI_HOR_RES 320
#define UI_VER_RES 240

12
include/touch.h Normal file
View File

@@ -0,0 +1,12 @@
#pragma once
#include <lvgl.h>
#include <stdint.h>
void touch_init();
void touch_read_cb(lv_indev_t *indev, lv_indev_data_t *data);
// 调试:最近一次触点(物理 / LVGL 旋转后逻辑)
extern int16_t g_dbg_phys_x, g_dbg_phys_y;
extern int16_t g_dbg_logic_x, g_dbg_logic_y;
extern bool g_dbg_touch_down;

4
include/ui.h Normal file
View File

@@ -0,0 +1,4 @@
#pragma once
void ui_create();
void ui_refresh_buzzer();