rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
hitec_port_hw_t Struct Reference

What the port needs from the hardware. More...

#include <hitec_port.h>

Data Fields

void * ctx
 The caller's context, passed as the first argument of each hook.
uint8_t ports
 Programming ports the build has, 1 to LINK_PG_PORTS_MAX.
uint8_t(*) pin (void *ctx, uint8_t port)
bool(*) take (void *ctx, uint8_t port, uint8_t pin, uint8_t family, uint8_t drive, uint8_t rx)
void(*) give (void *ctx)
 Close the wire driver and give the pin back to the generator.
void(*) abort (void *ctx)
 Cut the running transaction: the next poll() hands back what came, marked aborted.
void(*) run (void *ctx, hitec_port_run_t *out)
 What the driver says about the line; NULL: nothing.
void(*) supply (void *ctx, supply_port_view_t *out)
 What the supply says now (supply_page_port_view()).
bool(*) supply_set (void *ctx, bool on, uint16_t mv, uint16_t ma)
hitec_driver_t driver
 The wire driver.

Detailed Description

What the port needs from the hardware.

Field Documentation

◆ driver

hitec_driver_t hitec_port_hw_t::driver

The wire driver.

now_us() works while the driver is closed.

◆ pin

uint8_t(*) hitec_port_hw_t::pin(void *ctx, uint8_t port)

The pin the PWM generator has for port, or a value above OUT_MAX_PIN while it has none.

◆ supply

void(*) hitec_port_hw_t::supply(void *ctx, supply_port_view_t *out)

What the supply says now (supply_page_port_view()).

NULL, with supply_set: the build has no supply to switch.

◆ supply_set

bool(*) hitec_port_hw_t::supply_set(void *ctx, bool on, uint16_t mv, uint16_t ma)

Ask the supply on at mv and ma, or off. False when it does not take the request.

◆ take

bool(*) hitec_port_hw_t::take(void *ctx, uint8_t port, uint8_t pin, uint8_t family, uint8_t drive, uint8_t rx)

Take pin of port from the generator and open the wire driver on it for family, drive and the receive mode rx (hitec_rx_mode_t; PULL-UP for classic), released. False when the driver gets no resources; give() returns the pin.


The documentation for this struct was generated from the following file: