# A101 click decoder candidate

Source: vendor manual printed pages 2–5; source receipt ../manual_evidence_A101.json.

Build locally:

```sh
clang -std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined drill_click.c test_click.c -o /tmp/a101_click_test
/tmp/a101_click_test
```

450 ms is a tunable candidate release-to-release window, not vendor timing. Single-click waits for this window to distinguish double/triple-click; do not use it as an emergency-stop mechanism. An independent immediate fault/stop path remains required.

Supply debounced release edges and drain both channels before admitting new edges. Clock must be monotonic uint32 milliseconds, polled regularly. Handle simultaneous requests centrally; never start hardware directly from these requests. Main triple click requests a mode change. Handpiece triple and all sequences of four or more reject. Reinitialization/cancel discards pending requests; fault/park/power-state transitions must call cancel in eventual integration.

Future runtime adapter: start request goes through validated startup and ds_start prerequisites; pause calls ds_stop; reverse goes through ds_update zero-speed/dwell interlock; mode request only changes actual UI state if ds_set_beginner_mode accepts. Current supervisor permits mode changes only while stopped, an engineering policy requiring reference comparison. Knob, LCD, handpiece protocol, GPIO debounce and target integration are not supplied by this module. No GPIO/PWM calls or motor permission exist here.
