72#define INJ_RES_X 1024u
75#define INJ_LINE_MAX 63u
76#define INJ_REPORT_MS 10u
77#define INJ_ACK_TIMEOUT_MS 100u
78#define INJ_TAP_MS 100u
79#define INJ_MS_MAX 30000u
80#define INJ_SWIPE_STEP_PX 100u
81#define INJ_LIVE_MS 100u
83#define INJ_CONTACTS GT911_EMU_POINTS
87#define INJ_REPLY_LEN 128u
The register file of a GT911 touch controller as an I2C (Inter-Integrated Circuit) target sees it: th...
Which of two wires carries SCL, read from I2C (Inter-Integrated Circuit) traffic the injector only li...
inj_led_t
What the status LED shows.
Definition injector.h:107
@ INJ_LED_DOWN
Definition injector.h:112
@ INJ_LED_LISTEN
Definition injector.h:108
@ INJ_LED_WIRING_BAD
Definition injector.h:109
@ INJ_LED_OFF
Definition injector.h:110
@ INJ_LED_POLLED
Definition injector.h:111
@ INJ_LED_FAILED
Definition injector.h:113
void injector_host_closed(injector_t *in)
The host closed the port (DTR, data terminal ready, fell).
Definition injector.c:549
#define INJ_REPLIES
The replies queued: 8.
Definition injector.h:89
inj_state_t
The injector's state: LISTEN after a reset, ACTIVE once confirmed.
Definition injector.h:92
@ INJ_ACTIVE
Definition injector.h:94
@ INJ_LISTEN
Definition injector.h:93
#define INJ_REPLY_LEN
A reply line's buffer: 128 characters.
Definition injector.h:87
const char * inj_gesture_name(inj_gesture_t g)
The gesture's word.
Definition injector.c:57
bool injector_take_wiring(injector_t *in)
True once after wiring: the glue starts listening to the lines.
Definition injector.c:502
void injector_poll(injector_t *in, uint32_t now_ms)
Move the gestures on: frames, acknowledges, timeouts. Call often.
Definition injector.c:750
void injector_init(injector_t *in)
Reset: LISTEN, no contacts, no replies.
Definition injector.c:70
inj_gesture_t
What a contact is doing.
Definition injector.h:98
@ INJ_G_RELEASE
Definition injector.h:103
@ INJ_G_NONE
Definition injector.h:99
@ INJ_G_SWIPE
Definition injector.h:102
@ INJ_G_HOLD
Definition injector.h:101
@ INJ_G_TAP
Definition injector.h:100
#define INJ_LINE_MAX
Definition injector.h:75
#define INJ_ID_MAX
The highest contact id: ids are 0 to 15.
Definition injector.h:85
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.
Definition injector.c:476
bool injector_take_attach(injector_t *in)
True once after confirm: the glue attaches the I2C target.
Definition injector.c:542
inj_led_t injector_led(const injector_t *in, uint32_t now_ms)
What the status LED shows at now_ms.
Definition injector.c:802
void injector_wiring_done(injector_t *in, const inj_line_result_t *r)
The glue's 500ms of listening, classified.
Definition injector.c:509
bool injector_take_reply(injector_t *in, char *out, size_t n)
The oldest reply.
Definition injector.c:46
The register file and the transfer under way.
Definition gt911_emu.h:92
Definition inj_line_id.h:61
The whole injector: protocol, contacts, frames and replies.
Definition injector.h:139
bool any_read
Definition injector.h:162
uint32_t t_pub
Definition injector.h:155
char replies[INJ_REPLIES][INJ_REPLY_LEN]
Definition injector.h:165
uint8_t r_head
Definition injector.h:166
bool published
Definition injector.h:154
bool withdraw_due
Definition injector.h:156
bool overflow
Definition injector.h:145
uint32_t seen_reads
Definition injector.h:159
bool wiring_running
Definition injector.h:148
char line[INJ_LINE_MAX+1u]
Definition injector.h:143
uint8_t r_count
Definition injector.h:167
bool wiring_wanted
Definition injector.h:149
uint8_t len
Definition injector.h:144
inj_state_t state
Definition injector.h:140
bool pending
Definition injector.h:153
gt911_emu_t emu
Definition injector.h:141
inj_contact_t c[INJ_ID_MAX+1u]
Definition injector.h:152
bool attach_wanted
Definition injector.h:150
bool failed
Definition injector.h:157
uint32_t t_last_read
Definition injector.h:163
inj_line_result_t wiring
Definition injector.h:147
uint32_t seen_acks
Definition injector.h:160
uint32_t seen_product
Definition injector.h:161