Motion-start count, hold bar, auto polarity, and flashable firmware/cyd package. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
460 B
C
17 lines
460 B
C
#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();
|