Skip to content

Struct SYN_MotorOutput

ClassList > SYN_MotorOutput

Abstract motor output interface (vtable). More...

  • #include <syn_motor_output.h>

Public Attributes

Type Name
void(* brake
Active brake — short motor windings or active stop.
void(* coast
Coast — free-spin, both outputs off.
void * ctx
User context passed to all callbacks.
void(* set_output
Drive the motor at the given signed output level.

Detailed Description

The motor controller calls these functions to drive the motor without knowing the underlying hardware. This allows any motor driver to be used with syn_motor_ctrl, syn_autotune, etc.

Public Attributes Documentation

variable brake

Active brake — short motor windings or active stop.

void(* SYN_MotorOutput::brake) (void *ctx);

Motor decelerates as quickly as possible. Called during emergency stop (e-stop).

Parameters:

  • ctx User context.

variable coast

Coast — free-spin, both outputs off.

void(* SYN_MotorOutput::coast) (void *ctx);

Motor decelerates due to friction only. Called when the controller enters idle or stops normally.

Parameters:

  • ctx User context.

variable ctx

User context passed to all callbacks.

void* SYN_MotorOutput::ctx;


variable set_output

Drive the motor at the given signed output level.

void(* SYN_MotorOutput::set_output) (void *ctx, int32_t output);

The output range matches the controller's [output_min, output_max]. Positive = forward, negative = reverse, 0 = stop. The implementation must map this to the appropriate hardware command (PWM duty, step rate, etc.).

Parameters:

  • ctx User context (motor instance pointer).
  • output Signed output level.


The documentation for this class was generated from the following file src/syntropic/motor/syn_motor_output.h