rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
iomcu_hitec.c File Reference

The HITEC page and the programming port's hardware it drives; see iomcu.h for the other files. More...

#include "iomcu.h"

Functions

bool hitec_hw_take (void *ctx, uint8_t port, uint8_t pin, uint8_t family, uint8_t drive, uint8_t rx)
 Takes the programming port's pin for the HITEC wire driver.
void hitec_hw_give (void *ctx)
 Gives the programming port's pin back from the HITEC wire driver.
void hitec_hw_abort (void *ctx)
 Aborts the HITEC operation in progress.
void hitec_hw_run (void *ctx, hitec_port_run_t *out)
 Reports the timing of the last HITEC run.
void hitec_read (void *ctx, uint8_t off, uint8_t n, uint16_t *out)
 Reads the HITEC page.
uint8_t hitec_write (void *ctx, uint8_t off, uint8_t n, const uint16_t *in)
 Writes the HITEC page.

Detailed Description

The HITEC page and the programming port's hardware it drives; see iomcu.h for the other files.

Implements the signal-wire programming protocols of Hitec servos. Hitec is a name or trademark of its owner; it is used here only to say which servos this module works with (README.md, "Legal notice and disclaimer").

SPDX-License-Identifier: MIT

Function Documentation

◆ hitec_hw_abort()

void hitec_hw_abort ( void * ctx)

Aborts the HITEC operation in progress.

Parameters
ctxUnused.

◆ hitec_hw_give()

void hitec_hw_give ( void * ctx)

Gives the programming port's pin back from the HITEC wire driver.

Parameters
ctxUnused.

◆ hitec_hw_run()

void hitec_hw_run ( void * ctx,
hitec_port_run_t * out )

Reports the timing of the last HITEC run.

Parameters
ctxUnused.
outReceives the lead time, span and bit time of the run.

◆ hitec_hw_take()

bool hitec_hw_take ( void * ctx,
uint8_t port,
uint8_t pin,
uint8_t family,
uint8_t drive,
uint8_t rx )

Takes the programming port's pin for the HITEC wire driver.

Parameters
ctxUnused.
portIndex of the programming port. Not used here.
pinGPIO number to take.
familyHitec protocol family the line is opened for.
driveDrive setting of the pin.
rxNonzero to claim the sampler as well, for PRECHARGE.
Returns
True when the HITEC line opened on the pin.

◆ hitec_read()

void hitec_read ( void * ctx,
uint8_t off,
uint8_t n,
uint16_t * out )

Reads the HITEC page.

Parameters
ctxUnused.
offFirst register to read.
nNumber of registers to read.
outReceives the n register values.

◆ hitec_write()

uint8_t hitec_write ( void * ctx,
uint8_t off,
uint8_t n,
const uint16_t * in )

Writes the HITEC page.

Parameters
ctxUnused.
offFirst register to write.
nNumber of registers to write.
inThe n register values to write.
Returns
0 to accept, or a link_nack_t to refuse.