Davide Aliprandi / X_NUCLEO_IHM14A1

Dependencies:   ST_INTERFACES

Embed: (wiki syntax)

« Back to documentation index

STSPIN820 Library Functions

STSPIN820 Library Functions
[STSPIN820 Exported Variables]

Functions

MOTOR_vt_t * STSPIN820_GetMotorHandle (void)
 Return motor handle (pointer to the STSPIN820 motor driver structure)
void STSPIN820_Init (void *pInit)
 Start the STSPIN820 library.
uint16_t STSPIN820_ReadId (void)
 Read id.
void STSPIN820_AttachFlagInterrupt (void(*callback)(void))
 Attach a user callback to the flag Interrupt The call back will be then called each time the status flag pin will be pulled down due to the occurrence of a programmed alarms ( OCD, thermal pre-warning or shutdown, UVLO, wrong command, non-performable command)
uint8_t STSPIN820_CheckStatusHw (void)
 Check if STSPIN820 has a fault by reading EN pin position.
void STSPIN820_Disable (uint8_t deviceId)
 Disable the power bridges (leave the output bridges HiZ)
void STSPIN820_Enable (uint8_t deviceId)
 Enable the power bridges.
void STSPIN820_ErrorHandler (uint16_t error)
 Error handler which calls the user callback (if defined)
void STSPIN820_ExitDeviceFromStandby (uint8_t deviceId)
 Exit STSPIN820 device from standby (low power consumption)
motor_decay_mode_t STSPIN820_GetDecayMode (uint8_t deviceId)
 Return the decay mode of the specified device.
uint16_t STSPIN820_GetDeceleration (uint8_t deviceId)
 Return the deceleration of the specified device.
motor_state_t STSPIN820_GetDeviceState (uint8_t deviceId)
 Return the device state.
motor_direction_t STSPIN820_GetDirection (uint8_t deviceId)
 Get the motor current direction.
uint32_t STSPIN820_GetFwVersion (void)
 Return the FW version of the library.
int32_t STSPIN820_GetMark (uint8_t deviceId)
 Return the mark position of the specified device.
uint16_t STSPIN820_GetMaxSpeed (uint8_t deviceId)
 Return the max speed of the specified device.
uint16_t STSPIN820_GetMinSpeed (uint8_t deviceId)
 Return the min speed of the specified device.
uint8_t STSPIN820_GetNbDevices (void)
 Returns the number of devices.
int32_t STSPIN820_GetPosition (uint8_t deviceId)
 Return the current position value of the specified device.
motor_step_mode_t STSPIN820_GetStepMode (uint8_t deviceId)
 Get the motor step mode.
motor_stop_mode_t STSPIN820_GetStopMode (uint8_t deviceId)
 Get the selected stop mode.
uint8_t STSPIN820_GetTorque (uint8_t deviceId, motor_torque_mode_t torqueMode)
 Get the torque of the specified device.
bool STSPIN820_GetTorqueBoostEnable (uint8_t deviceId)
 Get the torque boost feature status.
uint16_t STSPIN820_GetTorqueBoostThreshold (uint8_t deviceId)
 Get the torque boost threshold.
void STSPIN820_GoHome (uint8_t deviceId)
 Request the motor to move to the home position (ABS_POSITION = 0)
void STSPIN820_GoMark (uint8_t deviceId)
 Request the motor to move to the mark position.
void STSPIN820_GoTo (uint8_t deviceId, int32_t targetPosition)
 Request the motor to move to the specified position.
void STSPIN820_GoToDir (uint8_t deviceId, motor_direction_t direction, int32_t targetPosition)
 Move the motor to the absolute position.
void STSPIN820_HardHiZ (uint8_t deviceId)
 Immediatly stop the motor and disable the power bridge.
void STSPIN820_HardStop (uint8_t deviceId)
 Immediatly stop the motor and either set holding torque when stop mode is HOLD_MODE, or call STSPIN820_HardHiz function when stop mode is HIZ_MODE, or call STSPIN820_PutDeviceInStandby function when stop mode is STANDBY_MODE.
void STSPIN820_Move (uint8_t deviceId, motor_direction_t direction, uint32_t stepCount)
 Moves the motor of the specified number of steps.
void STSPIN820_PutDeviceInStandby (uint8_t deviceId)
 Put STSPIN820 device in standby (low power consumption)
void STSPIN820_Run (uint8_t deviceId, motor_direction_t direction)
 Runs the motor.
bool STSPIN820_SetAcceleration (uint8_t deviceId, uint16_t newAcc)
 Changes the acceleration of the specified device.
void STSPIN820_SetDecayMode (uint8_t deviceId, motor_decay_mode_t decay)
 Specifies the decay mode.
bool STSPIN820_SetDeceleration (uint8_t deviceId, uint16_t newDec)
 Changes the deceleration of the specified device.
void STSPIN820_SetDirection (uint8_t deviceId, motor_direction_t direction)
 Specifies the direction.
void STSPIN820_SetHome (uint8_t deviceId)
 Set current position to be the Home position (current position set to 0)
void STSPIN820_SetMark (uint8_t deviceId)
 Set current position to be the Mark position.
bool STSPIN820_SetMaxSpeed (uint8_t deviceId, uint16_t newMaxSpeed)
 Changes the max speed of the specified device.
bool STSPIN820_SetMinSpeed (uint8_t deviceId, uint16_t newMinSpeed)
 Changes the min speed of the specified device.
bool STSPIN820_SetNbDevices (uint8_t nbDevices)
 Sets the number of devices to be used.
bool STSPIN820_SetStepMode (uint8_t deviceId, motor_step_mode_t stepMode)
 Set the stepping mode.
void STSPIN820_SetStopMode (uint8_t deviceId, motor_stop_mode_t stopMode)
 Select the mode to stop the motor.
void STSPIN820_SetTorque (uint8_t deviceId, motor_torque_mode_t torqueMode, uint8_t torqueValue)
 Set the torque of the specified device.
void STSPIN820_SetTorqueBoostEnable (uint8_t deviceId, bool enable)
 Enable or disable the torque boost feature.
void STSPIN820_SetTorqueBoostThreshold (uint8_t deviceId, uint16_t speedThreshold)
 Set the torque boost threshold.
bool STSPIN820_SoftStop (uint8_t deviceId)
 Stops the motor by using the device deceleration.
uint32_t STSPIN820_VrefPwmGetFreq (uint8_t deviceId)
 Get the frequency of REF PWM of the specified device.
void STSPIN820_VrefPwmSetFreq (uint8_t deviceId, uint32_t newFreq)
 Set the frequency of REF PWM of the specified device.
void STSPIN820_WaitWhileActive (uint8_t deviceId)
 Locks until the device state becomes Inactive.
void STSPIN820_ApplySpeed (uint8_t pwmId, uint16_t newSpeed)
 Updates the current speed of the device.
void STSPIN820_ApplyTorque (uint8_t deviceId, motor_torque_mode_t torqueMode)
 Apply the set torque to the specified device.
void STSPIN820_ComputeSpeedProfile (uint8_t deviceId, uint32_t nbSteps)
 Computes the speed profile according to the number of steps to move.
void STSPIN820_FlagInterruptHandler (void)
 Handlers of the flag interrupt which calls the user callback (if defined)
void STSPIN820_SetDeviceParamsOtherValues (void)
 Set the parameters of the device whose values are not defined in STSPIN820_config.h.
void STSPIN820_SetDeviceParamsToGivenValues (STSPIN820_init_t *initDevicePrm)
 Set the parameters of the device to values of initDevicePrm structure.
void STSPIN820_SetDeviceParamsToPredefinedValues (void)
 Sets the parameters of the device to predefined values from STSPIN820_config.h.
void STSPIN820_StartMovement (uint8_t deviceId)
 Initialises the bridge parameters to start the movement and enable the power bridge.
void STSPIN820_StepClockHandler (uint8_t deviceId)
 Handles the device state machine at each pulse.

Function Documentation

void STSPIN820_ApplySpeed ( uint8_t  deviceId,
uint16_t  newSpeed 
) [protected, inherited]

Updates the current speed of the device.

Parameters:
[in]deviceIdUnused parameter
[in]newSpeedin pps
Return values:
None

Definition at line 1169 of file STSPIN820.cpp.

void STSPIN820_ApplyTorque ( uint8_t  deviceId,
motor_torque_mode_t  torqueMode 
) [protected, inherited]

Apply the set torque to the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]torqueModetorque mode
Return values:
None
Note:

Definition at line 1236 of file STSPIN820.cpp.

void STSPIN820_AttachFlagInterrupt ( void(*)(void)  callback ) [protected, inherited]

Attach a user callback to the flag Interrupt The call back will be then called each time the status flag pin will be pulled down due to the occurrence of a programmed alarms ( OCD, thermal pre-warning or shutdown, UVLO, wrong command, non-performable command)

Parameters:
[in]callbackName of the callback to attach to the Flag Interrupt
Return values:
None

Definition at line 141 of file STSPIN820.cpp.

uint8_t STSPIN820_CheckStatusHw ( void   ) [protected, inherited]

Check if STSPIN820 has a fault by reading EN pin position.

Return values:
Oneif STSPIN820 has EN pin down, otherwise zero

Definition at line 150 of file STSPIN820.cpp.

void STSPIN820_ComputeSpeedProfile ( uint8_t  deviceId,
uint32_t  nbSteps 
) [protected, inherited]

Computes the speed profile according to the number of steps to move.

Parameters:
[in]deviceIdUnused parameter
[in]nbStepsnumber of steps to perform
Return values:
None
Note:
Using the acceleration and deceleration of the device, this function determines the duration in steps of the acceleration, steady and deceleration phases. If the total number of steps to perform is big enough, a trapezoidal move is performed (i.e. there is a steady phase where the motor runs at the maximum speed. Else, a triangular move is performed (no steady phase: the maximum speed is never reached.

Definition at line 1277 of file STSPIN820.cpp.

void STSPIN820_Disable ( uint8_t  deviceId ) [protected, inherited]

Disable the power bridges (leave the output bridges HiZ)

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 167 of file STSPIN820.cpp.

void STSPIN820_Enable ( uint8_t  deviceId ) [protected, inherited]

Enable the power bridges.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 177 of file STSPIN820.cpp.

void STSPIN820_ErrorHandler ( uint16_t  error ) [protected, inherited]

Error handler which calls the user callback (if defined)

Parameters:
[in]errorNumber of the error
Return values:
None

Definition at line 187 of file STSPIN820.cpp.

void STSPIN820_ExitDeviceFromStandby ( uint8_t  deviceId ) [protected, inherited]

Exit STSPIN820 device from standby (low power consumption)

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 207 of file STSPIN820.cpp.

void STSPIN820_FlagInterruptHandler ( void   ) [protected, inherited]

Handlers of the flag interrupt which calls the user callback (if defined)

Return values:
None

Definition at line 1332 of file STSPIN820.cpp.

motor_decay_mode_t STSPIN820_GetDecayMode ( uint8_t  deviceId ) [protected, inherited]

Return the decay mode of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
DecayMode State (SLOW or MIXED)

Definition at line 292 of file STSPIN820.cpp.

uint16_t STSPIN820_GetDeceleration ( uint8_t  deviceId ) [protected, inherited]

Return the deceleration of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
Decelerationin pps^2

Definition at line 312 of file STSPIN820.cpp.

motor_state_t STSPIN820_GetDeviceState ( uint8_t  deviceId ) [protected, inherited]

Return the device state.

Parameters:
[in]deviceIdUnused parameter
Return values:
State(ACCELERATING, DECELERATING, STEADY or INACTIVE)

Definition at line 322 of file STSPIN820.cpp.

motor_direction_t STSPIN820_GetDirection ( uint8_t  deviceId ) [protected, inherited]

Get the motor current direction.

Parameters:
[in]deviceIdUnused parameter
Return values:
direction

Definition at line 332 of file STSPIN820.cpp.

uint32_t STSPIN820_GetFwVersion ( void   ) [protected, inherited]

Return the FW version of the library.

Return values:
Stspin220_FW_VERSION

Definition at line 341 of file STSPIN820.cpp.

int32_t STSPIN820_GetMark ( uint8_t  deviceId ) [protected, inherited]

Return the mark position of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
markposition value

Definition at line 351 of file STSPIN820.cpp.

uint16_t STSPIN820_GetMaxSpeed ( uint8_t  deviceId ) [protected, inherited]

Return the max speed of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
maxSpeedin pps

Definition at line 361 of file STSPIN820.cpp.

uint16_t STSPIN820_GetMinSpeed ( uint8_t  deviceId ) [protected, inherited]

Return the min speed of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
minSpeedin pps

Definition at line 371 of file STSPIN820.cpp.

MOTOR_vt_t * STSPIN820_GetMotorHandle ( void   ) [protected, inherited]

Return motor handle (pointer to the STSPIN820 motor driver structure)

Return values:
Pointerto the MOTOR_vt_t structure

Definition at line 75 of file STSPIN820.cpp.

uint8_t STSPIN820_GetNbDevices ( void   ) [protected, inherited]

Returns the number of devices.

Return values:
numberof devices

Definition at line 380 of file STSPIN820.cpp.

int32_t STSPIN820_GetPosition ( uint8_t  deviceId ) [protected, inherited]

Return the current position value of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
currentposition value

Definition at line 390 of file STSPIN820.cpp.

motor_step_mode_t STSPIN820_GetStepMode ( uint8_t  deviceId ) [protected, inherited]

Get the motor step mode.

Parameters:
[in]deviceIdUnused parameter
Return values:
stepmode

Definition at line 400 of file STSPIN820.cpp.

motor_stop_mode_t STSPIN820_GetStopMode ( uint8_t  deviceId ) [protected, inherited]

Get the selected stop mode.

Parameters:
[in]deviceIdUnused parameter
Return values:
theselected stop mode

Definition at line 410 of file STSPIN820.cpp.

uint8_t STSPIN820_GetTorque ( uint8_t  deviceId,
motor_torque_mode_t  torqueMode 
) [protected, inherited]

Get the torque of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]torqueModetorque mode
Return values:
thetorqueValue in % (from 0 to 100)
Note:

Definition at line 422 of file STSPIN820.cpp.

bool STSPIN820_GetTorqueBoostEnable ( uint8_t  deviceId ) [protected, inherited]

Get the torque boost feature status.

Parameters:
[in]deviceIdUnused parameter
Return values:
TRUEif enabled, FALSE if disabled

Definition at line 453 of file STSPIN820.cpp.

uint16_t STSPIN820_GetTorqueBoostThreshold ( uint8_t  deviceId ) [protected, inherited]

Get the torque boost threshold.

Parameters:
[in]deviceId(from 0 to MAX_NUMBER_OF_DEVICES - 1)
Return values:
thetorque boost threshold above which the step mode is changed to full step

Definition at line 464 of file STSPIN820.cpp.

void STSPIN820_GoHome ( uint8_t  deviceId ) [protected, inherited]

Request the motor to move to the home position (ABS_POSITION = 0)

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 474 of file STSPIN820.cpp.

void STSPIN820_GoMark ( uint8_t  deviceId ) [protected, inherited]

Request the motor to move to the mark position.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 486 of file STSPIN820.cpp.

void STSPIN820_GoTo ( uint8_t  deviceId,
int32_t  targetPosition 
) [protected, inherited]

Request the motor to move to the specified position.

Parameters:
[in]deviceIdUnused parameter
[in]targetPositionabsolute position in steps
Return values:
None
Note:
The position is at the resolution corresponding to the selected step mode. STEP_MODE_FULL : Full step STEP_MODE_HALF : 1/2 step STEP_MODE_1_4 : 1/4 step STEP_MODE_1_8 : 1/8 step STEP_MODE_1_16 : 1/16 step STEP_MODE_1_32 : 1/32 step STEP_MODE_1_128 : 1/128 step STEP_MODE_1_256 : 1/256 step
The 1/64 step mode is not allowed

Definition at line 510 of file STSPIN820.cpp.

void STSPIN820_GoToDir ( uint8_t  deviceId,
motor_direction_t  direction,
int32_t  targetPosition 
) [protected, inherited]

Move the motor to the absolute position.

Parameters:
[in]deviceIdUnused parameter
[in]directionFORWARD or BACKWARD
[in]targetPosition32 bit signed value position
Return values:
None
Note:
The position is at the resolution corresponding to the selected step mode. STEP_MODE_FULL : step STEP_MODE_HALF : 1/2 step STEP_MODE_1_4 : 1/4 step STEP_MODE_1_8 : 1/8 step STEP_MODE_1_16 : 1/16 step STEP_MODE_1_32 : 1/32 step STEP_MODE_1_128 : 1/128 step STEP_MODE_1_256 : 1/256 step
The 1/64 step mode is not allowed

Definition at line 589 of file STSPIN820.cpp.

void STSPIN820_HardHiZ ( uint8_t  deviceId ) [protected, inherited]

Immediatly stop the motor and disable the power bridge.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 652 of file STSPIN820.cpp.

void STSPIN820_HardStop ( uint8_t  deviceId ) [protected, inherited]

Immediatly stop the motor and either set holding torque when stop mode is HOLD_MODE, or call STSPIN820_HardHiz function when stop mode is HIZ_MODE, or call STSPIN820_PutDeviceInStandby function when stop mode is STANDBY_MODE.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 694 of file STSPIN820.cpp.

void STSPIN820_Init ( void *  pInit ) [protected, inherited]

Start the STSPIN820 library.

Parameters:
[in]pInitpointer to the initialization data
Return values:
None

Definition at line 85 of file STSPIN820.cpp.

void STSPIN820_Move ( uint8_t  deviceId,
motor_direction_t  direction,
uint32_t  stepCount 
) [protected, inherited]

Moves the motor of the specified number of steps.

Parameters:
[in]deviceIdUnused parameter
[in]directionFORWARD or BACKWARD
[in]stepCountNumber of steps to perform
Return values:
None

Definition at line 741 of file STSPIN820.cpp.

void STSPIN820_PutDeviceInStandby ( uint8_t  deviceId ) [protected, inherited]

Put STSPIN820 device in standby (low power consumption)

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 776 of file STSPIN820.cpp.

uint16_t STSPIN820_ReadId ( void   ) [protected, inherited]

Read id.

Return values:
Idof the STSPIN820 Driver Instance

Definition at line 113 of file STSPIN820.cpp.

void STSPIN820_Run ( uint8_t  deviceId,
motor_direction_t  direction 
) [protected, inherited]

Runs the motor.

It will accelerate from the min speed up to the max speed by using the device acceleration.

Parameters:
[in]deviceIdUnused parameter
[in]directionFORWARD or BACKWARD
Return values:
None

Definition at line 794 of file STSPIN820.cpp.

bool STSPIN820_SetAcceleration ( uint8_t  deviceId,
uint16_t  newAcc 
) [protected, inherited]

Changes the acceleration of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]newAccNew acceleration to apply in pps^2
Return values:
trueif the command is successfully executed, else false
Note:
The command is not performed if the device is executing a MOVE or GOTO command (but it can be used during a RUN command)

Definition at line 822 of file STSPIN820.cpp.

void STSPIN820_SetDecayMode ( uint8_t  deviceId,
motor_decay_mode_t  decay 
) [protected, inherited]

Specifies the decay mode.

Parameters:
[in]deviceIdUnused parameter
[in]decaySLOW_DECAY or MIXED_DECAY
Return values:
trueif the command is successfully executed, else false

Definition at line 841 of file STSPIN820.cpp.

bool STSPIN820_SetDeceleration ( uint8_t  deviceId,
uint16_t  newDec 
) [protected, inherited]

Changes the deceleration of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]newDecNew deceleration to apply in pps^2
Return values:
trueif the command is successfully executed, else false
Note:
The command is not performed if the device is executing a MOVE or GOTO command (but it can be used during a RUN command)

Definition at line 861 of file STSPIN820.cpp.

void STSPIN820_SetDeviceParamsOtherValues ( void   ) [protected, inherited]

Set the parameters of the device whose values are not defined in STSPIN820_config.h.

Return values:
None

Definition at line 1345 of file STSPIN820.cpp.

void STSPIN820_SetDeviceParamsToGivenValues ( STSPIN820_init_t *  pInitDevicePrm ) [protected, inherited]

Set the parameters of the device to values of initDevicePrm structure.

Parameters:
pInitDevicePrmstructure containing values to initialize the device parameters
Return values:
None

Definition at line 1375 of file STSPIN820.cpp.

void STSPIN820_SetDeviceParamsToPredefinedValues ( void   ) [protected, inherited]

Sets the parameters of the device to predefined values from STSPIN820_config.h.

Return values:
None

Definition at line 1443 of file STSPIN820.cpp.

void STSPIN820_SetDirection ( uint8_t  deviceId,
motor_direction_t  dir 
) [protected, inherited]

Specifies the direction.

Parameters:
[in]deviceIdUnused parameter
[in]dirFORWARD or BACKWARD
Note:
The direction change is applied if the device is in INACTIVE or STANDBY state or if the device is executing a run command
Return values:
None

Definition at line 883 of file STSPIN820.cpp.

void STSPIN820_SetHome ( uint8_t  deviceId ) [protected, inherited]

Set current position to be the Home position (current position set to 0)

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 903 of file STSPIN820.cpp.

void STSPIN820_SetMark ( uint8_t  deviceId ) [protected, inherited]

Set current position to be the Mark position.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 913 of file STSPIN820.cpp.

bool STSPIN820_SetMaxSpeed ( uint8_t  deviceId,
uint16_t  newMaxSpeed 
) [protected, inherited]

Changes the max speed of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]newMaxSpeedNew max speed to apply in pps
Return values:
trueif the command is successfully executed, else false
Note:
The command is not performed is the device is executing a MOVE or GOTO command (but it can be used during a RUN command).

Definition at line 926 of file STSPIN820.cpp.

bool STSPIN820_SetMinSpeed ( uint8_t  deviceId,
uint16_t  newMinSpeed 
) [protected, inherited]

Changes the min speed of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]newMinSpeedNew min speed to apply in pps
Return values:
trueif the command is successfully executed, else false
Note:
The command is not performed is the device is executing a MOVE or GOTO command (but it can be used during a RUN command).

Definition at line 951 of file STSPIN820.cpp.

bool STSPIN820_SetNbDevices ( uint8_t  nbDevices ) [protected, inherited]

Sets the number of devices to be used.

Parameters:
[in]nbDevices(from 1 to MAX_NUMBER_OF_DEVICES)
Return values:
TRUEif successfull, FALSE if failure, attempt to set a number of devices greater than MAX_NUMBER_OF_DEVICES

Definition at line 972 of file STSPIN820.cpp.

bool STSPIN820_SetStepMode ( uint8_t  deviceId,
motor_step_mode_t  stepMode 
) [protected, inherited]

Set the stepping mode.

Parameters:
[in]deviceIdUnused parameter
[in]stepModefrom full step to 1/256 microstep as specified in enum motor_step_mode_t 1/64 microstep mode not supported by STSPIN820
Return values:
trueif the command is successfully executed, else false

Definition at line 993 of file STSPIN820.cpp.

void STSPIN820_SetStopMode ( uint8_t  deviceId,
motor_stop_mode_t  stopMode 
) [protected, inherited]

Select the mode to stop the motor.

Parameters:
[in]deviceIdUnused parameter
[in]stopModeHOLD_MODE to let power bridge enabled
Return values:
None

Definition at line 1040 of file STSPIN820.cpp.

void STSPIN820_SetTorque ( uint8_t  deviceId,
motor_torque_mode_t  torqueMode,
uint8_t  torqueValue 
) [protected, inherited]

Set the torque of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]torqueModeTorque mode as specified in enum motor_torque_mode_t
[in]torqueValuein % (from 0 to 100)
Return values:
None
Note:

Definition at line 1053 of file STSPIN820.cpp.

void STSPIN820_SetTorqueBoostEnable ( uint8_t  deviceId,
bool  enable 
) [protected, inherited]

Enable or disable the torque boost feature.

Parameters:
[in]deviceIdUnused parameter
[in]enabletrue to enable torque boost, false to disable
Return values:
None

Definition at line 1092 of file STSPIN820.cpp.

void STSPIN820_SetTorqueBoostThreshold ( uint8_t  deviceId,
uint16_t  speedThreshold 
) [protected, inherited]

Set the torque boost threshold.

Parameters:
[in]deviceId(from 0 to MAX_NUMBER_OF_DEVICES - 1)
[in]speedThresholdspeed threshold above which the step mode is changed to full step
Return values:
None

Definition at line 1104 of file STSPIN820.cpp.

bool STSPIN820_SoftStop ( uint8_t  deviceId ) [protected, inherited]

Stops the motor by using the device deceleration.

Parameters:
[in]deviceIdUnused parameter
Return values:
trueif the command is successfully executed, else false
Note:
The command is not performed if the device is in INACTIVE, STANDBYTOINACTIVE or STANDBY state.

Definition at line 1116 of file STSPIN820.cpp.

void STSPIN820_StartMovement ( uint8_t  deviceId ) [protected, inherited]

Initialises the bridge parameters to start the movement and enable the power bridge.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 1511 of file STSPIN820.cpp.

void STSPIN820_StepClockHandler ( uint8_t  deviceId ) [protected, inherited]

Handles the device state machine at each pulse.

Parameters:
[in]deviceIdUnused parameter
Return values:
None
Note:
Must only be called by the timer ISR

Definition at line 1546 of file STSPIN820.cpp.

uint32_t STSPIN820_VrefPwmGetFreq ( uint8_t  deviceId ) [protected, inherited]

Get the frequency of REF PWM of the specified device.

Parameters:
[in]deviceIdUnused parameter
Return values:
thefrequency of REF PWM in Hz
Note:

Definition at line 1133 of file STSPIN820.cpp.

void STSPIN820_VrefPwmSetFreq ( uint8_t  deviceId,
uint32_t  newFreq 
) [protected, inherited]

Set the frequency of REF PWM of the specified device.

Parameters:
[in]deviceIdUnused parameter
[in]newFreqin Hz
Return values:
None
Note:

Definition at line 1145 of file STSPIN820.cpp.

void STSPIN820_WaitWhileActive ( uint8_t  deviceId ) [protected, inherited]

Locks until the device state becomes Inactive.

Parameters:
[in]deviceIdUnused parameter
Return values:
None

Definition at line 1156 of file STSPIN820.cpp.