|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The programmer for servos by Hitec as the SERVO screen runs it: the session with one servo, driven step by step through the panel's half of the HITEC link page, read only. More...
#include <stdatomic.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "hitec_card.h"#include "hitec_link.h"#include "hitec_reg.h"#include "hitec_session.h"#include "link_pages.h"Go to the source code of this file.
Data Structures | |
| struct | hitec_prog_msg_t |
| The last message, its level, its arguments and its number. More... | |
| struct | hitec_prog_cmd_t |
| One call for the task that owns the link module. More... | |
| struct | hitec_prog_gate_t |
| The pass a command needs to be carried out, as kst_prog.h's gate. More... | |
| struct | hitec_prog_feed_t |
| What the task that owns the link module publishes, every frame. More... | |
| struct | hitec_prog_t |
| The programmer's state. More... | |
Macros | |
| #define | HITEC_PROG_SUPPLY_MV 5000u |
| The programming voltage and current until set otherwise. | |
| #define | HITEC_PROG_SUPPLY_MA 1000u |
| The programming current limit until set otherwise, mA. | |
| #define | HITEC_PROG_MV_MIN LINK_HITEC_SUPPLY_MIN_MV |
| The lowest programming voltage a POWER takes, mV. | |
| #define | HITEC_PROG_MV_MAX LINK_HITEC_SUPPLY_MAX_MV |
| The highest, mV: a higher setting is taken as this one. | |
| #define | HITEC_PROG_MA_MIN 50u |
| The lowest current limit a POWER takes, mA. | |
| #define | HITEC_PROG_MA_MAX 3000u |
| The highest, mA: the PD mini's. | |
| #define | HITEC_PROG_PIN_LAST 47u |
| The highest GPIO of the IOmcu, and a pin that is not known. | |
| #define | HITEC_PROG_NO_PIN 0xFFu |
| A pin that is not known. | |
| #define | HITEC_PROG_START_MS 2000u |
| A command the link's task has not answered this long is given up, ms. | |
| #define | HITEC_PROG_RUN_MS (HITEC_LINK_RUN_MAX_MS + 5000u) |
| A request without an outcome this long after its command was taken is aborted, ms: HITEC_LINK_RUN_MAX_MS and 5000ms. | |
| #define | HITEC_PROG_CARD_MS 3000u |
| A write waits this long for the card to take its record, ms. | |
| #define | HITEC_RULE_BIT(r) |
The bit of rule r in a rule set. | |
| #define | HITEC_PROG_CUT_CHECK 0xFFu |
| HITEC_PROG_MSG_WRITE_CUT's kind of a cut in the read-back. | |
| #define | HITEC_PROG_SLOW_PCT 30 |
| The speed below which SPEED asks, %. | |
| #define | HITEC_PROG_FS_FAR_US 300 |
| How far from 1500us a failsafe position asks, us. | |
Functions | |
| void | hitec_prog_gate_init (hitec_prog_gate_t *g) |
| Sets up a gate: no pass offered. | |
| void | hitec_prog_gate_offer (hitec_prog_gate_t *g, uint32_t id) |
The pass of command id is there to be taken. | |
| bool | hitec_prog_gate_claim (hitec_prog_gate_t *g, uint32_t id) |
The link's task, with command id out of its queue. | |
| bool | hitec_prog_gate_revoke (hitec_prog_gate_t *g, uint32_t id) |
The model gives command id up. | |
| void | hitec_prog_init (hitec_prog_t *p) |
| Sets up the programmer: nothing fed, D series, the default supply. | |
| 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. | |
| 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, and the state follows the page. | |
| bool | hitec_prog_take (hitec_prog_t *p, hitec_prog_cmd_t *out) |
| The next command for the link's task. | |
| hitec_prog_state_t | hitec_prog_state (const hitec_prog_t *p) |
| Where the programmer is. | |
| void | hitec_prog_bench_armed (hitec_prog_t *p, bool armed) |
| The bench is armed or asked to arm. | |
| 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: hitec_prog_servo() and hitec_prog_model() return NULL until the next read. | |
| 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. | |
| 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. | |
| 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. | |
| 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 HITEC_PROG_MV_MIN. | |
| 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. | |
| bool | hitec_prog_mv_capped (const hitec_prog_t *p) |
| Whether the setting is above HITEC_PROG_MV_MAX and is taken as it. | |
| hitec_prog_msg_id_t | hitec_prog_connect (hitec_prog_t *p) |
| CONNECT on the SERVO screen's programming port. | |
| hitec_prog_msg_id_t | hitec_prog_read (hitec_prog_t *p) |
| READ ALL. | |
| hitec_prog_msg_id_t | hitec_prog_leave (hitec_prog_t *p) |
| LEAVE: programming mode ends and the port goes back to PWM. | |
| hitec_prog_msg_id_t | hitec_prog_clear (hitec_prog_t *p) |
| CLEAR the page's STOPPED flag, then the entry or the read. | |
| void | hitec_prog_abort (hitec_prog_t *p) |
| ABORT the running operation; the port stays held. | |
| hitec_prog_msg_id_t | hitec_prog_release (hitec_prog_t *p) |
| RELEASE PORT: CLOSE the port another session holds. | |
| const hitec_prog_msg_t * | hitec_prog_message (const hitec_prog_t *p) |
| The last message. | |
| hitec_prog_level_t | hitec_prog_level (unsigned id) |
The level of message id. | |
| 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 session, else the tester's; 0 while the tester drives the standard outputs. | |
| 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. | |
| 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, else the mode its next OPEN takes. | |
| bool | hitec_prog_on_port (const hitec_prog_t *p) |
| Whether the SERVO screen's tester drives a programming port. | |
| 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 programmer opens and the bench takes no arm. | |
| 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. | |
| bool | hitec_prog_in_mode (const hitec_prog_t *p) |
| Whether the servo is in programming mode. | |
| bool | hitec_prog_stopped (const hitec_prog_t *p) |
| Whether the page's STOPPED flag is set on this panel's port. | |
| bool | hitec_prog_rail (const hitec_prog_t *p) |
| Whether a PD mini answers the page (LINK_HT_F_RAIL). | |
| const hitec_image_t * | hitec_prog_servo (const hitec_prog_t *p) |
| The servo as the last full read found it; NULL with none. | |
| const hitec_model_t * | hitec_prog_model (const hitec_prog_t *p) |
| The model of that servo; NULL with none. | |
| 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. | |
| bool | hitec_prog_progress (const hitec_prog_t *p, unsigned *done, unsigned *total) |
| The progress of the running read. | |
| 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. | |
| 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. | |
| 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, the port not stopped. | |
| bool | hitec_prog_editable (const hitec_prog_t *p, uint8_t id) |
Whether parameter id of the servo's layout takes an edit. | |
| 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. | |
| uint16_t | hitec_prog_pending (const hitec_prog_t *p, uint8_t *id, int32_t *value) |
| The edit that waits for a confirmation. | |
| hitec_prog_edit_t | hitec_prog_confirm (hitec_prog_t *p) |
| Take the edit that waits: its rules are confirmed for its value. | |
| void | hitec_prog_cancel (hitec_prog_t *p) |
| Drop the edit that waits; the draft stays as it was. | |
| 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. | |
| 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. | |
| unsigned | hitec_prog_changes (const hitec_prog_t *p) |
| The writable parameters in which the draft differs from the servo read. | |
| void | hitec_prog_discard (hitec_prog_t *p) |
| DISCARD EDITS: the draft is the servo read again, and every confirmation ends. | |
| hitec_prog_msg_id_t | hitec_prog_write_enable (hitec_prog_t *p, bool on) |
| ENABLE WRITE TO SERVO. | |
| bool | hitec_prog_write_on (const hitec_prog_t *p) |
| Whether ENABLE WRITE TO SERVO is on. | |
| 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. | |
| hitec_prog_msg_id_t | hitec_prog_write (hitec_prog_t *p) |
| WRITE n VALUES: the draft to the servo, then its read-back. | |
| 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. | |
| hitec_prog_msg_id_t | hitec_prog_repair (hitec_prog_t *p) |
| REPAIR: the classic balance 0x1C alone, then the read-back. | |
| bool | hitec_prog_first_done (const hitec_prog_t *p) |
| Whether the first write of this CONNECT has gone out. | |
| bool | hitec_prog_write_progress (const hitec_prog_t *p, unsigned *done, unsigned *total, uint8_t *kind) |
| The progress of the running write. | |
| bool | hitec_prog_record (const hitec_prog_t *p) |
| Whether a record of a write stands. | |
| hitec_prog_rec_t | hitec_prog_record_verdict (const hitec_prog_t *p) |
| What the last servo read holds of the record. | |
| 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 it ends verified. | |
| 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. | |
| hitec_prog_msg_id_t | hitec_prog_forget (hitec_prog_t *p) |
| FORGET: discard the record without a write. | |
| bool | hitec_prog_file_due (const hitec_prog_t *p) |
| Whether the record's text is to go to the card. | |
| 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, no card is mounted or n is under HITEC_CARD_TEXT_MAX. | |
| void | hitec_prog_file_done (hitec_prog_t *p, bool ok) |
| How the card took the text hitec_prog_file_take() gave. | |
| 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. | |
The programmer for servos by Hitec as the SERVO screen runs it: the session with one servo, driven step by step through the panel's half of the HITEC link page, read only.
Hitec is a name or trademark of its owner; it is used here only to say which servos this module works with.
The session runs on the panel (protocols/hitec/include/hitec_session.h): this model holds it, hands each of its steps to the task that owns the link module (hitec_link.h) as a command, and feeds each outcome back. The IOmcu's page runs one raw transaction at a time and holds no session (shared/outputs/hitec_port.h).
What it does:
Writing (hitec_prog_write.c):
Every model is written: the D series with the HFP-30's registers, the classic servos with the HPP-21 Plus's cells (hitec_reg.h).
The programming voltage is the SERVO programmer's setting; the page takes LINK_HITEC_SUPPLY_MIN_MV to LINK_HITEC_SUPPLY_MAX_MV for a POWER, so a higher one is taken as LINK_HITEC_SUPPLY_MAX_MV (hitec_prog_mv()).
Every refusal, outcome and session result becomes one message (hitec_prog_msg_id_t) the screen has a text for.
Pure C. The caller hands in hitec_prog_feed_t every frame and carries out the commands hitec_prog_take() gives. One task only.
SPDX-License-Identifier: MIT
| #define HITEC_RULE_BIT | ( | r | ) |
The bit of rule r in a rule set.
The kinds of command for the task that owns the link module.
| Enumerator | |
|---|---|
| HITEC_PROG_CMD_OPEN | |
| HITEC_PROG_CMD_STEP | |
| HITEC_PROG_CMD_CLEAR | |
| HITEC_PROG_CMD_CLOSE | |
| HITEC_PROG_CMD_ABORT | hitec_link_abort(); answered by none |
| enum hitec_prog_edit_t |
| enum hitec_prog_msg_id_t |
What the screen says.
| Enumerator | |
|---|---|
| HITEC_PROG_MSG_READ | read; arg the D series model number, reg the D series ID or the classic version |
| HITEC_PROG_MSG_DOWN | no IOmcu answers |
| HITEC_PROG_MSG_NO_PAGE | the IOmcu has no HITEC page |
| HITEC_PROG_MSG_BUSY | another operation runs |
| HITEC_PROG_MSG_NEED_DISARM | ARMED or asked to arm |
| HITEC_PROG_MSG_STOP_LATCHED | STOP is latched at the panel |
| HITEC_PROG_MSG_NEED_TARGET | the tester drives the standard outputs |
| HITEC_PROG_MSG_NO_PIN | the port has no pin |
| HITEC_PROG_MSG_RX_PENDING | the D series receive mode is not held by the IOmcu yet |
| HITEC_PROG_MSG_NEED_PD_C | classic, and no PD mini answers |
| HITEC_PROG_MSG_SUPPLY_CAPS | the programming voltage or current is above the SUPPLY limits |
| HITEC_PROG_MSG_HELD_KST | the KST page holds the port |
| HITEC_PROG_MSG_HELD_OTHER | the page holds a port this panel did not open; arg its port |
| HITEC_PROG_MSG_NO_C | no classic servo answered |
| HITEC_PROG_MSG_NO_D | no D series servo answered |
| HITEC_PROG_MSG_ENTRY_BAD | bytes came that do not fit the series' entry |
| HITEC_PROG_MSG_READ_FAIL | a read failed on every try; arg the address |
| HITEC_PROG_MSG_NOT_IN_MODE | no servo is in programming mode |
| HITEC_PROG_MSG_STOPPED | a stop cut the operation |
| HITEC_PROG_MSG_ABORTED | ABORT ended it |
| HITEC_PROG_MSG_CLEARED | CLEAR was taken |
| HITEC_PROG_MSG_UNSAFE | refused: the IOmcu trusts neither heartbeat nor link |
| HITEC_PROG_MSG_LEFT | the port is back in PWM |
| HITEC_PROG_MSG_RELEASED | another's port closed; arg its port |
| HITEC_PROG_MSG_SESSION_ENDED | the port went back to PWM with no command of this model |
| HITEC_PROG_MSG_TIMEOUT | no answer or no outcome in time |
| HITEC_PROG_MSG_NO_ANSWER | the link did not answer |
| HITEC_PROG_MSG_RESTARTED | the IOmcu started again, or another writer sent a command |
| HITEC_PROG_MSG_NACK | a frame refused; arg the reason |
| HITEC_PROG_MSG_REFUSED | refused for a reason with no message of its own; arg link_hitec_refusal_t |
| HITEC_PROG_MSG_NO_LINE | OPEN: the IOmcu found no free line |
| HITEC_PROG_MSG_SUPPLY | POWER: the supply did not switch |
| HITEC_PROG_MSG_UNKNOWN | a code the tables do not hold; arg the code |
| HITEC_PROG_MSG_WRITTEN | a write verified; arg the values |
| HITEC_PROG_MSG_REPAIRED | the classic balance written |
| HITEC_PROG_MSG_RESTORED | the record's values written back |
| HITEC_PROG_MSG_WRITE_OFF | the write switch is off |
| HITEC_PROG_MSG_NOT_READ | no servo read |
| HITEC_PROG_MSG_MUST_READ | a write failed: READ ALL first |
| HITEC_PROG_MSG_NO_CHANGES | the draft is the servo's |
| HITEC_PROG_MSG_EDITS_PENDING | edits not written stand |
| HITEC_PROG_MSG_EDIT_REFUSED | an edit refused; arg hitec_set_t |
| HITEC_PROG_MSG_RECORD_FAILED | the card took no record; nothing was written |
| HITEC_PROG_MSG_WRITE_CUT | a write ended after a step went out; arg the address (a balance: the cell it balances), reg the hitec_step_kind_t of the step out or HITEC_PROG_CUT_CHECK |
| HITEC_PROG_MSG_VERIFY_FAIL | the read-back differs; arg the addresses that differ |
| HITEC_PROG_MSG_RECORD | a record stands, not compared yet; arg its pin, reg its port |
| HITEC_PROG_MSG_REC_SAME | the servo holds the values before the recorded write; as RECORD |
| HITEC_PROG_MSG_REC_DONE | it holds the write's values |
| HITEC_PROG_MSG_REC_MIX | it holds both |
| HITEC_PROG_MSG_REC_OTHER | it is another servo; as RECORD |
| HITEC_PROG_MSG_RECORD_HELD | a write refused: a record stands |
| HITEC_PROG_MSG_FORGOTTEN | the record discarded |
| HITEC_PROG_MSG_RECORD_BAD | the card's record does not read; arg hitec_card_result_t |
| HITEC_PROG_MSG_SUM_OK | REPAIR refused: the sum is right |
| enum hitec_prog_rec_t |
What the servo read holds of a record.
| enum hitec_prog_rule_t |
The soft rules of an edit: bit n of a rule set is rule n.
| enum hitec_prog_state_t |
Where the programmer is.
| enum hitec_prog_wr_t |
| void hitec_prog_abort | ( | hitec_prog_t * | p | ) |
ABORT the running operation; the port stays held.
| p | The programmer. |
| void hitec_prog_bench_armed | ( | hitec_prog_t * | p, |
| bool | armed ) |
The bench is armed or asked to arm.
| p | The programmer. |
| armed | true while it is. |
| 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, the port not stopped.
| p | The programmer. |
| void hitec_prog_cancel | ( | hitec_prog_t * | p | ) |
Drop the edit that waits; the draft stays as it was.
| p | The programmer. |
| unsigned hitec_prog_changes | ( | const hitec_prog_t * | p | ) |
The writable parameters in which the draft differs from the servo read.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_clear | ( | hitec_prog_t * | p | ) |
CLEAR the page's STOPPED flag, then the entry or the read.
| p | The programmer. |
| hitec_prog_edit_t hitec_prog_confirm | ( | hitec_prog_t * | p | ) |
Take the edit that waits: its rules are confirmed for its value.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_connect | ( | hitec_prog_t * | p | ) |
CONNECT on the SERVO screen's programming port.
| p | The programmer. |
| 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.
| p | The programmer. |
| img | The image; the draft for NULL. |
| id | hitec_param_t. |
| void hitec_prog_discard | ( | hitec_prog_t * | p | ) |
DISCARD EDITS: the draft is the servo read again, and every confirmation ends.
| p | The programmer. |
| 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.
| p | The programmer. |
| 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.
A value equal to the draft's changes nothing. A value hitec_param_set() refuses is refused (HITEC_PROG_MSG_EDIT_REFUSED, arg its hitec_set_t). A value that breaks a soft rule not confirmed for it waits: hitec_prog_pending() names it, hitec_prog_confirm() takes it, hitec_prog_cancel() drops it.
| p | The programmer. |
| id | hitec_param_t. |
| value | The value. |
| bool hitec_prog_editable | ( | const hitec_prog_t * | p, |
| uint8_t | id ) |
Whether parameter id of the servo's layout takes an edit.
| p | The programmer. |
| id | hitec_param_t. |
| 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, and the state follows the page.
| p | The programmer. |
| f | The feed. |
| void hitec_prog_file_done | ( | hitec_prog_t * | p, |
| bool | ok ) |
How the card took the text hitec_prog_file_take() gave.
Only the answer to the text that holds the record of the write waiting in HITEC_PROG_RECORDING releases that write, or ends it when the card refused the text. The answer to a text taken before that write began, the record of an aborted or timed-out write or the text that clears a record, only frees the card for the next text.
| p | The programmer. |
| ok | true when the card holds it whole. |
| bool hitec_prog_file_due | ( | const hitec_prog_t * | p | ) |
Whether the record's text is to go to the card.
| p | The programmer. |
| 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.
| p | The programmer. |
| text | The text. |
| len | Its length in bytes. |
| 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, no card is mounted or n is under HITEC_CARD_TEXT_MAX.
| p | The programmer. |
| out | Receives the text. |
| n | Bytes at out. |
| bool hitec_prog_first_done | ( | const hitec_prog_t * | p | ) |
Whether the first write of this CONNECT has gone out.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_forget | ( | hitec_prog_t * | p | ) |
FORGET: discard the record without a write.
| p | The programmer. |
| bool hitec_prog_gate_claim | ( | hitec_prog_gate_t * | g, |
| uint32_t | id ) |
The link's task, with command id out of its queue.
| g | The gate. |
| id | The command's id. |
| void hitec_prog_gate_init | ( | hitec_prog_gate_t * | g | ) |
Sets up a gate: no pass offered.
| g | The gate. |
| void hitec_prog_gate_offer | ( | hitec_prog_gate_t * | g, |
| uint32_t | id ) |
The pass of command id is there to be taken.
| g | The gate. |
| id | The command's id. |
| bool hitec_prog_gate_revoke | ( | hitec_prog_gate_t * | g, |
| uint32_t | id ) |
The model gives command id up.
| g | The gate. |
| id | The command's id. |
| 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.
With none, a command nobody answers within HITEC_PROG_START_MS counts as one that may have run: an ABORT follows it.
| p | The programmer. |
| g | The gate. |
| 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 programmer opens and the bench takes no arm.
| p | The programmer. |
| bool hitec_prog_in_mode | ( | const hitec_prog_t * | p | ) |
Whether the servo is in programming mode.
| p | The programmer. |
| void hitec_prog_init | ( | hitec_prog_t * | p | ) |
Sets up the programmer: nothing fed, D series, the default supply.
| p | The programmer. |
| 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.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_leave | ( | hitec_prog_t * | p | ) |
LEAVE: programming mode ends and the port goes back to PWM.
Taken while the port is this panel's and nothing runs, STOPPED or not.
| p | The programmer. |
| hitec_prog_level_t hitec_prog_level | ( | unsigned | id | ) |
| 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.
| p | The programmer. |
| const hitec_prog_msg_t * hitec_prog_message | ( | const hitec_prog_t * | p | ) |
The last message.
| p | The programmer. |
| const hitec_model_t * hitec_prog_model | ( | const hitec_prog_t * | p | ) |
The model of that servo; NULL with none.
| p | The programmer. |
| 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 HITEC_PROG_MV_MIN.
| p | The programmer. |
| bool hitec_prog_mv_capped | ( | const hitec_prog_t * | p | ) |
Whether the setting is above HITEC_PROG_MV_MAX and is taken as it.
| p | The programmer. |
| bool hitec_prog_on_port | ( | const hitec_prog_t * | p | ) |
Whether the SERVO screen's tester drives a programming port.
| p | The programmer. |
| uint16_t hitec_prog_pending | ( | const hitec_prog_t * | p, |
| uint8_t * | id, | ||
| int32_t * | value ) |
The edit that waits for a confirmation.
| p | The programmer. |
| id | Receives its hitec_param_t; may be NULL. |
| value | Receives its value; may be NULL. |
| 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.
| p | The programmer. |
| 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 session, else the tester's; 0 while the tester drives the standard outputs.
| p | The programmer. |
| 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.
| rd | The module's readout. |
| 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, else the mode its next OPEN takes.
| p | The programmer. |
| bool hitec_prog_progress | ( | const hitec_prog_t * | p, |
| unsigned * | done, | ||
| unsigned * | total ) |
The progress of the running read.
| p | The programmer. |
| done | Receives the addresses read. |
| total | Receives the addresses it reads. |
| bool hitec_prog_rail | ( | const hitec_prog_t * | p | ) |
Whether a PD mini answers the page (LINK_HT_F_RAIL).
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_read | ( | hitec_prog_t * | p | ) |
READ ALL.
| p | The programmer. |
| bool hitec_prog_record | ( | const hitec_prog_t * | p | ) |
Whether a record of a write stands.
| p | The programmer. |
| hitec_prog_rec_t hitec_prog_record_verdict | ( | const hitec_prog_t * | p | ) |
What the last servo read holds of the record.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_release | ( | hitec_prog_t * | p | ) |
RELEASE PORT: CLOSE the port another session holds.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_repair | ( | hitec_prog_t * | p | ) |
REPAIR: the classic balance 0x1C alone, then the read-back.
| p | The programmer. |
| 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 it ends verified.
Taken once the servo read is compared and is not another servo.
| p | The programmer. |
| 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.
| p | The programmer. |
| out | Receives it. |
| 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.
| p | The programmer. |
| 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.
| p | The programmer. |
| id | hitec_param_t. |
| value | The value. |
| 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.
| p | The programmer. |
| 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: hitec_prog_servo() and hitec_prog_model() return NULL until the next read.
| p | The programmer. |
| series | hitec_family_t. |
| const hitec_image_t * hitec_prog_servo | ( | const hitec_prog_t * | p | ) |
The servo as the last full read found it; NULL with none.
| p | The programmer. |
| hitec_prog_state_t hitec_prog_state | ( | const hitec_prog_t * | p | ) |
Where the programmer is.
| p | The programmer. |
| bool hitec_prog_stopped | ( | const hitec_prog_t * | p | ) |
Whether the page's STOPPED flag is set on this panel's port.
| p | The programmer. |
| 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.
| p | The programmer. |
| 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.
| p | The programmer. |
| max_mv | The voltage limit, mV. |
| max_ma | The current limit, mA. |
| 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.
| p | The programmer. |
| mv | The voltage, mV. |
| ma | The current limit, mA. |
| bool hitec_prog_take | ( | hitec_prog_t * | p, |
| hitec_prog_cmd_t * | out ) |
The next command for the link's task.
| p | The programmer. |
| out | Receives it. |
| hitec_prog_msg_id_t hitec_prog_write | ( | hitec_prog_t * | p | ) |
WRITE n VALUES: the draft to the servo, then its read-back.
| p | The programmer. |
| hitec_prog_msg_id_t hitec_prog_write_enable | ( | hitec_prog_t * | p, |
| bool | on ) |
ENABLE WRITE TO SERVO.
Off is always taken. On needs the state hitec_prog_can_edit() needs, a SAFE bench and no STOP latched.
| p | The programmer. |
| on | The switch. |
| 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.
| p | The programmer. |
| kind | hitec_prog_wr_t. |
| bool hitec_prog_write_on | ( | const hitec_prog_t * | p | ) |
Whether ENABLE WRITE TO SERVO is on.
| p | The programmer. |
| bool hitec_prog_write_progress | ( | const hitec_prog_t * | p, |
| unsigned * | done, | ||
| unsigned * | total, | ||
| uint8_t * | kind ) |
The progress of the running write.
| p | The programmer. |
| done | Receives the plan's steps done. |
| total | Receives its steps. |
| kind | Receives the hitec_step_kind_t of the step out; 0xFF in the read-back. |