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

The texts of the programmer's overlay. More...

#include "kst_panel.h"
#include <stdio.h>
#include "kst_limits.h"
#include "kst_port.h"
#include "link_pages.h"
#include "ui_card_text.h"
#include "ui_text.h"
#include "kst_panel_int.h"

Macros

#define FIXED_COUNT   ((unsigned)(sizeof(k_fixed) / sizeof(k_fixed[0])))
 The number of rows in k_fixed.
#define START_COUNT   ((unsigned)(sizeof(k_start) / sizeof(k_start[0])))
 The number of rows in k_start.
#define OUT_COUNT   ((unsigned)(sizeof(k_out) / sizeof(k_out[0])))
 The number of rows in k_out.
#define REF_COUNT   ((unsigned)(sizeof(k_ref) / sizeof(k_ref[0])))
 The number of rows in k_ref.
#define SES_COUNT   ((unsigned)(sizeof(k_ses) / sizeof(k_ses[0])))
 The number of rows in k_ses.

Functions

const char * kst_panel_rule_text (unsigned rule)
static bool do_not_use (unsigned id)
 A session result that leaves a servo nobody should use.
void kpn_stay_line (char *out, unsigned n)
 Into out, KST_PANEL_LINE bytes: how many values stay as they are, n.
void kpn_journal_line (char *out, int text, unsigned arg)
 Into out: a line of the interrupted write's record, the GPIO or the port of kst_prog_journal_arg() in arg.
void kpn_kind_line (char *out, int text)
 Into out: what an edited file is, with the fields it gives a value for where the card's side counted them.
static void file_stay_line (char *out, unsigned n)
 Writes the line that says how many values stay as they are after a file load.
void kpn_write_n (char *out, size_t size, unsigned n)
 Into out, size bytes: the title of a write of n values.
int kst_panel_message_lines (const kst_prog_msg_t *m, char out[KST_PANEL_MSG_LINES][KST_PANEL_LINE])

Variables

static const int16_t k_fixed [][2]
 A message's first line and, where it has one, its second.
static const int16_t k_start []
 Text of each kst_link_start_t result.
static const int16_t k_out []
 Text of each kst_link_outcome_t.
static const int16_t k_ref []
 Text of each LINK_KST_REF_* refusal.
static const int16_t k_ses []
 Text of each KST_SES_* session result.
const int16_t kpn_rule [KST_RULE_COUNT]
 A soft limit's words, by rule, in kst_panel_text.c.

Detailed Description

The texts of the programmer's overlay.

The texts of the programmer's overlay for KST and Chaservo servos: the tables from the model's codes to the interface's words, and the lines of a message. The state and the seam are kst_panel_int.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ kpn_journal_line()

void kpn_journal_line ( char * out,
int text,
unsigned arg )

Into out: a line of the interrupted write's record, the GPIO or the port of kst_prog_journal_arg() in arg.

Parameters
outthe text
textthe text id of the line
argthe journal's argument

◆ kpn_kind_line()

void kpn_kind_line ( char * out,
int text )

Into out: what an edited file is, with the fields it gives a value for where the card's side counted them.

Parameters
outthe text
textthe text id of the line

◆ kpn_stay_line()

void kpn_stay_line ( char * out,
unsigned n )

Into out, KST_PANEL_LINE bytes: how many values stay as they are, n.

Parameters
outthe text
nthe number of values

◆ kpn_write_n()

void kpn_write_n ( char * out,
size_t size,
unsigned n )

Into out, size bytes: the title of a write of n values.

Parameters
outthe text
sizethe size of out, bytes
nthe number of values

◆ kst_panel_message_lines()

int kst_panel_message_lines ( const kst_prog_msg_t * m,
char out[KST_PANEL_MSG_LINES][KST_PANEL_LINE] )

A message as the overlay writes it, in the language in force. Returns the lines used, 0 for no message.

◆ kst_panel_rule_text()

const char * kst_panel_rule_text ( unsigned rule)

The line a rule's refusal or warning shows.

Variable Documentation

◆ k_out

const int16_t k_out[]
static
Initial value:
= {
[KST_LINK_OUT_NONE] = TX_KP_O_NONE,
[KST_LINK_OUT_DONE] = TX_KP_O_DONE,
[KST_LINK_OUT_REFUSED] = TX_KP_O_REFUSED,
[KST_LINK_OUT_NACK] = TX_KP_O_NACK,
[KST_LINK_OUT_NO_ANSWER] = TX_KP_O_NO_ANSWER,
[KST_LINK_OUT_RESTARTED] = TX_KP_O_RESTARTED,
[KST_LINK_OUT_DROPPED] = TX_KP_O_DROPPED,
}

Text of each kst_link_outcome_t.

◆ k_ref

const int16_t k_ref[]
static
Initial value:
= {
[LINK_KST_REF_NONE] = TX_KP_O_DONE,
[LINK_KST_REF_BUSY] = TX_KP_R_BUSY,
[LINK_KST_REF_PORT] = TX_KP_R_PORT,
[LINK_KST_REF_UNSAFE] = TX_KP_R_UNSAFE,
[LINK_KST_REF_NOT_PROGRAMMING] = TX_KP_R_NOT_PROGRAMMING,
[LINK_KST_REF_NO_ENABLE] = TX_KP_M_NEED_ENABLE,
[LINK_KST_REF_STAGED] = TX_KP_R_STAGED,
[LINK_KST_REF_START] = TX_KP_R_START,
[LINK_KST_REF_MUST_READ] = TX_KP_R_MUST_READ,
[LINK_KST_REF_NO_IMAGE] = TX_KP_M_NEED_READ,
[LINK_KST_REF_PLAN_RULES] = TX_KP_R_PLAN_RULES,
[LINK_KST_REF_PLAN_R00] = TX_KP_R_PLAN_R00,
[LINK_KST_REF_PLAN_PAIRING] = TX_KP_R_PLAN_PAIRING,
[LINK_KST_REF_PLAN_NO_PATH] = TX_KP_R_PLAN_NO_PATH,
[LINK_KST_REF_NO_PIN] = TX_KP_R_NO_PIN,
[LINK_KST_REF_SUPPLY_RANGE] = TX_KP_R_SUPPLY_RANGE,
[LINK_KST_REF_NO_SUPPLY] = TX_KP_R_NO_SUPPLY,
[LINK_KST_REF_LEAVE_MS] = TX_KP_R_LEAVE_MS,
[LINK_KST_REF_LOCKED] = TX_KP_R_LOCKED,
[LINK_KST_REF_SUPPLY_LOW] = TX_KP_R_SUPPLY_LOW,
}

Text of each LINK_KST_REF_* refusal.

◆ k_ses

const int16_t k_ses[]
static
Initial value:
= {
[KST_SES_OK] = TX_KP_O_DONE,
[KST_SES_BUSY] = TX_KP_ST_BUSY,
[KST_SES_ERR_BUSY] = TX_KP_S_BUSY,
[KST_SES_ERR_ARG] = TX_KP_S_ARG,
[KST_SES_ERR_NO_SERVO] = TX_KP_S_NO_SERVO,
[KST_SES_ERR_NOT_IN_MODE] = TX_KP_S_NOT_IN_MODE,
[KST_SES_ERR_READ] = TX_KP_S_READ,
[KST_SES_ERR_NO_BACKUP] = TX_KP_S_NO_BACKUP,
[KST_SES_ERR_FINGERPRINT] = TX_KP_M_READ_ONLY,
[KST_SES_ERR_LOCKED] = TX_KP_S_LOCKED,
[KST_SES_ERR_BAD_PLAN] = TX_KP_S_BAD_PLAN,
[KST_SES_ERR_UNCONFIRMED] = TX_KP_S_UNCONFIRMED,
[KST_SES_ERR_CHANGED] = TX_KP_S_CHANGED,
[KST_SES_ERR_WRITE_FAILED] = TX_KP_S_WRITE_FAILED,
[KST_SES_ERR_ROLLED_BACK] = TX_KP_S_ROLLED_BACK,
[KST_SES_ERR_TORN] = TX_KP_S_TORN,
[KST_SES_ERR_UNINTENDED] = TX_KP_S_UNINTENDED,
[KST_SES_ERR_VERIFY] = TX_KP_S_VERIFY,
[KST_SES_ERR_DRIVER] = TX_KP_S_DRIVER,
[KST_SES_ERR_ABORTED] = TX_KP_S_ABORTED,
[KST_SES_ERR_NO_PLAN] = TX_KP_R_PLAN_NO_PATH,
[LINK_KST_RESULT_SUPPLY] = TX_KP_S_SUPPLY,
[LINK_KST_RESULT_NO_PATH] = TX_KP_R_PLAN_NO_PATH,
[LINK_KST_RESULT_TOO_COMPLEX] = TX_KP_S_TOO_COMPLEX,
}
@ KST_SES_ERR_DRIVER
Definition kst_session.h:154
@ KST_SES_ERR_TORN
Definition kst_session.h:151
@ KST_SES_ERR_ARG
Definition kst_session.h:136
@ KST_SES_ERR_ROLLED_BACK
Definition kst_session.h:149
@ KST_SES_ERR_ABORTED
Definition kst_session.h:155
@ KST_SES_ERR_WRITE_FAILED
Definition kst_session.h:147
@ KST_SES_ERR_NO_PLAN
Definition kst_session.h:156
@ KST_SES_ERR_NO_SERVO
Definition kst_session.h:137
@ KST_SES_ERR_LOCKED
Definition kst_session.h:142
@ KST_SES_BUSY
Definition kst_session.h:133
@ KST_SES_ERR_NO_BACKUP
Definition kst_session.h:140
@ KST_SES_ERR_FINGERPRINT
Definition kst_session.h:141
@ KST_SES_ERR_UNINTENDED
Definition kst_session.h:152
@ KST_SES_ERR_NOT_IN_MODE
Definition kst_session.h:138
@ KST_SES_ERR_BUSY
Definition kst_session.h:135
@ KST_SES_ERR_VERIFY
Definition kst_session.h:153
@ KST_SES_ERR_READ
Definition kst_session.h:139
@ KST_SES_ERR_CHANGED
Definition kst_session.h:145
@ KST_SES_OK
Definition kst_session.h:132
@ KST_SES_ERR_UNCONFIRMED
Definition kst_session.h:144
@ KST_SES_ERR_BAD_PLAN
Definition kst_session.h:143

Text of each KST_SES_* session result.

◆ k_start

const int16_t k_start[]
static
Initial value:
= {
[KST_LINK_START_OK] = TX_KP_ST_OK,
[KST_LINK_START_DOWN] = TX_KP_ST_DOWN,
[KST_LINK_START_NO_PAGE] = TX_KP_ST_NO_PAGE,
[KST_LINK_START_BUSY] = TX_KP_ST_BUSY,
[KST_LINK_START_ARG] = TX_KP_ST_ARG,
[KST_LINK_START_NO_ENABLE] = TX_KP_M_NEED_ENABLE,
[KST_LINK_START_NO_IMAGE] = TX_KP_M_NEED_READ,
[KST_LINK_START_NO_OP] = TX_KP_ST_NO_OP,
}

Text of each kst_link_start_t result.