Transport and clock callbacks driving the mailbox protocol. More...
#include <lwir_state.h>
Data Fields | |
| void * | context |
| Opaque provider state (USBFS session, test fake). | |
| 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. | |
| uint64_t(* | now_us )(void *context) |
| Current time in microseconds; must be monotonic for budgets to hold. | |
| bool(* | pause )(void *context, unsigned milliseconds) |
Sleep about milliseconds; return false to cancel the whole operation. | |
Detailed Description
Transport and clock callbacks driving the mailbox protocol.
All callbacks receive context unchanged. All three function pointers are required; a table with any NULL is rejected as invalid.
Definition at line 147 of file lwir_state.h.
Field Documentation
◆ context
| void* lwir_state_io::context |
Opaque provider state (USBFS session, test fake).
Definition at line 148 of file lwir_state.h.
◆ now_us
| uint64_t(* lwir_state_io::now_us) (void *context) |
Current time in microseconds; must be monotonic for budgets to hold.
Definition at line 160 of file lwir_state.h.
◆ pause
| bool(* lwir_state_io::pause) (void *context, unsigned milliseconds) |
Sleep about milliseconds; return false to cancel the whole operation.
Definition at line 162 of file lwir_state.h.
◆ transfer
| int(* lwir_state_io::transfer) (void *context, bool input, uint16_t address, uint8_t *data, unsigned length, unsigned timeout_ms) |
Move length bytes between data and mailbox address.
- Parameters
-
input True reads from the device into data; false writesdata.timeout_ms Per-transfer limit, never 0 and at most 50 ms.
- Returns
- Bytes transferred. Any value other than
lengthis a failure: -7 means timeout, -10 means cancelled, anything else is an I/O error.
- Warning
- A failed or late write may still have reached the device.
Definition at line 157 of file lwir_state.h.
The documentation for this struct was generated from the following file:
- modules/lwir_cam/lwir_state.h