MotorWare f2806x Module API Documentation
Data Structures | Macros | Typedefs | Enumerations | Functions
SpinTAC Position Plan

Data Structures

struct  ST_PlanError_t
 Defines the ST_PlanError_t data. More...
 
struct  ST_PosPlan_t
 Defines the ST_PosPlan_t data. More...
 

Macros

#define ST_POS_PLAN_ACT_DWORDS   (5)
 Defines the amount of memory that needs to be allocated for each component. More...
 
#define ST_POS_PLAN_COND_DWORDS   (3)
 Each configured Condition takes 3 double words of memory. More...
 
#define ST_POS_PLAN_VAR_DWORDS   (2)
 Each configured Variable takes 2 double words of memory. More...
 
#define ST_POS_PLAN_TRAN_DWORDS   (7)
 Each configured Transition takes 7 double words of memory. More...
 
#define ST_POS_PLAN_STATE_DWORDS   (7)
 Each configured State takes 7 double words of memory. More...
 
#define __ST_PLAN_ENUM__
 
#define __ST_PLAN_ERROR__
 

Typedefs

typedef struct _ST_POSPLAN_Handle_ * ST_POSPLAN_Handle
 

Enumerations

enum  ST_PlanStatus_e {
  ST_PLAN_IDLE =0, ST_PLAN_INIT, ST_PLAN_BUSY, ST_PLAN_HALT,
  ST_PLAN_WAIT, ST_PLAN_IDLE =0, ST_PLAN_INIT, ST_PLAN_BUSY,
  ST_PLAN_HALT, ST_PLAN_WAIT
}
 Enumeration for the Plan Status States. More...
 
enum  ST_PlanCond_e {
  ST_COND_NC =0, ST_COND_FC, ST_COND_AND, ST_COND_OR,
  ST_COND_NC =0, ST_COND_FC, ST_COND_AND, ST_COND_OR
}
 Enumeration for the Plan Condition options. More...
 
enum  ST_PlanComp_e {
  ST_COMP_NA =0, ST_COMP_EQ, ST_COMP_NEQ, ST_COMP_GT,
  ST_COMP_EGT, ST_COMP_LW, ST_COMP_ELW, ST_COMP_In,
  ST_COMP_EIn, ST_COMP_InE, ST_COMP_EInE, ST_COMP_Out,
  ST_COMP_EOut, ST_COMP_OutE, ST_COMP_EOutE, ST_COMP_NA =0,
  ST_COMP_EQ, ST_COMP_NEQ, ST_COMP_GT, ST_COMP_EGT,
  ST_COMP_LW, ST_COMP_ELW, ST_COMP_In, ST_COMP_EIn,
  ST_COMP_InE, ST_COMP_EInE, ST_COMP_Out, ST_COMP_EOut,
  ST_COMP_OutE, ST_COMP_EOutE
}
 Enumeration for the Plan Compare options. More...
 
enum  ST_PlanActOptn_e { ST_ACT_EQ =0, ST_ACT_ADD, ST_ACT_EQ =0, ST_ACT_ADD }
 Enumeration for the Plan Action Options. More...
 
enum  ST_PlanActTrgr_e { ST_ACT_ENTR =0, ST_ACT_EXIT, ST_ACT_ENTR =0, ST_ACT_EXIT }
 Enumeration for the Plan Action trigger point types. More...
 
enum  ST_PlanFsmState_e {
  ST_FSM_STATE_STAY =0, ST_FSM_STATE_COND, ST_FSM_STATE_TRAN, ST_FSM_STATE_STAY =0,
  ST_FSM_STATE_COND, ST_FSM_STATE_TRAN
}
 Enumeration for the Plan FSM states. More...
 
enum  ST_PlanVar_e {
  ST_VAR_INOUT =0, ST_VAR_IN, ST_VAR_OUT, ST_VAR_INOUT =0,
  ST_VAR_IN, ST_VAR_OUT
}
 Enumeration for the Plan variable types. More...
 

Functions

static void STPOSPLAN_getPositionStep_mrev (ST_POSPLAN_Handle handle, int32_t *posStepInt_mrev, _iq24 *posStepFrac_mrev)
 Gets the Position Step (posStepInt_mrev, posStepFrac_mrev) for SpinTAC Position Plan. More...
 
static _iq24 STPOSPLAN_getVelocityLimit (ST_POSPLAN_Handle handle)
 Gets the Velocity Limit (VelLim) for SpinTAC Position Plan. More...
 
static _iq24 STPOSPLAN_getAccelerationLimit (ST_POSPLAN_Handle handle)
 Gets the Acceleration Limit (AccLim) for SpinTAC Position Plan. More...
 
static _iq24 STPOSPLAN_getDecelerationLimit (ST_POSPLAN_Handle handle)
 Gets the Deceleration Limit (DecLim) for SpinTAC Position Plan. More...
 
static _iq20 STPOSPLAN_getJerkLimit (ST_POSPLAN_Handle handle)
 Gets the Jerk Limit (JrkLim) for SpinTAC Position Plan. More...
 
static void STPOSPLAN_setEnable (ST_POSPLAN_Handle handle, bool enb)
 Sets the Enable signal (ENB) for SpinTAC Position Plan. More...
 
static bool STPOSPLAN_getEnable (ST_POSPLAN_Handle handle)
 Gets the Enable signal (ENB) for SpinTAC Position Plan. More...
 
static void STPOSPLAN_setReset (ST_POSPLAN_Handle handle, bool res)
 Sets the Reset signal (RES) for SpinTAC Position Plan. More...
 
static bool STPOSPLAN_getReset (ST_POSPLAN_Handle handle)
 Gets the Reset signal (RES) for SpinTAC Position Plan. More...
 
static ST_PlanStatus_e STPOSPLAN_getStatus (ST_POSPLAN_Handle handle)
 Gets the Status value (STATUS) for SpinTAC Position Plan. More...
 
static uint16_t STPOSPLAN_getCurrentState (ST_POSPLAN_Handle handle)
 Gets the Current State (CurState) for SpinTAC Position Plan. More...
 
static uint16_t STPOSPLAN_getCurrentTransition (ST_POSPLAN_Handle handle)
 Gets the Current Transition (CurTran) for SpinTAC Position Plan. More...
 
static ST_PlanFsmState_e STPOSPLAN_getFsmState (ST_POSPLAN_Handle handle)
 Gets the State Machine State (FsmState) for SpinTAC Position Plan. More...
 
static int32_t STPOSPLAN_getCurrentTimerValue_tick (ST_POSPLAN_Handle handle)
 Gets the Current Time Value (Timer_tick) for SpinTAC Position Plan. More...
 
static uint16_t STPOSPLAN_getCfgError (ST_POSPLAN_Handle handle, uint16_t *ERR_idx, uint16_t *ERR_code)
 Gets the Configuration Error for SpinTAC Position Plan. More...
 
static uint16_t STPOSPLAN_getErrorID (ST_POSPLAN_Handle handle)
 Gets the Error value (ERR_ID) for SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfgStateNum (ST_POSPLAN_Handle handle, uint16_t *StateNum)
 Returns the number of configured States in SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfgVarNum (ST_POSPLAN_Handle handle, uint16_t *VarNum)
 Returns the number of configured Variables in SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfgCondNum (ST_POSPLAN_Handle handle, uint16_t *CondNum)
 Returns the number of configured Conditions in SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfgTranNum (ST_POSPLAN_Handle handle, uint16_t *TranNum)
 Returns the number of configured Transitions in SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfgActNum (ST_POSPLAN_Handle handle, uint16_t *ActNum)
 Returns the number of configured Actions in SpinTAC Position Plan. More...
 
void STPOSPLAN_addCfgCond (ST_POSPLAN_Handle handle, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2)
 Adds a Condition to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgCond (ST_POSPLAN_Handle handle, uint16_t CondIdx)
 Deletes a Condition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgCond (ST_POSPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2)
 Modifies a Condition in the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgCond (ST_POSPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx, ST_PlanComp_e *Comp, _iq24 *Value1, _iq24 *Value2)
 Returns a Condition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_addCfgVarCond (ST_POSPLAN_Handle handle, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp)
 Adds a Variable Condition to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgVarCond (ST_POSPLAN_Handle handle, uint16_t CondIdx)
 Deletes a Variable Condition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgVarCond (ST_POSPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp)
 Modifies a Variable Condition to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgVarCond (ST_POSPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx1, uint16_t *VarIdx2, ST_PlanComp_e *Comp)
 Returns a Variable Condition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_addCfgTran (ST_POSPLAN_Handle handle, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 VelLim, _iq24 AccLim, _iq24 DecLim, _iq20 JrkLim)
 Adds a Transition to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgTran (ST_POSPLAN_Handle handle, uint16_t TranIdx)
 Deletes a Transition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgTran (ST_POSPLAN_Handle handle, uint16_t TranIdx, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 VelLim, _iq24 AccLim, _iq24 DecLim, _iq20 JrkLim)
 Modifies a Transition in the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgTran (ST_POSPLAN_Handle handle, uint16_t TranIdx, uint16_t *FromState, uint16_t *ToState, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, _iq24 *VelLim, _iq24 *AccLim, _iq24 *DecLim, _iq20 *JrkLim)
 Get a Transition from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_addCfgAct (ST_POSPLAN_Handle handle, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit)
 Adds an action to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgAct (ST_POSPLAN_Handle handle, uint16_t ActIdx)
 Deletes an action from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgAct (ST_POSPLAN_Handle handle, uint16_t ActIdx, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit)
 Modifies an action in the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgAct (ST_POSPLAN_Handle handle, uint16_t ActIdx, uint16_t *State, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, uint16_t *VarIdx, ST_PlanActOptn_e *Opt, _iq24 *Value, ST_PlanActTrgr_e *EnterExit)
 Returns an action from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_addCfgVar (ST_POSPLAN_Handle handle, ST_PlanVar_e Type, _iq24 Value)
 Adds a variable to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgVar (ST_POSPLAN_Handle handle, uint16_t VarIdx)
 Deletes a Variable from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgVar (ST_POSPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e Type, _iq24 Value)
 Modifies a variable in the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgVar (ST_POSPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e *Type, _iq24 *Value)
 Returns a variable from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setVar (ST_POSPLAN_Handle handle, uint16_t VarIdx, _iq24 Value)
 Sets the value of a SpinTAC Position Plan variable. More...
 
void STPOSPLAN_getVar (ST_POSPLAN_Handle handle, uint16_t VarIdx, _iq24 *Value)
 Gets the value of a SpinTAC Position Plan variable. More...
 
void STPOSPLAN_setUnitProfDone (ST_POSPLAN_Handle handle, bool ProDON)
 Sets a flag in SpinTAC Position Plan to indicate if the unit profile is complete. More...
 
void STPOSPLAN_setCfg (ST_POSPLAN_Handle handle, _iq24 T_sec, bool LoopENB)
 Configures SpinTAC Position Plan. More...
 
void STPOSPLAN_getCfg (ST_POSPLAN_Handle handle, _iq24 *T_sec, bool *LoopENB)
 Gets the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgHaltState (ST_POSPLAN_Handle handle, int32_t PosStepInt_mrev, _iq24 PosStepFrac_mrev, _iq24 VelLim, _iq24 AccLim, _iq20 JrkLim, int32_t Timer_tick)
 Configures the SpinTAC Position Plan Halt state. More...
 
void STPOSPLAN_getCfgHaltState (ST_POSPLAN_Handle handle, int32_t *PosStepInt_mrev, _iq24 *PosStepFrac_mrev, _iq24 *VelLim, _iq24 *AccLim, _iq20 *JrkLim, int32_t *Timer_tick)
 Gets the SpinTAC Position Plan Halt state. More...
 
void STPOSPLAN_addCfgState (ST_POSPLAN_Handle handle, int32_t PosStepInt_mrev, _iq24 PosStep_Fracmrev, int32_t Timer_tick)
 Adds a State to the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_delCfgState (ST_POSPLAN_Handle handle, uint16_t StateIdx)
 Deletes a state from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_setCfgState (ST_POSPLAN_Handle handle, uint16_t StateIdx, int32_t PosStepInt_mrev, _iq24 PosStepFrac_mrev, int32_t Timer_tick)
 Modifies a state in the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_getCfgState (ST_POSPLAN_Handle handle, uint16_t StateIdx, int32_t *PosStepInt_mrev, _iq24 *PosStepFrac_mrev, int32_t *Timer_tick)
 Returns a state from the SpinTAC Position Plan configuration. More...
 
void STPOSPLAN_reset (ST_POSPLAN_Handle handle)
 Resets the SpinAC Position Plan component. More...
 
ST_POSPLAN_Handle STPOSPLAN_init (void *pMemory, const size_t numBytes)
 Initializes the SpinTAC Position Plan component. More...
 
void STPOSPLAN_run (ST_POSPLAN_Handle handle)
 Runs SpinTAC Position Plan calculation. More...
 
void STPOSPLAN_runTick (ST_POSPLAN_Handle handle)
 Runs SpinTAC Position Plan Timing. Call this only from an ISR. More...
 
void STPOSPLAN_setCfgArray (ST_POSPLAN_Handle handle, uint32_t *cfgArray, const size_t numBytes, uint16_t MaxActNum, uint16_t MaxCondNum, uint16_t MaxVarNum, uint16_t MaxTranNum, uint16_t MaxStateNum)
 Prepares SpinTAC Position Plan data structure. More...
 

Detailed Description


Data Structure Documentation

struct ST_PlanError_t

Defines the ST_PlanError_t data.

The ST_PlanError_t object contains error debugging information for the Position Plan component

The ST_PlanError_t object contains error debugging information for the Velocity Plan component

Definition at line 139 of file spintac_pos_plan.h.

Data Fields
uint16_t ERR_code Function specific condition that caused the error.
uint16_t ERR_idx Plan component index that caused the error.
struct ST_PosPlan_t

Defines the ST_PosPlan_t data.

The ST_PosPlan_t object contains all configuration parameters of the Position Plan component

Definition at line 148 of file spintac_pos_plan.h.

Data Fields
_iq24 AccLim Acceleration limit { unit: [pu/s^2], value range: [0.001, 120.0] }.
ST_PlanError_t CfgError Error decoding structure.
uint16_t CurState Current state of the state machine.
uint16_t CurTran Current transition of the state machine.
_iq24 DecLim Deceleration limit { unit: [pu/s^2], value range: [0.001, 120.0] }.
bool ENB Enable bit { false: disabled; true: enabled }.
uint16_t ERR_ID Error ID { 0: no error; others: see error code }.
ST_PlanFsmState_e FsmState State of the state machine.
_iq20 JrkLim Jerk Limit { unit: [pu/s^3], value range: [0.0005, 2000.0] }.
_iq24 PosStepFrac_mrev Position Step fraction part { unit: [MRev], value range: (-1.0, 1.0)}.
int32_t PosStepInt_mrev Position Step Integer part { unit: [MRev] }.
bool RES Reset bit { false: not reset; true: reset }.
uint32_t s0[31]
ST_PlanStatus_e STATUS Plan status { ST_PLAN_IDLE, ST_PLAN_INIT, ST_PLAN_BUSY, ST_PLAN_HALT, ST_PLAN_WAIT}.
int32_t Timer_tick State Timer { unit: [tick] }.
_iq24 VelLim Velocity limit { unit: [pu/s], value range: (0.0, 1.0] }.

Macro Definition Documentation

#define __ST_PLAN_ENUM__

Definition at line 63 of file spintac_pos_plan.h.

#define __ST_PLAN_ERROR__

Definition at line 135 of file spintac_pos_plan.h.

#define ST_POS_PLAN_ACT_DWORDS   (5)

Defines the amount of memory that needs to be allocated for each component.

Each configured Action takes 3 double words of memory

Definition at line 51 of file spintac_pos_plan.h.

#define ST_POS_PLAN_COND_DWORDS   (3)

Each configured Condition takes 3 double words of memory.

Definition at line 53 of file spintac_pos_plan.h.

#define ST_POS_PLAN_STATE_DWORDS   (7)

Each configured State takes 7 double words of memory.

Definition at line 59 of file spintac_pos_plan.h.

#define ST_POS_PLAN_TRAN_DWORDS   (7)

Each configured Transition takes 7 double words of memory.

Definition at line 57 of file spintac_pos_plan.h.

#define ST_POS_PLAN_VAR_DWORDS   (2)

Each configured Variable takes 2 double words of memory.

Definition at line 55 of file spintac_pos_plan.h.

Typedef Documentation

typedef struct _ST_POSPLAN_Handle_* ST_POSPLAN_Handle

Definition at line 172 of file spintac_pos_plan.h.

Enumeration Type Documentation

Enumeration for the Plan Action Options.

Enumerator
ST_ACT_EQ 

Action will set the variable equal to a value.

ST_ACT_ADD 

Action will add a value to the variable.

ST_ACT_EQ 

Action will set the variable equal to a value.

ST_ACT_ADD 

Action will add a value to the variable.

Definition at line 105 of file spintac_pos_plan.h.

Enumeration for the Plan Action trigger point types.

Enumerator
ST_ACT_ENTR 

Action will be considered when entering the state.

ST_ACT_EXIT 

Action will be considered when exiting the state.

ST_ACT_ENTR 

Action will be considered when entering the state.

ST_ACT_EXIT 

Action will be considered when exiting the state.

Definition at line 112 of file spintac_pos_plan.h.

Enumeration for the Plan Compare options.

Enumerator
ST_COMP_NA 

No comparison.

ST_COMP_EQ 

Compares, VarIdx == Value1 OR VarIdx1 == VarIdx2.

ST_COMP_NEQ 

Compares, VarIdx != Value1 OR VarIdx1 != VarIdx2.

ST_COMP_GT 

Compares, VarIdx > Value1 OR VarIdx1 > VarIdx2.

ST_COMP_EGT 

Compares, VarIdx >= Value1 OR VarIdx1 >= VarIdx2.

ST_COMP_LW 

Compares, VarIdx < Value1 OR VarIdx1 < VarIdx2.

ST_COMP_ELW 

Compares, VarIdx <= Value1 OR VarIdx1 <= VarIdx2.

ST_COMP_In 

Compares, Value1 <= VarIdx <= Value2.

ST_COMP_EIn 

Compares, Value1 < VarIdx <= Value2.

ST_COMP_InE 

Compares, Value1 <= VarIdx < Value2.

ST_COMP_EInE 

Compares, Value1 < VarIdx < Value2.

ST_COMP_Out 

Compares, Value1 >= VarIdx >= Value2.

ST_COMP_EOut 

Compares, Value1 > VarIdx >= Value2.

ST_COMP_OutE 

Compares, Value1 >= VarIdx > Value2.

ST_COMP_EOutE 

Compares, Value1 > VarIdx > Value2.

ST_COMP_NA 

No comparison.

ST_COMP_EQ 

Compares, VarIdx == Value1 OR VarIdx1 == VarIdx2.

ST_COMP_NEQ 

Compares, VarIdx != Value1 OR VarIdx1 != VarIdx2.

ST_COMP_GT 

Compares, VarIdx > Value1 OR VarIdx1 > VarIdx2.

ST_COMP_EGT 

Compares, VarIdx >= Value1 OR VarIdx1 >= VarIdx2.

ST_COMP_LW 

Compares, VarIdx < Value1 OR VarIdx1 < VarIdx2.

ST_COMP_ELW 

Compares, VarIdx <= Value1 OR VarIdx1 <= VarIdx2.

ST_COMP_In 

Compares, Value1 <= VarIdx <= Value2.

ST_COMP_EIn 

Compares, Value1 < VarIdx <= Value2.

ST_COMP_InE 

Compares, Value1 <= VarIdx < Value2.

ST_COMP_EInE 

Compares, Value1 < VarIdx < Value2.

ST_COMP_Out 

Compares, Value1 >= VarIdx >= Value2.

ST_COMP_EOut 

Compares, Value1 > VarIdx >= Value2.

ST_COMP_OutE 

Compares, Value1 >= VarIdx > Value2.

ST_COMP_EOutE 

Compares, Value1 > VarIdx > Value2.

Definition at line 85 of file spintac_pos_plan.h.

Enumeration for the Plan Condition options.

Enumerator
ST_COND_NC 

Transition/Action with no conditions satisfied.

ST_COND_FC 

Transition/Action with first condition satisfied.

ST_COND_AND 

Transition/Action with both conditions satisfied.

ST_COND_OR 

Transition/Action with either condition satisfied.

ST_COND_NC 

Transition/Action with no conditions satisfied.

ST_COND_FC 

Transition/Action with first condition satisfied.

ST_COND_AND 

Transition/Action with both conditions satisfied.

ST_COND_OR 

Transition/Action with either condition satisfied.

Definition at line 76 of file spintac_pos_plan.h.

Enumeration for the Plan FSM states.

Enumerator
ST_FSM_STATE_STAY 

Plan is staying in a state until the timer is up.

ST_FSM_STATE_COND 

Plan is waiting for a transition condition to be true.

ST_FSM_STATE_TRAN 

Plan is in transition with a motion profile.

ST_FSM_STATE_STAY 

Plan is staying in a state until the timer is up.

ST_FSM_STATE_COND 

Plan is waiting for a transition condition to be true.

ST_FSM_STATE_TRAN 

Plan is in transition with a motion profile.

Definition at line 119 of file spintac_pos_plan.h.

Enumeration for the Plan Status States.

Enumerator
ST_PLAN_IDLE 

idle state, holding position

ST_PLAN_INIT 

init state, initialize internal states

ST_PLAN_BUSY 

busy state, running state machine

ST_PLAN_HALT 

halt state, return to the position reference in idle state

ST_PLAN_WAIT 

wait state, holding the position reference in idle state

ST_PLAN_IDLE 

idle state, holding velocity

ST_PLAN_INIT 

init state, initialize internal states

ST_PLAN_BUSY 

busy state, running state machine

ST_PLAN_HALT 

halt state, return to the speed reference in idle state

ST_PLAN_WAIT 

wait state, holding the speed reference in idle state

Definition at line 66 of file spintac_pos_plan.h.

Enumeration for the Plan variable types.

Enumerator
ST_VAR_INOUT 

Variable type input/output.

ST_VAR_IN 

Variable type input.

ST_VAR_OUT 

Variable type output.

ST_VAR_INOUT 

Variable type input/output.

ST_VAR_IN 

Variable type input.

ST_VAR_OUT 

Variable type output.

Definition at line 127 of file spintac_pos_plan.h.

Function Documentation

void STPOSPLAN_addCfgAct ( ST_POSPLAN_Handle  handle,
uint16_t  State,
ST_PlanCond_e  AndOr,
uint16_t  CondIdx1,
uint16_t  CondIdx2,
uint16_t  VarIdx,
ST_PlanActOptn_e  Opt,
_iq24  Value,
ST_PlanActTrgr_e  EnterExit 
)

Adds an action to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]StateIndex of the State the Action happens in
[in]AndOrCondition option for the Action
[in]CondIdx1Index of the first Condition to consider for the Action
[in]CondIdx2Index of the second Condition to consider for the Action
[in]VarIdxIndex of the Varaible to be acted upon
[in]OptType of Action to perform on the Varaible
[in]ValueValue to use in the Action
[in]EnterExitState event that will trigger the Action
void STPOSPLAN_addCfgCond ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx,
ST_PlanComp_e  Comp,
_iq24  Value1,
_iq24  Value2 
)

Adds a Condition to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Plan Variable that will be compared
[in]CompType of comparison that will be done
[in]Value1First value to use in the comparison
[in]Value2Second value to use in the comparison
void STPOSPLAN_addCfgState ( ST_POSPLAN_Handle  handle,
int32_t  PosStepInt_mrev,
_iq24  PosStep_Fracmrev,
int32_t  Timer_tick 
)

Adds a State to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]PosStepInt_mrevPosition step integer part in State { unit: [MRev], value range: 32 bit integer (-2^31, 2^31) }
[in]PosStepFrac_mrevPosition step fraction part in State { unit: [MRev], value range: (-1.0, 1.0) }
[in]Timer_tickMinimum time to stay in State { unit: [tick] }
void STPOSPLAN_addCfgTran ( ST_POSPLAN_Handle  handle,
uint16_t  FromState,
uint16_t  ToState,
ST_PlanCond_e  AndOr,
uint16_t  CondIdx1,
uint16_t  CondIdx2,
_iq24  VelLim,
_iq24  AccLim,
_iq24  DecLim,
_iq20  JrkLim 
)

Adds a Transition to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]FromStateIndex of the from State
[in]ToStateIndex of the to State
[in]AndOrCondition option for the Transition
[in]CondIdx1Index of the first Condition to consider for the Transition
[in]CondIdx2Index of the second Condition to consider for the Transition
[in]VelLimVelocity limit for the Transition { unit: [pu/s], value range: (0.0, 1.0] }
[in]AccLimAcceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[in]DecLimDeceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[in]JrkLimJerk limit for the Transition { unit: [pu/s^3], value range: [0.0005, 2000.0] }
void STPOSPLAN_addCfgVar ( ST_POSPLAN_Handle  handle,
ST_PlanVar_e  Type,
_iq24  Value 
)

Adds a variable to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]TypeType of Variable
[in]ValueInitial value of the Variable
void STPOSPLAN_addCfgVarCond ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx1,
uint16_t  VarIdx2,
ST_PlanComp_e  Comp 
)

Adds a Variable Condition to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdx1Index of the first Plan Variable that will be compared
[in]VarIdx2Index of the second Plan Variable that will be compared
[in]CompType of comparison that will be done
void STPOSPLAN_delCfgAct ( ST_POSPLAN_Handle  handle,
uint16_t  ActIdx 
)

Deletes an action from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]ActIdxIndex of the Action to delete
void STPOSPLAN_delCfgCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx 
)

Deletes a Condition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to delete
void STPOSPLAN_delCfgState ( ST_POSPLAN_Handle  handle,
uint16_t  StateIdx 
)

Deletes a state from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]StateIdxIndex of the State to delete
void STPOSPLAN_delCfgTran ( ST_POSPLAN_Handle  handle,
uint16_t  TranIdx 
)

Deletes a Transition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]TranIdxIndex of the Transition to delete
void STPOSPLAN_delCfgVar ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx 
)

Deletes a Variable from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Variable to delete
void STPOSPLAN_delCfgVarCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx 
)

Deletes a Variable Condition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to delete
static _iq24 STPOSPLAN_getAccelerationLimit ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Acceleration Limit (AccLim) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
_iq24 AccLim Acceleration limit { unit: [pu/s^2], value range: (0.0, 120.0] }

Definition at line 197 of file spintac_pos_plan.h.

References ST_PosPlan_t::AccLim.

void STPOSPLAN_getCfg ( ST_POSPLAN_Handle  handle,
_iq24 T_sec,
bool *  LoopENB 
)

Gets the SpinTAC Position Plan configuration.

Parameters
[in]handlehandle The handle for the SpinTAC Position Plan Object
[out]*T_secSample Time { unit: [sec], value range: (0, 0.01] }
[out]*LoopENBSets if SpinTAC Position Plan should continuously run after it reaches the end { false: Do not continuously run Plan; true: Continuously run Plan }
void STPOSPLAN_getCfgAct ( ST_POSPLAN_Handle  handle,
uint16_t  ActIdx,
uint16_t *  State,
ST_PlanCond_e AndOr,
uint16_t *  CondIdx1,
uint16_t *  CondIdx2,
uint16_t *  VarIdx,
ST_PlanActOptn_e Opt,
_iq24 Value,
ST_PlanActTrgr_e EnterExit 
)

Returns an action from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]ActIdxIndex of the Action to return
[out]*StateIndex of the State the Action happens in
[out]*AndOrCondition option for the Action
[out]*CondIdx1Index of the first Condition to consider for the Action
[out]*CondIdx2Index of the second Condition to consider for the Action
[out]*VarIdxIndex of the Varaible to be acted upon
[out]*OptType of Action to perform on the Varaible
[out]*ValueValue to use in the Action
[out]*EnterExitState event that will trigger the Action
void STPOSPLAN_getCfgActNum ( ST_POSPLAN_Handle  handle,
uint16_t *  ActNum 
)

Returns the number of configured Actions in SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*ActNumThe number of configured Actions in SpinTAC Position Plan
void STPOSPLAN_getCfgCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx,
uint16_t *  VarIdx,
ST_PlanComp_e Comp,
_iq24 Value1,
_iq24 Value2 
)

Returns a Condition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to return
[out]*VarIdxIndex of the Plan Variable that will be compared
[out]*CompType of comparison that will be done
[out]*Value1First value to use in the comparison
[out]*Value2Second value to use in the comparison
void STPOSPLAN_getCfgCondNum ( ST_POSPLAN_Handle  handle,
uint16_t *  CondNum 
)

Returns the number of configured Conditions in SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*CondNumThe number of configured Conditions in SpinTAC Position Plan
static uint16_t STPOSPLAN_getCfgError ( ST_POSPLAN_Handle  handle,
uint16_t *  ERR_idx,
uint16_t *  ERR_code 
)
inlinestatic

Gets the Configuration Error for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*ERR_idxComponent index where error occurred { 0: no index; others: see error code }
[out]*ERR_codeSpecific configuration error { 0: no additional information; others: see error code }
Returns
uint16_t ERR_ID Error ID { 0: no error; others: see error code }

Definition at line 312 of file spintac_pos_plan.h.

References ST_PosPlan_t::CfgError, ST_PlanError_t::ERR_code, ST_PosPlan_t::ERR_ID, and ST_PlanError_t::ERR_idx.

void STPOSPLAN_getCfgHaltState ( ST_POSPLAN_Handle  handle,
int32_t *  PosStepInt_mrev,
_iq24 PosStepFrac_mrev,
_iq24 VelLim,
_iq24 AccLim,
_iq20 JrkLim,
int32_t *  Timer_tick 
)

Gets the SpinTAC Position Plan Halt state.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*PosStepInt_mrevPosition step integer part for Halt State { unit: [MRev] }
[out]*PosStepFrac_mrevPosition step fraction part for Halt State { unit: [MRev], value range: (-1.0, 1.0) }
[out]*VelLimVelocity limit during Halt state { unit: [pu/s], value range: (0, 1] }
[out]*AccLimAcceleration limit for Halt state { unit: [pu/s^2], value range: [0.001, 120.0] }
void STPOSPLAN_getCfgState ( ST_POSPLAN_Handle  handle,
uint16_t  StateIdx,
int32_t *  PosStepInt_mrev,
_iq24 PosStepFrac_mrev,
int32_t *  Timer_tick 
)

Returns a state from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]StateIdxIndex of the State to modify
[out]*PosStepInt_mrevPosition step integer part in State { unit: [MRev] }
[out]*PosStepFrac_mrevPosition step fraction part in State { unit: [MRev] }
[out]*Timer_tickMinimum time to stay in State { unit: [tick] }
void STPOSPLAN_getCfgStateNum ( ST_POSPLAN_Handle  handle,
uint16_t *  StateNum 
)

Returns the number of configured States in SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*StateNumThe number of configured States in SpinTAC Position Plan
void STPOSPLAN_getCfgTran ( ST_POSPLAN_Handle  handle,
uint16_t  TranIdx,
uint16_t *  FromState,
uint16_t *  ToState,
ST_PlanCond_e AndOr,
uint16_t *  CondIdx1,
uint16_t *  CondIdx2,
_iq24 VelLim,
_iq24 AccLim,
_iq24 DecLim,
_iq20 JrkLim 
)

Get a Transition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]TranIdxIndex of the Transition to return
[out]*FromStateIndex of the from State
[out]*ToStateIndex of the to State
[out]*AndOrCondition option for the Transition
[out]*CondIdx1Index of the first Condition to consider for the Transition
[out]*CondIdx2Index of the second Condition to consider for the Transition
[out]*VelLimVelocity limit for the Transition { unit: [pu/s], value range: (0.0, 1.0] }
[out]*AccLimAcceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[out]*DecLimDeceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[out]*JrkLimJerk limit for the Transition { unit: [pu/s^3], value range: [0.0005, 2000.0] }
void STPOSPLAN_getCfgTranNum ( ST_POSPLAN_Handle  handle,
uint16_t *  TranNum 
)

Returns the number of configured Transitions in SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*TranNumThe number of configured Transitions in SpinTAC Position Plan
void STPOSPLAN_getCfgVar ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx,
ST_PlanVar_e Type,
_iq24 Value 
)

Returns a variable from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Variable to return
[out]*TypeType of Variable
[out]*ValueInitial value of the Variable
void STPOSPLAN_getCfgVarCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx,
uint16_t *  VarIdx1,
uint16_t *  VarIdx2,
ST_PlanComp_e Comp 
)

Returns a Variable Condition from the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to return
[out]*VarIdx1Index of the first Plan Variable that will be compared
[out]*VarIdx2Index of the second Plan Variable that will be compared
[out]*CompType of comparison that will be done
void STPOSPLAN_getCfgVarNum ( ST_POSPLAN_Handle  handle,
uint16_t *  VarNum 
)

Returns the number of configured Variables in SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*VarNumThe number of configured Variables in SpinTAC Position Plan
static uint16_t STPOSPLAN_getCurrentState ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Current State (CurState) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
uint16_t CurState Current state of the state machine

Definition at line 274 of file spintac_pos_plan.h.

References ST_PosPlan_t::CurState.

static int32_t STPOSPLAN_getCurrentTimerValue_tick ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Current Time Value (Timer_tick) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
int32_t Timer State Timer { unit: [tick] }

Definition at line 301 of file spintac_pos_plan.h.

References ST_PosPlan_t::Timer_tick.

static uint16_t STPOSPLAN_getCurrentTransition ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Current Transition (CurTran) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
uint16_t CurTran Current transition of the state machine

Definition at line 283 of file spintac_pos_plan.h.

References ST_PosPlan_t::CurTran.

static _iq24 STPOSPLAN_getDecelerationLimit ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Deceleration Limit (DecLim) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
_iq24 DecLim Deceleration limit { unit: [pu/s^2], value range: (0.0, 120.0] }

Definition at line 206 of file spintac_pos_plan.h.

References ST_PosPlan_t::DecLim.

static bool STPOSPLAN_getEnable ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Enable signal (ENB) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
bool ENB Enable bit { false: disable; true: enable }

Definition at line 235 of file spintac_pos_plan.h.

References ST_PosPlan_t::ENB.

static uint16_t STPOSPLAN_getErrorID ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Error value (ERR_ID) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
uint16_t ERR_ID Error ID { 0: no error; others: see error code }

Definition at line 324 of file spintac_pos_plan.h.

References ST_PosPlan_t::ERR_ID.

static ST_PlanFsmState_e STPOSPLAN_getFsmState ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the State Machine State (FsmState) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
ST_PlanFsmState_e FsmState Current operation of the state machine

Definition at line 292 of file spintac_pos_plan.h.

References ST_PosPlan_t::FsmState.

static _iq20 STPOSPLAN_getJerkLimit ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Jerk Limit (JrkLim) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
_iq20 JrkLim Jerk Limit { unit: [pu/s^3], value range: (0.0, 2000.0] }

Definition at line 215 of file spintac_pos_plan.h.

References ST_PosPlan_t::JrkLim.

static void STPOSPLAN_getPositionStep_mrev ( ST_POSPLAN_Handle  handle,
int32_t *  posStepInt_mrev,
_iq24 posStepFrac_mrev 
)
inlinestatic

Gets the Position Step (posStepInt_mrev, posStepFrac_mrev) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[out]*posStepInt_mrevPosition Step integer part value { unit: [MRev], value range: 32-bit integer }
[out]*posStepFrac_mrevPosition Step fraction part value { unit: [MRev], value range: (-1.0, 1.0) }

Definition at line 178 of file spintac_pos_plan.h.

References ST_PosPlan_t::PosStepFrac_mrev, and ST_PosPlan_t::PosStepInt_mrev.

static bool STPOSPLAN_getReset ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Reset signal (RES) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
bool RES Reset bit { false: reset; true: not reset }

Definition at line 255 of file spintac_pos_plan.h.

References ST_PosPlan_t::RES.

static ST_PlanStatus_e STPOSPLAN_getStatus ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Status value (STATUS) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
ST_PlanStatus_e STATUS Status { ST_VEL_ID_IDLE, ST_VEL_ID_INIT, ST_VEL_ID_BUSY }

Definition at line 264 of file spintac_pos_plan.h.

References ST_PosPlan_t::STATUS.

void STPOSPLAN_getVar ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx,
_iq24 Value 
)

Gets the value of a SpinTAC Position Plan variable.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Variable to get
[out]*ValueValue to get from the Variable
static _iq24 STPOSPLAN_getVelocityLimit ( ST_POSPLAN_Handle  handle)
inlinestatic

Gets the Velocity Limit (VelLim) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
Returns
_iq24 VelLim Velocity limit { unit: [pu/s], value range: [-1.0, 1.0] }

Definition at line 188 of file spintac_pos_plan.h.

References ST_PosPlan_t::VelLim.

ST_POSPLAN_Handle STPOSPLAN_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the SpinTAC Position Plan component.

Parameters
[in]*pMemoryPointer to the memory for ST_PosPlan_t
[in]numBytesThe number of bytes in the ST_PosPlan_t
Returns
ST_POSPLAN_Handle handle The handle for the SpinTAC Position Plan Object
void STPOSPLAN_reset ( ST_POSPLAN_Handle  handle)

Resets the SpinAC Position Plan component.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
void STPOSPLAN_run ( ST_POSPLAN_Handle  handle)

Runs SpinTAC Position Plan calculation.

Parameters
[in]handleThe handle for the Position Plan structure
void STPOSPLAN_runTick ( ST_POSPLAN_Handle  handle)

Runs SpinTAC Position Plan Timing. Call this only from an ISR.

Parameters
[in]handleThe handle for the Position Plan structure
void STPOSPLAN_setCfg ( ST_POSPLAN_Handle  handle,
_iq24  T_sec,
bool  LoopENB 
)

Configures SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]T_secSample Time { unit: [sec], value range: (0, 0.01] }
[in]LoopENBSets if SpinTAC Position Plan should continuously run after it reaches the end { false: Do not continuously run Plan; true: Continuously run Plan }
void STPOSPLAN_setCfgAct ( ST_POSPLAN_Handle  handle,
uint16_t  ActIdx,
uint16_t  State,
ST_PlanCond_e  AndOr,
uint16_t  CondIdx1,
uint16_t  CondIdx2,
uint16_t  VarIdx,
ST_PlanActOptn_e  Opt,
_iq24  Value,
ST_PlanActTrgr_e  EnterExit 
)

Modifies an action in the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]ActIdxIndex of the Action to modify
[in]StateIndex of the State the Action happens in
[in]AndOrCondition option for the Action
[in]CondIdx1Index of the first Condition to consider for the Action
[in]CondIdx2Index of the second Condition to consider for the Action
[in]VarIdxIndex of the Varaible to be acted upon
[in]OptType of Action to perform on the Varaible
[in]ValueValue to use in the Action
[in]EnterExitState event that will trigger the Action
void STPOSPLAN_setCfgArray ( ST_POSPLAN_Handle  handle,
uint32_t *  cfgArray,
const size_t  numBytes,
uint16_t  MaxActNum,
uint16_t  MaxCondNum,
uint16_t  MaxVarNum,
uint16_t  MaxTranNum,
uint16_t  MaxStateNum 
)

Prepares SpinTAC Position Plan data structure.

Parameters
[in]handleThe handle for the Position Plan structure
[in]*cfgArrayPointer to the SpinTAC Position Plan configuration array
[in]numBytesThe number of bytes in the SpinTAC Position Plan configuration array
[in]MaxActNumNumber of Actions
[in]MaxCondNumNumber of Conditions
[in]MaxVarNumNumber of Variables
[in]MaxTranNumNumber of Transitions
[in]MaxStateNumNumber of States
void STPOSPLAN_setCfgCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx,
uint16_t  VarIdx,
ST_PlanComp_e  Comp,
_iq24  Value1,
_iq24  Value2 
)

Modifies a Condition in the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to modify
[in]VarIdxIndex of the Plan Variable that will be compared
[in]CompType of comparison that will be done
[in]Value1First value to use in the comparison
[in]Value2Second value to use in the comparison
void STPOSPLAN_setCfgHaltState ( ST_POSPLAN_Handle  handle,
int32_t  PosStepInt_mrev,
_iq24  PosStepFrac_mrev,
_iq24  VelLim,
_iq24  AccLim,
_iq20  JrkLim,
int32_t  Timer_tick 
)

Configures the SpinTAC Position Plan Halt state.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]PosStepInt_mrevPosition step integer part for Halt State { unit: [MRev], value range: 32 bit integer [-2, 2] }
[in]PosStepFrac_mrevPosition step fraction part for Halt State { unit: [MRev], value range: (-1.0, 1.0) }
[in]VelLimVelocity limit during Halt state { unit: [pu/s], value range: (0, 1] }
[in]AccLimAcceleration limit for Halt state { unit: [pu/s^2], value range: [0.001, 120.0] }
[in]JrkLimJerk limit for Halt state { unit: [pu/s^3], value range: [0.0005, 2000.0] }
[in]Timer_tickMinimum amount of time to stay in Halt state { unit: [tick] }
void STPOSPLAN_setCfgState ( ST_POSPLAN_Handle  handle,
uint16_t  StateIdx,
int32_t  PosStepInt_mrev,
_iq24  PosStepFrac_mrev,
int32_t  Timer_tick 
)

Modifies a state in the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]StateIdxIndex of the State to modify
[in]PosStepInt_mrevPosition step integer part in State { unit: [MRev], value range: 32 bit integer (-2^31, 2^31) }
[in]PosStepFrac_mrevPosition step fraction part in State { unit: [MRev], value range: (-1.0, 1.0) }
[in]Timer_tickMinimum time to stay in State { unit: [tick] }
void STPOSPLAN_setCfgTran ( ST_POSPLAN_Handle  handle,
uint16_t  TranIdx,
uint16_t  FromState,
uint16_t  ToState,
ST_PlanCond_e  AndOr,
uint16_t  CondIdx1,
uint16_t  CondIdx2,
_iq24  VelLim,
_iq24  AccLim,
_iq24  DecLim,
_iq20  JrkLim 
)

Modifies a Transition in the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]TranIdxIndex of the Transition to modify
[in]FromStateIndex of the from State
[in]ToStateIndex of the to State
[in]AndOrCondition option for the Transition
[in]CondIdx1Index of the first Condition to consider for the Transition
[in]CondIdx2Index of the second Condition to consider for the Transition
[in]VelLimVelocity limit for the Transition { unit: [pu/s], value range: [-1.0, 1.0] }
[in]AccLimAcceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[in]DecLimDeceleration limit for the Transition { unit: [pu/s^2], value range: [0.001, 120.0] }
[in]JrkLimJerk limit for the Transition { unit: [pu/s^3], value range: [0.0005, 2000.0] }
void STPOSPLAN_setCfgVar ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx,
ST_PlanVar_e  Type,
_iq24  Value 
)

Modifies a variable in the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Variable to modify
[in]TypeType of Variable
[in]ValueInitial value of the Variable
void STPOSPLAN_setCfgVarCond ( ST_POSPLAN_Handle  handle,
uint16_t  CondIdx,
uint16_t  VarIdx1,
uint16_t  VarIdx2,
ST_PlanComp_e  Comp 
)

Modifies a Variable Condition to the SpinTAC Position Plan configuration.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]CondIdxIndex of the Plan Condition to modify
[in]VarIdx1Index of the first Plan Variable that will be compared
[in]VarIdx2Index of the second Plan Variable that will be compared
[in]CompType of comparison that will be done
static void STPOSPLAN_setEnable ( ST_POSPLAN_Handle  handle,
bool  enb 
)
inlinestatic

Sets the Enable signal (ENB) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]enbEnable bit { false: disable; true: enable }

Definition at line 224 of file spintac_pos_plan.h.

References ST_PosPlan_t::ENB.

static void STPOSPLAN_setReset ( ST_POSPLAN_Handle  handle,
bool  res 
)
inlinestatic

Sets the Reset signal (RES) for SpinTAC Position Plan.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]resReset bit { false: reset; true: not reset }

Definition at line 244 of file spintac_pos_plan.h.

References ST_PosPlan_t::RES.

void STPOSPLAN_setUnitProfDone ( ST_POSPLAN_Handle  handle,
bool  ProDON 
)

Sets a flag in SpinTAC Position Plan to indicate if the unit profile is complete.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]ProDONIndicates if the unit profile is completed
void STPOSPLAN_setVar ( ST_POSPLAN_Handle  handle,
uint16_t  VarIdx,
_iq24  Value 
)

Sets the value of a SpinTAC Position Plan variable.

Parameters
[in]handleThe handle for the SpinTAC Position Plan Object
[in]VarIdxIndex of the Variable to set
[in]ValueValue to set to the Variable