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

SETUP > SENSORS' list. See sensors_rows.h. More...

#include "sensors_rows.h"
#include <stdio.h>
#include "outputs_screen.h"
#include "sense_limit_link.h"
#include "settings_screen.h"
#include "settings_sensors.h"
#include "ui_text.h"
#include "ui_theme.h"

Functions

void sensors_rows_set_status (uint16_t word)
void sensors_rows_set_limits (uint16_t word)
 Sets the LIMIT rows' marks. A change repaints SETUP.
static bool limit_row (setting_id_t id, int *c)
 Whether a row is a LIMIT row.
sens_part_t sensors_rows_status (int a)
static bool fitted (int a)
bool sensors_rows_listed (setting_id_t id)
int sensors_rows_heading (setting_id_t id)
const char * sensors_rows_title (int a, char *buf, size_t n)
const char * sensors_rows_state (int a)
gfx_color_t sensors_rows_state_color (int a)
bool sensors_rows_unheld (setting_id_t id)
 Whether the row of id is marked.
const char * sensors_rows_why (setting_id_t id)
const char * sensors_rows_alert (char *buf, size_t n, sense_limit_link_ev_t ev, unsigned ch, uint16_t ma, int watch)
 Builds the band's line for a SENSE_LIMIT alert, in the panel's language.
const char * sensors_rows_channel (int c, char *buf, size_t n)
const char * sensors_rows_meter (char *buf, size_t n)
const char * sensors_rows_short (char *buf, size_t n)
int sensors_rows_watcher (uint16_t code)
void sensors_rows_publish_watch (void)

Variables

static uint16_t s_status
static uint16_t s_limits
 The limits' marks as the control task last said: bits 0 to 11 the channels, 12 to 15 sense_limit_st_t.

Detailed Description

SETUP > SENSORS' list. See sensors_rows.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ limit_row()

bool limit_row ( setting_id_t id,
int * c )
static

Whether a row is a LIMIT row.

Parameters
idthe row's setting
cits channel, 0 to 11, for a SENSORS channel row
Returns
true for a LIMIT row

◆ sensors_rows_alert()

const char * sensors_rows_alert ( char * buf,
size_t n,
sense_limit_link_ev_t ev,
unsigned ch,
uint16_t ma,
int watch )

Builds the band's line for a SENSE_LIMIT alert, in the panel's language.

Parameters
bufwhere the line goes.
nthe size of buf, bytes; UI_ALERT_MAX holds every line.
evthe alert, from sense_limit_link_event().
chfor EV_OVER the channel, 0 to 11.
mafor EV_OVER the limit it passed, mA, shown in A to 0.01A.
watchfor EV_OVER the channel's WATCHES option, said in brackets; none for SENS_W_NONE.
Returns
buf; "" for EV_NONE, a channel past 11, or no buffer.

◆ sensors_rows_channel()

const char * sensors_rows_channel ( int c,
char * buf,
size_t n )

Channel c (0 to 11) as the screens name it, "0x41 CH2", into buf; "" for no channel.

◆ sensors_rows_heading()

int sensors_rows_heading ( setting_id_t id)

The part whose heading stands above id, 0 to 3: id is the first row of a fitted part. -1 otherwise.

◆ sensors_rows_listed()

bool sensors_rows_listed ( setting_id_t id)

Whether SETUP lists id: any id that is not a SENSORS row, a FITTED row, and the channel rows of a fitted part.

◆ sensors_rows_meter()

const char * sensors_rows_meter ( char * buf,
size_t n )

The servo rail's INA3221 meter as the reports and the LIMIT RUN line name it: the channel watching the tester's target, "INA3221 0x41 CH2", or "INA3221" with none; into buf.

◆ sensors_rows_publish_watch()

void sensors_rows_publish_watch ( void )

Each programming port's WATCHED BY line on OUTPUTS, from the settings as they stand (outputs_screen_set_port_watch()).

◆ sensors_rows_set_limits()

void sensors_rows_set_limits ( uint16_t word)

Sets the LIMIT rows' marks. A change repaints SETUP.

Parameters
wordsense_limit_link_unheld()'s 12 bits in bits 0 to 11, and sense_limit_link_status() in bits 12 to 15.

◆ sensors_rows_set_status()

void sensors_rows_set_status ( uint16_t word)

The parts' states, sense_map_link_status()'s word: 4 bits a part, part 0 lowest. A change repaints SETUP. 0 at start: every part SENS_PART_UNKNOWN.

◆ sensors_rows_short()

const char * sensors_rows_short ( char * buf,
size_t n )

The same over SERVO's plot and on the TEST card: "INA 0x41 CH2", or "INA3221" with none; into buf.

◆ sensors_rows_state()

const char * sensors_rows_state ( int a)

Part a's state in words, and the colour it is drawn in.

◆ sensors_rows_status()

sens_part_t sensors_rows_status ( int a)

Part a's state as last set.

◆ sensors_rows_title()

const char * sensors_rows_title ( int a,
char * buf,
size_t n )

Part a's heading, "INA3221 0x4n", into buf.

◆ sensors_rows_unheld()

bool sensors_rows_unheld ( setting_id_t id)

Whether the row of id is marked.

Parameters
ida setting id.
Returns
true for a SENSORS row of a part the IOmcu does not read, and for a LIMIT row the IOmcu does not hold (sensors_rows_set_limits()).

◆ sensors_rows_watcher()

int sensors_rows_watcher ( uint16_t code)

The lowest channel with a shunt on a fitted part whose WATCH is the page code code (LINK_SM_WATCH_*), 0 to 11; -1 for none.

◆ sensors_rows_why()

const char * sensors_rows_why ( setting_id_t id)

The line a marked row shows in place of its help.