Skip to content

Class OpenSkyhawk::MotorDriver

ClassList > OpenSkyhawk > MotorDriver

Common interface every motor/servo backend implements. More...

  • #include <MotorDriver.h>

Inherited by the following classes: OpenSkyhawk::StepperMotor

Public Functions

Type Name
virtual void configure () = 0
Configure pins / drive hardware. Call once from the owner's configure() .
virtual void home () = 0
Establish the zero reference (mechanical stop, home sensor, or absolute read).
virtual void moveTo (int32_t pos) = 0
Set the target position in driver-native units. Non-blocking.
virtual int32_t position () const = 0
Current position in driver-native units.
virtual void update () = 0
Advance one step/increment toward the target if due. Call every loop().
virtual ~MotorDriver () = default

Detailed Description

Positions are in driver-native units (steps for a stepper, microseconds for a servo). The owning control maps DCS-BIOS values into that space.

Public Functions Documentation

function configure

Configure pins / drive hardware. Call once from the owner's configure() .

virtual void OpenSkyhawk::MotorDriver::configure () = 0

Note:

Runs after bus/board init (PanelGroup::setup()), never from a constructor.


function home

Establish the zero reference (mechanical stop, home sensor, or absolute read).

virtual void OpenSkyhawk::MotorDriver::home () = 0

Note:

May block (boot-time homing). Call once, after configure().


function moveTo

Set the target position in driver-native units. Non-blocking.

virtual void OpenSkyhawk::MotorDriver::moveTo (
    int32_t pos
) = 0

Parameters:

  • pos Target position; the driver clamps / wraps to its own limits.

function position

Current position in driver-native units.

virtual int32_t OpenSkyhawk::MotorDriver::position () const = 0

function update

Advance one step/increment toward the target if due. Call every loop().

virtual void OpenSkyhawk::MotorDriver::update () = 0

Note:

Non-blocking — does at most the work for the current instant.


function ~MotorDriver

virtual OpenSkyhawk::MotorDriver::~MotorDriver () = default


The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Drivers/MotorDriver/MotorDriver.h