The TARGET row of a workbench's output card: what the screen drives now, read as protocol pins ("SERVO PWM GPIO 2 GPIO 4", "PROG PORT 1 GPIO
13"), and the control that picks it.
More...
|
| void | ui_target_row_init (ui_target_row_t *t, gfx_rect_t row) |
| | The row at row, with no press.
|
| gfx_rect_t | ui_target_row_value_rect (const ui_target_row_t *t) |
| | The value box: the row less the label's share.
|
| const gfx_font_t * | ui_target_row_font (const ui_target_row_t *t) |
| | The face the row draws its label and its value in.
|
| unsigned | ui_target_row_cells (const ui_target_row_t *t) |
| | How many cells of text the value box holds, in the row's face.
|
| ui_target_ev_t | ui_target_row_event (ui_target_row_t *t, const touch_event_t *evt, bool locked) |
| | A touch event.
|
| void | ui_target_row_cancel (ui_target_row_t *t) |
| | Drop a press under way, as touch events went missing.
|
| void | ui_target_row_render (const ui_target_row_t *t, gfx_canvas_t *c, const char *label, const char *value, bool warn, bool locked) |
| | The row: label at the left, value centred in its box, both in ui_target_row_font().
|
| size_t | ui_target_text (char *out, size_t size, const char *protocol, uint64_t pins, unsigned cells) |
| | protocol pins into out: "SERVO PWM GPIO 2 GPIO 4", with as many pins as fit after the protocol and a space, then "+N" (ui_pinlist()).
|
The TARGET row of a workbench's output card: what the screen drives now, read as protocol pins ("SERVO PWM GPIO 2 GPIO 4", "PROG PORT 1 GPIO
13"), and the control that picks it.
The row is a label on the left and a value box on the right, the shape of a settings row: a tap on the box asks the screen to open its choice of targets. The row takes no press while it is locked – ARMED, a run or a sweep under way, a programmer holding the port: the screen says when – and it still names the target then. It is drawn in the warning colour when the screen says the target is none or not known.
Pure layout, text and touch logic; no state outside the struct.
SPDX-License-Identifier: MIT
| size_t ui_target_text |
( |
char * | out, |
|
|
size_t | size, |
|
|
const char * | protocol, |
|
|
uint64_t | pins, |
|
|
unsigned | cells ) |
protocol pins into out: "SERVO PWM GPIO 2 GPIO 4", with as many pins as fit after the protocol and a space, then "+N" (ui_pinlist()).
With no pin, or no room for one after the protocol, the protocol alone; with a NULL or empty protocol, the pins alone.
- Parameters
-
| out | Where the text goes; NULL writes nothing. |
| size | The bytes at out; 0 writes nothing. |
| protocol | The protocol's name. |
| pins | The pins, bit n for GPIO n. |
| cells | The most characters, ui_target_row_cells(). |
- Returns
- The length written.