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

The driver: the only way to the wire. More...

#include <kst_session.h>

Data Fields

void * ctx
bool(*) start (void *ctx, const kst_frame_t *frame, uint32_t window_ns)
 Clocks out frame and records the line up to window_ns; false when it cannot start.
bool(*) poll (void *ctx, kst_capture_t *out)
 Reports the window's end: false while the transaction runs; true once, with out filled.
uint32_t(*) now_us (void *ctx)

Detailed Description

The driver: the only way to the wire.

Contract:

  • Outside a transaction the line is low.
  • start() clocks out frame->n_half half-cells of KST_HALF_CELL_NS each, taken from kst_frame_level(), drives low for KST_RELEASE_NS, switches to input and records every level change until window_ns after the frame's last edge. It returns at once; false when it cannot start.
  • poll() returns false while the transaction runs. When the window has ended it fills out and returns true, once.
  • now_us() is a free-running microsecond clock. It may wrap; the session uses differences only.

There is no delay function: the session waits by returning from kst_session_step().

Field Documentation

◆ ctx

void* kst_driver_t::ctx

driver state, passed to each function

◆ now_us

uint32_t(*) kst_driver_t::now_us(void *ctx)

free-running microseconds, may wrap

◆ poll

bool(*) kst_driver_t::poll(void *ctx, kst_capture_t *out)

Reports the window's end: false while the transaction runs; true once, with out filled.

Parameters
ctxDriver state, as in the struct.
outReceives the capture when the window has ended.
Returns
true once, after the window has ended; false while it runs.

◆ start

bool(*) kst_driver_t::start(void *ctx, const kst_frame_t *frame, uint32_t window_ns)

Clocks out frame and records the line up to window_ns; false when it cannot start.

Parameters
ctxDriver state, as in the struct.
frameFrame to send.
window_nsTime in ns to record after the frame's last edge.
Returns
false when the call cannot start; true otherwise.

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