|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The programmer for KST and Chaservo servos as the SERVO screen runs it: what is read from a servo, what the operator has changed, and what may be written. More...
#include <stdatomic.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "kst_limits.h"#include "kst_link.h"#include "kst_plan.h"#include "kst_reg.h"Go to the source code of this file.
Data Structures | |
| struct | kst_prog_msg_t |
| The last message the programmer says, with its id, level and argument. More... | |
| struct | kst_prog_restore_t |
| A restore as kst_prog_restore_plan() prepared it. More... | |
| struct | kst_prog_card_req_t |
| A request to the card side. More... | |
| struct | kst_prog_card_done_t |
| The card side's answer to a request. More... | |
| struct | kst_prog_cmd_t |
| One call for the task that owns the link module. More... | |
| struct | kst_prog_gate_t |
| The pass a START needs to be carried out. More... | |
| struct | kst_prog_feed_t |
| What the task that owns the link module publishes, every frame. More... | |
| struct | kst_prog_t |
| The state of the servo programmer. More... | |
Macros | |
| #define | KST_PROG_SUPPLY_MV 5000u |
| The supply an ENTER asks for until it is set otherwise. | |
| #define | KST_PROG_SUPPLY_MA 1000u |
| #define | KST_PROG_WAIT_MS 100u |
| The wait between the end of a session and the first PWM pulse: its default and the highest value taken. | |
| #define | KST_PROG_WAIT_MAX_MS 10000u |
| #define | KST_PROG_FILE_MAX 400u |
| The file text's size, with its terminator. | |
| #define | KST_PROG_PIN_LAST 47u |
| The highest GPIO of the IOmcu (GP0 to GP47), and the pin that is not known. | |
| #define | KST_PROG_NO_PIN 0xFFu |
| #define | KST_PROG_START_MS 2000u |
| A command without an answer from the control task for this long is given up. | |
| #define | KST_PROG_RUN_MS 30000u |
| An operation without an outcome for this long is aborted. | |
| #define | KST_PROG_RUN_MAX_MS 120000u |
| And one the port reports busy for this long from its start is aborted too. | |
| #define | KST_PROG_STORE_MS 3000u |
| The file not written for this long: the write to the servo is not sent. | |
| #define | KST_PROG_FETCH_MS 1000u |
| The time between two fetches of images the port holds. | |
| #define | KST_PROG_FILE_RETRY_MS 5000u |
| A file the card did not take is written again after this long. | |
| #define | KST_PROG_CARD_MS 5000u |
| A save, a list or a load without an end for this long has failed. | |
| #define | KST_PROG_FILES_MAX 5u |
| The files a list holds. | |
| #define | KST_PROG_NAME_MAX 33u |
| A file's name with its terminator. | |
Typedefs | |
| typedef unsigned | kst_prog_msg_id_t |
| What the screen says. | |
Functions | |
| void | kst_prog_gate_init (kst_prog_gate_t *g) |
| Sets up a START gate. | |
| void | kst_prog_gate_offer (kst_prog_gate_t *g, uint32_t id) |
The pass of START id is there to be taken. | |
| bool | kst_prog_gate_claim (kst_prog_gate_t *g, uint32_t id) |
| The link's task, with a START out of its queue: true when the command is to be carried out. | |
| bool | kst_prog_gate_revoke (kst_prog_gate_t *g, uint32_t id) |
The model: true when START id is not carried out and never is. | |
| kst_prog_res_t | kst_prog_result_class (unsigned result) |
The class of result, a kst_ses_t or a LINK_KST_RESULT_ value. | |
| void | kst_prog_init (kst_prog_t *p) |
| Sets up the programmer state. | |
| void | kst_prog_gate_set (kst_prog_t *p, kst_prog_gate_t *g) |
| The gate the link's task claims each START at. | |
| void | kst_prog_feed (kst_prog_t *p, const kst_prog_feed_t *f) |
| The published state of this frame. | |
| bool | kst_prog_take (kst_prog_t *p, kst_prog_cmd_t *out) |
| The next command for the task that owns the link module; false for none. | |
| void | kst_prog_screen_entry (kst_prog_t *p) |
| The screen was entered: ENABLE WRITE TO SERVO goes off. | |
| kst_prog_state_t | kst_prog_state (const kst_prog_t *p) |
| The programmer state. | |
| link_kst_op_t | kst_prog_op (const kst_prog_t *p) |
| The operation on its way or running; LINK_KST_OP_NONE for none. | |
| bool | kst_prog_writing (const kst_prog_t *p) |
| A write, a restore or a release is on its way or runs under this model: the record of it is no interrupted write yet. | |
| unsigned | kst_prog_write_steps (const kst_prog_t *p) |
| The registers that write writes, as this model planned it; 0 when no write runs or the IOmcu alone plans it (a restore with no checked order, a release). | |
| bool | kst_prog_planning (const kst_prog_t *p) |
| The IOmcu plans the order of a write's or a restore's writes: no frame goes to the servo yet. | |
| const kst_prog_msg_t * | kst_prog_message (const kst_prog_t *p) |
| The last message. | |
| bool | kst_prog_have_servo (const kst_prog_t *p) |
| Whether a servo was read. | |
| bool | kst_prog_editable (const kst_prog_t *p) |
| A servo was read, its image passes the fingerprint and is not in doubt: it may be edited and written. | |
| const kst_image_t * | kst_prog_servo (const kst_prog_t *p) |
| The servo's image as last read. | |
| const kst_image_t * | kst_prog_draft (const kst_prog_t *p) |
| The draft image being edited. | |
| bool | kst_prog_write_enabled (const kst_prog_t *p) |
| Whether the write switch is on. | |
| uint8_t | kst_prog_port (const kst_prog_t *p) |
| The programming port. | |
| bool | kst_prog_journal (const kst_prog_t *p) |
| A write was interrupted and the servo was not compared since. | |
| bool | kst_prog_journal_held (const kst_prog_t *p) |
| A record of an interrupted write is held, read back or not: the one RESTORE offers the values of. | |
| bool | kst_prog_journal_other (const kst_prog_t *p) |
| The servo read cannot be the one of the interrupted write: it is on another port, or a register of it holds neither the record's value nor the write's target. | |
| kst_prog_msg_id_t | kst_prog_journal_asks (const kst_prog_t *p) |
| The servo read holds, register for register, the record's image (KST_PROG_MSG_JOURNAL_SAME) or the write's target (KST_PROG_MSG_JOURNAL_DONE), and the record stands: a second servo with the same settings is not told apart from the one of the write. | |
| bool | kst_prog_backup_other (const kst_prog_t *p) |
| The servo read is not the one the session's backup was read from: the two differ in a field no write of the session set out to change. | |
| uint8_t | kst_prog_journal_port (const kst_prog_t *p) |
| The port of the interrupted write, from 0. | |
| uint8_t | kst_prog_journal_pin (const kst_prog_t *p) |
| The GPIO that port drove at the write, or KST_PROG_NO_PIN: not known, or a record of version 1. | |
| unsigned | kst_prog_journal_arg (const kst_prog_t *p) |
| The argument of the journal's messages: the port + 1 in bits 0-7, the pin + 1 in bits 8-15, 0 there when the pin is not known. | |
| bool | kst_prog_in_doubt (const kst_prog_t *p) |
| The servo may hold part of a write: a journal stands, the port asks for a read, an operation timed out, or the session is locked. | |
| bool | kst_prog_first_write (const kst_prog_t *p) |
| No write was sent since the servo was connected: the next asks for the free horn. | |
| bool | kst_prog_backed_up (const kst_prog_t *p) |
| A file holds the servo as this session found it: the next write waits for no save. | |
| const char * | kst_prog_backup_name (const kst_prog_t *p) |
| That file's name; "" while there is none. | |
| bool | kst_prog_no_file (const kst_prog_t *p) |
| A write of this session started with no card in the slot, and no file holds the servo as the session found it: the session's backup is the one copy. | |
| bool | kst_prog_save_first (const kst_prog_t *p) |
| The next write saves the servo as the session found it to a file first. | |
| bool | kst_prog_save_none (const kst_prog_t *p) |
| That write goes without the file: no card is mounted, or the servo may hold other values than the session found and the session's backup, the image the file takes then, is not fetched. | |
| kst_field_set_t | kst_prog_changed (const kst_prog_t *p) |
| The fields in which the draft differs from the servo, register 01's copy of Max. | |
| unsigned | kst_prog_changes (const kst_prog_t *p) |
| The number of fields the draft differs in. | |
| kst_rules_t | kst_prog_rules (const kst_prog_t *p) |
| The rules the draft breaks as an edit of the servo's image. | |
| bool | kst_prog_range (const kst_prog_t *p, kst_field_id_t id, uint16_t *lo, uint16_t *hi) |
The raw values of id the hard rules accept in the draft as it is, as the lowest and the highest. | |
| kst_prog_edit_t | kst_prog_edit (kst_prog_t *p, kst_field_id_t id, uint16_t raw) |
Set a field of the draft to raw. | |
| kst_prog_edit_t | kst_prog_step (kst_prog_t *p, kst_field_id_t id, int dir) |
One raw count up (dir above 0) or down. | |
| kst_rules_t | kst_prog_soft_rules (const kst_prog_t *p) |
| The soft rules the edit that waits asks a confirmation for; 0 while none waits. | |
| const kst_image_t * | kst_prog_soft_base (const kst_prog_t *p) |
| The image the soft rules compare with: the backup of the IOmcu's session, the servo as the session first read it. | |
| kst_field_set_t | kst_prog_soft_fields (const kst_prog_t *p, const kst_image_t *img) |
The fields of img that differ from the servo and are at fault for a soft rule: the rule goes when the field takes the value of kst_prog_soft_base(). | |
| const kst_image_t * | kst_prog_soft_image (const kst_prog_t *p) |
| The image the edit that waits would leave. | |
| void | kst_prog_soft_confirm (kst_prog_t *p) |
| Confirms the waiting soft edit. | |
| void | kst_prog_soft_cancel (kst_prog_t *p) |
| Drops the waiting soft edit. | |
| void | kst_prog_discard (kst_prog_t *p) |
| The draft becomes the servo's image again, and no value counts as confirmed. | |
| kst_prog_msg_id_t | kst_prog_connect (kst_prog_t *p, uint8_t port) |
Take programming port port, from 0, with the supply set by kst_prog_supply_set(). | |
| void | kst_prog_bench_armed (kst_prog_t *p, bool armed) |
| The bench is armed or asked to arm. | |
| bool | kst_prog_port_taken (const kst_link_readout_t *rd) |
| Whether the bench takes no arm by what the link module reads: an operation is on its way or runs, the port is read and is not in PWM, or the page answers and is not read yet (KST_LINK_SYNC). | |
| bool | kst_prog_holds_port (const kst_prog_t *p) |
| Whether nothing but the programmer reaches the port: an operation of this model is on its way or a session is open (ENTERING, PROGRAMMING, WORKING, LEAVING), or kst_prog_port_taken() says so of the readout last fed. | |
| void | kst_prog_supply_set (kst_prog_t *p, uint16_t mv, uint16_t ma) |
What an ENTER asks of the PD mini: mv and its current limit ma. | |
| void | kst_prog_supply_caps (kst_prog_t *p, uint16_t max_mv, uint16_t max_ma) |
| The highest voltage and current limit the operator lets the supply give (the SUPPLY screen's limits), 0 for none. | |
| void | kst_prog_supply_floor (kst_prog_t *p, uint16_t min_mv) |
| The lowest voltage a session runs at, mV; 0 for none. | |
| uint16_t | kst_prog_supply_mv (const kst_prog_t *p) |
| The voltage an ENTER asks for, in mV. | |
| uint16_t | kst_prog_supply_ma (const kst_prog_t *p) |
| The current limit an ENTER asks for, in mA. | |
| kst_prog_msg_id_t | kst_prog_read (kst_prog_t *p) |
| Asks for a read of the servo. | |
| kst_prog_msg_id_t | kst_prog_verify (kst_prog_t *p) |
| Asks for a check of the servo's image. | |
| kst_prog_msg_id_t | kst_prog_enable (kst_prog_t *p, bool on) |
| The switch. | |
| kst_prog_msg_id_t | kst_prog_enable_check (const kst_prog_t *p) |
| What kst_prog_enable() would refuse the switch for, and nothing said; KST_PROG_MSG_NONE where it goes on. | |
| bool | kst_prog_restore_only (const kst_prog_t *p) |
| The session is locked and its backup is held: the switch is taken with no servo read, and the restore of that backup is the one write that goes. | |
| kst_prog_msg_id_t | kst_prog_write_check (kst_prog_t *p) |
| Whether kst_prog_write() would be sent, without sending it. | |
| kst_prog_msg_id_t | kst_prog_write (kst_prog_t *p) |
| Write the draft. | |
| kst_prog_msg_id_t | kst_prog_release_check (kst_prog_t *p) |
| The same for kst_prog_release(). | |
| kst_prog_msg_id_t | kst_prog_release (kst_prog_t *p) |
| Releases the servo. | |
| bool | kst_prog_restore_offered (const kst_prog_t *p, kst_prog_from_t from) |
Whether from holds an image that differs from the servo. | |
| kst_prog_msg_id_t | kst_prog_restore_plan (kst_prog_t *p, kst_prog_from_t from, kst_prog_restore_t *out) |
| Prepare a restore. | |
| kst_prog_msg_id_t | kst_prog_restore (kst_prog_t *p, const kst_prog_restore_t *plan) |
| Run the restore prepared. | |
| void | kst_prog_forget (kst_prog_t *p) |
| Discard the journal. | |
| bool | kst_prog_run_hold (kst_prog_t *p) |
| Hold the servo as read now as the run's. | |
| void | kst_prog_run_written (kst_prog_t *p) |
| The run's first write was sent, whether it ended well or not: the file it saved, if any, holds the servo as held. | |
| void | kst_prog_run_close (kst_prog_t *p) |
| The run is over: the servo stays held for RESTORE, and a later session's first write saves its own file again. | |
| void | kst_prog_run_drop (kst_prog_t *p) |
| Nothing held. | |
| const kst_image_t * | kst_prog_run_image (const kst_prog_t *p) |
| The servo the run held, or NULL. | |
| const char * | kst_prog_run_backup (const kst_prog_t *p) |
| The file of that servo; "" for none: no card, or the first write not ended yet. | |
| bool | kst_prog_run_matches (const kst_prog_t *p) |
| The servo read differs from the run's in LEFT ANGLE, RIGHT ANGLE, PULSE LOWER and PULSE UPPER at most. | |
| kst_prog_msg_id_t | kst_prog_leave (kst_prog_t *p) |
| End the session: the port goes back to PWM and the supply stays as it is. | |
| bool | kst_prog_wait_set (kst_prog_t *p, uint32_t ms) |
| The wait between the end of a session and the first PWM pulse, up to KST_PROG_WAIT_MAX_MS. | |
| uint16_t | kst_prog_wait_ms (const kst_prog_t *p) |
| The wait before the first PWM pulse. | |
| void | kst_prog_abort (kst_prog_t *p) |
| The operator's cancel. | |
| kst_prog_msg_id_t | kst_prog_save (kst_prog_t *p, const char *name) |
Save the servo's image to a new file with name. | |
| kst_prog_msg_id_t | kst_prog_files (kst_prog_t *p, unsigned first) |
Ask for the list of files from file first on, counted from 0: up to KST_PROG_FILES_MAX of them. | |
| unsigned | kst_prog_files_first (const kst_prog_t *p) |
| The number of the last list's first file among the card's. | |
| kst_prog_msg_id_t | kst_prog_load (kst_prog_t *p, const char *name) |
Load the file with name into the draft. | |
| bool | kst_prog_card_busy (const kst_prog_t *p) |
| A save, a list or a load is on its way. | |
| uint32_t | kst_prog_files_seq (const kst_prog_t *p) |
| The sequence number of the file list. | |
| const char * | kst_prog_file_name (const kst_prog_t *p, unsigned i) |
The names of the last list, i from 0; "" beyond them. | |
| unsigned | kst_prog_file_type (const kst_prog_t *p, unsigned i) |
| That file's servo type as the card's side gave it; 0 none. | |
| unsigned | kst_prog_file_count (const kst_prog_t *p, unsigned *total) |
The entries of the last list and, when total is not NULL, the servo files on the card. | |
| const char * | kst_prog_preset_name (const kst_prog_t *p) |
| The next preset name as the last list gave it; "" when none is left. | |
| const char * | kst_prog_card_name (const kst_prog_t *p) |
| The file last saved or asked for. | |
| kst_prog_file_kind_t | kst_prog_load_kind (const kst_prog_t *p) |
| What the file last loaded is. | |
| unsigned | kst_prog_load_named (const kst_prog_t *p, unsigned *fields) |
The fields the file last loaded gives a value for, and through fields, when not NULL, the named fields a file has: 0 where the card's side did not count them. | |
| kst_field_set_t | kst_prog_load_skipped (const kst_prog_t *p) |
| The fields in which the file in the draft differs from the servo and that are never written; 0 once the servo is read again or the draft is discarded. | |
| bool | kst_prog_soft_is_load (const kst_prog_t *p) |
| The edit that waits for kst_prog_soft_confirm() is a file. | |
| bool | kst_prog_card_take (kst_prog_t *p, kst_prog_card_req_t *out) |
| A request for the card's side; false while there is none. | |
| void | kst_prog_card_done (kst_prog_t *p, const kst_prog_card_done_t *done) |
| What the card's side made of it. | |
| size_t | kst_prog_file_take (kst_prog_t *p, char *out, size_t n) |
The file text is to be written: fill out and return its length; 0 while nothing is to be written or n is too small. | |
| void | kst_prog_file_done (kst_prog_t *p, bool ok) |
| How the write of the text kst_prog_file_take() gave went. | |
| bool | kst_prog_file_whole (const char *text, size_t len) |
Whether text is a whole file: its version, its lines and its check value. | |
| bool | kst_prog_file_load (kst_prog_t *p, const char *text, size_t len) |
| The file as found at start. | |
| size_t | kst_prog_file_text (const kst_prog_t *p, char *out, size_t n) |
| The text of the state as it is, for a caller that only reads. | |
The programmer for KST and Chaservo servos as the SERVO screen runs it: what is read from a servo, what the operator has changed, and what may be written.
The session with the servo runs at the IOmcu and the panel's link module (kst_link.h) carries its operations. This file sits between that module and the screen:
The journal: before a write the image the servo holds, the port and the GPIO that port drives are recorded, in memory and in the file text (kst_prog_file_text()). A write that ends with the servo verified clears it. A journal that stands after a link loss, a restart or an abort says the servo may hold part of a write; the next read compares the servo with the recorded image.
Servo files: the card keeps images of servos in named files. This file asks for a save, a list and a load (kst_prog_card_take()) and takes what the card's side made of it (kst_prog_card_done()), as images and names: the text of a file, its name's rules and the servo type's rule are the card side's (kst_card.h).
The journal's file text, at most KST_PROG_FILE_MAX bytes:
RCBENCH KST 2 journal=<64 hexadecimal digits> the image before a write, when one is recorded target=<64 hexadecimal digits> what that write was to leave port=<1 hexadecimal digit> pin=<2 hexadecimal digits> the GPIO the port drove, FF not known check=<4 hexadecimal digits> CRC-16/CCITT of the bytes before
A text of version 1 ("RCBENCH KST 1", no pin line) is read as one whose pin is not known. A pin above KST_PROG_PIN_LAST reads as not known: the record stands and names its port. The text written is version 2.
Pure C. The caller hands in kst_prog_feed_t every frame and carries out the commands kst_prog_take() gives. One task only.
SPDX-License-Identifier: MIT
| #define KST_PROG_RUN_MAX_MS 120000u |
And one the port reports busy for this long from its start is aborted too.
A chosen value: the longest wait of the port is the 10000ms of a LEAVE, and the duration of the longest write is not measured.
| #define KST_PROG_RUN_MS 30000u |
An operation without an outcome for this long is aborted.
The time counts from the last feed in which the port reported it busy.
| typedef unsigned kst_prog_msg_id_t |
What the screen says.
The four ranges at the end take a code of the link module or the core: KST_PROG_MSG_START + kst_link_start_t, KST_PROG_MSG_OUT + kst_link_outcome_kind_t, KST_PROG_MSG_REF + link_kst_refusal_t and KST_PROG_MSG_SES + the result byte of the outcome (a kst_ses_t or a LINK_KST_RESULT_*). A message is a number and not an enum for that reason: most of its values lie between the names.
| anonymous enum |
The message ids of the programmer's screen.
| Enumerator | |
|---|---|
| KST_PROG_MSG_READ | all registers read |
| KST_PROG_MSG_READ_ONLY | read; the fingerprint fails |
| KST_PROG_MSG_WRITTEN | arg values written and verified |
| KST_PROG_MSG_VERIFIED | the servo holds what was read |
| KST_PROG_MSG_VERIFY_DIFF | arg registers differ |
| KST_PROG_MSG_LEFT | the tester has the output again |
| KST_PROG_MSG_SAVED | the servo's image is in the file kst_prog_card_name() |
| KST_PROG_MSG_CARD_NONE | no card: no file, nothing written |
| KST_PROG_MSG_STORE_FAILED | the card took no journal; nothing was written to the servo |
| KST_PROG_MSG_FILE_BAD | the journal's file is not readable |
| KST_PROG_MSG_JOURNAL | a write was interrupted; read. arg: kst_prog_journal_arg() |
| KST_PROG_MSG_JOURNAL_SAME | the servo holds what the record says it held before the write; the record stands and asks whether this is the servo. arg: as for KST_PROG_MSG_JOURNAL |
| KST_PROG_MSG_JOURNAL_DONE | the same for the write's target |
| KST_PROG_MSG_JOURNAL_DIFF | the servo holds something else |
| KST_PROG_MSG_FORGOTTEN | the journal was discarded |
| KST_PROG_MSG_EDIT_HARD | arg: the kst_rule_t that refuses |
| KST_PROG_MSG_EDIT_LOCKED | the field is not editable |
| KST_PROG_MSG_NEED_ENABLE | ENABLE WRITE TO SERVO is off |
| KST_PROG_MSG_NEED_READ | read the servo first |
| KST_PROG_MSG_NEED_PORT | no servo is connected |
| KST_PROG_MSG_NO_RESTORE | the servo holds that image already |
| KST_PROG_MSG_RESTORE_REFUSED | arg: the kst_rule_t that refuses |
| KST_PROG_MSG_STOPPED | STOP: the operation was aborted |
| KST_PROG_MSG_TIMEOUT | no outcome within KST_PROG_RUN_MS |
| KST_PROG_MSG_JOURNAL_OTHER | the servo read is not the journal's; arg: as for KST_PROG_MSG_JOURNAL |
| KST_PROG_MSG_CARD_FULL | no space on the card, or no preset name is left |
| KST_PROG_MSG_CARD_WRITE | the file was not written whole |
| KST_PROG_MSG_CARD_READ | the card was not read |
| KST_PROG_MSG_NO_FILES | the card holds no servo file |
| KST_PROG_MSG_NAME_BAD | the card's side does not take the name |
| KST_PROG_MSG_NAME_EXISTS | a file has the name; none is replaced |
| KST_PROG_MSG_LOAD_BAD | the file is not whole; arg: its line, 0 none |
| KST_PROG_MSG_LOAD_CHECKSUM | the check value does not fit the text |
| KST_PROG_MSG_LOAD_NEWER | the file's format is a later one |
| KST_PROG_MSG_LOAD_TYPE | the file is of another servo type; arg: the file's type, and above bit 7 the servo's |
| KST_PROG_MSG_LOAD_VALUE | a value of the file is not taken; reg: its kst_field_id_t, 0xFF none; arg: its line, 0 none |
| KST_PROG_MSG_LOAD_REFUSED | the file breaks a hard rule; arg: the kst_rule_t |
| KST_PROG_MSG_LOAD_SAME | the file changes nothing; arg: locked fields that differ and stay |
| KST_PROG_MSG_LOAD_SOFT | the file waits for kst_prog_soft_confirm() |
| KST_PROG_MSG_LOADED | the draft holds the file; arg: fields it changes, and above bit 7 the locked fields that differ and stay |
| KST_PROG_MSG_LOADED_EDITED | the same for a file edited by hand |
| KST_PROG_MSG_LOADED_UNTYPED | and for one that names no servo type |
| KST_PROG_MSG_NEED_TARGET | the SERVO screen's target is not the programming port |
| KST_PROG_MSG_LEAVE_SUPPLY | a PD mini answers and the IOmcu is below link 4.15: the port has no way back to PWM that leaves the supply on |
| KST_PROG_MSG_LEFT_NO_WAIT | the port is back in PWM by an IOmcu below link 4.15: no wait was applied |
| KST_PROG_MSG_LEFT_DOUBT | the port is back in PWM from a session in doubt, no PD mini answering: no wait was applied |
| KST_PROG_MSG_LEAVE_CUT | the wait of a LEAVE was cut: an abort, a disarm or the supply off |
| KST_PROG_MSG_NEED_DISARM | the bench is armed or asked to arm: the port is not taken and no frame is sent |
| KST_PROG_MSG_BACKUP_OTHER | the servo read is not the one the session's backup was read from: the backup is not restored to it |
| KST_PROG_MSG_SESSION_ENDED | the port is in PWM and no command of this model put it there: the supply went off or the IOmcu started again. The session's values are gone |
| KST_PROG_MSG_UNKNOWN | a result, a refusal or an outcome the tables do not hold; arg: the byte |
| KST_PROG_MSG_SUPPLY_CAPS | the programming voltage or current is above the supply's limits: the port is not taken |
| KST_PROG_MSG_CARD_DENIED | the card takes no file: it is write protected, or a file has the name of the directory |
| enum kst_prog_card_op_t |
How it went.
| enum kst_prog_cmd_kind_t |
The kinds of command the programmer hands to the link module.
| Enumerator | |
|---|---|
| KST_PROG_CMD_START | kst_link_start(req) |
| KST_PROG_CMD_ABORT | |
| KST_PROG_CMD_FETCH | kst_link_fetch(): the port holds images this panel does not, after a start of the panel on a held port |
| enum kst_prog_edit_t |
What an edit came to.
| Enumerator | |
|---|---|
| KST_PROG_EDIT_OK | the draft holds the value |
| KST_PROG_EDIT_SOFT | it waits for kst_prog_soft_confirm() |
| KST_PROG_EDIT_REFUSED | not taken; kst_prog_message() says why |
| enum kst_prog_file_kind_t |
| enum kst_prog_from_t |
Where a restore takes its image from.
| Enumerator | |
|---|---|
| KST_PROG_FROM_SESSION | the backup of the IOmcu's session |
| KST_PROG_FROM_JOURNAL | the image recorded before a write |
| KST_PROG_FROM_RUN | the servo before a limit run's first write (kst_prog_run_hold()) |
| enum kst_prog_res_t |
What a result of the session says of a write that ended with it.
| enum kst_prog_state_t |
Where the programmer is.
| void kst_prog_abort | ( | kst_prog_t * | p | ) |
The operator's cancel.
| p | The programmer state. |
| bool kst_prog_backed_up | ( | const kst_prog_t * | p | ) |
A file holds the servo as this session found it: the next write waits for no save.
| p | The programmer state. |
| const char * kst_prog_backup_name | ( | const kst_prog_t * | p | ) |
That file's name; "" while there is none.
| p | The programmer state. |
| bool kst_prog_backup_other | ( | const kst_prog_t * | p | ) |
The servo read is not the one the session's backup was read from: the two differ in a field no write of the session set out to change.
The backup is not offered and not restored until a new session reads its own. Two servos that agree in every such field are not told apart. Never true for a session this model did not see begin, after a link loss or a start of the panel under a session: its writes are not known.
| p | The programmer state. |
| void kst_prog_bench_armed | ( | kst_prog_t * | p, |
| bool | armed ) |
The bench is armed or asked to arm.
Programming and an armed bench are exclusive: while this is set or the feed reports armed outputs no port is taken and no operation that sends frames starts (KST_PROG_MSG_NEED_DISARM), and the caller takes no arm while a port is held.
| p | The programmer state. |
| armed | true when the bench is armed or asked to arm. |
| bool kst_prog_card_busy | ( | const kst_prog_t * | p | ) |
A save, a list or a load is on its way.
| p | The programmer state. |
| void kst_prog_card_done | ( | kst_prog_t * | p, |
| const kst_prog_card_done_t * | done ) |
What the card's side made of it.
An answer to a request that is no longer awaited changes nothing, but for one: the OK of a save given up at KST_PROG_CARD_MS names its file and, for the servo as it was saved, is the session's backup.
| p | The programmer state. |
| done | The answer of the card. |
| const char * kst_prog_card_name | ( | const kst_prog_t * | p | ) |
The file last saved or asked for.
| p | The programmer state. |
| bool kst_prog_card_take | ( | kst_prog_t * | p, |
| kst_prog_card_req_t * | out ) |
A request for the card's side; false while there is none.
| p | The programmer state. |
| out | Receives the request. |
| kst_field_set_t kst_prog_changed | ( | const kst_prog_t * | p | ) |
The fields in which the draft differs from the servo, register 01's copy of Max.
Duty left out.
| p | The programmer state. |
| unsigned kst_prog_changes | ( | const kst_prog_t * | p | ) |
The number of fields the draft differs in.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_connect | ( | kst_prog_t * | p, |
| uint8_t | port ) |
Take programming port port, from 0, with the supply set by kst_prog_supply_set().
KST_PROG_MSG_NEED_TARGET while the feed's target is not that port, KST_PROG_MSG_NEED_DISARM on an armed bench.
| p | The programmer state. |
| port | The programming port, from 0. |
| void kst_prog_discard | ( | kst_prog_t * | p | ) |
The draft becomes the servo's image again, and no value counts as confirmed.
| p | The programmer state. |
| const kst_image_t * kst_prog_draft | ( | const kst_prog_t * | p | ) |
The draft image being edited.
| p | The programmer state. |
| kst_prog_edit_t kst_prog_edit | ( | kst_prog_t * | p, |
| kst_field_id_t | id, | ||
| uint16_t | raw ) |
Set a field of the draft to raw.
| p | The programmer state. |
| id | The field. |
| raw | The raw value to set. |
| bool kst_prog_editable | ( | const kst_prog_t * | p | ) |
A servo was read, its image passes the fingerprint and is not in doubt: it may be edited and written.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_enable | ( | kst_prog_t * | p, |
| bool | on ) |
The switch.
On is taken with a servo read that passes the fingerprint, and by a locked session that holds its backup.
| p | The programmer state. |
| on | true to switch the write switch on. |
| kst_prog_msg_id_t kst_prog_enable_check | ( | const kst_prog_t * | p | ) |
What kst_prog_enable() would refuse the switch for, and nothing said; KST_PROG_MSG_NONE where it goes on.
| p | The programmer state. |
| void kst_prog_feed | ( | kst_prog_t * | p, |
| const kst_prog_feed_t * | f ) |
The published state of this frame.
Outcomes and answers are taken here.
| p | The programmer state. |
| f | The inputs of this frame. |
| unsigned kst_prog_file_count | ( | const kst_prog_t * | p, |
| unsigned * | total ) |
The entries of the last list and, when total is not NULL, the servo files on the card.
| p | The programmer state. |
| total | Receives the total number of servo files on the card, or NULL. |
| void kst_prog_file_done | ( | kst_prog_t * | p, |
| bool | ok ) |
How the write of the text kst_prog_file_take() gave went.
The answer to a write's journal releases that write when the card completed the file and the write's start gate holds as it is now: the port in PROGRAMMING on the write's port, no STOP, the bench not ARMED and ENABLE WRITE TO SERVO on. Otherwise the write ends as one that did not start: nothing goes to the servo, its record is cleared, and the message names the gate that refused it, or KST_PROG_MSG_STORE_FAILED.
| p | The programmer state. |
| ok | true when the card completed the file. |
| bool kst_prog_file_load | ( | kst_prog_t * | p, |
| const char * | text, | ||
| size_t | len ) |
The file as found at start.
False, with KST_PROG_MSG_FILE_BAD, for a text that is not whole.
| p | The programmer state. |
| text | The file text. |
| len | The length of the text, in bytes. |
| const char * kst_prog_file_name | ( | const kst_prog_t * | p, |
| unsigned | i ) |
The names of the last list, i from 0; "" beyond them.
| p | The programmer state. |
| i | The index in the list. |
| size_t kst_prog_file_take | ( | kst_prog_t * | p, |
| char * | out, | ||
| size_t | n ) |
The file text is to be written: fill out and return its length; 0 while nothing is to be written or n is too small.
| p | The programmer state. |
| out | Receives the text. |
| n | The size of out, in bytes. |
| size_t kst_prog_file_text | ( | const kst_prog_t * | p, |
| char * | out, | ||
| size_t | n ) |
The text of the state as it is, for a caller that only reads.
| p | The programmer state. |
| out | Receives the text. |
| n | The size of out, in bytes. |
| unsigned kst_prog_file_type | ( | const kst_prog_t * | p, |
| unsigned | i ) |
That file's servo type as the card's side gave it; 0 none.
| p | The programmer state. |
| i | The index in the list. |
| bool kst_prog_file_whole | ( | const char * | text, |
| size_t | len ) |
Whether text is a whole file: its version, its lines and its check value.
Changes nothing and says nothing.
| text | The file text. |
| len | The length of the text, in bytes. |
| kst_prog_msg_id_t kst_prog_files | ( | kst_prog_t * | p, |
| unsigned | first ) |
Ask for the list of files from file first on, counted from 0: up to KST_PROG_FILES_MAX of them.
kst_prog_files_seq() moves when it is there. Refused with KST_PROG_MSG_NEED_READ while the servo is in doubt.
| p | The programmer state. |
| first | The index of the first file to list. |
| unsigned kst_prog_files_first | ( | const kst_prog_t * | p | ) |
The number of the last list's first file among the card's.
| p | The programmer state. |
| uint32_t kst_prog_files_seq | ( | const kst_prog_t * | p | ) |
The sequence number of the file list.
| p | The programmer state. |
| bool kst_prog_first_write | ( | const kst_prog_t * | p | ) |
No write was sent since the servo was connected: the next asks for the free horn.
| p | The programmer state. |
| void kst_prog_forget | ( | kst_prog_t * | p | ) |
Discard the journal.
KST_PROG_MSG_START + KST_LINK_START_BUSY, and nothing discarded, while an operation is on its way.
| p | The programmer state. |
| bool kst_prog_gate_claim | ( | kst_prog_gate_t * | g, |
| uint32_t | id ) |
The link's task, with a START out of its queue: true when the command is to be carried out.
False: it is dropped, with no answer.
| g | The gate. |
| id | The START's id. |
| void kst_prog_gate_init | ( | kst_prog_gate_t * | g | ) |
Sets up a START gate.
| g | The gate to set up. |
| void kst_prog_gate_offer | ( | kst_prog_gate_t * | g, |
| uint32_t | id ) |
The pass of START id is there to be taken.
| g | The gate. |
| id | The START's id. |
| bool kst_prog_gate_revoke | ( | kst_prog_gate_t * | g, |
| uint32_t | id ) |
The model: true when START id is not carried out and never is.
| g | The gate. |
| id | The START's id. |
| void kst_prog_gate_set | ( | kst_prog_t * | p, |
| kst_prog_gate_t * | g ) |
The gate the link's task claims each START at.
With one set, a START nobody answers within KST_PROG_START_MS is revoked and was never carried out. With none set, such a START counts as one that may have run: the servo is read before anything else. kst_prog_init() sets none.
| p | The programmer state. |
| g | The gate, or NULL for none. |
| bool kst_prog_have_servo | ( | const kst_prog_t * | p | ) |
Whether a servo was read.
| p | The programmer state. |
| bool kst_prog_holds_port | ( | const kst_prog_t * | p | ) |
Whether nothing but the programmer reaches the port: an operation of this model is on its way or a session is open (ENTERING, PROGRAMMING, WORKING, LEAVING), or kst_prog_port_taken() says so of the readout last fed.
The tester's target and the port's pulse stay as they are for as long (settings_held(), prog_link_hold()).
| p | The programmer state. |
| bool kst_prog_in_doubt | ( | const kst_prog_t * | p | ) |
The servo may hold part of a write: a journal stands, the port asks for a read, an operation timed out, or the session is locked.
| p | The programmer state. |
| void kst_prog_init | ( | kst_prog_t * | p | ) |
Sets up the programmer state.
| p | The programmer state to set up. |
| bool kst_prog_journal | ( | const kst_prog_t * | p | ) |
A write was interrupted and the servo was not compared since.
| p | The programmer state. |
| unsigned kst_prog_journal_arg | ( | const kst_prog_t * | p | ) |
The argument of the journal's messages: the port + 1 in bits 0-7, the pin + 1 in bits 8-15, 0 there when the pin is not known.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_journal_asks | ( | const kst_prog_t * | p | ) |
The servo read holds, register for register, the record's image (KST_PROG_MSG_JOURNAL_SAME) or the write's target (KST_PROG_MSG_JOURNAL_DONE), and the record stands: a second servo with the same settings is not told apart from the one of the write.
Nothing is written to the servo until kst_prog_forget() discards the record. KST_PROG_MSG_NONE otherwise.
| p | The programmer state. |
| bool kst_prog_journal_held | ( | const kst_prog_t * | p | ) |
A record of an interrupted write is held, read back or not: the one RESTORE offers the values of.
| p | The programmer state. |
| bool kst_prog_journal_other | ( | const kst_prog_t * | p | ) |
The servo read cannot be the one of the interrupted write: it is on another port, or a register of it holds neither the record's value nor the write's target.
The low register of a field in two registers that the write changes is exempt: a plan may set it to a third value. Nothing is restored to it and nothing is written to it until the journal is discarded.
| p | The programmer state. |
| uint8_t kst_prog_journal_pin | ( | const kst_prog_t * | p | ) |
The GPIO that port drove at the write, or KST_PROG_NO_PIN: not known, or a record of version 1.
| p | The programmer state. |
| uint8_t kst_prog_journal_port | ( | const kst_prog_t * | p | ) |
The port of the interrupted write, from 0.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_leave | ( | kst_prog_t * | p | ) |
End the session: the port goes back to PWM and the supply stays as it is.
The one place a session is ended by the operator. While a PD mini answers the port has no command for it and the answer is KST_PROG_MSG_LEAVE_SUPPLY.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_load | ( | kst_prog_t * | p, |
| const char * | name ) |
Load the file with name into the draft.
Taken with a servo read that passes the fingerprint and is not in doubt. A file of another servo type, a file with a value that is not taken, a file that breaks a hard rule and a file that is not whole change nothing. A file that breaks soft rules waits for kst_prog_soft_confirm().
| p | The programmer state. |
| name | The file name. |
| kst_prog_file_kind_t kst_prog_load_kind | ( | const kst_prog_t * | p | ) |
What the file last loaded is.
| p | The programmer state. |
| unsigned kst_prog_load_named | ( | const kst_prog_t * | p, |
| unsigned * | fields ) |
The fields the file last loaded gives a value for, and through fields, when not NULL, the named fields a file has: 0 where the card's side did not count them.
| p | The programmer state. |
| fields | Receives the field set, or NULL. |
| kst_field_set_t kst_prog_load_skipped | ( | const kst_prog_t * | p | ) |
The fields in which the file in the draft differs from the servo and that are never written; 0 once the servo is read again or the draft is discarded.
| p | The programmer state. |
| const kst_prog_msg_t * kst_prog_message | ( | const kst_prog_t * | p | ) |
The last message.
| p | The programmer state. |
| bool kst_prog_no_file | ( | const kst_prog_t * | p | ) |
A write of this session started with no card in the slot, and no file holds the servo as the session found it: the session's backup is the one copy.
Ends with the next file a write saves.
| p | The programmer state. |
| link_kst_op_t kst_prog_op | ( | const kst_prog_t * | p | ) |
The operation on its way or running; LINK_KST_OP_NONE for none.
| p | The programmer state. |
| bool kst_prog_planning | ( | const kst_prog_t * | p | ) |
The IOmcu plans the order of a write's or a restore's writes: no frame goes to the servo yet.
| p | The programmer state. |
| uint8_t kst_prog_port | ( | const kst_prog_t * | p | ) |
The programming port.
| p | The programmer state. |
| bool kst_prog_port_taken | ( | const kst_link_readout_t * | rd | ) |
Whether the bench takes no arm by what the link module reads: an operation is on its way or runs, the port is read and is not in PWM, or the page answers and is not read yet (KST_LINK_SYNC).
False where no page answers: nothing can hold a port there.
| rd | The link module's readout. |
| const char * kst_prog_preset_name | ( | const kst_prog_t * | p | ) |
The next preset name as the last list gave it; "" when none is left.
| p | The programmer state. |
| bool kst_prog_range | ( | const kst_prog_t * | p, |
| kst_field_id_t | id, | ||
| uint16_t * | lo, | ||
| uint16_t * | hi ) |
The raw values of id the hard rules accept in the draft as it is, as the lowest and the highest.
False when none is accepted, the field is not editable or no servo was read.
| p | The programmer state. |
| id | The field. |
| lo | Receives the lowest raw value accepted. |
| hi | Receives the highest raw value accepted. |
| kst_prog_msg_id_t kst_prog_read | ( | kst_prog_t * | p | ) |
Asks for a read of the servo.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_release | ( | kst_prog_t * | p | ) |
Releases the servo.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_release_check | ( | kst_prog_t * | p | ) |
The same for kst_prog_release().
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_restore | ( | kst_prog_t * | p, |
| const kst_prog_restore_t * | plan ) |
Run the restore prepared.
| p | The programmer state. |
| plan | The plan from kst_prog_restore_plan(). |
| bool kst_prog_restore_offered | ( | const kst_prog_t * | p, |
| kst_prog_from_t | from ) |
Whether from holds an image that differs from the servo.
| p | The programmer state. |
| from | The source of the image. |
| bool kst_prog_restore_only | ( | const kst_prog_t * | p | ) |
The session is locked and its backup is held: the switch is taken with no servo read, and the restore of that backup is the one write that goes.
Every other write waits for a read and for the lock to end.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_restore_plan | ( | kst_prog_t * | p, |
| kst_prog_from_t | from, | ||
| kst_prog_restore_t * | out ) |
Prepare a restore.
For KST_PROG_FROM_JOURNAL the draft becomes the servo's image with the editable fields of the source.
| p | The programmer state. |
| from | The source of the image. |
| out | Receives the plan. |
| kst_prog_res_t kst_prog_result_class | ( | unsigned | result | ) |
The class of result, a kst_ses_t or a LINK_KST_RESULT_ value.
A value that is neither is KST_PROG_RES_DOUBT.
| result | The result code. |
| kst_rules_t kst_prog_rules | ( | const kst_prog_t * | p | ) |
The rules the draft breaks as an edit of the servo's image.
| p | The programmer state. |
| const char * kst_prog_run_backup | ( | const kst_prog_t * | p | ) |
The file of that servo; "" for none: no card, or the first write not ended yet.
| p | The programmer state. |
| void kst_prog_run_close | ( | kst_prog_t * | p | ) |
The run is over: the servo stays held for RESTORE, and a later session's first write saves its own file again.
| p | The programmer state. |
| void kst_prog_run_drop | ( | kst_prog_t * | p | ) |
Nothing held.
| p | The programmer state. |
| bool kst_prog_run_hold | ( | kst_prog_t * | p | ) |
Hold the servo as read now as the run's.
False, and nothing held, with no servo read.
| p | The programmer state. |
| const kst_image_t * kst_prog_run_image | ( | const kst_prog_t * | p | ) |
The servo the run held, or NULL.
| p | The programmer state. |
| bool kst_prog_run_matches | ( | const kst_prog_t * | p | ) |
The servo read differs from the run's in LEFT ANGLE, RIGHT ANGLE, PULSE LOWER and PULSE UPPER at most.
| p | The programmer state. |
| void kst_prog_run_written | ( | kst_prog_t * | p | ) |
The run's first write was sent, whether it ended well or not: the file it saved, if any, holds the servo as held.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_save | ( | kst_prog_t * | p, |
| const char * | name ) |
Save the servo's image to a new file with name.
The card's side says whether the name is one a file may have; a file is never replaced.
| p | The programmer state. |
| name | The file name. |
| bool kst_prog_save_first | ( | const kst_prog_t * | p | ) |
The next write saves the servo as the session found it to a file first.
A mounted card that does not take the file ends the write. False while a record of an interrupted write is held: the servo may be half written, and the record holds it as found.
| p | The programmer state. |
| bool kst_prog_save_none | ( | const kst_prog_t * | p | ) |
That write goes without the file: no card is mounted, or the servo may hold other values than the session found and the session's backup, the image the file takes then, is not fetched.
| p | The programmer state. |
| void kst_prog_screen_entry | ( | kst_prog_t * | p | ) |
The screen was entered: ENABLE WRITE TO SERVO goes off.
| p | The programmer state. |
| const kst_image_t * kst_prog_servo | ( | const kst_prog_t * | p | ) |
The servo's image as last read.
| p | The programmer state. |
| const kst_image_t * kst_prog_soft_base | ( | const kst_prog_t * | p | ) |
The image the soft rules compare with: the backup of the IOmcu's session, the servo as the session first read it.
The servo as last read while that backup is not held or is another servo's (kst_prog_backup_other()).
| p | The programmer state. |
| void kst_prog_soft_cancel | ( | kst_prog_t * | p | ) |
Drops the waiting soft edit.
| p | The programmer state. |
| void kst_prog_soft_confirm | ( | kst_prog_t * | p | ) |
Confirms the waiting soft edit.
| p | The programmer state. |
| kst_field_set_t kst_prog_soft_fields | ( | const kst_prog_t * | p, |
| const kst_image_t * | img ) |
The fields of img that differ from the servo and are at fault for a soft rule: the rule goes when the field takes the value of kst_prog_soft_base().
| p | The programmer state. |
| img | The image to check. |
| const kst_image_t * kst_prog_soft_image | ( | const kst_prog_t * | p | ) |
The image the edit that waits would leave.
| p | The programmer state. |
| bool kst_prog_soft_is_load | ( | const kst_prog_t * | p | ) |
The edit that waits for kst_prog_soft_confirm() is a file.
| p | The programmer state. |
| kst_rules_t kst_prog_soft_rules | ( | const kst_prog_t * | p | ) |
The soft rules the edit that waits asks a confirmation for; 0 while none waits.
They are the rules it breaks and the draft does not, and the rules of a field it moves further from kst_prog_soft_base() than the value last confirmed for that field, or to its other side. A value the servo holds counts as confirmed.
| p | The programmer state. |
| kst_prog_state_t kst_prog_state | ( | const kst_prog_t * | p | ) |
| kst_prog_edit_t kst_prog_step | ( | kst_prog_t * | p, |
| kst_field_id_t | id, | ||
| int | dir ) |
One raw count up (dir above 0) or down.
| p | The programmer state. |
| id | The field. |
| dir | The direction: above 0 counts up, else down. |
| void kst_prog_supply_caps | ( | kst_prog_t * | p, |
| uint16_t | max_mv, | ||
| uint16_t | max_ma ) |
The highest voltage and current limit the operator lets the supply give (the SUPPLY screen's limits), 0 for none.
kst_prog_connect() is KST_PROG_MSG_SUPPLY_CAPS and asks nothing while a value of kst_prog_supply_set() is above its limit: a session never runs at values other than the ones shown. None after kst_prog_init().
| p | The programmer state. |
| max_mv | The highest voltage the supply may give, in mV, or 0 for none. |
| max_ma | The highest current limit, in mA, or 0 for none. |
| void kst_prog_supply_floor | ( | kst_prog_t * | p, |
| uint16_t | min_mv ) |
The lowest voltage a session runs at, mV; 0 for none.
An ENTER lowers a PD mini output that is on to the session's voltage or leaves it, and never raises it: kst_prog_connect() is KST_PROG_MSG_REF + LINK_KST_REF_SUPPLY_LOW and asks nothing while the feed reads an output that is on (supply_read) and set (set_mv) under min_mv. The port of link version 4.15 refuses the same ENTER by that name; an IOmcu built before the refusal takes it, so the panel holds the floor for every peer. None after kst_prog_init().
| p | The programmer state. |
| min_mv | The lowest voltage a session runs at, in mV, or 0 for none. |
| uint16_t kst_prog_supply_ma | ( | const kst_prog_t * | p | ) |
The current limit an ENTER asks for, in mA.
| p | The programmer state. |
| uint16_t kst_prog_supply_mv | ( | const kst_prog_t * | p | ) |
The voltage an ENTER asks for, in mV.
| p | The programmer state. |
| void kst_prog_supply_set | ( | kst_prog_t * | p, |
| uint16_t | mv, | ||
| uint16_t | ma ) |
What an ENTER asks of the PD mini: mv and its current limit ma.
The port checks the range. KST_PROG_SUPPLY_MV and KST_PROG_SUPPLY_MA after kst_prog_init().
| p | The programmer state. |
| mv | The voltage an ENTER asks for, in mV. |
| ma | The current limit an ENTER asks for, in mA. |
| bool kst_prog_take | ( | kst_prog_t * | p, |
| kst_prog_cmd_t * | out ) |
The next command for the task that owns the link module; false for none.
| p | The programmer state. |
| out | Receives the command. |
| kst_prog_msg_id_t kst_prog_verify | ( | kst_prog_t * | p | ) |
Asks for a check of the servo's image.
| p | The programmer state. |
| uint16_t kst_prog_wait_ms | ( | const kst_prog_t * | p | ) |
The wait before the first PWM pulse.
| p | The programmer state. |
| bool kst_prog_wait_set | ( | kst_prog_t * | p, |
| uint32_t | ms ) |
The wait between the end of a session and the first PWM pulse, up to KST_PROG_WAIT_MAX_MS.
False, and nothing set, above it.
| p | The programmer state. |
| ms | The wait, in ms. |
| kst_prog_msg_id_t kst_prog_write | ( | kst_prog_t * | p | ) |
Write the draft.
The first write of a session saves the servo's image to a file before it and is not sent without one; the journal goes to its file before every write.
| p | The programmer state. |
| kst_prog_msg_id_t kst_prog_write_check | ( | kst_prog_t * | p | ) |
Whether kst_prog_write() would be sent, without sending it.
| p | The programmer state. |
| bool kst_prog_write_enabled | ( | const kst_prog_t * | p | ) |
Whether the write switch is on.
| p | The programmer state. |
| unsigned kst_prog_write_steps | ( | const kst_prog_t * | p | ) |
The registers that write writes, as this model planned it; 0 when no write runs or the IOmcu alone plans it (a restore with no checked order, a release).
The register under way is not on the link page.
| p | The programmer state. |
| bool kst_prog_writing | ( | const kst_prog_t * | p | ) |
A write, a restore or a release is on its way or runs under this model: the record of it is no interrupted write yet.
| p | The programmer state. |