rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
kst_prog_int.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <stdbool.h>
16#include <stdint.h>
17
18#include "kst_prog.h"
19
20/* What is awaited. */
21enum {
22 W_NONE = 0,
23 W_SAVE, /* the servo's file, before the first write */
24 W_FILE, /* the journal's file, before the request goes */
25 W_ANSWER, /* the control task's answer to the command */
26 W_OUTCOME, /* the operation's outcome */
27};
28
29/* What a write of the file is for. */
30enum {
31 FILE_NONE = 0,
32 FILE_KEEP, /* the state changed; nobody waits */
33 FILE_JOURNAL, /* a write to the servo waits */
34};
35
43bool kst_prog_same(const kst_image_t *a, const kst_image_t *b);
50unsigned kst_prog_lowest(uint64_t set);
57unsigned kst_prog_ones(uint64_t set);
81 const kst_image_t *target);
91 const kst_image_t *target);
109kst_prog_msg_id_t kst_prog_say_reg(kst_prog_t *p, unsigned id, unsigned arg,
110 unsigned reg);
119kst_prog_msg_id_t kst_prog_say(kst_prog_t *p, unsigned id, unsigned arg);
126void kst_prog_send(kst_prog_t *p, const kst_link_request_t *req);
135 const char *name);
167void kst_prog_not_started(kst_prog_t *p, unsigned id, unsigned arg);
174void kst_prog_load_take(kst_prog_t *p, const kst_image_t *target);
@ W_ANSWER
Definition hitec_prog.c:22
@ W_NONE
Definition hitec_prog.c:21
@ W_OUTCOME
Definition hitec_prog.c:23
uint64_t kst_rules_t
A set of rules, bit n for rule n.
Definition kst_limits.h:141
void kst_prog_not_started(kst_prog_t *p, unsigned id, unsigned arg)
Ends a command that was not taken, with its message.
Definition kst_prog.c:1257
kst_prog_msg_id_t kst_prog_held_gate(const kst_prog_t *p)
The start gate of the held write as it is now, the wait for its own files left out: the port in PROGR...
Definition kst_prog.c:710
const kst_image_t * kst_prog_file_image(const kst_prog_t *p)
The image the file before a write takes: the servo as the session found it.
Definition kst_prog.c:1739
bool kst_prog_journal_classify(kst_prog_t *p)
Classifies the held journal record against the servo read.
Definition kst_prog.c:872
kst_prog_msg_id_t kst_prog_say_reg(kst_prog_t *p, unsigned id, unsigned arg, unsigned reg)
Sets the message with an argument and a register.
Definition kst_prog.c:119
void kst_prog_card_ask(kst_prog_t *p, kst_prog_card_op_t op, const char *name)
Asks the card side for a save, a list or a load.
Definition kst_prog.c:500
void kst_prog_load_take(kst_prog_t *p, const kst_image_t *target)
Takes a loaded file's target into the draft.
Definition kst_prog.c:1921
bool kst_prog_same(const kst_image_t *a, const kst_image_t *b)
Whether two images hold the same values.
Definition kst_prog.c:44
unsigned kst_prog_lowest(uint64_t set)
The index of the lowest field bit set in a set.
Definition kst_prog.c:61
unsigned kst_prog_ones(uint64_t set)
The number of field bits set in a set.
Definition kst_prog.c:71
kst_rules_t kst_prog_soft_asks(const kst_prog_t *p, const kst_image_t *from, const kst_image_t *target)
The soft rules an edit from one image to another asks about.
Definition kst_prog.c:363
void kst_prog_send(kst_prog_t *p, const kst_link_request_t *req)
Queues a command for the task that owns the link module.
Definition kst_prog.c:445
bool kst_prog_field_editable(kst_field_id_t id)
Whether a field may be edited.
Definition kst_prog.c:228
kst_prog_msg_id_t kst_prog_say(kst_prog_t *p, unsigned id, unsigned arg)
Sets the message with an argument.
Definition kst_prog.c:130
kst_field_set_t kst_prog_differ(const kst_image_t *a, const kst_image_t *b)
The fields in which two images differ.
Definition kst_prog.c:236
void kst_prog_write_go(kst_prog_t *p)
Starts the write that is held: its journal, its file, then the request.
Definition kst_prog.c:516
kst_rules_t kst_prog_hard_new(const kst_prog_t *p, const kst_image_t *target)
The hard rules the target image breaks.
Definition kst_prog.c:252
The programmer for KST and Chaservo servos as the SERVO screen runs it: what is read from a servo,...
unsigned kst_prog_msg_id_t
What the screen says.
Definition kst_prog.h:164
kst_prog_card_op_t
What the card's side is asked for.
Definition kst_prog.h:326
uint64_t kst_field_set_t
A set of fields, bit n for field n.
Definition kst_reg.h:110
kst_field_id_t
Every bit of the 32 registers belongs to exactly one field.
Definition kst_reg.h:61
The 32 registers, by address.
Definition kst_reg.h:47
The state of the servo programmer.
Definition kst_prog.h:536