Loading...
Searching...
No Matches
lwir_state.h
Go to the documentation of this file.
137 uint64_t started_us; ///< now_us() before the first transfer; clock domain is the io provider's.
231bool lwir_state_control(const struct lwir_state_io *io, const struct lwir_control_request *request,
254bool lwir_state_u16(const struct lwir_device_state *state, enum lwir_state_field field, uint16_t *value);
static uint64_t milliseconds(void)
Read elapsed-time evidence unaffected by changes to civil time.
Definition dipla_camera_backend.c:59
bool lwir_state_u16(const struct lwir_device_state *state, enum lwir_state_field field, uint16_t *value)
Decode a validated two-byte big-endian field.
Definition lwir_state.c:412
void lwir_state_read(const struct lwir_state_io *io, struct lwir_device_state *state)
Take a best-effort, read-only snapshot of all device-state fields.
Definition lwir_state.c:159
bool lwir_state_control_read(const struct lwir_state_io *io, enum lwir_control_kind kind, struct lwir_control_result *result)
Read one controllable setting without writing anything.
Definition lwir_state.c:331
bool lwir_state_control(const struct lwir_state_io *io, const struct lwir_control_request *request, struct lwir_control_result *result)
Apply one setting or trigger FFC, then confirm it.
Definition lwir_state.c:366
lwir_state_field
Index of each queried device-state field; also the read order.
Definition lwir_state.h:87
size_t lwir_state_format(const struct lwir_device_state *state, char *output, size_t capacity)
Render a snapshot as key=value evidence lines for the JPEG APP14 segment.
Definition lwir_state.c:430
bool lwir_control_valid(const struct lwir_control_request *request)
Check a control request against the vendor value ranges.
Definition lwir_state.c:231
One requested setting change; validate with lwir_control_valid().
Definition lwir_state.h:181
Outcome of lwir_state_control() or lwir_state_control_read().
Definition lwir_state.h:195
uint16_t readback
Value read back; meaningful only once a read-back reply arrived.
Definition lwir_state.h:198
struct lwir_state_value reply
Status/transport detail of the last step reached.
Definition lwir_state.h:196
One post-capture snapshot of all lwir_state_field values.
Definition lwir_state.h:135
bool requested
True once lwir_state_read() ran; false means no device state exists.
Definition lwir_state.h:139
uint64_t started_us
now_us() before the first transfer; clock domain is the io provider's.
Definition lwir_state.h:137
struct lwir_state_value values[LWIR_STATE_FIELDS]
Indexed by enum lwir_state_field.
Definition lwir_state.h:136
uint64_t finished_us
now_us() after the last attempt; 0 if the io table was unusable.
Definition lwir_state.h:138
int(* transfer)(void *context, bool input, uint16_t address, uint8_t *data, unsigned length, unsigned timeout_ms)
Move length bytes between data and mailbox address.
Definition lwir_state.h:157
bool(* pause)(void *context, unsigned milliseconds)
Sleep about milliseconds; return false to cancel the whole operation.
Definition lwir_state.h:162
uint64_t(* now_us)(void *context)
Current time in microseconds; must be monotonic for budgets to hold.
Definition lwir_state.h:160
Raw result of one mailbox query, kept verbatim as evidence.
Definition lwir_state.h:122
enum lwir_state_status status
Outcome; data is meaningful only for LWIR_STATE_OK.
Definition lwir_state.h:123
uint8_t length
Valid bytes in data (2 or 64); 0 unless a reply was accepted.
Definition lwir_state.h:127
uint8_t device_status
Last status byte read from 0x0200; 0 if none was read.
Definition lwir_state.h:128