rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
settings_rows.c File Reference

SETUP's list rows: a category's settings in schema order, a heading above each section, a part's heading above its rows on SENSORS, and the category's strings after its settings. SENSORS lists the channel rows of a fitted part only (sensors_rows.h). More...

#include "settings_rows_int.h"
#include "sensors_rows.h"
#include "settings_screen.h"
#include "settings_sensors.h"

Data Structures

struct  heading_t

Macros

#define MAX_ROWS   40
 The settings a category holds, at most: SENSORS' 40, 4 FITTED rows and 3 rows for each of 12 channels.
#define N_HEADINGS   ((int)(sizeof(k_headings) / sizeof(k_headings[0])))
#define MAX_ENTRIES   (MAX_ROWS + N_HEADINGS + SET_INA_PARTS + SETTING_TEXT_COUNT)

Functions

static int entries (setting_cat_t cat, settings_row_t *out, int max)
int settings_screen_row_of (setting_cat_t cat, int index)
int settings_screen_text_row (setting_cat_t cat, setting_text_id_t id)
int settings_screen_rows (setting_cat_t cat)
settings_row_t settings_rows_entry (setting_cat_t cat, int index)
 Returns row index of cat's list; a setting of id 0 with every index -1 past the last.
ui_text_id_t settings_rows_heading_text (int heading)
 Returns the words of section heading heading.
int settings_rows_listed (setting_cat_t cat)
 Counts the settings and strings cat lists: its rows less its headings.

Variables

static const heading_t k_headings []

Detailed Description

SETUP's list rows: a category's settings in schema order, a heading above each section, a part's heading above its rows on SENSORS, and the category's strings after its settings. SENSORS lists the channel rows of a fitted part only (sensors_rows.h).

SPDX-License-Identifier: MIT

Function Documentation

◆ settings_rows_entry()

settings_row_t settings_rows_entry ( setting_cat_t cat,
int index )

Returns row index of cat's list; a setting of id 0 with every index -1 past the last.

Parameters
catthe category
indexthe row
Returns
the row

◆ settings_rows_heading_text()

ui_text_id_t settings_rows_heading_text ( int heading)

Returns the words of section heading heading.

Parameters
headingthe heading's index
Returns
the text id

◆ settings_rows_listed()

int settings_rows_listed ( setting_cat_t cat)

Counts the settings and strings cat lists: its rows less its headings.

Parameters
catthe category
Returns
the count

◆ settings_screen_row_of()

int settings_screen_row_of ( setting_cat_t cat,
int index )

The list row that shows the index-th setting of cat (as settings_in_category() orders them), or -1 past the last and for a setting not listed (SENSORS' rows of a part not fitted). A category with section headings has a row for each, above its section, so the row is the index plus the headings above it.

◆ settings_screen_rows()

int settings_screen_rows ( setting_cat_t cat)

The rows of cat's list: its settings, its headings and its strings.

◆ settings_screen_text_row()

int settings_screen_text_row ( setting_cat_t cat,
setting_text_id_t id )

The list row that shows string id of cat, after its settings (settings_texts_in_category()), or -1 for a string not in cat.

Variable Documentation

◆ k_headings

const heading_t k_headings[]
static
Initial value:
= {
{ SET_INA228_EN, TX_SET_HD_I2C },
{ SET_TONE_EN, TX_SET_HD_TAP },
{ SET_VIBE_EN, TX_SET_HD_BALANCE },
{ SET_PDMINI_EN, TX_SET_HD_SUPPLY },
{ SET_HITEC_RX, TX_SET_HD_PROG },
{ SET_INA_FIT_0, TX_SET_HD_INA_PARTS },
}