|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The numeric keypad (ui_keypad.h) for a number of the settings schema: opened with the setting's label, unit, range and the decimals of its step, and its OK set through settings_set(), the call the - and + keys end in. More...
#include <stdbool.h>#include <stddef.h>#include "gfx.h"#include "settings.h"#include "ui_keypad.h"Go to the source code of this file.
Enumerations | |
| enum | ui_setkey_result_t { UI_SETKEY_SET = 0 , UI_SETKEY_REFUSED , UI_SETKEY_LOCKED } |
| What an OK on a setting's keypad came to. 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. | |
| bool | ui_setting_keypad_takes (setting_id_t id, float v) |
Whether settings_set() takes v for id as a value the - and. | |
| 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 (ui_keypad.h) for a number of the settings schema: opened with the setting's label, unit, range and the decimals of its step, and its OK set through settings_set(), the call the - and + keys end in.
settings_set() puts a value onto the setting's step inside its range, so a typed value between two steps is set to the nearer one, as the MOTOR & ESC and SUPPLY keypads set it. A value the - and + keys never reach is refused: the keypad stays open and shows, in the warning colour and in place of the range, why (ui_setting_keypad_why()). That is a value between 0 and off_below (a SENSORS shunt of 0.1 to 4.9mΩ: "0 or 5.0 to 1000.0mΩ"; a SENSORS limit of 1 to 9mA: "0 or 10 to 32767mA"), a Sensor SDA pin settings_sense_sda_valid() refuses and a Tap pin settings_tap_pin_valid() refuses (the pins each takes, listed), and the GPIO the other PD mini pin holds. The next key brings the range back.
SPDX-License-Identifier: MIT
| enum ui_setkey_result_t |
What an OK on a setting's keypad came to.
| Enumerator | |
|---|---|
| UI_SETKEY_SET | set through settings_set(); keypad closed |
| UI_SETKEY_REFUSED | refused (ui_keypad_refuse_why()); open |
| UI_SETKEY_LOCKED | the row is held or derived now; nothing set, keypad closed |
| 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.