Open FFBoard
Open source force feedback firmware
MotorSimplemotion Class Referenceabstract

#include <MotorSimplemotion.h>

Inheritance diagram for MotorSimplemotion:
MotorDriver Encoder CommandHandler UARTDevice ChoosableClass ChoosableClass MotorSimplemotion1 MotorSimplemotion2

Classes

struct  Sm2FastUpdate
 
struct  Sm2FastUpdate_reply
 

Public Member Functions

 MotorSimplemotion (uint8_t instance)
 
virtual ~MotorSimplemotion ()
 
const ClassIdentifier getInfo ()=0
 Command handlers always have class infos. Works well with ChoosableClass. More...
 
void turn (int16_t power) override
 
void stopMotor () override
 
void startMotor () override
 
EncodergetEncoder () override
 
bool hasIntegratedEncoder ()
 
int32_t getPos () override
 
void setPos (int32_t pos) override
 
EncoderType getEncoderType () override
 
uint32_t getCpr () override
 
CommandStatus command (const ParsedCommand &cmd, std::vector< CommandReply > &replies) override
 
void registerCommands ()
 
std::string getHelpstring ()
 
void uartRcv (char &buf)
 
void sendFastUpdate (uint16_t val1, uint16_t val2=0)
 
void startUartTransfer (UARTPort *port, bool transmit)
 
void endUartTransfer (UARTPort *port, bool transmit)
 
bool sendCommand (uint8_t *buf, uint8_t len, uint8_t adr)
 
uint8_t queueCommand (uint8_t *buf, MotorSimplemotion_cmdtypes type, uint32_t data)
 
bool read1Parameter (MotorSimplemotion_param paramId, uint32_t *reply_p, MotorSimplemotion_cmdtypes replylen=MotorSimplemotion_cmdtypes::none)
 
bool set1Parameter (MotorSimplemotion_param paramId, int32_t value, uint32_t *reply_p=nullptr)
 
bool getSettings ()
 
uint32_t getCumstat ()
 
bool motorReady ()
 
int16_t getTorque ()
 
int16_t getVoltage ()
 
void restart ()
 
- Public Member Functions inherited from MotorDriver
 MotorDriver ()
 
virtual ~MotorDriver ()
 
const ClassType getClassType () override
 returns the used classchooser selection id of this instance More...
 
virtual void emergencyStop (bool reset=false)
 
virtual void setEncoder (std::shared_ptr< Encoder > &encoder)
 
- Public Member Functions inherited from ChoosableClass
virtual ~ChoosableClass ()
 
uint16_t getSelectionID ()
 
- Public Member Functions inherited from Encoder
 Encoder ()
 
virtual ~Encoder ()
 
virtual float getPos_f ()
 
virtual int32_t getPosAbs ()
 
virtual float getPosAbs_f ()
 
virtual const ClassType getClassType () override
 returns the used classchooser selection id of this instance More...
 
- Public Member Functions inherited from CommandHandler
virtual const ClassType getClassType ()
 
 CommandHandler (const char *clsname, uint16_t clsid, uint8_t instance=0)
 
virtual ~CommandHandler ()
 
virtual bool hasCommands ()
 
virtual void setCommandsEnabled (bool enable)
 
void registerCommands ()
 
virtual CommandStatus internalCommand (const ParsedCommand &cmd, std::vector< CommandReply > &replies)
 
virtual std::string getCommandsHelpstring ()
 
virtual std::string getCsvHelpstring ()
 
virtual uint8_t getCommandHandlerInstance ()
 
void broadcastCommandReply (CommandReply reply, uint32_t cmdId, CMDtype type)
 
void sendCommandReplyAsync (CommandReply reply, uint32_t cmdId, CMDtype type, CommandInterface *interface=nullptr)
 
virtual uint16_t getCommandHandlerID ()
 
virtual CmdHandlerInfogetCommandHandlerInfo ()
 
virtual bool isValidCommandId (uint32_t cmdid, uint32_t ignoredFlags=0, uint32_t requiredFlag=0)
 
virtual CmdHandlerCommanddefgetCommandFromName (const std::string &cmd, uint32_t ignoredFlags=0)
 
virtual CmdHandlerCommanddefgetCommandFromId (const uint32_t id, uint32_t ignoredFlags=0)
 
template<typename ID >
void registerCommand (const char *cmd, const ID cmdid, const char *help=nullptr, uint32_t flags=0)
 
- Public Member Functions inherited from UARTDevice
 UARTDevice ()
 
 UARTDevice (UARTPort &port)
 
virtual ~UARTDevice ()
 

Static Public Attributes

static const uint8_t SMCMD_FAST_UPDATE_CYCLE = 2<<3
 
static const uint8_t SMCMD_FAST_UPDATE_CYCLE_RET = (2<<3) | 1
 
static const uint8_t SMP_FAST_UPDATE_CYCLE_FORMAT = 17
 
static const uint8_t SMCMD_INSTANT_CMD = 0x24
 
static const uint8_t SMCMD_INSTANT_CMD_RET = 0x25
 
static const uint8_t SMPCMD_SETPARAMADDR = 2
 
- Static Public Attributes inherited from MotorDriver
static ClassIdentifier info ={.name = "None" , .id=CLSID_MOT_NONE, .visibility = ClassVisibility::visible}
 
static const std::vector< class_entry< MotorDriver > > all_drivers
 
- Static Public Attributes inherited from ChoosableClass
static ClassIdentifier info
 
- Static Public Attributes inherited from Encoder
static ClassIdentifier info ={.name = "None" , .id=CLSID_ENCODER_NONE, .visibility = ClassVisibility::visible}
 
static const std::vector< class_entry< Encoder > > all_encoders
 
- Static Public Attributes inherited from CommandHandler
static bool logEnabled = true
 

Protected Attributes

const OutputPinwriteEnablePin = gpMotor
 
volatile char rxbuf [RXBUF_SIZE]
 
volatile uint8_t rxbuf_i = 0
 
char txbuf [TXBUF_SIZE]
 
volatile uint8_t replyidx = 0
 
volatile uint32_t replyvalues [REPLYBUF_SIZE]
 
volatile uint32_t crcerrors = 0
 
int16_t lastTorque = 0
 
volatile uint32_t lastUpdateTime = 0
 
volatile uint32_t uarterrors = 0
 
- Protected Attributes inherited from MotorDriver
std::shared_ptr< EncoderdrvEncoder = std::make_shared<Encoder>()
 
- Protected Attributes inherited from ChoosableClass
uint16_t selectionId
 Should only be written by ClassChooser during creation. More...
 
- Protected Attributes inherited from Encoder
uint32_t cpr = 0
 
- Protected Attributes inherited from CommandHandler
bool commandsEnabled = true
 
std::vector< CmdHandlerCommanddefregisteredCommands
 
CmdHandlerInfo cmdHandlerInfo
 
- Protected Attributes inherited from UARTDevice
UARTPortuartport = nullptr
 

Static Protected Attributes

static std::array< uint8_t, 256 > tableCRC8
 
static std::array< uint16_t, 256 > tableCRC16
 
static const uint8_t crcpoly = 0x07
 
static const uint16_t crcpoly16 = 0x8005
 
static bool crcTableInitialized = false
 
static const uint8_t crc8init = 0x52
 
static const uint8_t RXBUF_SIZE = 32
 
static const uint8_t TXBUF_SIZE = 32
 
static const uint8_t REPLYBUF_SIZE = 32
 

Private Types

enum class  MotorSimplemotion_commands : uint8_t {
  crcerrors , uarterrors , voltage , torque ,
  status , restart , reg , devtype
}
 
enum class  MotorSimplemotion_cmdtypes : uint8_t {
  param32b = 0 , param24b = 1 , setparamadr = 2 , status =3 ,
  none = 0xff
}
 
enum class  MotorSimplemotion_param : uint16_t {
  FBD = 493 , FBR = 565 , ControlMode = 559 , Voltage = 900 ,
  Torque = 901 , systemcontrol = 554 , status = 553 , CB1 = 2533 ,
  cumstat = 13 , faults = 552 , devtype = 6020
}
 
enum class  MotorSimplemotion_FBR : uint8_t {
  none = 0 , ABN1 , ABN2 , Resolver ,
  Hall , Serial , Sincos16 , Sincos64 ,
  Sincos256
}
 

Private Member Functions

struct MotorSimplemotion::Sm2FastUpdate __attribute__ ((packed))
 
struct MotorSimplemotion::Sm2FastUpdate_reply __attribute__ ((packed))
 
void updatePosition (uint16_t value)
 
void updateStatus (uint16_t value)
 
void resetBuffer ()
 
bool prepareUartTransmit ()
 
template<size_t params, size_t replynum>
bool readParameter (std::array< MotorSimplemotion_param, params > paramIds, std::array< uint32_t *, replynum > replies, MotorSimplemotion_cmdtypes replylen=MotorSimplemotion_cmdtypes::none, uint32_t timeout_ms=uartErrorTimeout)
 
template<size_t params, size_t replynum>
bool writeParameter (std::array< std::pair< MotorSimplemotion_param, int32_t >, params > paramIds_value, std::array< uint32_t *, replynum > replies, MotorSimplemotion_cmdtypes type, uint32_t timeout_ms=uartErrorTimeout)
 

Static Private Member Functions

static uint16_t calculateCrc16rev (std::array< uint16_t, 256 > &crctable, uint8_t *buf, uint16_t len, uint16_t crc)
 

Private Attributes

uint8_t address
 
uint16_t status
 
uint16_t devicetype =0
 
int32_t position = 0
 
int32_t position_offset = 0
 
uint16_t lastPosRep = 0x7fff
 
volatile bool waitingFastUpdate = false
 
volatile bool waitingReply = false
 
int32_t overflows = 0
 
Sm2FastUpdate fastbuffer
 
volatile uint32_t lastSentTime = 0
 
volatile uint32_t lastStatusTime = 0
 
volatile uint32_t lastTimeByteReceived = 0
 
volatile bool uartErrorOccured = false
 
bool initialized = false
 
bool hardfault = false
 
Error configError = {ErrorCode::externalConfigurationError, ErrorType::critical, "Simplemotion device invalid configuration"}
 
MotorSimplemotion_FBR encodertype
 

Static Private Attributes

static const uint32_t uartErrorTimeout = 10
 

Additional Inherited Members

- Static Public Member Functions inherited from ChoosableClass
static bool isCreatable ()
 
- Static Public Member Functions inherited from CommandHandler
static void logSerial (std::string string)
 Send a log formatted sequence. More...
 
static void logSerialDebug (std::string string)
 Send a log formatted sequence if debug is on. More...
 
static bool logsEnabled ()
 
static void setLogsEnabled (bool enabled)
 
static uint32_t getClassIdFromName (const char *name)
 
static const char * getClassNameFromId (const uint32_t id)
 
static CommandHandlergetHandlerFromHandlerId (const uint16_t cmdhandlerID)
 
static CommandHandlergetHandlerFromId (const uint16_t id, const uint8_t instance=0xFF)
 
static CommandHandlergetHandlerFromClassName (const char *name, const uint8_t instance=0xFF)
 
static std::vector< CommandHandler * > getHandlersFromClassName (const char *name)
 
static std::vector< CommandHandler * > getHandlersFromId (const uint16_t id)
 
static bool isInHandlerList (CommandHandler *handler)
 
static std::string getAllHelpstrings ()
 
static std::vector< CommandHandler * > & getCommandHandlers ()
 
template<typename TVal >
static CommandStatus handleGetSet (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value)
 
template<typename TVal , class cls , class cls1 >
static CommandStatus handleGetSetFunc (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value, void(cls1::*setfunc)(TVal), cls *obj)
 
template<typename TVal , class cls , class cls1 , class cls2 >
static CommandStatus handleGetFuncSetFunc (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal(cls1::*getfunc)(), void(cls2::*setfunc)(TVal), cls *obj)
 
template<typename TVal , class cls , class cls1 >
static CommandStatus handleGetFuncSet (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value, TVal(cls1::*getfunc)(), cls *obj)
 
- Protected Member Functions inherited from CommandHandler
void setInstance (uint8_t instance)
 
virtual void addCommandHandler ()
 
virtual void removeCommandHandler ()
 
- Static Protected Member Functions inherited from CommandHandler
static std::vector< uint16_t > & getCommandHandlerIds ()
 

Detailed Description

Requires a uart port and one GPIO output for the transceiver

Definition at line 24 of file MotorSimplemotion.h.

Member Enumeration Documentation

◆ MotorSimplemotion_cmdtypes

enum class MotorSimplemotion::MotorSimplemotion_cmdtypes : uint8_t
strongprivate
Enumerator
param32b 
param24b 
setparamadr 
status 
none 

Definition at line 30 of file MotorSimplemotion.h.

◆ MotorSimplemotion_commands

enum class MotorSimplemotion::MotorSimplemotion_commands : uint8_t
strongprivate
Enumerator
crcerrors 
uarterrors 
voltage 
torque 
status 
restart 
reg 
devtype 

Definition at line 26 of file MotorSimplemotion.h.

◆ MotorSimplemotion_FBR

enum class MotorSimplemotion::MotorSimplemotion_FBR : uint8_t
strongprivate
Enumerator
none 
ABN1 
ABN2 
Resolver 
Hall 
Serial 
Sincos16 
Sincos64 
Sincos256 

Definition at line 38 of file MotorSimplemotion.h.

◆ MotorSimplemotion_param

enum class MotorSimplemotion::MotorSimplemotion_param : uint16_t
strongprivate
Enumerator
FBD 
FBR 
ControlMode 
Voltage 
Torque 
systemcontrol 
status 
CB1 
cumstat 
faults 
devtype 

Definition at line 34 of file MotorSimplemotion.h.

Constructor & Destructor Documentation

◆ MotorSimplemotion()

MotorSimplemotion::MotorSimplemotion ( uint8_t  instance)

Definition at line 30 of file MotorSimplemotion.cpp.

◆ ~MotorSimplemotion()

MotorSimplemotion::~MotorSimplemotion ( )
virtual

Definition at line 54 of file MotorSimplemotion.cpp.

Member Function Documentation

◆ __attribute__() [1/2]

struct MotorSimplemotion::Sm2FastUpdate_reply MotorSimplemotion::__attribute__ ( (packed)  )
private

◆ __attribute__() [2/2]

struct MotorSimplemotion::Sm2FastUpdate MotorSimplemotion::__attribute__ ( (packed)  )
private

◆ calculateCrc16rev()

static uint16_t MotorSimplemotion::calculateCrc16rev ( std::array< uint16_t, 256 > &  crctable,
uint8_t *  buf,
uint16_t  len,
uint16_t  crc 
)
staticprivate

◆ command()

CommandStatus MotorSimplemotion::command ( const ParsedCommand cmd,
std::vector< CommandReply > &  replies 
)
overridevirtual
Parameters
[in]cmdThe parsed command to be executed.
[out]repliesA vector to return one or multiple reply objects into. Replies to the interface will be generated based on the reply objects. A string reply may not contain start, end and separation markers: [,],| Other characters are allowed.

Reimplemented from CommandHandler.

Definition at line 485 of file MotorSimplemotion.cpp.

◆ endUartTransfer()

void MotorSimplemotion::endUartTransfer ( UARTPort port,
bool  transmit 
)
virtual

Reimplemented from UARTDevice.

Definition at line 462 of file MotorSimplemotion.cpp.

◆ getCpr()

uint32_t MotorSimplemotion::getCpr ( )
overridevirtual

This is requested always before position so we need to make sure we have the cpr

Reimplemented from Encoder.

Definition at line 128 of file MotorSimplemotion.cpp.

◆ getCumstat()

uint32_t MotorSimplemotion::getCumstat ( )

Definition at line 140 of file MotorSimplemotion.cpp.

◆ getEncoder()

Encoder * MotorSimplemotion::getEncoder ( )
overridevirtual

Returns the encoder of this motor driver. Either the integrated encoder or an external encoder assigned to this motor driver passed externally

Reimplemented from MotorDriver.

Definition at line 106 of file MotorSimplemotion.cpp.

◆ getEncoderType()

EncoderType MotorSimplemotion::getEncoderType ( )
overridevirtual

Returns the type of the encoder. Must override this and NOT return NONE in other classes

Reimplemented from Encoder.

Definition at line 450 of file MotorSimplemotion.cpp.

◆ getHelpstring()

std::string MotorSimplemotion::getHelpstring ( )
inlinevirtual

Returns a description of this class

Reimplemented from CommandHandler.

Definition at line 78 of file MotorSimplemotion.h.

◆ getInfo()

const ClassIdentifier MotorSimplemotion::getInfo ( )
pure virtual

Command handlers always have class infos. Works well with ChoosableClass.

Implements CommandHandler.

Implemented in MotorSimplemotion1, and MotorSimplemotion2.

◆ getPos()

int32_t MotorSimplemotion::getPos ( )
overridevirtual

In order to get a position update the fast update must be sent first by updating a torque value

Reimplemented from Encoder.

Definition at line 114 of file MotorSimplemotion.cpp.

◆ getSettings()

bool MotorSimplemotion::getSettings ( )

Definition at line 148 of file MotorSimplemotion.cpp.

◆ getTorque()

int16_t MotorSimplemotion::getTorque ( )

Definition at line 248 of file MotorSimplemotion.cpp.

◆ getVoltage()

int16_t MotorSimplemotion::getVoltage ( )

Definition at line 239 of file MotorSimplemotion.cpp.

◆ hasIntegratedEncoder()

bool MotorSimplemotion::hasIntegratedEncoder ( )
inlinevirtual

If returned true it signals that this motor driver contains its own encoder and does not require an external encoder

Reimplemented from MotorDriver.

Definition at line 68 of file MotorSimplemotion.h.

◆ motorReady()

bool MotorSimplemotion::motorReady ( )
virtual

Reimplemented from MotorDriver.

Definition at line 135 of file MotorSimplemotion.cpp.

◆ prepareUartTransmit()

bool MotorSimplemotion::prepareUartTransmit ( )
private

Checks for a failed transfer and takes the semaphore for uart port

Definition at line 289 of file MotorSimplemotion.cpp.

◆ queueCommand()

uint8_t MotorSimplemotion::queueCommand ( uint8_t *  buf,
MotorSimplemotion_cmdtypes  type,
uint32_t  data 
)

Appends a subpacket to a buffer. Buffer must be 0 initialized returns appended length

Definition at line 331 of file MotorSimplemotion.cpp.

◆ read1Parameter()

bool MotorSimplemotion::read1Parameter ( MotorSimplemotion_param  paramId,
uint32_t *  reply_p,
MotorSimplemotion_cmdtypes  replylen = MotorSimplemotion_cmdtypes::none 
)

Definition at line 226 of file MotorSimplemotion.cpp.

◆ readParameter()

template<size_t params, size_t replynum>
bool MotorSimplemotion::readParameter ( std::array< MotorSimplemotion_param, params >  paramIds,
std::array< uint32_t *, replynum >  replies,
MotorSimplemotion_cmdtypes  replylen = MotorSimplemotion_cmdtypes::none,
uint32_t  timeout_ms = uartErrorTimeout 
)
inlineprivate

Templated function to read multiple parameters TODO: support more than 1 request at once

Definition at line 173 of file MotorSimplemotion.h.

◆ registerCommands()

void MotorSimplemotion::registerCommands ( )

Definition at line 472 of file MotorSimplemotion.cpp.

◆ resetBuffer()

void MotorSimplemotion::resetBuffer ( )
private

Resets the buffer and ends a transfer. must be called after every receive

Definition at line 344 of file MotorSimplemotion.cpp.

◆ restart()

void MotorSimplemotion::restart ( )

Definition at line 256 of file MotorSimplemotion.cpp.

◆ sendCommand()

bool MotorSimplemotion::sendCommand ( uint8_t *  buf,
uint8_t  len,
uint8_t  adr 
)

Sends a command buffer

Definition at line 300 of file MotorSimplemotion.cpp.

◆ sendFastUpdate()

void MotorSimplemotion::sendFastUpdate ( uint16_t  val1,
uint16_t  val2 = 0 
)

Sends a fast cycle packet. Driver will reply with status and position

Definition at line 62 of file MotorSimplemotion.cpp.

◆ set1Parameter()

bool MotorSimplemotion::set1Parameter ( MotorSimplemotion_param  paramId,
int32_t  value,
uint32_t *  reply_p = nullptr 
)

Definition at line 232 of file MotorSimplemotion.cpp.

◆ setPos()

void MotorSimplemotion::setPos ( int32_t  pos)
overridevirtual

Change the position of the encoder Can be used to reset the center

Reimplemented from Encoder.

Definition at line 121 of file MotorSimplemotion.cpp.

◆ startMotor()

void MotorSimplemotion::startMotor ( )
overridevirtual

Enable the motor driver

Reimplemented from MotorDriver.

Definition at line 441 of file MotorSimplemotion.cpp.

◆ startUartTransfer()

void MotorSimplemotion::startUartTransfer ( UARTPort port,
bool  transmit 
)
virtual

Reimplemented from UARTDevice.

Definition at line 454 of file MotorSimplemotion.cpp.

◆ stopMotor()

void MotorSimplemotion::stopMotor ( )
overridevirtual

Disable the motor driver

Reimplemented from MotorDriver.

Definition at line 445 of file MotorSimplemotion.cpp.

◆ turn()

void MotorSimplemotion::turn ( int16_t  val)
overridevirtual

Turn the motor with positive/negative power. Range should be full signed 16 bit A value of 0 should have no torque. The sign is the direction.

Reimplemented from MotorDriver.

Definition at line 101 of file MotorSimplemotion.cpp.

◆ uartRcv()

void MotorSimplemotion::uartRcv ( char &  buf)
virtual

Reimplemented from UARTDevice.

Definition at line 353 of file MotorSimplemotion.cpp.

◆ updatePosition()

void MotorSimplemotion::updatePosition ( uint16_t  value)
private

Definition at line 261 of file MotorSimplemotion.cpp.

◆ updateStatus()

void MotorSimplemotion::updateStatus ( uint16_t  value)
private

Definition at line 277 of file MotorSimplemotion.cpp.

◆ writeParameter()

template<size_t params, size_t replynum>
bool MotorSimplemotion::writeParameter ( std::array< std::pair< MotorSimplemotion_param, int32_t >, params >  paramIds_value,
std::array< uint32_t *, replynum >  replies,
MotorSimplemotion_cmdtypes  type,
uint32_t  timeout_ms = uartErrorTimeout 
)
inlineprivate

Definition at line 219 of file MotorSimplemotion.h.

Member Data Documentation

◆ address

uint8_t MotorSimplemotion::address
private

Definition at line 137 of file MotorSimplemotion.h.

◆ configError

Error MotorSimplemotion::configError = {ErrorCode::externalConfigurationError, ErrorType::critical, "Simplemotion device invalid configuration"}
private

Definition at line 163 of file MotorSimplemotion.h.

◆ crc8init

const uint8_t MotorSimplemotion::crc8init = 0x52
staticprotected

Definition at line 116 of file MotorSimplemotion.h.

◆ crcerrors

volatile uint32_t MotorSimplemotion::crcerrors = 0
protected

Definition at line 131 of file MotorSimplemotion.h.

◆ crcpoly

const uint8_t MotorSimplemotion::crcpoly = 0x07
staticprotected

Definition at line 113 of file MotorSimplemotion.h.

◆ crcpoly16

const uint16_t MotorSimplemotion::crcpoly16 = 0x8005
staticprotected

Definition at line 114 of file MotorSimplemotion.h.

◆ crcTableInitialized

bool MotorSimplemotion::crcTableInitialized = false
staticprotected

Definition at line 115 of file MotorSimplemotion.h.

◆ devicetype

uint16_t MotorSimplemotion::devicetype =0
private

Definition at line 142 of file MotorSimplemotion.h.

◆ encodertype

MotorSimplemotion_FBR MotorSimplemotion::encodertype
private

Definition at line 164 of file MotorSimplemotion.h.

◆ fastbuffer

Sm2FastUpdate MotorSimplemotion::fastbuffer
private

Definition at line 150 of file MotorSimplemotion.h.

◆ hardfault

bool MotorSimplemotion::hardfault = false
private

Definition at line 162 of file MotorSimplemotion.h.

◆ initialized

bool MotorSimplemotion::initialized = false
private

Definition at line 161 of file MotorSimplemotion.h.

◆ lastPosRep

uint16_t MotorSimplemotion::lastPosRep = 0x7fff
private

Definition at line 146 of file MotorSimplemotion.h.

◆ lastSentTime

volatile uint32_t MotorSimplemotion::lastSentTime = 0
private

Definition at line 151 of file MotorSimplemotion.h.

◆ lastStatusTime

volatile uint32_t MotorSimplemotion::lastStatusTime = 0
private

Definition at line 152 of file MotorSimplemotion.h.

◆ lastTimeByteReceived

volatile uint32_t MotorSimplemotion::lastTimeByteReceived = 0
private

Definition at line 155 of file MotorSimplemotion.h.

◆ lastTorque

int16_t MotorSimplemotion::lastTorque = 0
protected

Definition at line 132 of file MotorSimplemotion.h.

◆ lastUpdateTime

volatile uint32_t MotorSimplemotion::lastUpdateTime = 0
protected

Definition at line 133 of file MotorSimplemotion.h.

◆ overflows

int32_t MotorSimplemotion::overflows = 0
private

Definition at line 149 of file MotorSimplemotion.h.

◆ position

int32_t MotorSimplemotion::position = 0
private

Definition at line 144 of file MotorSimplemotion.h.

◆ position_offset

int32_t MotorSimplemotion::position_offset = 0
private

Definition at line 145 of file MotorSimplemotion.h.

◆ REPLYBUF_SIZE

const uint8_t MotorSimplemotion::REPLYBUF_SIZE = 32
staticprotected

Definition at line 128 of file MotorSimplemotion.h.

◆ replyidx

volatile uint8_t MotorSimplemotion::replyidx = 0
protected

Definition at line 127 of file MotorSimplemotion.h.

◆ replyvalues

volatile uint32_t MotorSimplemotion::replyvalues[REPLYBUF_SIZE]
protected

Definition at line 129 of file MotorSimplemotion.h.

◆ rxbuf

volatile char MotorSimplemotion::rxbuf[RXBUF_SIZE]
protected

Definition at line 120 of file MotorSimplemotion.h.

◆ rxbuf_i

volatile uint8_t MotorSimplemotion::rxbuf_i = 0
protected

Definition at line 121 of file MotorSimplemotion.h.

◆ RXBUF_SIZE

const uint8_t MotorSimplemotion::RXBUF_SIZE = 32
staticprotected

Definition at line 119 of file MotorSimplemotion.h.

◆ SMCMD_FAST_UPDATE_CYCLE

const uint8_t MotorSimplemotion::SMCMD_FAST_UPDATE_CYCLE = 2<<3
static

Definition at line 100 of file MotorSimplemotion.h.

◆ SMCMD_FAST_UPDATE_CYCLE_RET

const uint8_t MotorSimplemotion::SMCMD_FAST_UPDATE_CYCLE_RET = (2<<3) | 1
static

Definition at line 101 of file MotorSimplemotion.h.

◆ SMCMD_INSTANT_CMD

const uint8_t MotorSimplemotion::SMCMD_INSTANT_CMD = 0x24
static

Definition at line 103 of file MotorSimplemotion.h.

◆ SMCMD_INSTANT_CMD_RET

const uint8_t MotorSimplemotion::SMCMD_INSTANT_CMD_RET = 0x25
static

Definition at line 104 of file MotorSimplemotion.h.

◆ SMP_FAST_UPDATE_CYCLE_FORMAT

const uint8_t MotorSimplemotion::SMP_FAST_UPDATE_CYCLE_FORMAT = 17
static

Definition at line 102 of file MotorSimplemotion.h.

◆ SMPCMD_SETPARAMADDR

const uint8_t MotorSimplemotion::SMPCMD_SETPARAMADDR = 2
static

Definition at line 105 of file MotorSimplemotion.h.

◆ status

uint16_t MotorSimplemotion::status
private

Definition at line 141 of file MotorSimplemotion.h.

◆ tableCRC16

std::array<uint16_t,256> MotorSimplemotion::tableCRC16
staticprotected

Definition at line 112 of file MotorSimplemotion.h.

◆ tableCRC8

std::array<uint8_t,256> MotorSimplemotion::tableCRC8
staticprotected

Definition at line 111 of file MotorSimplemotion.h.

◆ txbuf

char MotorSimplemotion::txbuf[TXBUF_SIZE]
protected

Definition at line 125 of file MotorSimplemotion.h.

◆ TXBUF_SIZE

const uint8_t MotorSimplemotion::TXBUF_SIZE = 32
staticprotected

Definition at line 124 of file MotorSimplemotion.h.

◆ uartErrorOccured

volatile bool MotorSimplemotion::uartErrorOccured = false
private

Definition at line 156 of file MotorSimplemotion.h.

◆ uarterrors

volatile uint32_t MotorSimplemotion::uarterrors = 0
protected

Definition at line 134 of file MotorSimplemotion.h.

◆ uartErrorTimeout

const uint32_t MotorSimplemotion::uartErrorTimeout = 10
staticprivate

Definition at line 154 of file MotorSimplemotion.h.

◆ waitingFastUpdate

volatile bool MotorSimplemotion::waitingFastUpdate = false
private

Definition at line 147 of file MotorSimplemotion.h.

◆ waitingReply

volatile bool MotorSimplemotion::waitingReply = false
private

Definition at line 148 of file MotorSimplemotion.h.

◆ writeEnablePin

const OutputPin& MotorSimplemotion::writeEnablePin = gpMotor
protected

Definition at line 108 of file MotorSimplemotion.h.


The documentation for this class was generated from the following files: