Sample idle level at boot; OUT on GPIO22, no internal pull fight. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
426 B
C
15 lines
426 B
C
#pragma once
|
||
|
||
#include <stdint.h>
|
||
|
||
void button_init();
|
||
/** 轮询:检测按下边沿,返回本周期是否有一次有效按下 */
|
||
bool button_poll_press();
|
||
uint32_t button_count();
|
||
void button_reset_count();
|
||
bool button_is_down();
|
||
/** 原始电平:1=HIGH,0=LOW */
|
||
int button_raw_level();
|
||
/** 按下时的有效电平:1=HIGH 有效,0=LOW 有效(开机按空闲电平自动判定) */
|
||
int button_active_level();
|