|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Which meter measures the servo rail. More...
Functions | |
| void | servo_source_init (servo_source_t *s) |
| The meter is the model until a step says otherwise. | |
| static servo_source_why_t | judge (uint32_t now_ms, uint16_t minor, const sense_link_meter_t *m) |
| The first of conditions 1 to 5 that fails, or NONE. | |
| static servo_source_id_t | step (servo_source_t *s, uint32_t now_ms, bool link_up, uint16_t minor, const sense_link_meter_t *m) |
| Carries out one poll of the source. | |
| servo_source_id_t | servo_source_step (servo_source_t *s, uint32_t now_ms, bool link_up, uint16_t minor, const sense_link_meter_t *m) |
One poll: the conditions judged at now_ms from link_up, the IOmcu's protocol minor minor and m, sense_link_meter()'s answer of the same poll. | |
| servo_source_why_t | servo_source_dropped (const servo_source_t *s, uint32_t *at) |
| Why the INA3221 last stopped being the meter: SERVO_SOURCE_WHY_RESET when its reset count moved in that step, else the condition that failed in it, or SERVO_SOURCE_WHY_NO_LINK. | |
| uint32_t | servo_source_changes (const servo_source_t *s) |
| How many times the meter has changed since servo_source_init(), modulo 2^32. | |
| servo_source_id_t | servo_source_id (const servo_source_t *s) |
| The meter as of the last step. | |
| servo_source_why_t | servo_source_why (const servo_source_t *s) |
| Why the INA3221 is not the meter, as of the last step. | |
| uint32_t | servo_source_event (servo_source_t *s, uint32_t now_ms) |
One event for the alert band, the older IOmcu before the reset, cleared; 0 while none waits or while the last one handed out is younger than SERVO_SOURCE_EVENT_GAP_MS at now_ms. | |
| void | servo_source_event_back (servo_source_t *s, uint32_t ev) |
| Put back an event servo_source_event() handed out that never reached the band, so it is handed out again after the gap. | |
|
static |
The first of conditions 1 to 5 that fails, or NONE.
| now_ms | The time, in ms. |
| minor | The IOmcu's protocol minor version. |
| m | The sense_link_meter() answer. |
| uint32_t servo_source_changes | ( | const servo_source_t * | s | ) |
How many times the meter has changed since servo_source_init(), modulo 2^32.
It orders two answers taken at different polls: of two counts the one that is ahead by less than 2^31 is the later.
| s | The source state. |
| servo_source_why_t servo_source_dropped | ( | const servo_source_t * | s, |
| uint32_t * | at ) |
Why the INA3221 last stopped being the meter: SERVO_SOURCE_WHY_RESET when its reset count moved in that step, else the condition that failed in it, or SERVO_SOURCE_WHY_NO_LINK.
at, when not NULL, takes servo_source_changes() as that step left it. SERVO_SOURCE_WHY_NONE while the INA3221 has not stopped being the meter since servo_source_init().
| s | The source state. |
| at | Receives the change count of that step, or NULL. |
| uint32_t servo_source_event | ( | servo_source_t * | s, |
| uint32_t | now_ms ) |
One event for the alert band, the older IOmcu before the reset, cleared; 0 while none waits or while the last one handed out is younger than SERVO_SOURCE_EVENT_GAP_MS at now_ms.
| s | The source state. |
| now_ms | The time, in ms. |
| void servo_source_event_back | ( | servo_source_t * | s, |
| uint32_t | ev ) |
Put back an event servo_source_event() handed out that never reached the band, so it is handed out again after the gap.
Not once the link has gone: both events are about the IOmcu that answered.
| s | The source state. |
| ev | The event to put back. |
| servo_source_id_t servo_source_id | ( | const servo_source_t * | s | ) |
The meter as of the last step.
| s | The source state. |
| void servo_source_init | ( | servo_source_t * | s | ) |
The meter is the model until a step says otherwise.
| s | The source state. |
| servo_source_id_t servo_source_step | ( | servo_source_t * | s, |
| uint32_t | now_ms, | ||
| bool | link_up, | ||
| uint16_t | minor, | ||
| const sense_link_meter_t * | m ) |
One poll: the conditions judged at now_ms from link_up, the IOmcu's protocol minor minor and m, sense_link_meter()'s answer of the same poll.
Returns the meter.
| s | The source state. |
| now_ms | The time, in ms. |
| link_up | true while the IOmcu link is up. |
| minor | The IOmcu's protocol minor version. |
| m | The sense_link_meter() answer of this poll. |
| servo_source_why_t servo_source_why | ( | const servo_source_t * | s | ) |
Why the INA3221 is not the meter, as of the last step.
| s | The source state. |
|
static |
Carries out one poll of the source.
| s | The source state. |
| now_ms | The time, in ms. |
| link_up | true while the IOmcu link is up. |
| minor | The IOmcu's protocol minor version. |
| m | The sense_link_meter() answer, or NULL. |