Files
humanInfraredModuletest/include/pir.h
DESKTOP-PUHFO60\dsx2016 bab93d0e36 Add human IR (PIR) module test on GPIO22 with SoftSPI touch and LVGL.
Motion-start count, hold bar, auto polarity, and flashable firmware/cyd package.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 14:46:56 +08:00

17 lines
460 B
C
Raw 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 pir_init();
/** 轮询:检测运动开始边沿,返回本周期是否有一次新感应 */
bool pir_poll_detect();
uint32_t pir_count();
void pir_reset_count();
bool pir_is_active();
/** 原始电平:1=HIGH,0=LOW */
int pir_raw_level();
/** 有人/运动时的有效电平(开机按空闲电平自动判定) */
int pir_active_level();
/** 当前连续有人时长 ms;空闲为 0 */
uint32_t pir_hold_ms();