|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Stick programming: an ESC (electronic speed controller) programmed through its throttle-stick menu, with the beeps counted in the supply current. More...
Go to the source code of this file.
Data Structures | |
| struct | esc_stick_timing_t |
| How the beeps are timed and told apart from the ESC's idle current. More... | |
| struct | esc_stick_change_t |
| One selection: the profile's item and value, as indices. More... | |
| struct | esc_det_t |
| The beep detector: hysteresis on the current above its idle floor, pulse and gap lengths judged in readings, groups split by silence. More... | |
| struct | esc_stick_bench_t |
| What the bench is doing, each step. More... | |
| struct | esc_stick_sample_t |
One supply sample. seq is the supply's count of its own readings, modulo 65536 (supply_state_t's samples): it moves when the reading is new, and a step of more than one is a reading the panel never saw. at_ms is when the panel first had the reading (taken_ms), so a supply whose count stops is a supply whose readings stop, however often the panel reads its page. More... | |
| struct | esc_stick_out_t |
| What the bench is to do, after a step. More... | |
| struct | esc_stick_t |
| State of one stick programming run. More... | |
| struct | esc_stick_light_t |
| The green light: on while the detector holds a pulse, from the reading that rose above the threshold to the one that fell below the release, and for at least ESC_STICK_BEEP_LIGHT_MS from the first look that sees a pulse begun, so a pulse that rises and falls between two looks still shows. More... | |
Macros | |
| #define | ESC_STICK_MAX_CHANGES 16u |
| The most selections one run makes. | |
| #define | ESC_STICK_SIGNAL_MS 1000u |
| The throttle at the entry position before the supply comes on, ms: the ESC has to see the signal when it starts. | |
| #define | ESC_STICK_ARM_WAIT_MS 3000u |
| How long the bench is given to arm, and the supply to report its output on, ms. | |
| #define | ESC_STICK_POWER_WAIT_MS 3000u |
| Time the supply is given to report its output on, ms. | |
| #define | ESC_STICK_STALE_MS 1000u |
| No new reading for this long ends the run, ms. | |
| #define | ESC_STICK_SETTLE_MS 500u |
| Readings ignored for the floor after the output comes on: the ESC's input capacitors charging, ms. | |
| #define | ESC_STICK_LATE_RUN 3u |
| This many late readings in a row end the run: the supply reads too slowly for the beeps the timing describes. | |
| #define | ESC_STICK_HAND_WAIT_MS 60000u |
| A manual step not confirmed within this long ends the run, ms. | |
| #define | ESC_STICK_HAND_MIN_MS 1000u |
| DONE counts only this long after its step is asked, ms, so one tap meant for the step before cannot confirm the next. | |
| #define | ESC_STICK_OFF_MA 20 |
| The output counts as off only once the supply itself reports it off and the current has stayed at or under ESC_STICK_OFF_MA for ESC_STICK_OFF_SETTLE_MS, in readings taken after the run asked it off: the panel's own OFF is a request, and the module answers it later. | |
| #define | ESC_STICK_OFF_SETTLE_MS 200u |
| Time the current must stay at or under ESC_STICK_OFF_MA, ms. | |
| #define | ESC_STICK_PCT_MIN 0.0f |
| Throttle positions as the output's percentage of travel. | |
| #define | ESC_STICK_PCT_MID 50.0f |
| Throttle middle, as the output's percentage of travel. | |
| #define | ESC_STICK_PCT_MAX 100.0f |
| Throttle maximum, as the output's percentage of travel. | |
| #define | ESC_STICK_BEEP_LIGHT_MS 150u |
| A beep shown for less than this would fall between two frames, ms: the green light stays on at least this long from the frame that first sees the pulse. | |
Functions | |
| void | esc_stick_timing_defaults (esc_stick_timing_t *t) |
| The defaults the settings start from. | |
| uint32_t | esc_stick_read_max_ms (const esc_stick_timing_t *t) |
| The longest interval between two readings the timing allows: the shorter of a beep and a gap, so every beep and every gap holds at least one reading. | |
| esc_stick_kind_t | esc_stick_kind (const esc_profile_t *p, const char **why) |
Which menu the engine runs for p, or ESC_STICK_KIND_NONE with the reason in why (a static string; may be NULL). | |
| esc_throttle_t | esc_stick_listen (const esc_profile_t *p) |
| Where the stick rests while the menu sounds: the profile's listen move, else where the entry left it. | |
| float | esc_stick_pct (esc_throttle_t pos) |
| A throttle position as the output's percentage. | |
| uint32_t | esc_stick_profile_mv (const esc_profile_t *p) |
| The supply voltage a profile asks for, mV: the lowest stated cell count among its models at 3800mV a LiPo cell or 1200mV a NiMH cell, which is above that model's cut-off and under every model's maximum. 0 when no model states a cell count. | |
| uint32_t | esc_stick_model_mv (const esc_profile_t *p, int model) |
The supply voltage for model model of p, mV: its own lowest cell count at the rates above, where it states one; else, and for -1, the family's (esc_stick_profile_mv()). | |
| uint32_t | esc_stick_model_v_max (const esc_profile_t *p, int model) |
The highest supply voltage model model of p is rated for, mV: its v_max_mv. | |
| uint32_t | esc_stick_model_ma_max (const esc_profile_t *p, int model) |
The continuous current model model of p is rated for, mA: its current_a. | |
| uint32_t | esc_stick_model_v_min (const esc_profile_t *p, int model) |
The lowest input model model of p takes, mV: its v_min_mv. | |
| esc_stick_rating_t | esc_stick_rating (const esc_profile_t *p, int model, uint32_t mv, uint32_t ma, bool by_hand) |
Whether mv and ma suit model model of p (-1: every model of the family). | |
| bool | esc_stick_rating_unknown (const esc_profile_t *p, int model, uint32_t mv, bool by_hand) |
Whether the data cannot vouch for mv on model model: the rated voltage is not stated, and the voltage is set by hand (by_hand) or is not the model's own cell count's – the family's lowest standing in for a model that states none, or none at all. | |
| bool | esc_stick_is_action (const esc_item_t *it) |
Whether it is an action rather than a setting: keyed reset or exit. | |
| const char * | esc_stick_not_offered (const esc_item_t *it) |
Why it is not offered as a change, or NULL when it is: an action, or an item with a single value, which is either the only setting there is or a rule written as a value ("N beeps = N cells") – nothing to choose either way, and nothing the menu would sound in order. | |
| esc_throttle_t | esc_stick_change_entry (const esc_profile_t *p, const esc_stick_change_t *c) |
The stick position change c is powered up from: its value's entry_throttle where the manual names one, else the profile's entry. | |
| bool | esc_stick_check (const esc_profile_t *p, const esc_stick_change_t *ch, size_t n, const esc_stick_timing_t *t, const char **why) |
Whether a run of n changes under t can start on p; the reason in why when not. | |
| void | esc_det_init (esc_det_t *d, const esc_stick_timing_t *t, uint8_t long_equals_short) |
| Set up the beep detector. | |
| void | esc_det_count (esc_det_t *d) |
| Pulses and groups from the next reading on; the floor is kept. | |
| esc_det_event_t | esc_det_reading (esc_det_t *d, uint32_t t_ms, int32_t ma, bool late) |
One reading, at t_ms, of ma; late marks it as having come too long after the one before. | |
| int32_t | esc_det_floor_ma (const esc_det_t *d) |
| The idle floor, mA. | |
| const char * | esc_stick_reason_text (esc_stick_reason_t r) |
| A word or two for the screen. | |
| esc_stick_reason_t | esc_stick_stop_reason (uint32_t stops, uint32_t pressed) |
The end stops stops give, pressed of them pressed by an operator, both counted over the same span: STOP when every one was pressed, BENCH STOPPED when any was not, so a stop the bench raised is never hidden by a press that came with it. | |
| bool | esc_stick_reason_is_fault (esc_stick_reason_t r) |
Whether a run that ended for r ended because something was not as expected: a reading, the supply, the link, the arm, the ESC, or a stop the bench raised itself. | |
| const char * | esc_stick_phase_text (esc_stick_phase_t ph) |
| Short text for a run phase. | |
| bool | esc_stick_start (esc_stick_t *e, const esc_profile_t *p, const esc_stick_change_t *ch, size_t n, const esc_stick_timing_t *t, uint32_t mv, uint32_t ma, const esc_stick_bench_t *b, const char **why) |
Start a run. mv and ma are the supply's set points, already held to the caps by the caller. | |
| void | esc_stick_sample (esc_stick_t *e, const esc_stick_sample_t *s) |
| One supply sample, as it arrives. | |
| void | esc_stick_step (esc_stick_t *e, const esc_stick_bench_t *b) |
Advance to b->now_ms and judge the bench. | |
| void | esc_stick_abort (esc_stick_t *e, esc_stick_reason_t why) |
End the run now, for why: throttle to its rest, supply off, disarmed. | |
| bool | esc_stick_running (const esc_stick_t *e) |
| Whether the run is under way: started and neither done nor aborted. | |
| const esc_stick_out_t * | esc_stick_out (const esc_stick_t *e) |
| What the bench is to do now. | |
| const esc_manual_t * | esc_stick_hand (const esc_stick_t *e) |
| The manual step the run waits for, or NULL when it waits for none. | |
| uint32_t | esc_stick_change_entry_ms (const esc_profile_t *p, const esc_stick_change_t *c, const esc_stick_timing_t *t) |
Power-on to the menu for change c, ms, as the run waits it: its value's entry_hold_ms where the manual gives one (Kontronik SUN PLUS modes 4 to 6, 5s), else t's entry, and no less than the longest hold of the profile's at_power_up steps. c NULL: the entry's. | |
| uint32_t | esc_stick_entry_ms (const esc_stick_t *e) |
| Power-on to the menu at this power-up, ms: esc_stick_change_entry_ms() of the change it makes. | |
| bool | esc_stick_cut_short (const esc_stick_t *e) |
| Whether the run ended between a selection and the DONE of the profile's before_power_off steps, or before the last of the moves that store the value (esc_stick_store_move()) – while the ESC stored or confirmed: the value may not be stored. | |
| bool | esc_stick_end_locks (const esc_stick_t *e) |
| Whether a before_power_off step of the run's profile marks locks: a cut before every such step is confirmed may lock the ESC, whichever step is asked. | |
| bool | esc_stick_lock_risk (const esc_stick_t *e) |
| esc_stick_cut_short() and esc_stick_end_locks(): the ESC may have locked itself. | |
| bool | esc_stick_hand_ready (const esc_stick_t *e) |
| Whether DONE would count now: ESC_STICK_HAND_MIN_MS after the step was asked. | |
| uint32_t | esc_stick_hand_left_ms (const esc_stick_t *e) |
| The time left to confirm the step asked, ms; 0 when none is. | |
| bool | esc_stick_confirm (esc_stick_t *e) |
| DONE: the step asked is done. | |
| esc_throttle_t | esc_stick_store_move (const esc_stick_t *e, unsigned k) |
The k-th move after a selection, from 0, or ESC_THR_NONE past the last: the profile's store move, then the moves the stored value asks for (esc_value_t's after: Kontronik's car modes go to the brake after full throttle). | |
| unsigned | esc_stick_done_count (const esc_stick_t *e) |
| How many selections have been made. | |
| bool | esc_stick_unsure (const esc_stick_t *e, unsigned i) |
Whether change i was selected, but the run was cut short before the ESC stored or confirmed it (esc_stick_cut_short()): the selection being stored when the run ended. | |
| unsigned | esc_stick_made_count (const esc_stick_t *e) |
| The selections made for certain: esc_stick_done_count() less the one esc_stick_unsure() names. | |
| unsigned | esc_stick_beeps (const esc_stick_t *e) |
| The beeps of the group under way. | |
| void | esc_stick_light_reset (esc_stick_light_t *l, const esc_stick_t *e) |
Start watching e: pulses already counted do not light it. | |
| bool | esc_stick_light_green (esc_stick_light_t *l, const esc_stick_t *e, uint32_t now_ms) |
Whether the green light is on at now_ms. | |
Stick programming: an ESC (electronic speed controller) programmed through its throttle-stick menu, with the beeps counted in the supply current.
The ESC is powered from the bench supply with a resistor load in place of the motor, or a motor mounted solid with no propeller. It sounds its menu through the load or the windings, so each beep is a pulse in the supply current. The engine drives the throttle to the profile's positions, switches the supply, counts the pulses into groups and moves the throttle on the group that names the wanted item or value.
Pure C, no I/O (input/output): the caller hands over each supply reading and the bench's state, and reads back what the throttle, the arm and the supply are to be. It sends nothing itself, so every move it asks for goes through the same arming, output and supply paths an operator's does, and a STOP or a disarm reaches the ESC without the engine.
No ESC has been recorded. Every time in esc_stick_timing_t is a default standing in for a measurement, not a measurement; see docs/StickProgramming.md.
SPDX-License-Identifier: MIT
| #define ESC_STICK_HAND_WAIT_MS 60000u |
A manual step not confirmed within this long ends the run, ms.
No manual states how long an ESC waits for its jumper or button; this is the operator's time to reach the ESC, not the ESC's.
| enum esc_det_event_t |
| enum esc_stick_kind_t |
| enum esc_stick_phase_t |
Phase of a stick programming run.
| enum esc_stick_rating_t |
| enum esc_stick_reason_t |
Reason a run ended.
| void esc_det_count | ( | esc_det_t * | d | ) |
Pulses and groups from the next reading on; the floor is kept.
| d | The detector. |
| int32_t esc_det_floor_ma | ( | const esc_det_t * | d | ) |
The idle floor, mA.
| d | The detector. |
| void esc_det_init | ( | esc_det_t * | d, |
| const esc_stick_timing_t * | t, | ||
| uint8_t | long_equals_short ) |
Set up the beep detector.
| d | The detector. |
| t | The timing. |
| long_equals_short | Count of short beeps that one long beep equals, 0 when every beep is short. |
| esc_det_event_t esc_det_reading | ( | esc_det_t * | d, |
| uint32_t | t_ms, | ||
| int32_t | ma, | ||
| bool | late ) |
One reading, at t_ms, of ma; late marks it as having come too long after the one before.
| d | The detector. |
| t_ms | Time of the reading, ms. |
| ma | Current, mA. |
| late | true when the reading came too long after the one before. |
| void esc_stick_abort | ( | esc_stick_t * | e, |
| esc_stick_reason_t | why ) |
End the run now, for why: throttle to its rest, supply off, disarmed.
A run already over is left as it ended.
| e | The run. |
| why | The end reason. |
| unsigned esc_stick_beeps | ( | const esc_stick_t * | e | ) |
The beeps of the group under way.
| e | The run. |
| esc_throttle_t esc_stick_change_entry | ( | const esc_profile_t * | p, |
| const esc_stick_change_t * | c ) |
The stick position change c is powered up from: its value's entry_throttle where the manual names one, else the profile's entry.
A run moves the stick there with the supply off and seen off, holds it ESC_STICK_SIGNAL_MS, and only then switches the supply on.
| p | The profile. |
| c | The change. |
| uint32_t esc_stick_change_entry_ms | ( | const esc_profile_t * | p, |
| const esc_stick_change_t * | c, | ||
| const esc_stick_timing_t * | t ) |
Power-on to the menu for change c, ms, as the run waits it: its value's entry_hold_ms where the manual gives one (Kontronik SUN PLUS modes 4 to 6, 5s), else t's entry, and no less than the longest hold of the profile's at_power_up steps. c NULL: the entry's.
| p | The profile. |
| c | The change, or NULL for the entry. |
| t | The timing. |
| bool esc_stick_check | ( | const esc_profile_t * | p, |
| const esc_stick_change_t * | ch, | ||
| size_t | n, | ||
| const esc_stick_timing_t * | t, | ||
| const char ** | why ) |
Whether a run of n changes under t can start on p; the reason in why when not.
Refused, never adjusted: a timing that cannot fit the profile's select window is a setting to change, not one to guess.
| p | The profile. |
| ch | The changes, in order. |
| n | Number of changes in ch. |
| t | The timing. |
| why | Receives the reason when refused, or NULL. |
| bool esc_stick_confirm | ( | esc_stick_t * | e | ) |
DONE: the step asked is done.
The run asks the next step due at the same point, or goes on. Ignored, returning false, when no step is asked or the step was asked less than ESC_STICK_HAND_MIN_MS ago.
| e | The run. |
| bool esc_stick_cut_short | ( | const esc_stick_t * | e | ) |
Whether the run ended between a selection and the DONE of the profile's before_power_off steps, or before the last of the moves that store the value (esc_stick_store_move()) – while the ESC stored or confirmed: the value may not be stored.
False while the run is under way, and for a value stored by its selection on a profile without such a step.
| e | The run. |
| unsigned esc_stick_done_count | ( | const esc_stick_t * | e | ) |
How many selections have been made.
| e | The run. |
| bool esc_stick_end_locks | ( | const esc_stick_t * | e | ) |
Whether a before_power_off step of the run's profile marks locks: a cut before every such step is confirmed may lock the ESC, whichever step is asked.
| e | The run. |
| uint32_t esc_stick_entry_ms | ( | const esc_stick_t * | e | ) |
Power-on to the menu at this power-up, ms: esc_stick_change_entry_ms() of the change it makes.
| e | The run. |
| const esc_manual_t * esc_stick_hand | ( | const esc_stick_t * | e | ) |
The manual step the run waits for, or NULL when it waits for none.
A run stops for a step a person does at the ESC where the profile says it is due, and goes on only on esc_stick_confirm():
STOP, ABORT, a disarm and every supply rule end a waiting run as any other: throttle to MIN, supply off, disarmed. No DONE within ESC_STICK_HAND_WAIT_MS ends it with ESC_STICK_R_HAND.
| e | The run. |
| uint32_t esc_stick_hand_left_ms | ( | const esc_stick_t * | e | ) |
The time left to confirm the step asked, ms; 0 when none is.
| e | The run. |
| bool esc_stick_hand_ready | ( | const esc_stick_t * | e | ) |
Whether DONE would count now: ESC_STICK_HAND_MIN_MS after the step was asked.
| e | The run. |
| bool esc_stick_is_action | ( | const esc_item_t * | it | ) |
Whether it is an action rather than a setting: keyed reset or exit.
Selecting one makes the ESC act on the select move; it sounds no values, and the engine does not offer it.
| it | The menu item. |
| esc_stick_kind_t esc_stick_kind | ( | const esc_profile_t * | p, |
| const char ** | why ) |
Which menu the engine runs for p, or ESC_STICK_KIND_NONE with the reason in why (a static string; may be NULL).
An assisted profile runs only through its manual steps (esc_profile_t's manual), and only when each can be waited for: no step during the menu, whose moment the run cannot know, and a hand at a powered ESC – an at_power_up or before_menu step – only with the stick at MIN for the entry. Otherwise the reason is "manual step".
| p | The profile. |
| why | Receives the reason when the engine cannot run it, or NULL. |
| bool esc_stick_light_green | ( | esc_stick_light_t * | l, |
| const esc_stick_t * | e, | ||
| uint32_t | now_ms ) |
Whether the green light is on at now_ms.
| l | The light state. |
| e | The run. |
| now_ms | Time of the look, ms. |
now_ms. | void esc_stick_light_reset | ( | esc_stick_light_t * | l, |
| const esc_stick_t * | e ) |
Start watching e: pulses already counted do not light it.
| l | The light state. |
| e | The run. |
| esc_throttle_t esc_stick_listen | ( | const esc_profile_t * | p | ) |
Where the stick rests while the menu sounds: the profile's listen move, else where the entry left it.
| p | The profile. |
| bool esc_stick_lock_risk | ( | const esc_stick_t * | e | ) |
esc_stick_cut_short() and esc_stick_end_locks(): the ESC may have locked itself.
| e | The run. |
| unsigned esc_stick_made_count | ( | const esc_stick_t * | e | ) |
The selections made for certain: esc_stick_done_count() less the one esc_stick_unsure() names.
| e | The run. |
| uint32_t esc_stick_model_ma_max | ( | const esc_profile_t * | p, |
| int | model ) |
The continuous current model model of p is rated for, mA: its current_a.
For -1, the lowest stated among its models. 0 where none is stated.
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| uint32_t esc_stick_model_mv | ( | const esc_profile_t * | p, |
| int | model ) |
The supply voltage for model model of p, mV: its own lowest cell count at the rates above, where it states one; else, and for -1, the family's (esc_stick_profile_mv()).
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| uint32_t esc_stick_model_v_max | ( | const esc_profile_t * | p, |
| int | model ) |
The highest supply voltage model model of p is rated for, mV: its v_max_mv.
For -1, the lowest of every model's, the one every model takes. 0 where the data does not state it – for -1, where a model does not, or there is none.
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| uint32_t esc_stick_model_v_min | ( | const esc_profile_t * | p, |
| int | model ) |
The lowest input model model of p takes, mV: its v_min_mv.
For -1, the highest stated among its models. 0 where none is stated.
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| const char * esc_stick_not_offered | ( | const esc_item_t * | it | ) |
Why it is not offered as a change, or NULL when it is: an action, or an item with a single value, which is either the only setting there is or a rule written as a value ("N beeps = N cells") – nothing to choose either way, and nothing the menu would sound in order.
| it | The menu item. |
| const esc_stick_out_t * esc_stick_out | ( | const esc_stick_t * | e | ) |
What the bench is to do now.
| e | The run. |
| float esc_stick_pct | ( | esc_throttle_t | pos | ) |
A throttle position as the output's percentage.
| pos | The throttle position. |
pos. | const char * esc_stick_phase_text | ( | esc_stick_phase_t | ph | ) |
Short text for a run phase.
| ph | The phase. |
| uint32_t esc_stick_profile_mv | ( | const esc_profile_t * | p | ) |
The supply voltage a profile asks for, mV: the lowest stated cell count among its models at 3800mV a LiPo cell or 1200mV a NiMH cell, which is above that model's cut-off and under every model's maximum. 0 when no model states a cell count.
| p | The profile. |
| esc_stick_rating_t esc_stick_rating | ( | const esc_profile_t * | p, |
| int | model, | ||
| uint32_t | mv, | ||
| uint32_t | ma, | ||
| bool | by_hand ) |
Whether mv and ma suit model model of p (-1: every model of the family).
A voltage over the rated one (esc_stick_model_v_max()) is refused, set by hand (by_hand) or taken from the cell count, and so is one under the lowest input the model states (v_min_mv; for -1 the highest of its models'). A current over the rated one, where stated, is refused. A rating the data does not state refuses nothing: esc_stick_rating_unknown() says when the operator is to be told.
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| mv | Supply voltage, mV. |
| ma | Supply current limit, mA. |
| by_hand | Whether the voltage was set by hand. |
| bool esc_stick_rating_unknown | ( | const esc_profile_t * | p, |
| int | model, | ||
| uint32_t | mv, | ||
| bool | by_hand ) |
Whether the data cannot vouch for mv on model model: the rated voltage is not stated, and the voltage is set by hand (by_hand) or is not the model's own cell count's – the family's lowest standing in for a model that states none, or none at all.
The run goes ahead; the screen says the ESC's rating is unknown.
| p | The profile. |
| model | Index into the models, or -1 for the family. |
| mv | Supply voltage, mV. |
| by_hand | Whether the voltage was set by hand. |
| uint32_t esc_stick_read_max_ms | ( | const esc_stick_timing_t * | t | ) |
The longest interval between two readings the timing allows: the shorter of a beep and a gap, so every beep and every gap holds at least one reading.
| t | The timing. |
| bool esc_stick_reason_is_fault | ( | esc_stick_reason_t | r | ) |
Whether a run that ended for r ended because something was not as expected: a reading, the supply, the link, the arm, the ESC, or a stop the bench raised itself.
False for the ends an operator chose (STOP pressed, ABORT, leaving the screen) and for none. The screen's red light.
| r | The end reason. |
| const char * esc_stick_reason_text | ( | esc_stick_reason_t | r | ) |
A word or two for the screen.
| r | The reason. |
| bool esc_stick_running | ( | const esc_stick_t * | e | ) |
Whether the run is under way: started and neither done nor aborted.
| e | The run. |
| void esc_stick_sample | ( | esc_stick_t * | e, |
| const esc_stick_sample_t * | s ) |
One supply sample, as it arrives.
| e | The run. |
| s | The sample. |
| bool esc_stick_start | ( | esc_stick_t * | e, |
| const esc_profile_t * | p, | ||
| const esc_stick_change_t * | ch, | ||
| size_t | n, | ||
| const esc_stick_timing_t * | t, | ||
| uint32_t | mv, | ||
| uint32_t | ma, | ||
| const esc_stick_bench_t * | b, | ||
| const char ** | why ) |
Start a run. mv and ma are the supply's set points, already held to the caps by the caller.
Refused with why when esc_stick_check() refuses, and the run stays idle.
| e | The run to start. |
| p | The profile. |
| ch | The changes to make, in order. |
| n | Number of changes in ch. |
| t | The timing. |
| mv | Supply set point, mV. |
| ma | Supply current limit, mA. |
| b | The bench state at the start. |
| why | Receives the reason when refused, or NULL. |
| void esc_stick_step | ( | esc_stick_t * | e, |
| const esc_stick_bench_t * | b ) |
Advance to b->now_ms and judge the bench.
| e | The run. |
| b | The bench state. |
| esc_stick_reason_t esc_stick_stop_reason | ( | uint32_t | stops, |
| uint32_t | pressed ) |
The end stops stops give, pressed of them pressed by an operator, both counted over the same span: STOP when every one was pressed, BENCH STOPPED when any was not, so a stop the bench raised is never hidden by a press that came with it.
| stops | Stops counted over the span. |
| pressed | Of those, the ones an operator pressed. |
| esc_throttle_t esc_stick_store_move | ( | const esc_stick_t * | e, |
| unsigned | k ) |
The k-th move after a selection, from 0, or ESC_THR_NONE past the last: the profile's store move, then the moves the stored value asks for (esc_value_t's after: Kontronik's car modes go to the brake after full throttle).
The run makes each STORE after the one before, then switches the supply off.
| e | The run. |
| k | Index of the move, from 0. |
| void esc_stick_timing_defaults | ( | esc_stick_timing_t * | t | ) |
The defaults the settings start from.
| t | Receives the default timing. |
| bool esc_stick_unsure | ( | const esc_stick_t * | e, |
| unsigned | i ) |
Whether change i was selected, but the run was cut short before the ESC stored or confirmed it (esc_stick_cut_short()): the selection being stored when the run ended.
| e | The run. |
| i | Index of the change. |