|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Acknowledged write and read sequences over a link port; see link_port.h. More...
Functions | |
| static bool | usable (const link_host_t *h, const link_port_t *port, const link_msg_t *reply) |
| Check that a link exchange has everything it needs. | |
| bool | link_write_acked (link_host_t *h, const link_port_t *port, uint8_t page, uint8_t offset, uint8_t count, const uint16_t *regs, link_msg_t *reply) |
Write count registers of page from offset, one frame of up to LINK_CAN_REGS_PER_FRAME registers per exchange, each acknowledged before the next is sent. | |
| bool | link_read_window (link_host_t *h, const link_port_t *port, uint8_t page, uint8_t offset, uint8_t count, link_msg_t *reply) |
Read count registers of page from offset in one exchange. | |
Acknowledged write and read sequences over a link port; see link_port.h.
SPDX-License-Identifier: MIT
| bool link_read_window | ( | link_host_t * | h, |
| const link_port_t * | port, | ||
| uint8_t | page, | ||
| uint8_t | offset, | ||
| uint8_t | count, | ||
| link_msg_t * | reply ) |
Read count registers of page from offset in one exchange.
True when it was answered; reply is the data or the refusal.
| h | The host state. |
| port | The transport and clock. |
| page | Page number to read. |
| offset | First register within the page. |
| count | Number of registers to read. |
| reply | Receives the data or the refusal. |
| bool link_write_acked | ( | link_host_t * | h, |
| const link_port_t * | port, | ||
| uint8_t | page, | ||
| uint8_t | offset, | ||
| uint8_t | count, | ||
| const uint16_t * | regs, | ||
| link_msg_t * | reply ) |
Write count registers of page from offset, one frame of up to LINK_CAN_REGS_PER_FRAME registers per exchange, each acknowledged before the next is sent.
True when the far end answered every frame sent. reply is then one of two things: an ACK (acknowledge) for the whole window, carrying what the far end stored for each register, or the NACK (negative acknowledge) of the first frame it refused, with that frame's offset. Nothing is sent after a refusal.
False when a frame ended unanswered, when a request is already outstanding on h, or when the window does not fit a page; reply is then not meaningful.
The frames before a refused or unanswered one stay applied at the far end: the transport has no rollback. A page that must change whole is written through pages that prepare it; see LINK_PAGE_BIND.
| h | The host state. |
| port | The transport and clock. |
| page | Page number to write. |
| offset | First register within the page. |
| count | Number of registers, 1 to LINK_MAX_REGS. |
| regs | The count values to write. |
| reply | Receives the ACK or the NACK. |
|
static |
Check that a link exchange has everything it needs.
| h | The host state. |
| port | The transport and clock. |
| reply | Where the answer goes. |