Support 3-pin button module (VCC/GND/OUT) with auto polarity.
Sample idle level at boot; OUT on GPIO22, no internal pull fight. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,5 +8,7 @@ bool button_poll_press();
|
||||
uint32_t button_count();
|
||||
void button_reset_count();
|
||||
bool button_is_down();
|
||||
/** 原始电平:1=HIGH,0=LOW(便于接线排查) */
|
||||
/** 原始电平:1=HIGH,0=LOW */
|
||||
int button_raw_level();
|
||||
/** 按下时的有效电平:1=HIGH 有效,0=LOW 有效(开机按空闲电平自动判定) */
|
||||
int button_active_level();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define CYD_TOUCH_CLK 25
|
||||
#define CYD_TOUCH_CS 33
|
||||
|
||||
// 轻触开关:一脚 → GPIO22,另一脚 → GND(内部上拉,按下为 LOW)
|
||||
// 三脚按键模块 OUT/S → GPIO22(VCC→3.3V,GND→GND)
|
||||
#define BTN_PIN 22
|
||||
|
||||
#define SCREEN_WIDTH 240
|
||||
|
||||
Reference in New Issue
Block a user