|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
One transaction. More...
#include <hitec_wire.h>
Data Fields | |
| uint8_t | kind |
| uint8_t | family |
| uint8_t | n_tx |
| uint8_t | gap_bits |
| uint8_t | tx [HITEC_TX_MAX] |
| uint8_t | max_rx |
| uint8_t | answer |
| uint8_t | answer_byte |
| uint8_t | level |
| uint32_t | lead_us |
| uint32_t | window_us |
| uint32_t | level_us |
One transaction.
Outside a transaction the driver leaves the pad an input: classic with a pull-down, D series with a pull-up.
SEND: the line rests at its idle level for lead_us (classic: released; D series: driven low, the inside-frame rest level), then the bytes go out with gap_bits idle bit times between two of them. Classic: the pad is released at the start of the last byte's stop bit, where the receiver starts. D series: the last stop bit is sent, the pad is released, and the receiver starts one bit time later (HITEC_D_SETTLE_BITS). With window_us 0 nothing is received.
LISTEN: the receiver starts at once. With answer set, the byte answer_byte goes out at the end of the stop bit of the first byte received.
The receiver runs until window_us of waiting for a start bit have passed or max_rx bytes have come. The time spent inside bytes and in the answer does not count against the window.
LEVEL: the line is held at level (0 low, 1 high) for level_us and then released. An open-drain line drives low only.
| uint8_t hitec_xfer_t::answer |
LISTEN: 1 sends answer_byte
| uint8_t hitec_xfer_t::answer_byte |
byte sent as the answer
| uint8_t hitec_xfer_t::family |
| uint8_t hitec_xfer_t::gap_bits |
SEND: 0 to HITEC_GAP_MAX
| uint8_t hitec_xfer_t::kind |
| uint32_t hitec_xfer_t::lead_us |
SEND: 0 to HITEC_TIME_MAX_US
| uint8_t hitec_xfer_t::level |
LEVEL: 0 or 1
| uint32_t hitec_xfer_t::level_us |
LEVEL: 1 to HITEC_TIME_MAX_US
| uint8_t hitec_xfer_t::max_rx |
1 to HITEC_RX_MAX; 0 with no window
| uint8_t hitec_xfer_t::n_tx |
SEND: 1 to HITEC_TX_MAX
| uint8_t hitec_xfer_t::tx[HITEC_TX_MAX] |
bytes a SEND sends, in order
| uint32_t hitec_xfer_t::window_us |
SEND, LISTEN: 0 to HITEC_TIME_MAX_US