|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Which of two wires carries SCL, read from I2C (Inter-Integrated Circuit) traffic the injector only listens to. Pure C: the RP2350 build feeds it the edges core 1 recorded on GP4 and GP5, the host suite feeds it synthetic ones. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | inj_edge_t |
| struct | inj_line_result_t |
Macros | |
| #define | INJ_LINE_GLITCH 2u |
| #define | INJ_LINE_IDLE_NS 10000u |
| #define | INJ_LINE_MIN_TX 20u |
| #define | INJ_LINE_MIN_AGREE_PCT 95u |
| #define | INJ_LINE_GP4 0x1u |
| #define | INJ_LINE_GP5 0x2u |
Enumerations | |
| enum | inj_wiring_t { INJ_WIRING_NONE = 0 , INJ_WIRING_OK , INJ_WIRING_SWAPPED , INJ_WIRING_IDLE , INJ_WIRING_LOW , INJ_WIRING_NOISE } |
Functions | |
| void | inj_line_classify (uint8_t first, const inj_edge_t *edges, uint32_t n, uint32_t samples, uint32_t rate_ksps, inj_line_result_t *out) |
| const char * | inj_wiring_name (inj_wiring_t v) |
Which of two wires carries SCL, read from I2C (Inter-Integrated Circuit) traffic the injector only listens to. Pure C: the RP2350 build feeds it the edges core 1 recorded on GP4 and GP5, the host suite feeds it synthetic ones.
Rules, per transaction (a stretch of activity between two idle spans):
Verdict: at least INJ_LINE_MIN_TX transactions that name a line, and at least half of all transactions; of those that name a line, at least INJ_LINE_MIN_AGREE_PCT percent name the same one. A transaction that names no line, such as a poll of an absent address, is left out of the agreement.
SPDX-License-Identifier: MIT
| #define INJ_LINE_GLITCH 2u |
samples
| #define INJ_LINE_IDLE_NS 10000u |
both high this long is idle
| #define INJ_LINE_MIN_AGREE_PCT 95u |
of them, those that agree
| #define INJ_LINE_MIN_TX 20u |
transactions that name a line
| void inj_line_classify | ( | uint8_t | first, |
| const inj_edge_t * | edges, | ||
| uint32_t | n, | ||
| uint32_t | samples, | ||
| uint32_t | rate_ksps, | ||
| inj_line_result_t * | out ) |
Classify n edges taken over samples samples at rate_ksps ksample/s. first is the state at sample 0; edges are in order of at, each a change from the state before it (a repeat is ignored).
| const char * inj_wiring_name | ( | inj_wiring_t | v | ) |
The verdict's word: ok, swapped, idle, low, noise, or none.