169#ifndef RCBENCH_KST_PORT_H
170#define RCBENCH_KST_PORT_H
186#define KST_PORT_STOP_MS 50u
188#define KST_PORT_LOW_MS 100u
194#define KST_PORT_RAIL_OFF_MS 2000u
198#define KST_PORT_RAIL_WAIT_MS 1000u
200#define KST_PORT_SUPPLY_MS 3000u
206#define KST_PORT_SUPPLY_MAX_MV 8400u
213#define KST_PORT_SUPPLY_MIN_MV 4800u
329 const uint16_t *in, uint32_t now_ms);
uint8_t kst_port_quiet_mask(const kst_port_t *p)
Bit n: programming port n renders no PWM pulse.
Definition kst_port.c:1274
bool kst_port_frame_out(const kst_port_t *p)
An operation of the session runs: a frame may be on the wire.
Definition kst_port.c:1280
void kst_port_step(kst_port_t *p, bool safe, bool stop, uint32_t now_ms)
One pass.
Definition kst_port.c:1206
void kst_port_other_mask(kst_port_t *p, uint8_t mask)
Bit n: the HITEC page holds programming port n (hitec_port_quiet_mask()).
Definition kst_port.c:1292
uint8_t kst_port_pin_mask(const kst_port_t *p)
Bit n: programming port n's pin is the wire driver's, not the PWM generator's.
Definition kst_port.c:1299
void kst_port_bench_armed(kst_port_t *p, bool armed)
Whether the bank is armed.
Definition kst_port.c:1285
link_kst_state_t kst_port_state(const kst_port_t *p)
Where the port is.
Definition kst_port.c:1269
bool kst_port_init(kst_port_t *p, const kst_port_hw_t *hw)
Prepare a port in LINK_KST_PWM.
Definition kst_port.c:1249
void kst_port_read(const kst_port_t *p, uint8_t off, uint8_t n, uint16_t *out)
A read of the page, LINK_KS_*.
Definition kst_port.c:878
uint8_t kst_port_write(kst_port_t *p, uint8_t off, uint8_t n, const uint16_t *in, uint32_t now_ms)
A write of the page: 0, or the LINK_NACK_* reason with nothing changed.
Definition kst_port.c:789
KST servo programming protocol: the session with one servo.
The page map: what the panel can ask the IOmcu for, and set.
#define LINK_KS_W_STAGED
The staged registers a command's CRC covers, from LINK_KS_W_IMAGE.
Definition link_pages.h:1922
#define LINK_KS_W_CMD_FRAME
Registers of the command, from LINK_KS_W_CMD: one frame.
Definition link_pages.h:1920
link_kst_state_t
Where the programming port is.
Definition link_pages.h:2008
The intermediary every output goes through: one set of rules for arming, clamping,...
The driver: the only way to the wire.
Definition kst_session.h:106
The 32 registers, by address.
Definition kst_reg.h:47
What the port needs from the hardware.
Definition kst_port.h:216
void * ctx
The caller's context, passed as the first argument of each hook.
Definition kst_port.h:219
void(*) give(void *ctx)
Close the wire driver and give the pin back to the generator.
Definition kst_port.h:233
kst_driver_t driver
The wire driver.
Definition kst_port.h:246
bool(*) take(void *ctx, uint8_t port, uint8_t pin)
Definition kst_port.h:228
uint8_t ports
Programming ports the build has, 1 to LINK_PG_PORTS_MAX.
Definition kst_port.h:221
bool(*) supply_set(void *ctx, bool on, uint16_t mv, uint16_t ma)
Definition kst_port.h:241
void(*) supply(void *ctx, supply_port_view_t *out)
What the supply says now (supply_page_port_view()).
Definition kst_port.h:238
uint8_t(*) pin(void *ctx, uint8_t port)
Definition kst_port.h:224
The state of one KST port: the hardware, the session, the staged registers and the running or last op...
Definition kst_port.h:253
uint32_t t1_ms
Definition kst_port.h:261
uint8_t on_here
Definition kst_port.h:293
uint16_t seq
Definition kst_port.h:262
uint8_t again
Definition kst_port.h:296
uint8_t sup
Definition kst_port.h:292
uint8_t watch
Definition kst_port.h:294
uint8_t other
Definition kst_port.h:290
uint16_t frames
Definition kst_port.h:263
uint8_t running
Definition kst_port.h:283
uint16_t supply_ma
Definition kst_port.h:265
uint16_t want_ma
Definition kst_port.h:267
uint8_t result
Definition kst_port.h:276
uint8_t view
Definition kst_port.h:287
uint16_t wait_ms
Definition kst_port.h:271
uint8_t from_pwm
Definition kst_port.h:297
uint8_t armed
Definition kst_port.h:289
uint8_t port
Definition kst_port.h:273
uint8_t safe
Definition kst_port.h:288
kst_image_t work
Definition kst_port.h:256
uint8_t op
Definition kst_port.h:275
uint8_t leaving
Definition kst_port.h:284
uint32_t t0_ms
Definition kst_port.h:260
uint8_t framed
Definition kst_port.h:285
uint8_t seen_step
Definition kst_port.h:281
uint16_t back_mv
Definition kst_port.h:268
uint8_t state
Definition kst_port.h:272
uint16_t staged[LINK_KS_W_STAGED]
Definition kst_port.h:258
uint8_t steps_done
Definition kst_port.h:280
uint16_t last_cmd[LINK_KS_W_CMD_FRAME]
Definition kst_port.h:259
uint8_t fail_reg
Definition kst_port.h:279
uint16_t supply_mv
Definition kst_port.h:264
uint16_t want_mv
Definition kst_port.h:266
uint8_t has_pin
Definition kst_port.h:291
uint8_t busy
Definition kst_port.h:282
uint8_t refusal
Definition kst_port.h:278
uint16_t back_ma
Definition kst_port.h:269
uint16_t leave_ms
Definition kst_port.h:270
uint8_t pin
Definition kst_port.h:274
uint8_t must_read
Definition kst_port.h:286
The session with one servo: results and state of its operation.
Definition kst_session.h:175
The supply as a programming port sees it (kst_port.h).
Definition supply_page.h:85
The SUPPLY link page at the IOmcu: a PD mini on a PIO UART, its wiring, what it is to do and what it ...