Files
voicechecktest/include/sound.h
DESKTOP-PUHFO60\dsx2016 b2052a7771 Add 3-pin whistle sound sensor digital H/L detect on GPIO22.
Touch+LVGL UI shows QUIET/SOUND, pin level, hit count; no dB (digital only).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 13:47:52 +08:00

21 lines
442 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <stdint.h>
void sound_init();
void sound_poll();
/** 当前是否检测到声音(已按 SOUND_ACTIVE_HIGH 解释) */
bool sound_detected();
/** 原始引脚电平:true=HIGH */
bool sound_raw_high();
/** 累计触发次数(边沿,带消抖) */
uint32_t sound_event_count();
/** 最近一次触发后经过的 ms;未触发过为 UINT32_MAX */
uint32_t sound_ms_since_last();
void sound_reset_count();