|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The numeric keypad for a number of the settings schema. See ui_setting_keypad.h. More...
#include "ui_setting_keypad.h"#include <math.h>#include <stdio.h>#include <string.h>#include "link_pages.h"#include "outputs.h"#include "ui_text.h"Enumerations | |
| enum | why_t { WHY_NONE = 0 , WHY_OFF_GAP , WHY_SDA , WHY_TAP , WHY_IDLE_GAP , WHY_FULL_GAP , WHY_PDMINI , WHY_NO_ROW } |
Why ui_setting_keypad_takes() refuses v for id. More... | |
Functions | |
| int | ui_setting_keypad_decimals (setting_id_t id) |
The digits the keypad takes after the point for id. | |
| bool | ui_setting_keypad_offered (setting_id_t id) |
Whether a tap on the value of id opens the keypad. | |
| bool | ui_setting_keypad_signed (setting_id_t id) |
Whether the keypad of id carries the +/- key. | |
| void | ui_setting_keypad_open (ui_keypad_t *k, gfx_rect_t area, setting_id_t id) |
Open k over area for setting id. | |
| static why_t | why_refused (setting_id_t id, float v) |
Sort v for id into taken or the rule that refuses it. | |
| bool | ui_setting_keypad_takes (setting_id_t id, float v) |
Whether settings_set() takes v for id as a value the - and. | |
| static const char * | pins_taken (bool(*valid)(int), char *buf, size_t n) |
The GPIOs valid takes, in rising order with one space between, cut at the last pin that fits whole. | |
| const char * | ui_setting_keypad_sda_pins (char *buf, size_t n) |
| The GPIOs Sensor SDA can have, from settings_sense_sda_valid(). | |
| const char * | ui_setting_keypad_tap_pins (char *buf, size_t n) |
| The GPIOs Tap pin can have, from settings_tap_pin_valid(). | |
| const char * | ui_setting_keypad_why (setting_id_t id, float v, char *buf, size_t n) |
The line a setting's keypad shows in place of the range after refusing v inside it. | |
| ui_setkey_result_t | ui_setting_keypad_ok (ui_keypad_t *k, setting_id_t id, float v) |
Take the value an OK on k handed back for id. | |
The numeric keypad for a number of the settings schema. See ui_setting_keypad.h.
SPDX-License-Identifier: MIT
| enum why_t |
Why ui_setting_keypad_takes() refuses v for id.
|
static |
The GPIOs valid takes, in rising order with one space between, cut at the last pin that fits whole.
| valid | The rule: true for a pin the row takes. |
| buf | Where the list goes. |
| n | The size of buf in bytes. |
buf; "" for a NULL or empty buf. | int ui_setting_keypad_decimals | ( | setting_id_t | id | ) |
The digits the keypad takes after the point for id.
| id | The setting. |
| bool ui_setting_keypad_offered | ( | setting_id_t | id | ) |
Whether a tap on the value of id opens the keypad.
| id | The setting. |
| ui_setkey_result_t ui_setting_keypad_ok | ( | ui_keypad_t * | k, |
| setting_id_t | id, | ||
| float | v ) |
Take the value an OK on k handed back for id.
| k | The keypad that returned UI_KEYPAD_OK. |
| id | The setting it was opened for. |
| v | The value it handed back. |
id, v); UI_SETKEY_REFUSED for a value ui_setting_keypad_takes() refuses, with k open again, marked and showing ui_setting_keypad_why() in place of the range; UI_SETKEY_LOCKED for a row no longer offered (ui_setting_keypad_offered()). | void ui_setting_keypad_open | ( | ui_keypad_t * | k, |
| gfx_rect_t | area, | ||
| setting_id_t | id ) |
Open k over area for setting id.
| k | The keypad. |
| area | Where it is drawn and hit, in the screen's coordinates. |
| id | The setting: its label in the language showing as the title, its unit, its value faint behind the entry, its range and ui_setting_keypad_decimals(); signed by ui_setting_keypad_signed(). Nothing opens for an id ui_setting_keypad_offered() refuses. |
| const char * ui_setting_keypad_sda_pins | ( | char * | buf, |
| size_t | n ) |
The GPIOs Sensor SDA can have, from settings_sense_sda_valid().
| buf | Where the list goes. |
| n | The size of buf in bytes. |
buf, holding the pins in rising order with one space between ("0 4 6 14 16 18 20 26" for the Pico header), cut at the last pin that fits whole; "" for a NULL or empty buf. | bool ui_setting_keypad_signed | ( | setting_id_t | id | ) |
Whether the keypad of id carries the +/- key.
| id | The setting. |
| bool ui_setting_keypad_takes | ( | setting_id_t | id, |
| float | v ) |
Whether settings_set() takes v for id as a value the - and.
| id | The setting. |
| v | The value typed, inside the range the keypad holds it to. |
| const char * ui_setting_keypad_tap_pins | ( | char * | buf, |
| size_t | n ) |
The GPIOs Tap pin can have, from settings_tap_pin_valid().
| buf | Where the list goes. |
| n | The size of buf in bytes. |
buf, holding the pins in rising order with one space between ("0 1 2 4 5 6 7 13 14 15 16 17 18 19 20 21 22" for the Pico header), cut at the last pin that fits whole; "" for a NULL or empty buf. | const char * ui_setting_keypad_why | ( | setting_id_t | id, |
| float | v, | ||
| char * | buf, | ||
| size_t | n ) |
The line a setting's keypad shows in place of the range after refusing v inside it.
| id | The setting. |
| v | The value typed. |
| buf | Where a text with numbers in it goes (the off gap's figures, the Sensor SDA pins). |
| n | The size of buf in bytes; 64 holds every reason. A smaller buf holds the text and as many whole pins as fit. |
buf holding KEYPAD_WHY_OFF with the row's off_below, maximum and unit for a value between 0 and off_below, buf holding KEYPAD_WHY_SDA with the pins for a Sensor SDA pin the bus cannot have, KEYPAD_WHY_TAP with the pins for a Tap pin the module does not bring out, and KEYPAD_WHY_PDMINI for the other PD mini pin's GPIO, in the panel's language.
|
static |
Sort v for id into taken or the rule that refuses it.
| id | The setting. |
| v | The value typed. |