|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The programmer for servos by Hitec: the session driven through the link's task, the state the overlay draws and the messages it says. See hitec_prog.h. More...
Enumerations | |
| enum | { W_NONE = 0 , W_ANSWER , W_OUTCOME } |
| What a command waits for. More... | |
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. | |
| static bool | gate_take (hitec_prog_gate_t *g, uint32_t id) |
The pass of id, taken by whoever asks first. | |
| 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. | |
| hitec_prog_level_t | hitec_prog_level (unsigned id) |
The level of message id. | |
| hitec_prog_msg_id_t | hpg_say2 (hitec_prog_t *p, hitec_prog_msg_id_t id, unsigned arg, unsigned reg) |
Say message id. | |
| static hitec_prog_msg_id_t | say (hitec_prog_t *p, hitec_prog_msg_id_t id, unsigned arg) |
Say message id with one argument. | |
| static bool | stop_seen (const hitec_prog_t *p) |
| Whether a stop at either end cut what ran. | |
| static void | refusal_say (hitec_prog_t *p, unsigned ref) |
| The message of a refusal of the page. | |
| static void | outcome_say (hitec_prog_t *p, const hitec_link_outcome_t *o) |
| The message of a request's outcome that did not end as asked. | |
| 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. | |
| static void | session_gone (hitec_prog_t *p) |
| The session ends: nothing of it is in mode any more. | |
| static void | send (hitec_prog_t *p, hitec_prog_cmd_t *cmd) |
| Put a command on its way to the link's task. Every caller has moved off ST_IDLE first, and every end of a command's wait goes back to it: a model in ST_IDLE has no command out. | |
| static void | send_bare (hitec_prog_t *p, uint8_t kind, uint8_t port) |
A command of kind on the port the model works on. | |
| bool | hitec_prog_take (hitec_prog_t *p, hitec_prog_cmd_t *out) |
| The next command for the link's task. | |
| static void | enter (hitec_prog_t *p) |
| Start the entry into programming mode on the open port. | |
| static void | read_all (hitec_prog_t *p) |
| Start a read of the full set. | |
| static void | read_done (hitec_prog_t *p) |
| A full read ended well: the servo, its model and the message. | |
| void | hpg_ses_say (hitec_prog_t *p, hitec_ses_t r) |
| The message of a session operation that did not end well. | |
| static void | ses_done (hitec_prog_t *p, hitec_ses_t r) |
A session operation ended with r. | |
| static void | give_up (hitec_prog_t *p) |
| A command that ended without an outcome: nothing of it ran, or what ran is not known. A step out ends as one that did not run. | |
| static void | not_started (hitec_prog_t *p, unsigned answer) |
The link's task answered the command awaited with answer, not OK: it did not start. | |
| static void | on_outcome (hitec_prog_t *p, const hitec_link_outcome_t *o) |
| An outcome of the request awaited. | |
| static void | take_answers (hitec_prog_t *p) |
| The answer to the command awaited, and the outcome of its request. | |
| static void | take_timeouts (hitec_prog_t *p) |
| A command nobody answered, and a request with no outcome. | |
| static void | follow (hitec_prog_t *p) |
| The session follows the page: a port that is no longer this model's ends it. | |
| void | hpg_pump (hitec_prog_t *p) |
| The session's next step goes out, or its operation's end is taken. | |
| 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. | |
| 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. | |
| static bool | bench_armed (const hitec_prog_t *p) |
| Whether the bench is armed or asked to arm. | |
| hitec_prog_msg_id_t | hpg_held_idle (const hitec_prog_t *p, bool safe) |
| Whether an operation of the held port may start now. | |
| static hitec_prog_msg_id_t | from_pwm (const hitec_prog_t *p) |
| What keeps the tester's port from a CONNECT. | |
| 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. | |
| 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_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_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_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. | |
The programmer for servos by Hitec: the session driven through the link's task, the state the overlay draws and the messages it says. See hitec_prog.h.
Hitec is a name or trademark of its owner; it is used here only to say which servos this module works with.
SPDX-License-Identifier: MIT
| anonymous enum |
|
static |
Whether the bench is armed or asked to arm.
| p | The programmer. |
|
static |
Start the entry into programming mode on the open port.
Classic: the supply is cycled HITEC_SES_OFF_MS. D series: the supply is switched on, off 0ms, where a PD mini answers the page; without one the servo runs on the supply as it is.
| p | The programmer. |
|
static |
The session follows the page: a port that is no longer this model's ends it.
| p | The programmer. |
|
static |
What keeps the tester's port from a CONNECT.
| p | The programmer. |
|
static |
The pass of id, taken by whoever asks first.
| g | The gate. |
| id | The command's id. |
|
static |
A command that ended without an outcome: nothing of it ran, or what ran is not known. A step out ends as one that did not run.
| p | The programmer. |
| 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. |
| 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_msg_id_t hitec_prog_connect | ( | hitec_prog_t * | p | ) |
CONNECT on the SERVO screen's programming port.
| p | The programmer. |
| 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. |
| 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. |
| 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. |
| hitec_prog_msg_id_t hitec_prog_release | ( | hitec_prog_t * | p | ) |
RELEASE PORT: CLOSE the port another session holds.
| p | The programmer. |
| 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. |
| 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. |
| 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 hpg_held_idle | ( | const hitec_prog_t * | p, |
| bool | safe ) |
Whether an operation of the held port may start now.
| p | The programmer. |
| safe | true for one that sends frames: not with STOP latched, not armed, not on a STOPPED port. |
| void hpg_pump | ( | hitec_prog_t * | p | ) |
The session's next step goes out, or its operation's end is taken.
| p | The programmer. |
| hitec_prog_msg_id_t hpg_say2 | ( | hitec_prog_t * | p, |
| hitec_prog_msg_id_t | id, | ||
| unsigned | arg, | ||
| unsigned | reg ) |
Say message id.
| p | The programmer. |
| id | hitec_prog_msg_id_t. |
| arg | Its argument. |
| reg | Its second argument. |
id. | void hpg_ses_say | ( | hitec_prog_t * | p, |
| hitec_ses_t | r ) |
The message of a session operation that did not end well.
| p | The programmer. |
| r | Its result. |
|
static |
The link's task answered the command awaited with answer, not OK: it did not start.
| p | The programmer. |
| answer | hitec_link_start_t. |
|
static |
An outcome of the request awaited.
| p | The programmer. |
| o | The outcome. |
|
static |
The message of a request's outcome that did not end as asked.
| p | The programmer. |
| o | The outcome. |
|
static |
Start a read of the full set.
| p | The programmer. |
|
static |
A full read ended well: the servo, its model and the message.
| p | The programmer. |
|
static |
The message of a refusal of the page.
| p | The programmer. |
| ref | link_hitec_refusal_t. |
|
static |
Say message id with one argument.
| p | The programmer. |
| id | hitec_prog_msg_id_t. |
| arg | Its argument. |
id.
|
static |
Put a command on its way to the link's task. Every caller has moved off ST_IDLE first, and every end of a command's wait goes back to it: a model in ST_IDLE has no command out.
| p | The programmer. |
| cmd | The command; its id is given here. |
|
static |
A command of kind on the port the model works on.
| p | The programmer. |
| kind | hitec_prog_cmd_kind_t. |
| port | The programming port. |
|
static |
A session operation ended with r.
| p | The programmer. |
| r | Its result. |
|
static |
The session ends: nothing of it is in mode any more.
| p | The programmer. |
|
static |
Whether a stop at either end cut what ran.
| p | The programmer. |
|
static |
The answer to the command awaited, and the outcome of its request.
| p | The programmer. |
|
static |
A command nobody answered, and a request with no outcome.
| p | The programmer. |