76#define TONE_LINK_MINOR 8u
83#define TONE_LINK_SETTLE_MS 500u
89#define TONE_LINK_READ_MS 40u
95#define TONE_LINK_RETRY_MS 5000u
98#define TONE_LINK_STALE_MS 500u
109#define TONE_LINK_WINDOW_STALE_MS 1500u
115#define TONE_LINK_EVENT_GAP_MS 5000u
118#define TONE_LINK_HISTORY 8u
120#define TONE_LINK_SHOWN 4u
123#define TONE_LINK_STATUS_COUNT \
124 ((unsigned)LINK_TN_COUNT - (unsigned)LINK_TN_FLAGS)
126#define TONE_LINK_BEEP_COUNT \
127 ((unsigned)LINK_TN_EVT_FLAGS - (unsigned)LINK_TN_EVT_SEQ + 1u)
130#define TONE_LINK_NO_ANSWER (-1)
131#define TONE_LINK_ACK 0
165#define TONE_LINK_EV_SETUP ((uint16_t)(TONE_LINK_EV_PIN_REFUSED \
166 | TONE_LINK_EV_SETUP_REFUSED \
167 | TONE_LINK_EV_PIN_BUSY))
171 TONE_LINK_OP_NONE = 0,
257 bool refused0, refused1;
261 uint32_t refused0_ms;
270 uint32_t status_asked_ms;
429 TONE_LINK_ROWS_TAP = 0x01,
430 TONE_LINK_ROWS_BEEP = 0x02,
The page map: what the panel can ask the IOmcu for, and set.
#define LINK_TN_CONFIG_COUNT
The set-up, ENABLE to register 6: what a write may change, and what flash keeps.
Definition link_pages.h:1243
One beep as the page reported it.
Definition tone_link.h:193
uint8_t flags
Definition tone_link.h:200
uint16_t bursts
Definition tone_link.h:198
uint16_t carrier_hhz
Definition tone_link.h:199
uint16_t freq_dhz
Definition tone_link.h:197
uint32_t start_ms
Definition tone_link.h:195
uint16_t len_dms
Definition tone_link.h:196
uint16_t seq
Definition tone_link.h:194
One exchange the TONE link asks the caller to make.
Definition tone_link.h:183
uint8_t off
Definition tone_link.h:187
uint16_t regs[4]
Definition tone_link.h:189
bool write
Definition tone_link.h:185
uint8_t n
Definition tone_link.h:188
uint8_t page
Definition tone_link.h:186
The panel's state of the TONE link page.
Definition tone_link.h:245
uint16_t was_flags
Definition tone_link.h:274
uint16_t last
Definition tone_link.h:284
uint8_t hist_at
Definition tone_link.h:290
uint8_t told
Definition tone_link.h:260
uint32_t win_moved_ms
Definition tone_link.h:277
bool page
Definition tone_link.h:247
bool synced
Definition tone_link.h:281
bool win_seen
Definition tone_link.h:275
uint8_t quiet
Definition tone_link.h:283
uint16_t win_last
Definition tone_link.h:276
bool retry0
Definition tone_link.h:258
bool ring_empty
Definition tone_link.h:282
bool up
Definition tone_link.h:246
uint8_t hist_n
Definition tone_link.h:289
uint32_t retry_ms
Definition tone_link.h:262
bool sel_ok
Definition tone_link.h:286
bool busy_nack
Definition tone_link.h:259
uint32_t want_ms
Definition tone_link.h:252
The screen's copy: a plain value the control task fills and the renderer reads.
Definition tone_link.h:217
uint16_t win_periods
Definition tone_link.h:234
bool read
The state and the seven values below come from a status read younger than TONE_LINK_STALE_MS; false,...
Definition tone_link.h:229
bool overrun
Definition tone_link.h:230
uint16_t win_freq_dhz
Definition tone_link.h:233
bool beep
Definition tone_link.h:232
uint16_t glitches
Definition tone_link.h:236
uint32_t missed
Definition tone_link.h:237
uint8_t n
Definition tone_link.h:238
tone_beep_t beeps[TONE_LINK_SHOWN]
Definition tone_link.h:239
uint16_t lost
Definition tone_link.h:235
bool tone
Definition tone_link.h:231
The set-up as SETUP INTERFACES has it.
Definition tone_link.h:134
uint8_t pin
Definition tone_link.h:136
bool enable
Definition tone_link.h:135
uint8_t min_periods
Definition tone_link.h:141
uint8_t split_pct
Definition tone_link.h:139
uint16_t f_min_hz
Definition tone_link.h:137
uint16_t f_max_hz
Definition tone_link.h:138
uint8_t gap_ms
Definition tone_link.h:140
void tone_link_readout(const tone_link_t *t, uint32_t now_ms, tone_readout_t *r)
The screen's copy of everything above, at now_ms.
Definition tone_link.c:869
bool tone_link_next(tone_link_t *t, uint32_t now_ms, tone_link_op_t *op)
The next exchange owed at now_ms, into op; false for none.
Definition tone_link.c:352
bool tone_link_settled(const tone_link_t *t)
Whether nothing is owed: the page holds the set-up asked, less the frames it refused.
Definition tone_link.c:766
unsigned tone_link_f_max(const tone_link_t *t)
The upper end of the tone range asked, for the alerts' text.
Definition tone_link.c:919
tone_link_op_kind_t
The exchange tone_link_next() asks for.
Definition tone_link.h:170
@ TONE_LINK_OP_FRAME1
Definition tone_link.h:174
@ TONE_LINK_OP_FRAME0
Definition tone_link.h:173
@ TONE_LINK_OP_BEEP
Definition tone_link.h:177
@ TONE_LINK_OP_READ_SETUP
Definition tone_link.h:172
@ TONE_LINK_OP_SELECT
Definition tone_link.h:176
@ TONE_LINK_OP_STATUS
Definition tone_link.h:175
#define TONE_LINK_SHOWN
The beeps the readout carries, newest first.
Definition tone_link.h:120
bool tone_link_event_stands(const tone_link_t *t, uint16_t ev)
Whether what ev, one TONE_LINK_EV_* bit, says still holds now.
Definition tone_link.c:697
#define TONE_LINK_HISTORY
The beeps the panel keeps for the screen.
Definition tone_link.h:118
uint32_t tone_link_missed(const tone_link_t *t)
Counts the beeps the panel did not read.
Definition tone_link.c:814
void tone_link_init(tone_link_t *t)
Sets up the tone link state.
Definition tone_link.c:95
void tone_link_event_back(tone_link_t *t, uint16_t ev)
Put back an event tone_link_event() handed out that never reached the band, so it is handed out again...
Definition tone_link.c:758
void tone_link_want(tone_link_t *t, const tone_setup_t *w, uint32_t now_ms)
The set-up SETUP names now.
Definition tone_link.c:165
void tone_link_lost(tone_link_t *t)
The link went: nothing on the page is known, and nothing is read or written until it comes up again.
Definition tone_link.c:102
bool tone_link_held_pin(const tone_link_t *t, int *pin)
The tap's pin the page holds by its last read or write, as the IOmcu reserves it (tone_page_pins()): ...
Definition tone_link.c:924
void tone_link_done(tone_link_t *t, int result, const uint16_t *regs, uint32_t now_ms)
How the exchange tone_link_next() gave went: TONE_LINK_ACK with the registers read (regs,...
Definition tone_link.c:645
#define TONE_LINK_STATUS_COUNT
Registers 8 to 23, as read.
Definition tone_link.h:123
@ TONE_LINK_EV_PIN_REFUSED
The page refused the first frame: the pin, or the tone range.
Definition tone_link.h:149
@ TONE_LINK_EV_SETUP_REFUSED
The page refused the second frame: split, gap or periods.
Definition tone_link.h:151
@ TONE_LINK_EV_OVERRUN
FLAGS says the capture overran: a beep was cut.
Definition tone_link.h:158
@ TONE_LINK_EV_NO_PAGE
The tap is enabled and the IOmcu has no TONE page.
Definition tone_link.h:147
@ TONE_LINK_EV_PIN_BUSY
FLAGS says the pin is not free: a set-up kept in the IOmcu's flash met a binding at boot.
Definition tone_link.h:156
void tone_link_came_up(tone_link_t *t, uint16_t minor, uint32_t now_ms)
An IOmcu answered with protocol minor minor.
Definition tone_link.c:129
unsigned tone_link_f_min(const tone_link_t *t)
The lower end of the tone range asked, for the alerts' text.
Definition tone_link.c:914
uint32_t tone_link_read_count(const tone_link_t *t)
Beeps read since init, and beeps the panel did not read: the ring moved past them,...
Definition tone_link.c:809
uint8_t tone_link_unheld(const tone_link_t *t)
The frames whose values as asked are not the ones the page holds, TONE_LINK_ROWS_*: not written yet,...
Definition tone_link.c:778
uint16_t tone_link_flags(const tone_link_t *t)
FLAGS as last read, 0 before any read.
Definition tone_link.c:819
uint16_t tone_link_event(tone_link_t *t, uint32_t now_ms)
One event for the alert band, which shows one line and replaces it with the next: the most pressing w...
Definition tone_link.c:725
unsigned tone_link_pin(const tone_link_t *t)
The pin and the tone range asked, for the alerts' text.
Definition tone_link.c:909
unsigned tone_link_beeps(const tone_link_t *t, tone_beep_t *out, unsigned max)
The beeps the panel has read, newest first, at most max; how many.
Definition tone_link.c:794
tone_state_t
What the tap is doing, for the screen.
Definition tone_link.h:204
@ TONE_STATE_WAITING
Definition tone_link.h:207
@ TONE_STATE_NO_PAGE
Definition tone_link.h:206
@ TONE_STATE_REFUSED
Definition tone_link.h:209
@ TONE_STATE_STOPPED
Definition tone_link.h:210
@ TONE_STATE_OFF
Definition tone_link.h:205
@ TONE_STATE_RUNNING
Definition tone_link.h:208