|
|
static void | reply (injector_t *in, const char *fmt,...) |
| | Queue one reply line; a full queue drops its oldest.
|
| bool | injector_take_reply (injector_t *in, char *out, size_t n) |
| | The oldest reply.
|
| const char * | inj_gesture_name (inj_gesture_t g) |
| | The gesture's word.
|
| void | injector_init (injector_t *in) |
| | Reset: LISTEN, no contacts, no replies.
|
|
static bool | live (const inj_contact_t *c) |
| | A tap, hold or swipe under way, not yet released.
|
|
static bool | pressing (const inj_contact_t *c) |
| | A gesture under way whose contact the panel has down.
|
|
static unsigned | in_use (const injector_t *in) |
| | Contact ids in use: gestures under way and lifts not yet read.
|
|
static void | contact_end (inj_contact_t *c) |
| | The id is free again; the last point stays for status.
|
| static void | release_contact (inj_contact_t *c) |
| | A gesture under way stops.
|
|
static void | fail_all (injector_t *in, const char *why) |
| | Every contact ends: each gesture under way gets fail why.
|
| static bool | parse_int (const char *s, long *out) |
| | A decimal integer, with an optional minus sign.
|
|
static bool | field (injector_t *in, const char *cmd, const char *tok, const field_t *f, long *out) |
| | Parse tok against f; on failure the error is replied.
|
| static int | take_id (injector_t *in, const char *cmd, char **tok, int *ntok) |
| | Take an id=N off the end of the line.
|
|
static void | cmd_gesture (injector_t *in, inj_gesture_t kind, char **tok, int ntok) |
| | tap, hold and swipe: the checks they share, then the start.
|
|
static void | cmd_status (injector_t *in, uint32_t now_ms) |
| | status: the state, the bus counts and contact 0.
|
|
static void | cmd_contacts (injector_t *in, int ntok) |
| | contacts: every id in use, its gesture, down and point.
|
|
static void | cmd_wiring (injector_t *in, int ntok) |
| | wiring: ask the glue to listen, in LISTEN only.
|
|
static void | cmd_confirm (injector_t *in, char **tok, int ntok) |
| | confirm scl=GP5: go ACTIVE after an ok verdict.
|
|
static void | cmd_release (injector_t *in, char **tok, int ntok) |
| | release [id=N]: one contact, or every one without id=.
|
|
static void | run_line (injector_t *in, char *line, uint32_t now_ms) |
| | Split one line into tokens and run its command.
|
| void | injector_input (injector_t *in, const char *bytes, size_t n, uint32_t now_ms) |
| | Bytes from the host. A full line runs at once.
|
| bool | injector_take_wiring (injector_t *in) |
| | True once after wiring: the glue starts listening to the lines.
|
| void | injector_wiring_done (injector_t *in, const inj_line_result_t *r) |
| | The glue's 500ms of listening, classified.
|
| bool | injector_take_attach (injector_t *in) |
| | True once after confirm: the glue attaches the I2C target.
|
| void | injector_host_closed (injector_t *in) |
| | The host closed the port (DTR, data terminal ready, fell).
|
|
static uint16_t | lerp (uint16_t a, uint16_t b, uint32_t num, uint32_t den) |
| | The point num / den of the way from a to b.
|
|
static long | labs_ (long v) |
| | The magnitude of v.
|
| static bool | swipe_point (const inj_contact_t *c, uint32_t now_ms, uint16_t *x, uint16_t *y) |
| | Where a swipe's next frame puts its contact at now_ms.
|
|
static void | finish (injector_t *in, inj_contact_t *c, uint32_t now_ms) |
| | The lift of contact c was read: done, unless it was released.
|
|
static void | frame_read (injector_t *in, uint32_t now_ms) |
| | The panel acknowledged the frame out at now_ms.
|
|
static plan_t | plan (const inj_contact_t *c, uint32_t now_ms) |
| | Plan contact c's part in a frame published at now_ms.
|
|
static void | publish_next (injector_t *in, uint32_t now_ms) |
| | Publish the next frame when a contact needs one.
|
|
static bool | any_down (const injector_t *in) |
| | A gesture under way has a contact the panel was given.
|
| void | injector_poll (injector_t *in, uint32_t now_ms) |
| | Move the gestures on: frames, acknowledges, timeouts. Call often.
|
| inj_led_t | injector_led (const injector_t *in, uint32_t now_ms) |
| | What the status LED shows at now_ms.
|
The touch injector's commands and gestures (injector.h): the line parser, up to INJ_CONTACTS contacts at once, and the frames that carry them to the panel.
SPDX-License-Identifier: MIT