81#define HITEC_LINE_GRACE_US 1000u
173 uint8_t family, uint8_t drive);
190 uint8_t family, uint8_t drive,
bool hitec_line_poll(void *ctx, hitec_capture_t *out)
Poll a transaction; the second of the three driver functions.
Definition hitec_line.c:710
bool hitec_line_is_open(const hitec_line_t *line)
Check whether a line is open.
Definition hitec_line.c:572
uint8_t hitec_line_rx_mode(const hitec_line_t *line)
The receive mode of the open line; HITEC_RX_PULL_UP while closed.
Definition hitec_line.c:582
void hitec_line_init(hitec_line_t *line)
Mark line closed.
Definition hitec_line.c:350
void hitec_line_close(hitec_line_t *line)
Stop the state machine, give back what the open claimed and leave the pad an input with the family's ...
Definition hitec_line.c:535
uint32_t hitec_line_now_us(void *ctx)
Read the microsecond clock; the third of the three driver functions.
Definition hitec_line.c:775
uint32_t hitec_line_bit_ns(const hitec_line_t *line)
The bit time the system clock gives, in ns; 0 on a closed line.
Definition hitec_line.c:588
bool hitec_line_start(void *ctx, const hitec_xfer_t *xfer)
The three functions of hitec_driver_t; ctx is the hitec_line_t.
Definition hitec_line.c:632
hitec_driver_t hitec_line_driver(hitec_line_t *line)
The driver for line.
Definition hitec_line.c:781
bool hitec_line_busy(const hitec_line_t *line)
A transaction runs: between a start() that returned true and the poll() that returns true.
Definition hitec_line.c:577
hitec_line_err_t hitec_line_open_rx(hitec_line_t *line, unsigned pin, uint8_t family, uint8_t drive, uint8_t rx_mode)
hitec_line_open() with the receive mode rx (hitec_rx_mode_t).
Definition hitec_line.c:435
hitec_line_err_t hitec_line_open(hitec_line_t *line, unsigned pin, uint8_t family, uint8_t drive)
Claim the resources and take pin for family (hitec_family_t) with drive (hitec_drive_t): from the ret...
Definition hitec_line.c:361
void hitec_line_abort(hitec_line_t *line)
Cut the running transaction: the pad is released at once, and the next poll() returns the bytes so fa...
Definition hitec_line.c:593
hitec_line_err_t
Definition hitec_line.h:83
@ HITEC_LINE_ERR_PIO
No state machine or no program space; for PRECHARGE, none for the sampler.
Definition hitec_line.h:99
@ HITEC_LINE_ERR_DMA
Fewer than 2 free DMA channels, 3 for PRECHARGE.
Definition hitec_line.h:101
@ HITEC_LINE_ERR_ARG
No line object, a pin the chip does not have, an unknown family or drive, or push-pull for classic.
Definition hitec_line.h:89
@ HITEC_LINE_ERR_CLOCK
The system clock gives no divider (hitec_pio.h), or PRECHARGE no cycle counts (hitec_pre_timing()).
Definition hitec_line.h:94
The numbers and words a PIO pin driver for the Hitec wire works with.
#define HITEC_PIO_TX_WORDS
Words of the longest stream: 3 counts and 8 words of bit times (8 bytes of 10 bits with 6 idle bits b...
Definition hitec_pio.h:157
Receive a D series answer by precharge and sample: the cycle arithmetic, the sampler's PIO program,...
#define HITEC_PRE_WORDS
Sample words the sampler's buffer holds: the longest window and HITEC_RX_MAX bytes at every clock the...
Definition hitec_pre.h:119
#define HITEC_PRE_PROGRAM_MAX
Instructions of the longest sampler program.
Definition hitec_pre.h:121
Hitec servo programming protocols: frames, transactions, the reply decoders and the driver interface.
#define HITEC_RX_MAX
Definition hitec_wire.h:204
What the receiver took, in the order the bytes came.
Definition hitec_wire.h:398
A pin driver.
Definition hitec_wire.h:544
One line.
Definition hitec_line.h:109
uint8_t pre_stall
Definition hitec_line.h:132
uint32_t pre_tx_us
Definition hitec_line.h:139
uint8_t cut
Definition hitec_line.h:125
uint32_t tx[HITEC_PIO_TX_WORDS]
Definition hitec_line.h:126
uint32_t pre_t_us
Definition hitec_line.h:138
uint32_t pre_span_us
Definition hitec_line.h:140
uint32_t rx[HITEC_RX_MAX]
Definition hitec_line.h:127
uint32_t pre_ctrl
Definition hitec_line.h:141
uint8_t pre_on
Definition hitec_line.h:130
uint8_t pre_held
Definition hitec_line.h:131
uint32_t pre_pad
Definition hitec_line.h:142
uint8_t kept
Definition hitec_line.h:124
uint8_t rx_mode
Definition hitec_line.h:129
The divider and the counts a system clock gives for one family.
Definition hitec_pio.h:160
One transaction, as hitec_pio_tx() laid it out.
Definition hitec_pio.h:169
State of one transaction on the sampler.
Definition hitec_pre.h:322
The cycle counts a system clock gives.
Definition hitec_pre.h:126
One transaction.
Definition hitec_wire.h:233