63#define SENSE_MAP_LINK_SETTLE_MS SENSE_LINK_SETTLE_MS
67#define SENSE_MAP_LINK_READ_MS 500u
69#define SENSE_MAP_LINK_EVENT_GAP_MS SENSE_LINK_EVENT_GAP_MS
71#define SENSE_MAP_LINK_ACK SENSE_LINK_ACK
72#define SENSE_MAP_LINK_NO_ANSWER SENSE_LINK_NO_ANSWER
126 SENSE_MAP_LINK_OP_NONE = 0,
170 uint16_t
ids[LINK_SM_PARTS];
175 bool silent_told[LINK_SM_PARTS];
176 bool online_seen[LINK_SM_PARTS];
244 const uint16_t *regs, uint32_t now_ms);
333 uint8_t *part, uint16_t *
id);
378 unsigned mirror, uint32_t now_ms);
396#define SENS_PART_OF(word, a) ((sens_part_t)(((word) >> (4u * (a))) & 0x0Fu))
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
The page map: what the panel can ask the IOmcu for, and set.
@ LINK_SM_KEPT
Definition link_pages.h:1039
The panel's half of the SENSE (0x2B), SERVO_SENSE (0x2C) and SERVO_WIN (0x31) link pages: what is wri...
sense_map_link_op_kind_t
The kinds of exchange of the SENSE_MAP link.
Definition sense_map_link.h:125
@ SENSE_MAP_LINK_OP_WRITE
Definition sense_map_link.h:128
@ SENSE_MAP_LINK_OP_READ
Definition sense_map_link.h:127
@ SENSE_MAP_LINK_OP_STATUS
Definition sense_map_link.h:129
void sense_map_link_event_back(sense_map_link_t *s, uint8_t ev, uint8_t part)
Put back an event sense_map_link_event() handed out that never reached the band, with the part it nam...
Definition sense_map_link.c:456
void sense_map_link_came_up(sense_map_link_t *s, uint16_t minor, uint32_t now_ms)
An IOmcu answered with protocol minor minor; below LINK_MINOR_SENSE_MAP nothing is sent to it.
Definition sense_map_link.c:72
sens_part_t
What a fitted part is doing, for its heading on SETUP > SENSORS; 4 bits each in sense_map_link_status...
Definition sense_map_link.h:93
@ SENS_PART_WRONG
Definition sense_map_link.h:99
@ SENS_PART_DARK
Definition sense_map_link.h:101
@ SENS_PART_UNKNOWN
Definition sense_map_link.h:94
@ SENS_PART_ONLINE
Definition sense_map_link.h:97
@ SENS_PART_NO_BUS
Definition sense_map_link.h:105
@ SENS_PART_PENDING
Definition sense_map_link.h:95
@ SENS_PART_REFUSED
Definition sense_map_link.h:100
@ SENS_PART_OLD
Definition sense_map_link.h:103
@ SENS_PART_SILENT
Definition sense_map_link.h:98
@ SENS_PART_SAME_ADDR
Definition sense_map_link.h:102
@ SENS_PART_SEARCHING
Definition sense_map_link.h:96
bool sense_map_link_held(const sense_map_link_t *s)
Whether the page holds the map asked: read since link-up, not refused, and nothing owed.
Definition sense_map_link.c:360
void sense_map_link_lost(sense_map_link_t *s)
The link went: nothing on the page is known.
Definition sense_map_link.c:53
uint8_t sense_map_link_event(sense_map_link_t *s, uint32_t now_ms, uint8_t *part, uint16_t *id)
The events since the last call, SENSE_MAP_LINK_EV_*, the lowest bit first, one at a time; 0 for none,...
Definition sense_map_link.c:380
sens_part_t sense_map_link_part(const sense_map_link_t *s, const sense_link_t *sl, unsigned a, unsigned mirror, uint32_t now_ms)
What fitted part a is doing at now_ms, a sens_part_t.
Definition sense_map_link.c:502
bool sense_map_link_in_force(const sense_map_link_t *s)
Whether the IOmcu goes by a map written to it, not the one derived from SENSE: FLAGS' IN_FORCE as las...
Definition sense_map_link.c:366
@ SENSE_MAP_LINK_EV_SILENT
A fitted part does not answer at its address.
Definition sense_map_link.h:81
@ SENSE_MAP_LINK_EV_DARK
A fitted part has every channel off: no map is written.
Definition sense_map_link.h:79
@ SENSE_MAP_LINK_EV_REFUSED
The page refused the map.
Definition sense_map_link.h:77
@ SENSE_MAP_LINK_EV_WRONG
Something answers at a fitted part's address with another identity.
Definition sense_map_link.h:86
void sense_map_link_done(sense_map_link_t *s, int result, const uint16_t *regs, uint32_t now_ms)
How it went: SENSE_MAP_LINK_ACK with the registers read (NULL for a write), a NACK's reason,...
Definition sense_map_link.c:315
bool sense_map_link_event_stands(const sense_map_link_t *s, uint8_t ev, uint8_t part)
Whether the cause of event ev for part part still holds: the map refused, the part dark,...
Definition sense_map_link.c:434
void sense_map_link_want(sense_map_link_t *s, const sense_map_want_t *w, uint32_t now_ms)
The map SENSORS asks for now.
Definition sense_map_link.c:101
uint16_t sense_map_link_status(const sense_map_link_t *s, const sense_link_t *sl, unsigned mirror, uint32_t now_ms)
The four parts' sense_map_link_part(), 4 bits each, part 0 lowest; SENS_PART_UNKNOWN for a part not f...
Definition sense_map_link.c:548
uint16_t sense_map_link_mirror_dmohm(const sense_map_link_t *s, unsigned ch)
The shunt in 0.1mOhm of CH ch (1 to 3) of the part SENSE mirrors, as the page holds the map: the part...
Definition sense_map_link.c:239
void sense_map_link_init(sense_map_link_t *s)
Sets up the SENSE_MAP link state.
Definition sense_map_link.c:25
bool sense_map_link_page(const sense_map_link_t *s)
Whether the IOmcu has the page: up, 4.25 or later, and no read refused.
Definition sense_map_link.c:355
bool sense_map_link_next(sense_map_link_t *s, uint32_t now_ms, bool idle, sense_map_link_op_t *op)
The next exchange owed at now_ms into op; false for none.
Definition sense_map_link.c:173
bool sense_map_link_waits_for_pins(const sense_map_link_t *s, const sense_link_t *sl)
Whether the map waits for SENSE's pins: it enables a part while SENSE has not been read since link-up...
Definition sense_map_link.c:249
bool sense_map_link_take_reread(sense_map_link_t *s)
Whether a write was taken since the last call: SENSE's set-up is to be read again.
Definition sense_map_link.c:371
The panel's state of the SENSE link page.
Definition sense_link.h:386
One exchange the SENSE_MAP link asks the caller to make.
Definition sense_map_link.h:135
const uint16_t * regs
Definition sense_map_link.h:140
The panel's state of the SENSE_MAP link page.
Definition sense_map_link.h:146
bool up
Definition sense_map_link.h:147
uint16_t flags
Definition sense_map_link.h:172
uint8_t ev_parts[4]
Definition sense_map_link.h:177
uint8_t events
Definition sense_map_link.h:178
uint8_t clash
Definition sense_map_link.h:154
uint16_t want[LINK_SM_KEPT]
Definition sense_map_link.h:152
uint16_t wrong_id[LINK_SM_PARTS]
Definition sense_map_link.h:171
bool nobus
Definition sense_map_link.h:156
bool reread
Definition sense_map_link.h:161
bool forced
Definition sense_map_link.h:162
uint8_t dark
Definition sense_map_link.h:153
uint8_t fitted
Definition sense_map_link.h:155
bool page
Definition sense_map_link.h:148
bool known
Definition sense_map_link.h:149
uint32_t told_ms
Definition sense_map_link.h:180
bool told
Definition sense_map_link.h:179
uint16_t ids[LINK_SM_PARTS]
Definition sense_map_link.h:170
bool have_status
Definition sense_map_link.h:169
uint32_t setup_ms
Definition sense_map_link.h:164
uint16_t was_flags
Definition sense_map_link.h:173
uint32_t want_ms
Definition sense_map_link.h:157
bool refused
Definition sense_map_link.h:160
The map SENSORS asks for (settings_sensors_map()).
Definition sense_map_link.h:110
uint8_t dark
Definition sense_map_link.h:112
bool nobus
The sensor bus's SDA or SCL is unset: no part is enabled, as SENSE enables no monitor then.
Definition sense_map_link.h:119
uint16_t regs[LINK_SM_KEPT]
Definition sense_map_link.h:111
uint8_t i228_addr
The INA228's address while it is on, 0 while it is off.
Definition sense_map_link.h:114