|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Reading a board drawing (LINK_ART_DRAWING): the layout link_pages.h gives under LINK_DRAW_*. More...
Go to the source code of this file.
Data Structures | |
| struct | link_draw_pad_t |
| One pad record. More... | |
| struct | link_draw_shape_t |
| One shape record; see link_pages.h for what a to d mean per kind. More... | |
| struct | link_drawing_t |
| A drawing that passed link_drawing_parse(). More... | |
Functions | |
| bool | link_drawing_parse (link_drawing_t *out, const uint8_t *data, uint32_t bytes, const char **why) |
Check bytes of data whole and describe them in out. | |
| bool | link_drawing_pad_at (const link_drawing_t *d, uint8_t i, link_draw_pad_t *out) |
Pad record i, 0 to pads - 1, in the order the drawing lists them. | |
| bool | link_drawing_find_pad (const link_drawing_t *d, uint8_t pad, link_draw_pad_t *out) |
The record of pad number pad. | |
| bool | link_drawing_shape_at (const link_drawing_t *d, uint16_t i, link_draw_shape_t *out) |
Shape record i, 0 to shapes - 1, in drawing order. | |
Reading a board drawing (LINK_ART_DRAWING): the layout link_pages.h gives under LINK_DRAW_*.
A drawing arrives over the link or out of the panel's flash, and either way it is bytes somebody else wrote. It is checked whole before any of it is used: every count against the length, every pad and every shape inside the outline, pads in ascending order, and only the kinds the format names. A drawing with one record out of place is refused, not drawn without it – a board that is drawn is a board an operator wires by.
Nothing is copied. A parsed drawing points into the bytes it was parsed from, which must outlive it.
SPDX-License-Identifier: MIT
| bool link_drawing_find_pad | ( | const link_drawing_t * | d, |
| uint8_t | pad, | ||
| link_draw_pad_t * | out ) |
The record of pad number pad.
False when the drawing has none.
| d | The parsed drawing. |
| pad | The pad number, 1 to 63. |
| out | Receives the record; may be NULL. |
| bool link_drawing_pad_at | ( | const link_drawing_t * | d, |
| uint8_t | i, | ||
| link_draw_pad_t * | out ) |
Pad record i, 0 to pads - 1, in the order the drawing lists them.
| d | The parsed drawing. |
| i | Index of the record, 0 to pads - 1. |
| out | Receives the record. |
| bool link_drawing_parse | ( | link_drawing_t * | out, |
| const uint8_t * | data, | ||
| uint32_t | bytes, | ||
| const char ** | why ) |
Check bytes of data whole and describe them in out.
False, with out zeroed, when anything is out of place; why (may be NULL) then names the first thing found, for a log line, and is never left pointing at nothing.
| out | Receives the description; zeroed on failure. |
| data | The drawing bytes. |
| bytes | Length of data in bytes. |
| why | Receives the reason text on failure; may be NULL. |
| bool link_drawing_shape_at | ( | const link_drawing_t * | d, |
| uint16_t | i, | ||
| link_draw_shape_t * | out ) |
Shape record i, 0 to shapes - 1, in drawing order.
| d | The parsed drawing. |
| i | Index of the record, 0 to shapes - 1. |
| out | Receives the record. |