Threshold Program (Bool Output)
Component Type: Program
Status: Implemented
Overview
CProgThreshold compares input samples against descriptor-configured
threshold values and writes boolean alert results to an output IO.
Supported modes:
above: output1whenx >= highbelow: output1whenx <= lowhysteresis: set whenx >= high, clear whenx <= lowwindow: output1whenlow <= x <= high
Implementation
Program type: callback/process based (no worker thread).
Input/output binding:
source IO must be notify-capable
destination must be a writable output IO with
DTYPE_BOOL
Supported source dtypes:
DTYPE_INT32DTYPE_UINT32DTYPE_FLOAT
Reset behavior:
trigger(CMD_RESET)clears internal hysteresis state.
Configuration
Kconfig
CONFIG_DAWN_PROG_THRESHOLD: enables the threshold program.
YAML
programs:
- id: threshold1
type: threshold
config:
iobind:
- sensor1
- virt_threshold1
mode: 2 # 0=above, 1=below, 2=hysteresis, 3=window
low: 8
high: 12
External Control
ControlIO: not documented.
TriggerIO: supported for reset.