rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
hitec_prog.h
Go to the documentation of this file.
1
84#pragma once
85
86#include <stdatomic.h>
87#include <stdbool.h>
88#include <stddef.h>
89#include <stdint.h>
90
91#include "hitec_card.h"
92#include "hitec_link.h"
93#include "hitec_reg.h"
94#include "hitec_session.h"
95#include "link_pages.h"
96
97#ifdef __cplusplus
98extern "C" {
99#endif
100
102#define HITEC_PROG_SUPPLY_MV 5000u
104#define HITEC_PROG_SUPPLY_MA 1000u
106#define HITEC_PROG_MV_MIN LINK_HITEC_SUPPLY_MIN_MV
108#define HITEC_PROG_MV_MAX LINK_HITEC_SUPPLY_MAX_MV
110#define HITEC_PROG_MA_MIN 50u
112#define HITEC_PROG_MA_MAX 3000u
114#define HITEC_PROG_PIN_LAST 47u
116#define HITEC_PROG_NO_PIN 0xFFu
119#define HITEC_PROG_START_MS 2000u
122#define HITEC_PROG_RUN_MS (HITEC_LINK_RUN_MAX_MS + 5000u)
124#define HITEC_PROG_CARD_MS 3000u
125
144
146typedef enum {
147 HITEC_PROG_MSG_NONE = 0,
224 HITEC_PROG_MSG_COUNT
226
228typedef enum {
229 HITEC_PROG_INFO = 0,
230 HITEC_PROG_WARN,
231 HITEC_PROG_DANGER,
233
235typedef struct {
236 uint8_t id;
237 uint8_t level;
238 uint16_t reg;
239 uint16_t arg;
240 uint32_t seq;
242
251
253typedef struct {
254 uint8_t kind;
255 uint8_t port;
256 uint8_t family;
257 uint8_t drive;
258 uint16_t mv;
259 uint16_t ma;
260 uint32_t id;
264
275typedef struct {
276 _Atomic uint32_t pass;
278
291void hitec_prog_gate_offer(hitec_prog_gate_t *g, uint32_t id);
300bool hitec_prog_gate_claim(hitec_prog_gate_t *g, uint32_t id);
308bool hitec_prog_gate_revoke(hitec_prog_gate_t *g, uint32_t id);
309
339
352
354#define HITEC_RULE_BIT(r) ((uint16_t)(1u << (r)))
355
357#define HITEC_PROG_CUT_CHECK 0xFFu
358
360#define HITEC_PROG_SLOW_PCT 30
362#define HITEC_PROG_FS_FAR_US 300
363
370
380
387
389typedef struct {
391 bool fed;
392 uint32_t outcomes_seen;
393 uint32_t next_id;
394
396 uint8_t series;
397 uint8_t port;
398 uint8_t st;
399 uint8_t op;
400 bool owned;
401 bool lost;
403 bool armed;
404 bool reenter;
405 uint16_t supply_mv;
406 uint16_t supply_ma;
407 uint16_t caps_mv;
408 uint16_t caps_ma;
409 uint16_t mv_open;
410 uint16_t ma_open;
411
415
416 uint8_t wait;
417 uint32_t wait_id;
418 uint32_t wait_ms;
426
427 /* --- the write side, hitec_prog_write.c --------------------------- */
430 bool write_on;
432 bool wrote;
433 uint8_t wr_kind;
434 uint8_t wr_values;
435 uint64_t soft_has;
436 int32_t soft_val[HITEC_P_COUNT];
437 bool pend;
438 uint8_t pend_id;
439 int32_t pend_value;
440 uint16_t pend_rules;
441 bool rec;
442 bool rec_open;
443 uint8_t rec_verdict;
450 uint32_t file_ms;
452
459
470
479
488
496
503void hitec_prog_bench_armed(hitec_prog_t *p, bool armed);
504
514bool hitec_prog_series_set(hitec_prog_t *p, uint8_t series);
515
523uint8_t hitec_prog_series(const hitec_prog_t *p);
524
532void hitec_prog_supply_set(hitec_prog_t *p, uint16_t mv, uint16_t ma);
533
541void hitec_prog_supply_caps(hitec_prog_t *p, uint16_t max_mv,
542 uint16_t max_ma);
543
551uint16_t hitec_prog_mv(const hitec_prog_t *p);
552
560uint16_t hitec_prog_ma(const hitec_prog_t *p);
561
569
577
585
595
603
610
618
626
634
643uint8_t hitec_prog_port(const hitec_prog_t *p);
644
652uint8_t hitec_prog_pin(const hitec_prog_t *p);
653
662
669bool hitec_prog_on_port(const hitec_prog_t *p);
670
680
688
695bool hitec_prog_in_mode(const hitec_prog_t *p);
696
703bool hitec_prog_stopped(const hitec_prog_t *p);
704
711bool hitec_prog_rail(const hitec_prog_t *p);
712
720
728
736uint8_t hitec_prog_layout(const hitec_prog_t *p);
737
746bool hitec_prog_progress(const hitec_prog_t *p, unsigned *done,
747 unsigned *total);
748
756unsigned hitec_prog_retry_code(const hitec_prog_t *p);
757
758/* --- the write side (hitec_prog_write.c) ---------------------------------- */
759
767
775bool hitec_prog_can_edit(const hitec_prog_t *p);
776
784bool hitec_prog_editable(const hitec_prog_t *p, uint8_t id);
785
801 int32_t value);
802
811uint16_t hitec_prog_pending(const hitec_prog_t *p, uint8_t *id,
812 int32_t *value);
813
821
828
838uint16_t hitec_prog_rules(const hitec_prog_t *p, uint8_t id, int32_t value);
839
849bool hitec_prog_differs(const hitec_prog_t *p, const hitec_image_t *img,
850 uint8_t id);
851
859unsigned hitec_prog_changes(const hitec_prog_t *p);
860
868
880
887bool hitec_prog_write_on(const hitec_prog_t *p);
888
897 uint8_t kind);
898
906
914bool hitec_prog_sum_bad(const hitec_prog_t *p);
915
923
931
942bool hitec_prog_write_progress(const hitec_prog_t *p, unsigned *done,
943 unsigned *total, uint8_t *kind);
944
951bool hitec_prog_record(const hitec_prog_t *p);
952
960
971
981
989
996bool hitec_prog_file_due(const hitec_prog_t *p);
997
1008size_t hitec_prog_file_take(hitec_prog_t *p, char *out, size_t n);
1009
1022void hitec_prog_file_done(hitec_prog_t *p, bool ok);
1023
1033bool hitec_prog_file_load(hitec_prog_t *p, const char *text, size_t len);
1034
1035#ifdef __cplusplus
1036}
1037#endif
The card's side of the programmer for servos by Hitec: the text of the record of a write,...
void hitec_prog_feed(hitec_prog_t *p, const hitec_prog_feed_t *f)
The feed of this frame: answers and outcomes are taken, the session's next step goes out,...
Definition hitec_prog.c:693
void hitec_prog_init(hitec_prog_t *p)
Sets up the programmer: nothing fed, D series, the default supply.
Definition hitec_prog.c:224
bool hitec_prog_rail(const hitec_prog_t *p)
Whether a PD mini answers the page (LINK_HT_F_RAIL).
Definition hitec_prog.c:1125
uint16_t hitec_prog_ma(const hitec_prog_t *p)
The current limit a POWER of the next CONNECT asks, HITEC_PROG_MA_MIN to HITEC_PROG_MA_MAX.
Definition hitec_prog.c:804
const hitec_model_t * hitec_prog_model(const hitec_prog_t *p)
The model of that servo; NULL with none.
Definition hitec_prog.c:1135
bool hitec_prog_in_mode(const hitec_prog_t *p)
Whether the servo is in programming mode.
Definition hitec_prog.c:1115
void hitec_prog_gate_init(hitec_prog_gate_t *g)
Sets up a gate: no pass offered.
Definition hitec_prog.c:28
bool hitec_prog_on_port(const hitec_prog_t *p)
Whether the SERVO screen's tester drives a programming port.
Definition hitec_prog.c:1086
hitec_prog_msg_id_t hitec_prog_leave(hitec_prog_t *p)
LEAVE: programming mode ends and the port goes back to PWM.
Definition hitec_prog.c:954
hitec_prog_msg_id_t hitec_prog_read(hitec_prog_t *p)
READ ALL.
Definition hitec_prog.c:939
hitec_prog_msg_id_t hitec_prog_connect(hitec_prog_t *p)
CONNECT on the SERVO screen's programming port.
Definition hitec_prog.c:910
void hitec_prog_abort(hitec_prog_t *p)
ABORT the running operation; the port stays held.
Definition hitec_prog.c:998
const hitec_prog_msg_t * hitec_prog_message(const hitec_prog_t *p)
The last message.
Definition hitec_prog.c:1040
bool hitec_prog_progress(const hitec_prog_t *p, unsigned *done, unsigned *total)
The progress of the running read.
Definition hitec_prog.c:1149
void hitec_prog_gate_set(hitec_prog_t *p, hitec_prog_gate_t *g)
The gate the link's task claims each command at; NULL for none.
Definition hitec_prog.c:233
hitec_prog_msg_id_t hitec_prog_release(hitec_prog_t *p)
RELEASE PORT: CLOSE the port another session holds.
Definition hitec_prog.c:1026
bool hitec_prog_gate_revoke(hitec_prog_gate_t *g, uint32_t id)
The model gives command id up.
Definition hitec_prog.c:57
bool hitec_prog_mv_capped(const hitec_prog_t *p)
Whether the setting is above HITEC_PROG_MV_MAX and is taken as it.
Definition hitec_prog.c:811
bool hitec_prog_holds_port(const hitec_prog_t *p)
Whether the session or another one holds a port, or a request of this model is on its way: no other p...
Definition hitec_prog.c:1105
const hitec_image_t * hitec_prog_servo(const hitec_prog_t *p)
The servo as the last full read found it; NULL with none.
Definition hitec_prog.c:1130
hitec_prog_level_t hitec_prog_level(unsigned id)
The level of message id.
Definition hitec_prog.c:64
bool hitec_prog_port_taken(const hitec_link_readout_t *rd)
The link task's view: the page holds a port, or a request runs.
Definition hitec_prog.c:1091
bool hitec_prog_series_set(hitec_prog_t *p, uint8_t series)
The series of the next CONNECT; taken in PWM only. A change of series drops what the last read found:...
Definition hitec_prog.c:760
hitec_prog_msg_id_t hitec_prog_clear(hitec_prog_t *p)
CLEAR the page's STOPPED flag, then the entry or the read.
Definition hitec_prog.c:971
void hitec_prog_gate_offer(hitec_prog_gate_t *g, uint32_t id)
The pass of command id is there to be taken.
Definition hitec_prog.c:33
bool hitec_prog_stopped(const hitec_prog_t *p)
Whether the page's STOPPED flag is set on this panel's port.
Definition hitec_prog.c:1120
void hitec_prog_supply_caps(hitec_prog_t *p, uint16_t max_mv, uint16_t max_ma)
The SUPPLY screen's limits, 0 for none.
Definition hitec_prog.c:790
hitec_prog_state_t hitec_prog_state(const hitec_prog_t *p)
Where the programmer is.
Definition hitec_prog.c:717
bool hitec_prog_gate_claim(hitec_prog_gate_t *g, uint32_t id)
The link's task, with command id out of its queue.
Definition hitec_prog.c:52
void hitec_prog_supply_set(hitec_prog_t *p, uint16_t mv, uint16_t ma)
The programming voltage and current limit the next CONNECT asks.
Definition hitec_prog.c:784
void hitec_prog_bench_armed(hitec_prog_t *p, bool armed)
The bench is armed or asked to arm.
Definition hitec_prog.c:755
uint8_t hitec_prog_layout(const hitec_prog_t *p)
The layout the values are decoded with: the model's, or the series' measured one before a read.
Definition hitec_prog.c:1140
bool hitec_prog_take(hitec_prog_t *p, hitec_prog_cmd_t *out)
The next command for the link's task.
Definition hitec_prog.c:288
unsigned hitec_prog_retry_code(const hitec_prog_t *p)
The decoder's code of the last failed try of the running transaction, while it goes again.
Definition hitec_prog.c:1159
uint8_t hitec_prog_series(const hitec_prog_t *p)
The series: the session's while the port is held, else the one the next CONNECT uses.
Definition hitec_prog.c:779
uint16_t hitec_prog_mv(const hitec_prog_t *p)
The voltage a POWER of the next CONNECT asks: the setting, at most HITEC_PROG_MV_MAX and at least HIT...
Definition hitec_prog.c:797
uint8_t hitec_prog_pin(const hitec_prog_t *p)
The GPIO that port drives: the HITEC page's while it holds the line, else the PROG page's.
Definition hitec_prog.c:1058
uint8_t hitec_prog_port(const hitec_prog_t *p)
The programming port the overlay names: the session's while one holds it, the held port of another se...
Definition hitec_prog.c:1045
bool hitec_prog_precharge(const hitec_prog_t *p)
Whether the line receives by PRECHARGE: the open line's mode while the page holds one,...
Definition hitec_prog.c:1076
hitec_prog_cmd_kind_t
The kinds of command for the task that owns the link module.
Definition hitec_prog.h:244
@ HITEC_PROG_CMD_STEP
Definition hitec_prog.h:246
@ HITEC_PROG_CMD_CLEAR
Definition hitec_prog.h:247
@ HITEC_PROG_CMD_CLOSE
Definition hitec_prog.h:248
@ HITEC_PROG_CMD_OPEN
Definition hitec_prog.h:245
@ HITEC_PROG_CMD_ABORT
Definition hitec_prog.h:249
hitec_prog_level_t
The level of a message.
Definition hitec_prog.h:228
hitec_prog_state_t
Where the programmer is.
Definition hitec_prog.h:127
@ HITEC_PROG_WRITING
Definition hitec_prog.h:142
@ HITEC_PROG_DOWN
Definition hitec_prog.h:128
@ HITEC_PROG_SYNC
Definition hitec_prog.h:130
@ HITEC_PROG_NO_PAGE
Definition hitec_prog.h:129
@ HITEC_PROG_RECORDING
Definition hitec_prog.h:141
@ HITEC_PROG_RELEASING
Definition hitec_prog.h:140
@ HITEC_PROG_ENTERING
Definition hitec_prog.h:135
@ HITEC_PROG_PWM
Definition hitec_prog.h:131
@ HITEC_PROG_OPENING
Definition hitec_prog.h:134
@ HITEC_PROG_OTHER
Definition hitec_prog.h:132
@ HITEC_PROG_LEAVING
Definition hitec_prog.h:139
@ HITEC_PROG_READING
Definition hitec_prog.h:137
@ HITEC_PROG_CLEARING
Definition hitec_prog.h:138
@ HITEC_PROG_HELD
Definition hitec_prog.h:136
hitec_prog_wr_t
What a write is.
Definition hitec_prog.h:382
@ HITEC_PROG_WR_EDITS
Definition hitec_prog.h:383
@ HITEC_PROG_WR_RESTORE
Definition hitec_prog.h:385
@ HITEC_PROG_WR_REPAIR
Definition hitec_prog.h:384
hitec_prog_rec_t
What the servo read holds of a record.
Definition hitec_prog.h:372
@ HITEC_PROG_REC_SAME
Definition hitec_prog.h:374
@ HITEC_PROG_REC_OTHER
Definition hitec_prog.h:377
@ HITEC_PROG_REC_DONE
Definition hitec_prog.h:375
@ HITEC_PROG_REC_MIX
Definition hitec_prog.h:376
@ HITEC_PROG_REC_NONE
Definition hitec_prog.h:373
hitec_prog_edit_t
What an edit came to.
Definition hitec_prog.h:365
@ HITEC_PROG_EDIT_REFUSED
Definition hitec_prog.h:368
@ HITEC_PROG_EDIT_OK
Definition hitec_prog.h:366
@ HITEC_PROG_EDIT_CHECK
Definition hitec_prog.h:367
hitec_prog_msg_id_t
What the screen says.
Definition hitec_prog.h:146
@ HITEC_PROG_MSG_RESTARTED
Definition hitec_prog.h:185
@ HITEC_PROG_MSG_NOT_IN_MODE
Definition hitec_prog.h:173
@ HITEC_PROG_MSG_STOP_LATCHED
Definition hitec_prog.h:155
@ HITEC_PROG_MSG_SUPPLY_CAPS
Definition hitec_prog.h:162
@ HITEC_PROG_MSG_SUPPLY
Definition hitec_prog.h:191
@ HITEC_PROG_MSG_REC_DONE
Definition hitec_prog.h:216
@ HITEC_PROG_MSG_MUST_READ
Definition hitec_prog.h:199
@ HITEC_PROG_MSG_NACK
Definition hitec_prog.h:187
@ HITEC_PROG_MSG_LEFT
Definition hitec_prog.h:179
@ HITEC_PROG_MSG_ABORTED
Definition hitec_prog.h:175
@ HITEC_PROG_MSG_NEED_DISARM
Definition hitec_prog.h:154
@ HITEC_PROG_MSG_REPAIRED
Definition hitec_prog.h:195
@ HITEC_PROG_MSG_REC_SAME
Definition hitec_prog.h:214
@ HITEC_PROG_MSG_RECORD_BAD
Definition hitec_prog.h:221
@ HITEC_PROG_MSG_VERIFY_FAIL
Definition hitec_prog.h:210
@ HITEC_PROG_MSG_NO_D
Definition hitec_prog.h:168
@ HITEC_PROG_MSG_FORGOTTEN
Definition hitec_prog.h:220
@ HITEC_PROG_MSG_NEED_PD_C
Definition hitec_prog.h:161
@ HITEC_PROG_MSG_RECORD_FAILED
Definition hitec_prog.h:203
@ HITEC_PROG_MSG_UNSAFE
Definition hitec_prog.h:177
@ HITEC_PROG_MSG_EDITS_PENDING
Definition hitec_prog.h:201
@ HITEC_PROG_MSG_BUSY
Definition hitec_prog.h:153
@ HITEC_PROG_MSG_RECORD_HELD
Definition hitec_prog.h:219
@ HITEC_PROG_MSG_SUM_OK
Definition hitec_prog.h:223
@ HITEC_PROG_MSG_NO_PAGE
Definition hitec_prog.h:152
@ HITEC_PROG_MSG_NO_PIN
Definition hitec_prog.h:158
@ HITEC_PROG_MSG_RECORD
Definition hitec_prog.h:212
@ HITEC_PROG_MSG_NO_ANSWER
Definition hitec_prog.h:184
@ HITEC_PROG_MSG_REFUSED
Definition hitec_prog.h:188
@ HITEC_PROG_MSG_NO_CHANGES
Definition hitec_prog.h:200
@ HITEC_PROG_MSG_DOWN
Definition hitec_prog.h:151
@ HITEC_PROG_MSG_STOPPED
Definition hitec_prog.h:174
@ HITEC_PROG_MSG_WRITTEN
Definition hitec_prog.h:194
@ HITEC_PROG_MSG_NOT_READ
Definition hitec_prog.h:198
@ HITEC_PROG_MSG_SESSION_ENDED
Definition hitec_prog.h:181
@ HITEC_PROG_MSG_HELD_OTHER
Definition hitec_prog.h:165
@ HITEC_PROG_MSG_UNKNOWN
Definition hitec_prog.h:192
@ HITEC_PROG_MSG_TIMEOUT
Definition hitec_prog.h:183
@ HITEC_PROG_MSG_EDIT_REFUSED
Definition hitec_prog.h:202
@ HITEC_PROG_MSG_ENTRY_BAD
Definition hitec_prog.h:169
@ HITEC_PROG_MSG_WRITE_OFF
Definition hitec_prog.h:197
@ HITEC_PROG_MSG_NO_C
Definition hitec_prog.h:167
@ HITEC_PROG_MSG_RESTORED
Definition hitec_prog.h:196
@ HITEC_PROG_MSG_NO_LINE
Definition hitec_prog.h:190
@ HITEC_PROG_MSG_READ
Definition hitec_prog.h:148
@ HITEC_PROG_MSG_REC_OTHER
Definition hitec_prog.h:218
@ HITEC_PROG_MSG_READ_FAIL
Definition hitec_prog.h:171
@ HITEC_PROG_MSG_NEED_TARGET
Definition hitec_prog.h:156
@ HITEC_PROG_MSG_WRITE_CUT
Definition hitec_prog.h:205
@ HITEC_PROG_MSG_HELD_KST
Definition hitec_prog.h:164
@ HITEC_PROG_MSG_RELEASED
Definition hitec_prog.h:180
@ HITEC_PROG_MSG_CLEARED
Definition hitec_prog.h:176
@ HITEC_PROG_MSG_REC_MIX
Definition hitec_prog.h:217
@ HITEC_PROG_MSG_RX_PENDING
Definition hitec_prog.h:159
hitec_prog_rule_t
The soft rules of an edit: bit n of a rule set is rule n.
Definition hitec_prog.h:341
@ HITEC_RULE_FS_FAR
Definition hitec_prog.h:348
@ HITEC_RULE_SPEED
Definition hitec_prog.h:342
@ HITEC_RULE_DEAD_BAND
Definition hitec_prog.h:343
@ HITEC_RULE_END
Definition hitec_prog.h:345
@ HITEC_RULE_OVERLOAD
Definition hitec_prog.h:344
@ HITEC_RULE_DIRECTION
Definition hitec_prog.h:347
@ HITEC_RULE_CENTRE
Definition hitec_prog.h:346
bool hitec_prog_write_on(const hitec_prog_t *p)
Whether ENABLE WRITE TO SERVO is on.
Definition hitec_prog_write.c:404
hitec_prog_msg_id_t hitec_prog_restore(hitec_prog_t *p)
RESTORE: the values before the recorded write back to the servo, as a write; the record stays until i...
Definition hitec_prog_write.c:665
hitec_prog_msg_id_t hitec_prog_write(hitec_prog_t *p)
WRITE n VALUES: the draft to the servo, then its read-back.
Definition hitec_prog_write.c:597
size_t hitec_prog_file_take(hitec_prog_t *p, char *out, size_t n)
The record's text for the card: fill out and return its length; 0 while none is due,...
Definition hitec_prog_write.c:846
hitec_prog_edit_t hitec_prog_confirm(hitec_prog_t *p)
Take the edit that waits: its rules are confirmed for its value.
Definition hitec_prog_write.c:339
hitec_prog_edit_t hitec_prog_edit(hitec_prog_t *p, uint8_t id, int32_t value)
Edit the draft: value in the unit of parameter id.
Definition hitec_prog_write.c:300
bool hitec_prog_sum_bad(const hitec_prog_t *p)
Whether the classic servo read has cells 0x00 to 0x1C that do not sum to 0.
Definition hitec_prog_write.c:99
bool hitec_prog_restore_image(const hitec_prog_t *p, hitec_image_t *out)
The image RESTORE writes: the servo read with the record's values before the write.
Definition hitec_prog_write.c:636
void hitec_prog_file_done(hitec_prog_t *p, bool ok)
How the card took the text hitec_prog_file_take() gave.
Definition hitec_prog_write.c:862
void hitec_prog_cancel(hitec_prog_t *p)
Drop the edit that waits; the draft stays as it was.
Definition hitec_prog_write.c:356
unsigned hitec_prog_changes(const hitec_prog_t *p)
The writable parameters in which the draft differs from the servo read.
Definition hitec_prog_write.c:94
bool hitec_prog_can_edit(const hitec_prog_t *p)
Whether an edit is taken now: the port held and idle, the servo in programming mode and read,...
Definition hitec_prog_write.c:39
hitec_prog_msg_id_t hitec_prog_write_gate(const hitec_prog_t *p, uint8_t kind)
Why a write of kind is not taken now, the switch included.
Definition hitec_prog_write.c:411
bool hitec_prog_record(const hitec_prog_t *p)
Whether a record of a write stands.
Definition hitec_prog_write.c:750
bool hitec_prog_editable(const hitec_prog_t *p, uint8_t id)
Whether parameter id of the servo's layout takes an edit.
Definition hitec_prog_write.c:45
hitec_prog_msg_id_t hitec_prog_write_enable(hitec_prog_t *p, bool on)
ENABLE WRITE TO SERVO.
Definition hitec_prog_write.c:382
bool hitec_prog_differs(const hitec_prog_t *p, const hitec_image_t *img, uint8_t id)
Whether parameter id differs in img from the servo read: in its decoded value or in its stored value.
Definition hitec_prog_write.c:52
bool hitec_prog_write_progress(const hitec_prog_t *p, unsigned *done, unsigned *total, uint8_t *kind)
The progress of the running write.
Definition hitec_prog_write.c:114
hitec_prog_rec_t hitec_prog_record_verdict(const hitec_prog_t *p)
What the last servo read holds of the record.
Definition hitec_prog_write.c:755
uint16_t hitec_prog_pending(const hitec_prog_t *p, uint8_t *id, int32_t *value)
The edit that waits for a confirmation.
Definition hitec_prog_write.c:324
bool hitec_prog_file_due(const hitec_prog_t *p)
Whether the record's text is to go to the card.
Definition hitec_prog_write.c:841
bool hitec_prog_first_done(const hitec_prog_t *p)
Whether the first write of this CONNECT has gone out.
Definition hitec_prog_write.c:109
void hitec_prog_discard(hitec_prog_t *p)
DISCARD EDITS: the draft is the servo read again, and every confirmation ends.
Definition hitec_prog_write.c:372
bool hitec_prog_file_load(hitec_prog_t *p, const char *text, size_t len)
The record's text as the card held it at the start.
Definition hitec_prog_write.c:885
hitec_prog_msg_id_t hitec_prog_repair(hitec_prog_t *p)
REPAIR: the classic balance 0x1C alone, then the read-back.
Definition hitec_prog_write.c:602
uint16_t hitec_prog_rules(const hitec_prog_t *p, uint8_t id, int32_t value)
The soft rules value of parameter id breaks against the servo read.
Definition hitec_prog_write.c:139
const hitec_image_t * hitec_prog_draft(const hitec_prog_t *p)
The draft: the servo read with the edits; NULL with no servo read.
Definition hitec_prog_write.c:34
hitec_prog_msg_id_t hitec_prog_forget(hitec_prog_t *p)
FORGET: discard the record without a write.
Definition hitec_prog_write.c:829
Hitec servo programming protocols: the register models, the parameter table and the write plans.
Hitec servo programming protocols: the session with one servo, as a state machine that hands out step...
A record of a write.
Definition hitec_card.h:61
The registers or cells of one servo, as read.
Definition hitec_reg.h:95
What identification found.
Definition hitec_reg.h:308
One call for the task that owns the link module.
Definition hitec_prog.h:253
uint8_t kind
Definition hitec_prog.h:254
uint8_t drive
Definition hitec_prog.h:257
uint16_t ma
Definition hitec_prog.h:259
hitec_ses_step_t step
Definition hitec_prog.h:262
uint8_t family
Definition hitec_prog.h:256
uint8_t port
Definition hitec_prog.h:255
uint16_t mv
Definition hitec_prog.h:258
uint32_t id
Definition hitec_prog.h:260
What the task that owns the link module publishes, every frame.
Definition hitec_prog.h:311
uint32_t outcomes
Definition hitec_prog.h:317
bool stopped
Definition hitec_prog.h:319
uint16_t out_ma
Definition hitec_prog.h:333
hitec_link_readout_t rd
Definition hitec_prog.h:313
bool armed
Definition hitec_prog.h:320
uint8_t answer
Definition hitec_prog.h:315
uint16_t out_mv
Definition hitec_prog.h:332
uint8_t port_pin_known
Definition hitec_prog.h:327
uint32_t answer_id
Definition hitec_prog.h:314
bool supply_read
Definition hitec_prog.h:330
uint8_t rx_mark
Definition hitec_prog.h:328
bool card
Definition hitec_prog.h:336
uint8_t target
Definition hitec_prog.h:321
uint8_t port_pin[LINK_PG_PORTS_MAX]
Definition hitec_prog.h:324
hitec_link_outcome_t outcome
Definition hitec_prog.h:318
uint32_t now_ms
Definition hitec_prog.h:312
bool supply_held
Definition hitec_prog.h:334
The pass a command needs to be carried out, as kst_prog.h's gate.
Definition hitec_prog.h:275
_Atomic uint32_t pass
Definition hitec_prog.h:276
The last message, its level, its arguments and its number.
Definition hitec_prog.h:235
uint32_t seq
Definition hitec_prog.h:240
uint8_t level
Definition hitec_prog.h:237
uint16_t reg
Definition hitec_prog.h:238
uint8_t id
Definition hitec_prog.h:236
uint16_t arg
Definition hitec_prog.h:239
The programmer's state.
Definition hitec_prog.h:389
hitec_link_outcome_t last
Definition hitec_prog.h:422
uint16_t caps_mv
Definition hitec_prog.h:407
bool have_servo
Definition hitec_prog.h:412
bool lost
Definition hitec_prog.h:401
bool rec
Definition hitec_prog.h:441
bool file_busy
Definition hitec_prog.h:446
uint8_t rec_verdict
Definition hitec_prog.h:443
hitec_card_record_t rec_r
Definition hitec_prog.h:444
bool file_rec
The text out holds the record of the write that waits for it: a text taken before that write began is...
Definition hitec_prog.h:449
hitec_prog_gate_t * gate
Definition hitec_prog.h:424
bool wrote
Definition hitec_prog.h:432
hitec_image_t wr_target
Definition hitec_prog.h:429
bool write_on
Definition hitec_prog.h:430
bool armed
Definition hitec_prog.h:403
bool must_read
Definition hitec_prog.h:431
uint32_t wait_id
Definition hitec_prog.h:417
uint64_t soft_has
Definition hitec_prog.h:435
uint8_t wait
Definition hitec_prog.h:416
hitec_model_t model
Definition hitec_prog.h:414
bool abort_ready
Definition hitec_prog.h:421
uint16_t ma_open
Definition hitec_prog.h:410
bool have_last
Definition hitec_prog.h:423
uint16_t caps_ma
Definition hitec_prog.h:408
int32_t pend_value
Definition hitec_prog.h:439
uint8_t pend_id
Definition hitec_prog.h:438
hitec_prog_feed_t f
Definition hitec_prog.h:390
uint32_t wait_ms
Definition hitec_prog.h:418
uint8_t wr_values
Definition hitec_prog.h:434
uint16_t supply_mv
Definition hitec_prog.h:405
uint8_t series
Definition hitec_prog.h:396
uint16_t mv_open
Definition hitec_prog.h:409
uint8_t op
Definition hitec_prog.h:399
bool file_wanted
Definition hitec_prog.h:445
uint32_t next_id
Definition hitec_prog.h:393
hitec_image_t draft
Definition hitec_prog.h:428
hitec_image_t servo
Definition hitec_prog.h:413
bool cmd_ready
Definition hitec_prog.h:419
uint16_t supply_ma
Definition hitec_prog.h:406
bool fed
Definition hitec_prog.h:391
uint16_t pend_rules
Definition hitec_prog.h:440
hitec_session_t ses
Definition hitec_prog.h:395
uint32_t file_ms
Definition hitec_prog.h:450
hitec_prog_cmd_t cmd
Definition hitec_prog.h:420
hitec_prog_msg_t msg
Definition hitec_prog.h:425
uint32_t outcomes_seen
Definition hitec_prog.h:392
uint8_t st
Definition hitec_prog.h:398
bool reenter
Definition hitec_prog.h:404
uint8_t wr_kind
Definition hitec_prog.h:433
bool rec_open
Definition hitec_prog.h:442
bool owned
Definition hitec_prog.h:400
bool pend
Definition hitec_prog.h:437
uint8_t port
Definition hitec_prog.h:397
int32_t soft_val[HITEC_P_COUNT]
Definition hitec_prog.h:436
One step.
Definition hitec_session.h:117
The session with one servo.
Definition hitec_session.h:170