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

The limit run's sessions on the programmer. More...

#include "kst_panel.h"
#include <math.h>
#include "kst_card.h"
#include "kst_port.h"
#include "kst_reg.h"
#include "supply_screen.h"
#include "kst_panel_int.h"

Enumerations

enum  { RUN_OP_NONE = 0 , RUN_OP_CONNECT , RUN_OP_WRITE , RUN_OP_LEAVE }

Functions

static void run_close_editors (void)
 Whatever the overlay has open goes: the run's step is no operator's.
kst_prog_msg_id_t kst_panel_run_connect (bool supply, uint16_t mv, uint16_t ma)
static bool run_edit (kst_field_id_t id, uint16_t raw)
 A field set for the run's write; false where the model refuses it.
static kst_prog_msg_id_t run_write2 (kst_field_id_t a, uint16_t va, kst_field_id_t b, uint16_t vb)
 Write two fields, a to va and b to vb, and nothing else.
kst_prog_msg_id_t kst_panel_run_write (uint16_t left, uint16_t right)
kst_prog_msg_id_t kst_panel_run_pulses (uint16_t lower_dus, uint16_t upper_dus)
 Write PULSE LOWER and PULSE UPPER and nothing else; as kst_panel_run_write() otherwise.
kst_prog_msg_id_t kst_panel_run_leave (void)
kst_panel_run_t kst_panel_run_poll (void)
 Reports how the limit run's step ended and takes the end.
bool kst_panel_run_no_servo (void)
 Whether the CONNECT of kst_panel_run_connect() ended with no servo answering.
bool kst_panel_run_servo (uint16_t angle[2], uint16_t *lo, uint16_t *hi, bool *reversion, unsigned *type, uint16_t pulse_dus[3])
 The servo as read.
const char * kst_panel_run_backup (void)
bool kst_panel_run_ready (void)
void kst_panel_run_begin (void)
void kst_panel_run_end (void)
kst_prog_t * kst_panel_model (void)
 Gives the model the overlay holds.

Detailed Description

The limit run's sessions on the programmer.

The limit run's sessions on the programmer for KST and Chaservo servos: the CONNECT, the write and the LEAVE the limit run (servo_limrun.h) asks of the overlay's model, and the poll that reports each step's end. The state and the seam are kst_panel_int.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ kst_panel_model()

kst_prog_t * kst_panel_model ( void )

Gives the model the overlay holds.

Returns
the model

◆ kst_panel_run_backup()

const char * kst_panel_run_backup ( void )

The file that holds the servo as the run found it; "" for none.

◆ kst_panel_run_begin()

void kst_panel_run_begin ( void )

A run begins: no write of it yet.

◆ kst_panel_run_connect()

kst_prog_msg_id_t kst_panel_run_connect ( bool supply,
uint16_t mv,
uint16_t ma )

CONNECT on the SERVO screen's port. With supply, a PD mini answers and the session asks it for mv and ma: its set point as it stands, so the ENTER changes nothing. KST_PROG_MSG_NONE when taken.

◆ kst_panel_run_end()

void kst_panel_run_end ( void )

The run is over: the programming voltage and current go back to the operator's. The servo as the run found it stays held for RESTORE.

◆ kst_panel_run_leave()

kst_prog_msg_id_t kst_panel_run_leave ( void )

LEAVE.

◆ kst_panel_run_no_servo()

bool kst_panel_run_no_servo ( void )

Whether the CONNECT of kst_panel_run_connect() ended with no servo answering.

True when the programmer's last message is KST_SES_ERR_NO_SERVO and was said after that call. A message left from before it does not count.

Returns
True for a CONNECT of a servo that is no KST or Chaservo, or not powered; false otherwise.

◆ kst_panel_run_poll()

kst_panel_run_t kst_panel_run_poll ( void )

Reports how the limit run's step ended and takes the end.

Returns
KST_PANEL_RUN_NONE when no step is asked, KST_PANEL_RUN_BUSY while it runs, then OK or FAILED once

◆ kst_panel_run_pulses()

kst_prog_msg_id_t kst_panel_run_pulses ( uint16_t lower_dus,
uint16_t upper_dus )

Write PULSE LOWER and PULSE UPPER and nothing else; as kst_panel_run_write() otherwise.

Parameters
lower_dusPULSE LOWER, 0.1us
upper_dusPULSE UPPER, 0.1us
Returns
as kst_panel_run_write()

◆ kst_panel_run_ready()

bool kst_panel_run_ready ( void )

The programmer's port is in PWM with no operation under way: a run's CONNECT can start.

◆ kst_panel_run_servo()

bool kst_panel_run_servo ( uint16_t angle[2],
uint16_t * lo,
uint16_t * hi,
bool * reversion,
unsigned * type,
uint16_t pulse_dus[3] )

The servo as read.

Parameters
angleout: its two angles; filled also when false is returned, where a servo was read
loout: the value both angles take by the hard rules, at least
hiout: and at most
reversionout: REVERSION
typeout: its type number
pulse_dusout: NEUTRAL, PULSE LOWER and PULSE UPPER in 0.1us, 0 for one not shown
Returns
false with none read, or one that is not editable (no KST or Chaservo servo, in doubt)

◆ kst_panel_run_write()

kst_prog_msg_id_t kst_panel_run_write ( uint16_t left,
uint16_t right )

Write LEFT ANGLE left and RIGHT ANGLE right and nothing else. The run's first write holds the servo as read (kst_prog_run_hold()).