|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
SETUP > SENSORS: the INA3221 parts' rows of the schema, their migration from the one INA3221 of 0.21, and the map they make. See settings_sensors.h. More...
#include "settings_sensors.h"#include "settings_opts.h"#include <math.h>#include <stddef.h>#include <string.h>Macros | |
| #define | WATCH_OPTS .options = settings_opts_watch, .option_count = (uint8_t)SENS_W_COUNT |
| A WATCHES row's options: list watch of ui_text.def. | |
| #define | AT(id) |
| #define | N_ROWS (SET_INA_CH_LAST - SET_INA_FIT_0 + 1) |
| #define | FIT_ROW(a) |
| #define | CH_ROWS(a, ch, watch_def) |
| #define | PART_ROWS(a, w1) |
Functions | |
| bool | settings_sensors_row (setting_id_t id) |
| const setting_def_t * | settings_sensors_def (setting_id_t id) |
| int | settings_sensors_part (setting_id_t id) |
| uint16_t | settings_sensors_watch_code (int option) |
| void | settings_sensors_unset (float *values) |
| static int | seed (float *values, setting_id_t id, float v) |
| int | settings_sensors_migrate (float *values) |
| int | settings_sensors_watch_option (uint16_t code) |
| The WATCHES option of a SENSE_MAP WATCH value. | |
| uint16_t | settings_sensors_limit_ma (int c) |
Channel c's LIMIT as SENSE_LIMIT's LIMIT_MA takes it. | |
| uint16_t | settings_sensors_dmohm (int c) |
| A channel's shunt as the map carries it. | |
| uint8_t | settings_sensors_fast (void) |
| uint8_t | settings_sensors_fitted (void) |
| uint16_t | settings_sensors_meter_dmohm (void) |
| The shunt of the channel the servo rail's meter reads. | |
| static bool | watches_target (uint16_t code, int target) |
| void | settings_sensors_map (settings_sensors_map_t *m) |
Variables | |
| static const setting_def_t | k_rows [N_ROWS] |
| static const setting_def_t | k_kept [4] |
SETUP > SENSORS: the INA3221 parts' rows of the schema, their migration from the one INA3221 of 0.21, and the map they make. See settings_sensors.h.
SPDX-License-Identifier: MIT
| #define AT | ( | id | ) |
| #define CH_ROWS | ( | a, | |
| ch, | |||
| watch_def ) |
| #define FIT_ROW | ( | a | ) |
| #define PART_ROWS | ( | a, | |
| w1 ) |
| const setting_def_t * settings_sensors_def | ( | setting_id_t | id | ) |
The schema row of id: a SENSORS row, or one of the four kept keys of 0.21; NULL for any other id.
| uint16_t settings_sensors_dmohm | ( | int | c | ) |
A channel's shunt as the map carries it.
| c | the channel |
| uint8_t settings_sensors_fast | ( | void | ) |
settings_sensors_map()'s FAST: the channel watching the servo tester's target, LINK_SM_FAST_NONE for none.
| uint8_t settings_sensors_fitted | ( | void | ) |
The fitted parts: bit a for 0x40 + a.
| uint16_t settings_sensors_limit_ma | ( | int | c | ) |
Channel c's LIMIT as SENSE_LIMIT's LIMIT_MA takes it.
| c | the channel, 0 to 11. |
c out of range. | void settings_sensors_map | ( | settings_sensors_map_t * | m | ) |
The map the values in force make, into m. FAST is the lowest channel with a shunt on a fitted part that watches the servo tester's target: an output, OUT 1 to OUT 8, while the target is OUTPUTS, and PORT n while it is programming port n (SET_SERVO_TARGET n).
| uint16_t settings_sensors_meter_dmohm | ( | void | ) |
The shunt of the channel the servo rail's meter reads.
| int settings_sensors_migrate | ( | float * | values | ) |
After the store is read and its values coerced: every SENSORS value still NAN seeded from the old INA3221 keys and the servo tester's target, as the file comment says. Returns how many were seeded.
| int settings_sensors_part | ( | setting_id_t | id | ) |
The part, 0 to 3, a SENSORS row belongs to; -1 for any other id.
| bool settings_sensors_row | ( | setting_id_t | id | ) |
Whether id is a SENSORS row.
| void settings_sensors_unset | ( | float * | values | ) |
Before the store is read: every SENSORS value set to NAN, a value no store holds, so settings_sensors_migrate() can tell a key the store did not have. values is the model's array of SETTING_COUNT.
| uint16_t settings_sensors_watch_code | ( | int | option | ) |
The SENSE_MAP WATCH value of WATCHES option option; NONE for one out of range.
| int settings_sensors_watch_option | ( | uint16_t | code | ) |
The WATCHES option of a SENSE_MAP WATCH value.
| code | a SENSE_MAP WATCH value. |
|
static |
|
static |