Added ST_INTERFACES library.
Fork of X-NUCLEO-IHM05A1 by
L6208 Class Reference
Class representing a L6208 component. More...
#include <l6208_class.h>
Public Member Functions | |
L6208 (PinName flag_and_enable_pin, PinName reset_pin, PinName direction_pin, PinName half_full_pin, PinName control_pin, PinName clock_pin, PinName vrefA_pwm_pin, PinName vrefB_pwm_pin) | |
Constructor. | |
virtual | ~L6208 (void) |
Destructor. | |
virtual int | Init (void *init=NULL) |
Public functions inherited from the Component Class. | |
virtual int | ReadID (uint8_t *id=NULL) |
Getting the ID of the component. | |
virtual unsigned int | GetStatus (void) |
Public functions inherited from the StepperMotor Class. | |
virtual signed int | GetPosition (void) |
Getting the position. | |
virtual signed int | GetMark (void) |
Getting the marked position. | |
virtual unsigned int | GetSpeed (void) |
Getting the current speed in pps. | |
virtual unsigned int | GetMaxSpeed (void) |
Getting the maximum speed in pps. | |
virtual unsigned int | GetMinSpeed (void) |
Getting the minimum speed in pps. | |
virtual unsigned int | GetAcceleration (void) |
Getting the acceleration in pps^2. | |
virtual unsigned int | GetDeceleration (void) |
Getting the deceleration in pps^2. | |
virtual direction_t | GetDirection (void) |
Getting the direction of rotation. | |
virtual void | SetHome (void) |
Setting the current position to be the home position. | |
virtual void | SetMark (void) |
Setting the current position to be the marked position. | |
virtual bool | SetMaxSpeed (unsigned int speed) |
Setting the maximum speed in pps. | |
virtual bool | SetMinSpeed (unsigned int speed) |
Setting the minimum speed in pps. | |
virtual bool | SetAcceleration (unsigned int acceleration) |
Setting the acceleration in pps^2. | |
virtual bool | SetDeceleration (unsigned int deceleration) |
Setting the deceleration in pps^2. | |
virtual bool | SetStepMode (step_mode_t step_mode) |
Setting the Step Mode. | |
virtual void | GoTo (signed int position) |
Going to a specified position. | |
virtual void | GoHome (void) |
Going to the home position. | |
virtual void | GoMark (void) |
Going to the marked position. | |
virtual void | Run (direction_t direction) |
Running the motor towards a specified direction. | |
virtual void | Move (direction_t direction, unsigned int steps) |
Moving the motor towards a specified direction for a certain number of steps. | |
virtual void | SoftStop (void) |
Stopping the motor through an immediate deceleration up to zero speed. | |
virtual void | HardStop (void) |
Stopping the motor through an immediate infinite deceleration. | |
virtual void | SoftHiZ (void) |
Disabling the power bridge after performing a deceleration to zero. | |
virtual void | HardHiZ (void) |
Disabling the power bridge immediately. | |
virtual void | WaitWhileActive (void) |
Waiting while the motor is active. | |
virtual void | AttachErrorHandler (void(*fptr)(uint16_t error)) |
Public functions NOT inherited. | |
virtual unsigned int | CheckStatusHw (void) |
Checks if the device is disabled or/and has an alarm flag set by reading the EN pin position. | |
virtual void | Disable (void) |
Disabling the device. | |
virtual void | Enable (void) |
Enabling the device. | |
virtual motorDecayMode_t | GetDecayMode () |
Getting the motor decay mode. | |
virtual uint32_t | GetFreqVrefPwm (void) |
Set the frequency of the VREFA and VREFB PWM. | |
virtual unsigned int | GetFwVersion (void) |
Getting the version of the firmware. | |
virtual step_mode_t | GetStepMode (void) |
Getting the motor step mode. | |
virtual motorStopMode_t | GetStopMode (void) |
Getting the motor stop mode. | |
virtual void | GoTo (direction_t direction, signed int position) |
Going to a specified position with a specificied direction. | |
virtual void | ReleaseReset (void) |
Release the L6208 reset (Reset pin set to high level). | |
virtual void | Reset (void) |
Reset the device with current step mode, resets current speed, positions and microstep variables. | |
virtual void | ResetDevice (void) |
Reset the L6208 (Reset pin set to low level). | |
virtual void | SetDecayMode (motorDecayMode_t decayMode) |
Set the motor decay mode. | |
virtual void | SetDirection (direction_t direction) |
Set the motor direction. | |
virtual void | SetFreqVrefPwm (uint32_t frequency) |
Set the frequency of the VREFA and VREFB PWM. | |
virtual void | SetStopMode (motorStopMode_t stopMode) |
Set the motor stop mode. | |
void | AttachFlagIRQ (void(*fptr)(void)) |
Attaching an interrupt handler to the FLAG interrupt. | |
void | EnableFlagIRQ (void) |
Enabling the FLAG interrupt handling. | |
Protected Member Functions | |
Status_t | L6208_Init (void *init) |
Start the L6208 library. | |
void | L6208_Disable (void) |
Disable the power bridges (leave the output bridges HiZ) | |
void | L6208_ErrorHandler (uint16_t error) |
Error handler which calls the user callback (if defined) | |
void | L6208_Enable (void) |
Enable the power bridges. | |
uint16_t | L6208_GetAcceleration (void) |
Get the stepper acceleration rate in step/s^2 for full, half and wave modes in microsteps/s^2 for microstep modes. | |
uint16_t | L6208_GetCurrentSpeed (void) |
Get the current speed in step/s for full, half and wave modes in microsteps/s for microstep modes. | |
uint16_t | L6208_GetDeceleration (void) |
Get the stepper deceleration rate in step/s^2 for full, half and wave modes in microsteps/s^2 for microstep modes. | |
motorDecayMode_t | L6208_GetDecayMode (void) |
Get the motor decay mode. | |
motorDir_t | L6208_GetDirection (void) |
Get the motor current direction. | |
uint32_t | L6208_GetFwVersion (void) |
Return the FW version. | |
int32_t | L6208_GetMark (void) |
Get the mark position (32b signed) | |
uint16_t | L6208_GetMaxSpeed (void) |
Get the max speed in step/s for full, half and wave modes in microsteps/s for microstep modes. | |
uint16_t | L6208_GetMinSpeed (void) |
Get the min speed in step/s for full, half and wave modes in microsteps/s for microstep modes. | |
motorState_t | L6208_GetMotionState (void) |
Get the stepper state machine index. | |
int32_t | L6208_GetPosition (void) |
Get the current position (32b signed) | |
motorStepMode_t | L6208_GetStepMode (void) |
Get the motor step mode. | |
motorStopMode_t | L6208_GetStopMode (void) |
Get the selected stop mode. | |
void | L6208_GoHome (void) |
Go to the home position. | |
void | L6208_GoMark (void) |
Go to the Mark position. | |
void | L6208_GoTo (int32_t targetPosition) |
Move the motor to the absolute position using the shortest path. | |
void | L6208_GoToDir (motorDir_t direction, int32_t targetPosition) |
Move the motor to the absolute position. | |
void | L6208_HardHiZ (void) |
Immediately stop the motor and disables the power bridges. | |
void | L6208_HardStop (void) |
Immediately stop the motor and keeps holding torque. | |
void | L6208_Move (motorDir_t direction, uint32_t stepCount) |
Move the motor by the specified number of steps in the specified direction. | |
void | L6208_ReleaseReset (void) |
Release the L6208 reset (Reset pin set to high level) | |
void | L6208_Reset (void) |
Reset the L6208 (Reset pin set to low level) | |
void | L6208_ResetDevice (void) |
Call L6208_SetStepMode with current step mode, the L6208_SetStepMode function along with setting the step mode resets the L6208 device. | |
void | L6208_Run (motorDir_t direction) |
Run the motor in the specified direction according to the speed profile defined by the minimum speed, maximum speed, and acceleration parameters. | |
bool | L6208_SetAcceleration (uint16_t newAcc) |
Set the stepper acceleration rate in step/s^2 and step/tick^2 for full, half and wave modes in microsteps/s^2 and microsteps/tick^2 for microstep modes. | |
void | L6208_SetDecayMode (motorDecayMode_t decayMode) |
Select the motor decay mode. | |
bool | L6208_SetDeceleration (uint16_t newDec) |
Set the stepper deceleration rate in step/s^2 and step/tick^2 for full, half and wave modes in microsteps/s^2 and microsteps/tick^2 for microstep modes. | |
void | L6208_SetDirection (motorDir_t direction) |
Specify the direction. | |
void | L6208_SetHome (void) |
Set current position to be the home position. | |
void | L6208_SetMark (void) |
Set current position to be the mark position. | |
bool | L6208_SetMaxSpeed (uint16_t volatile newSpeed) |
Set the user selected maximum speed in step/s and step/tick for full, half and wave modes in microsteps/s and microsteps/tick for microstep modes. | |
bool | L6208_SetMinSpeed (uint16_t volatile newSpeed) |
Set the user selected minimum speed in step/s and step/tick for full, half and wave modes in microsteps/s and microsteps/tick for microstep modes. | |
bool | L6208_SetStepMode (motorStepMode_t stepMode) |
Set the step mode. | |
void | L6208_SetStopMode (motorStopMode_t stopMode) |
Select the mode to stop the motor. | |
bool | L6208_SoftStop (void) |
Stop the motor by using the device deceleration and set deceleration torque. | |
void | L6208_TickHandler (void) |
Handle the device state machine at each tick timer pulse end. | |
uint32_t | L6208_VrefPwmGetFreq (void) |
Get the frequency of VREFA and VREFB PWM. | |
void | L6208_VrefPwmSetFreq (uint32_t newFreq) |
Set the frequency of the VREFA and VREFB PWM. | |
void | L6208_WaitWhileActive (void) |
Lock while motor is running. | |
void | L6208_ClearSysFlag (uint32_t mask) |
Clear the bit/s of flags according to the specified mask. | |
uint32_t | L6208_ComputeNbAccOrDecSteps (uint16_t accOrDecRate) |
Compute the number of steps at the end of the accereration/deceleration phase P = position in steps at the end of the acceleration/deceleration phase T = acceleration/deceleration time in seconds A = acceleration/deceleration rate in steps per second per second (steps/sec^2) V = peak velocity during acceleration/deceleration phase V1 = average velocity during acceleration/deceleration phase T = V/A V1 = V/2 P = V1*T P = V^2/2A. | |
uint16_t | L6208_ConvertAcceDecelRateValue (uint16_t newAccOrDecRate) |
Compute the acceleration/deceleration speed increment value. | |
void | L6208_DoAccel (void) |
Compute next position and speed according to the acceleration rate. | |
void | L6208_DoDecel (void) |
Compute next position and speed according to the deceleration rate. | |
void | L6208_DoRun (void) |
Compute next position by adding current speed. | |
uint8_t | L6208_GetMicrostepSample2Scale (void) |
Get number of samples to rescale. | |
void | L6208_Indexmodeinit (void) |
Initialize the system for position mode motor moving command P = total move distance in steps P1 = steps required to accel from 0 to V P2 = steps required to decel from V to 0 V = peak velocity in steps per second (steps/sec) V1 = average velocity during accel or decel* A = required accel rate in steps per second per second (steps/sec2) D = required decel rate in steps per second per second (steps/sec2) T1 = acceleration time in seconds T2 = deceleration time in seconds*. | |
bool | L6208_IsSysFlag (uint32_t mask) |
Check the bit/s of flags according to the specified mask. | |
void | L6208_ResetSteps (void) |
Stepper driver device step state reset subroutine. | |
uint32_t | L6208_ScaleWaveformSample (uint8_t sampleIndex) |
Compute the specified micro stepping waveform sample with the current selected torque and pwm period. | |
void | L6208_ScaleWaveformTable (void) |
Compute the micro stepping waveform sample table samples with the current selected torque and pwm period. | |
void | L6208_SetDeviceParamsToGivenValues (l6208_Init_t *pInitDevicePrm) |
Set the parameters of the device to values of the structure pointed by pInitDevicePrm. | |
void | L6208_SetDeviceParamsToPredefinedValues (void) |
Set the parameters of the device to predefined values Set GPIO according to these values from l6208_target_config.h. | |
void | L6208_SetMicrostepSample2Scale (uint8_t value) |
Set the number of micro stepping waveform samples to rescale. | |
void | L6208_SetMicrostepSample2Update (uint8_t value) |
Set the number of micro stepping waveform samples to update into scanning. | |
void | L6208_SetMotionState (motorState_t newMotionState) |
Set the stepper state machine index. | |
bool | L6208_SetSpeed (uint16_t newSpeed, uint32_t volatile *pSpeed) |
Set the user selected speed in step/tick. | |
void | L6208_SetSysFlag (uint32_t mask) |
Set the bit/s of flags according to the specified mask. | |
bool | L6208_StartMovement (void) |
Stepper motor start command. | |
void | L6208_UpdateScanWaveformTable (void) |
Update the micro stepping waveform samples table with the values previously scaled with current selected torque and tick period. | |
void | L6208_UstepWaveformHandling (void) |
Check if there are waveform samples to rescale and if so, perform the rescaling. | |
bool | L6208_VectorCalc (uint8_t newTorque) |
Set the current torque value (Vref) | |
bool | L6208_VrefPwmComputePulseWidth (uint8_t bridgeId, uint16_t value, bool valueIsPwmDutyCycle) |
Compute the pulse width of VREFA or VREFB PWM. | |
void | L6208_VrefPwmUpdatePulseWidth (void) |
Update the pulse width of VREFA or VREFB PWM. | |
void | L6208_Board_CLOCK_PIN_Reset (void) |
Reset the clock pin. | |
void | L6208_Board_CLOCK_PIN_Set (void) |
Set the clock pin. | |
void | L6208_Board_CONTROL_PIN_Set (void) |
Set the control pin. | |
void | L6208_Board_CONTROL_PIN_Reset (void) |
Reset the control pin. | |
void | L6208_Board_Delay (uint32_t delay) |
Making the CPU wait. | |
void | L6208_Board_DIR_PIN_Reset (void) |
Reset the dir pin. | |
void | L6208_Board_DIR_PIN_Set (void) |
Set the dir pin. | |
void | L6208_Board_Disable (void) |
Disable the power bridges (leave the output bridges HiZ). | |
void | L6208_Board_DisableIrq (void) |
Disabling interrupts. | |
void | L6208_Board_Enable (void) |
Enable the power bridges (leave the output bridges HiZ). | |
void | L6208_Board_EnableIrq (void) |
Enabling interrupts. | |
void | L6208_Board_HALF_FULL_PIN_Reset (void) |
Reset the half full pin. | |
void | L6208_Board_HALF_FULL_PIN_Set (void) |
Set the half full pin. | |
void | L6208_Board_VrefPwmInit (uint8_t bridgeId, uint32_t pwmFreq) |
Initialising the the VREFA or VREFB PWM. | |
void | L6208_Board_ReleaseReset (void) |
Exit the device from reset mode. | |
void | L6208_Board_Reset (void) |
Put the device in reset mode. | |
uint32_t | L6208_Board_TickGetFreq (void) |
Get the tick timer frequency in Hz. | |
void | L6208_Board_TickInit (void) |
Initialising the tick. | |
void | L6208_Board_TickStart (uint16_t frequency) |
Starting the tick timer, setting its frequency and attaching a tick handler function to it. | |
void | L6208_Board_TickStop (void) |
Stopping the tick. | |
void | L6208_Board_VrefPwmSetPulseWidthA (uint8_t pulseWidthInUs) |
Set the pulse width of the VREFA PWM. | |
void | L6208_Board_VrefPwmSetPulseWidthB (uint8_t pulseWidthInUs) |
Set the pulse width of the VREFB PWM. | |
bool | L6208_Board_VrefPwmStart (uint8_t bridgeId, uint16_t pwmPeriod) |
Start the timer for the VREFA or VREFB PWM. | |
bool | L6208_Board_VrefPwmStop (uint8_t bridgeId) |
Stop the timer for the VREFA or VREFB PWM. | |
Protected Attributes | |
uint16_t | updatedMicroTable [L6208_USTEPS_PER_QUARTER_PERIOD+1] |
microstepping PWM period and torque scaled waveform samples array | |
uint16_t | microTable1 [L6208_USTEPS_PER_QUARTER_PERIOD *3+1] |
waveform scanning microstepping PWM period sample arrays for VREFA wave | |
uint16_t * | pMicroTable2 |
waveform scanning microstepping PWM period sample array for VREFB wave | |
Static Protected Attributes | |
static const uint16_t | RefMicroTable [L6208_USTEPS_PER_QUARTER_PERIOD *3] |
RefMicroTable values are 2^L6208_SINE_WAVEFORM_POWER_OF_TWO_MAX_VALUE*|sin(n/16*PI/2)| where n is the index in the table. |
Detailed Description
Class representing a L6208 component.
Definition at line 72 of file l6208_class.h.
Constructor & Destructor Documentation
L6208 | ( | PinName | flag_and_enable_pin, |
PinName | reset_pin, | ||
PinName | direction_pin, | ||
PinName | half_full_pin, | ||
PinName | control_pin, | ||
PinName | clock_pin, | ||
PinName | vrefA_pwm_pin, | ||
PinName | vrefB_pwm_pin | ||
) |
Constructor.
- Parameters:
-
flag_and_enable_pin pin name of the EN pin of the component. reset_pin pin name of the RESET pin of the component. direction_pin pin name of the CW_CCW pin of the component. half_full_pin pin name of the HALF_FULL pin of the component. control_pin pin name of the CONTROL pin of the component. clock_pin pin name of the CLOCK pin of the component. vrefA_pwm_pin pin name of the PWM connected to the VREFA pin of the component. vrefB_pwm_pin pin name of the PWM connected to the VREFB pin of the component.
Definition at line 88 of file l6208_class.h.
virtual ~L6208 | ( | void | ) | [virtual] |
Destructor.
Definition at line 121 of file l6208_class.h.
Member Function Documentation
virtual void AttachErrorHandler | ( | void(*)(uint16_t error) | fptr ) | [virtual] |
Public functions NOT inherited.
Attaching an error handler.
- Parameters:
-
fptr An error handler.
- Return values:
-
None.
Definition at line 497 of file l6208_class.h.
void AttachFlagIRQ | ( | void(*)(void) | fptr ) |
Attaching an interrupt handler to the FLAG interrupt.
- Parameters:
-
fptr An interrupt handler.
- Return values:
-
None.
Definition at line 704 of file l6208_class.h.
virtual unsigned int CheckStatusHw | ( | void | ) | [virtual] |
Checks if the device is disabled or/and has an alarm flag set by reading the EN pin position.
- Parameters:
-
None.
- Return values:
-
One if the EN pin is low (the device is disabled or/and has an alarm flag set), otherwise zero.
Definition at line 509 of file l6208_class.h.
virtual void Disable | ( | void | ) | [virtual] |
Disabling the device.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 520 of file l6208_class.h.
virtual void Enable | ( | void | ) | [virtual] |
Enabling the device.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 530 of file l6208_class.h.
void EnableFlagIRQ | ( | void | ) |
Enabling the FLAG interrupt handling.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 715 of file l6208_class.h.
virtual unsigned int GetAcceleration | ( | void | ) | [virtual] |
Getting the acceleration in pps^2.
- Parameters:
-
None.
- Return values:
-
The acceleration in pps^2.
Definition at line 240 of file l6208_class.h.
virtual motorDecayMode_t GetDecayMode | ( | ) | [virtual] |
Getting the motor decay mode.
- Parameters:
-
None.
- Return values:
-
The motor decay mode.
Definition at line 540 of file l6208_class.h.
virtual unsigned int GetDeceleration | ( | void | ) | [virtual] |
Getting the deceleration in pps^2.
- Parameters:
-
None.
- Return values:
-
The deceleration in pps^2.
Definition at line 250 of file l6208_class.h.
virtual direction_t GetDirection | ( | void | ) | [virtual] |
Getting the direction of rotation.
- Parameters:
-
None.
- Return values:
-
The direction of rotation.
Definition at line 260 of file l6208_class.h.
virtual uint32_t GetFreqVrefPwm | ( | void | ) | [virtual] |
Set the frequency of the VREFA and VREFB PWM.
- Parameters:
-
frequency in Hz
- Return values:
-
None.
Definition at line 550 of file l6208_class.h.
virtual unsigned int GetFwVersion | ( | void | ) | [virtual] |
Getting the version of the firmware.
- Parameters:
-
None.
- Return values:
-
The version of the firmware.
Definition at line 560 of file l6208_class.h.
virtual signed int GetMark | ( | void | ) | [virtual] |
Getting the marked position.
- Parameters:
-
None.
- Return values:
-
The marked position.
Definition at line 200 of file l6208_class.h.
virtual unsigned int GetMaxSpeed | ( | void | ) | [virtual] |
Getting the maximum speed in pps.
- Parameters:
-
None.
- Return values:
-
The maximum speed in pps.
Definition at line 220 of file l6208_class.h.
virtual unsigned int GetMinSpeed | ( | void | ) | [virtual] |
Getting the minimum speed in pps.
- Parameters:
-
None.
- Return values:
-
The minimum speed in pps.
Definition at line 230 of file l6208_class.h.
virtual signed int GetPosition | ( | void | ) | [virtual] |
Getting the position.
- Parameters:
-
None.
- Return values:
-
The position.
Definition at line 190 of file l6208_class.h.
virtual unsigned int GetSpeed | ( | void | ) | [virtual] |
Getting the current speed in pps.
- Parameters:
-
None.
- Return values:
-
The current speed in pps.
Definition at line 210 of file l6208_class.h.
virtual unsigned int GetStatus | ( | void | ) | [virtual] |
Public functions inherited from the StepperMotor Class.
Getting the value of the motor state .
- Parameters:
-
None.
- Return values:
-
The motor state accoring to motorState_t in motor.h
Definition at line 180 of file l6208_class.h.
virtual step_mode_t GetStepMode | ( | void | ) | [virtual] |
Getting the motor step mode.
- Parameters:
-
None.
- Return values:
-
The motor step mode.
Definition at line 570 of file l6208_class.h.
virtual motorStopMode_t GetStopMode | ( | void | ) | [virtual] |
Getting the motor stop mode.
- Parameters:
-
None.
- Return values:
-
The motor stop mode.
Definition at line 580 of file l6208_class.h.
virtual void GoHome | ( | void | ) | [virtual] |
Going to the home position.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 392 of file l6208_class.h.
virtual void GoMark | ( | void | ) | [virtual] |
Going to the marked position.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 402 of file l6208_class.h.
virtual void GoTo | ( | signed int | position ) | [virtual] |
Going to a specified position.
- Parameters:
-
position The desired position.
- Return values:
-
None.
Definition at line 382 of file l6208_class.h.
virtual void GoTo | ( | direction_t | direction, |
signed int | position | ||
) | [virtual] |
Going to a specified position with a specificied direction.
- Parameters:
-
direction The desired direction. position The desired position.
- Return values:
-
None.
Definition at line 591 of file l6208_class.h.
virtual void HardHiZ | ( | void | ) | [virtual] |
Disabling the power bridge immediately.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 473 of file l6208_class.h.
virtual void HardStop | ( | void | ) | [virtual] |
Stopping the motor through an immediate infinite deceleration.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 443 of file l6208_class.h.
virtual int Init | ( | void * | init = NULL ) |
[virtual] |
Public functions inherited from the Component Class.
Initialize the component.
- Parameters:
-
init Pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 156 of file l6208_class.h.
void L6208_Board_CLOCK_PIN_Reset | ( | void | ) | [protected] |
Reset the clock pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 824 of file l6208_class.h.
void L6208_Board_CLOCK_PIN_Set | ( | void | ) | [protected] |
Set the clock pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 833 of file l6208_class.h.
void L6208_Board_CONTROL_PIN_Reset | ( | void | ) | [protected] |
Reset the control pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 853 of file l6208_class.h.
void L6208_Board_CONTROL_PIN_Set | ( | void | ) | [protected] |
Set the control pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 843 of file l6208_class.h.
void L6208_Board_Delay | ( | uint32_t | delay ) | [protected] |
Making the CPU wait.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 863 of file l6208_class.h.
void L6208_Board_DIR_PIN_Reset | ( | void | ) | [protected] |
Reset the dir pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 873 of file l6208_class.h.
void L6208_Board_DIR_PIN_Set | ( | void | ) | [protected] |
Set the dir pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 883 of file l6208_class.h.
void L6208_Board_Disable | ( | void | ) | [protected] |
Disable the power bridges (leave the output bridges HiZ).
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 893 of file l6208_class.h.
void L6208_Board_DisableIrq | ( | void | ) | [protected] |
Disabling interrupts.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 904 of file l6208_class.h.
void L6208_Board_Enable | ( | void | ) | [protected] |
Enable the power bridges (leave the output bridges HiZ).
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 914 of file l6208_class.h.
void L6208_Board_EnableIrq | ( | void | ) | [protected] |
Enabling interrupts.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 925 of file l6208_class.h.
void L6208_Board_HALF_FULL_PIN_Reset | ( | void | ) | [protected] |
Reset the half full pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 935 of file l6208_class.h.
void L6208_Board_HALF_FULL_PIN_Set | ( | void | ) | [protected] |
Set the half full pin.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 945 of file l6208_class.h.
void L6208_Board_ReleaseReset | ( | void | ) | [protected] |
Exit the device from reset mode.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 962 of file l6208_class.h.
void L6208_Board_Reset | ( | void | ) | [protected] |
Put the device in reset mode.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 972 of file l6208_class.h.
uint32_t L6208_Board_TickGetFreq | ( | void | ) | [protected] |
Get the tick timer frequency in Hz.
- Parameters:
-
None.
- Return values:
-
The tick timer frequency in Hz.
Definition at line 982 of file l6208_class.h.
void L6208_Board_TickInit | ( | void | ) | [protected] |
Initialising the tick.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 992 of file l6208_class.h.
void L6208_Board_TickStart | ( | uint16_t | frequency ) | [protected] |
Starting the tick timer, setting its frequency and attaching a tick handler function to it.
- Parameters:
-
frequency the frequency of the tick.
- Return values:
-
None.
Definition at line 1000 of file l6208_class.h.
void L6208_Board_TickStop | ( | void | ) | [protected] |
Stopping the tick.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 1015 of file l6208_class.h.
void L6208_Board_VrefPwmInit | ( | uint8_t | bridgeId, |
uint32_t | pwmFreq | ||
) | [protected] |
Initialising the the VREFA or VREFB PWM.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 955 of file l6208_class.h.
void L6208_Board_VrefPwmSetPulseWidthA | ( | uint8_t | pulseWidthInUs ) | [protected] |
Set the pulse width of the VREFA PWM.
- Parameters:
-
[in] pulseWidthInUs pulse width of the PWM in microsecond.
- Return values:
-
None.
Definition at line 1025 of file l6208_class.h.
void L6208_Board_VrefPwmSetPulseWidthB | ( | uint8_t | pulseWidthInUs ) | [protected] |
Set the pulse width of the VREFB PWM.
- Parameters:
-
[in] pulseWidthInUs pulse width of the PWM in microsecond.
- Return values:
-
None.
Definition at line 1035 of file l6208_class.h.
bool L6208_Board_VrefPwmStart | ( | uint8_t | bridgeId, |
uint16_t | pwmPeriod | ||
) | [protected] |
Start the timer for the VREFA or VREFB PWM.
- Parameters:
-
[in] bridgeId 0 for BRIDGE_A 1 for BRIDGE_B [in] pwmPeriod period of the PWM used to generate the reference voltage for the bridge.
- Return values:
-
true in case of success, "false" otherwise.
- Note:
- the unit is 1/256th of a microsecond. The VREFA PWM must be started before the VREFB PWM.
Definition at line 1051 of file l6208_class.h.
bool L6208_Board_VrefPwmStop | ( | uint8_t | bridgeId ) | [protected] |
Stop the timer for the VREFA or VREFB PWM.
- Parameters:
-
[in] bridgeId 0 for BRIDGE_A 1 for BRIDGE_B
- Return values:
-
true in case of success, "false" otherwise.
Definition at line 1074 of file l6208_class.h.
void L6208_ClearSysFlag | ( | uint32_t | mask ) | [protected] |
Clear the bit/s of flags according to the specified mask.
- Parameters:
-
[in] mask flag bit mask
- Return values:
-
None
Definition at line 1231 of file l6208_class.cpp.
uint32_t L6208_ComputeNbAccOrDecSteps | ( | uint16_t | accOrDecRate ) | [protected] |
Compute the number of steps at the end of the accereration/deceleration phase P = position in steps at the end of the acceleration/deceleration phase T = acceleration/deceleration time in seconds A = acceleration/deceleration rate in steps per second per second (steps/sec^2) V = peak velocity during acceleration/deceleration phase V1 = average velocity during acceleration/deceleration phase T = V/A V1 = V/2 P = V1*T P = V^2/2A.
- Parameters:
-
accOrDecRate acceleration/deceleration rate in steps per second per second (steps/sec^2)
- Return values:
-
end position or 0xFFFFFFFF on error
Definition at line 1250 of file l6208_class.cpp.
uint16_t L6208_ConvertAcceDecelRateValue | ( | uint16_t | newAccOrDecRate ) | [protected] |
Compute the acceleration/deceleration speed increment value.
- Parameters:
-
[in] newAccOrDecRate acceleration or deceleration value (steps/s^2) greater or equal than 24
- Return values:
-
the speed (step/tick) increment value LSB = 2^-24 step/tick^2 or 2^-20 microstep/tick^2
- Note:
- return 0 if the rate is too low or if the tick frequency is too small or if the device is running in position mode
Definition at line 1300 of file l6208_class.cpp.
void L6208_Disable | ( | void | ) | [protected] |
Disable the power bridges (leave the output bridges HiZ)
- Return values:
-
None
Definition at line 142 of file l6208_class.cpp.
void L6208_DoAccel | ( | void | ) | [protected] |
Compute next position and speed according to the acceleration rate.
- Return values:
-
None
Definition at line 1330 of file l6208_class.cpp.
void L6208_DoDecel | ( | void | ) | [protected] |
Compute next position and speed according to the deceleration rate.
- Return values:
-
None
Definition at line 1351 of file l6208_class.cpp.
void L6208_DoRun | ( | void | ) | [protected] |
Compute next position by adding current speed.
- Return values:
-
None
Definition at line 1373 of file l6208_class.cpp.
void L6208_Enable | ( | void | ) | [protected] |
void L6208_ErrorHandler | ( | uint16_t | error ) | [protected] |
Error handler which calls the user callback (if defined)
- Parameters:
-
[in] error Number of the error
- Return values:
-
None
Definition at line 153 of file l6208_class.cpp.
uint16_t L6208_GetAcceleration | ( | void | ) | [protected] |
Get the stepper acceleration rate in step/s^2 for full, half and wave modes in microsteps/s^2 for microstep modes.
- Return values:
-
the stepper acceleration rate in step/s^2 or microstep/s^2
- Note:
Definition at line 185 of file l6208_class.cpp.
uint16_t L6208_GetCurrentSpeed | ( | void | ) | [protected] |
Get the current speed in step/s for full, half and wave modes in microsteps/s for microstep modes.
- Return values:
-
return the current speed in step/s or microstep/s
- Note:
Definition at line 197 of file l6208_class.cpp.
motorDecayMode_t L6208_GetDecayMode | ( | void | ) | [protected] |
uint16_t L6208_GetDeceleration | ( | void | ) | [protected] |
Get the stepper deceleration rate in step/s^2 for full, half and wave modes in microsteps/s^2 for microstep modes.
- Return values:
-
the stepper deceleration rate in step/s^2 or microstep/s^2
- Note:
Definition at line 230 of file l6208_class.cpp.
motorDir_t L6208_GetDirection | ( | void | ) | [protected] |
Get the motor current direction.
- Return values:
-
direction
Definition at line 239 of file l6208_class.cpp.
uint32_t L6208_GetFwVersion | ( | void | ) | [protected] |
int32_t L6208_GetMark | ( | void | ) | [protected] |
Get the mark position (32b signed)
- Return values:
-
mark position
Definition at line 264 of file l6208_class.cpp.
uint16_t L6208_GetMaxSpeed | ( | void | ) | [protected] |
Get the max speed in step/s for full, half and wave modes in microsteps/s for microstep modes.
- Return values:
-
return the max speed in step/s or microstep/s
- Note:
Definition at line 276 of file l6208_class.cpp.
uint8_t L6208_GetMicrostepSample2Scale | ( | void | ) | [protected] |
Get number of samples to rescale.
- Return values:
-
uStepsample2scale the number of micro stepping waveform samples to rescale
Definition at line 1382 of file l6208_class.cpp.
uint16_t L6208_GetMinSpeed | ( | void | ) | [protected] |
Get the min speed in step/s for full, half and wave modes in microsteps/s for microstep modes.
- Return values:
-
return the min speed in step/s or microstep/s
- Note:
Definition at line 288 of file l6208_class.cpp.
motorState_t L6208_GetMotionState | ( | void | ) | [protected] |
Get the stepper state machine index.
- Return values:
-
one of the stepper state machine index in the motorState_t enum
Definition at line 297 of file l6208_class.cpp.
int32_t L6208_GetPosition | ( | void | ) | [protected] |
Get the current position (32b signed)
- Return values:
-
current absoulte position
Definition at line 307 of file l6208_class.cpp.
motorStepMode_t L6208_GetStepMode | ( | void | ) | [protected] |
motorStopMode_t L6208_GetStopMode | ( | void | ) | [protected] |
Get the selected stop mode.
- Return values:
-
the selected stop mode
Definition at line 325 of file l6208_class.cpp.
void L6208_GoHome | ( | void | ) | [protected] |
void L6208_GoMark | ( | void | ) | [protected] |
void L6208_GoTo | ( | int32_t | abs_pos ) | [protected] |
Move the motor to the absolute position using the shortest path.
- Parameters:
-
[in] abs_pos 32 bit signed value position
- Return values:
-
None
- Note:
- The position is at the resolution corresponding to the selected step mode. STEP_MODE_FULL or STEP_MODE_WAVE : 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
Definition at line 367 of file l6208_class.cpp.
void L6208_GoToDir | ( | motorDir_t | direction, |
int32_t | abs_pos | ||
) | [protected] |
Move the motor to the absolute position.
- Parameters:
-
[in] direction FORWARD or BACKWARD [in] abs_pos 32 bit signed value position
- Return values:
-
None
- Note:
- The position is at the resolution corresponding to the selected step mode. STEP_MODE_FULL or STEP_MODE_WAVE : 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
Definition at line 415 of file l6208_class.cpp.
void L6208_HardHiZ | ( | void | ) | [protected] |
Immediately stop the motor and disables the power bridges.
- Return values:
-
None
Definition at line 453 of file l6208_class.cpp.
void L6208_HardStop | ( | void | ) | [protected] |
Immediately stop the motor and keeps holding torque.
- Return values:
-
None
Definition at line 476 of file l6208_class.cpp.
void L6208_Indexmodeinit | ( | void | ) | [protected] |
Initialize the system for position mode motor moving command P = total move distance in steps P1 = steps required to accel from 0 to V P2 = steps required to decel from V to 0 V = peak velocity in steps per second (steps/sec) V1 = average velocity during accel or decel* A = required accel rate in steps per second per second (steps/sec2) D = required decel rate in steps per second per second (steps/sec2) T1 = acceleration time in seconds T2 = deceleration time in seconds*.
1) T1 = V / A 2) V1 = V / 2 3) P1 = V1 T1 Substituting 1 and 2 into 3 yields: 4) P1 = V2 / 2A In the same manner we have: 5) P2 = V2 / 2D
P1 = PD/(D+A)
- See also:
- Application Note: AN2044
- Return values:
-
None
Definition at line 1412 of file l6208_class.cpp.
Status_t L6208_Init | ( | void * | pInit ) | [protected] |
Start the L6208 library.
- Parameters:
-
[in] pInit pointer to the initialization data
- Return values:
-
COMPONENT_OK in case of success.
Definition at line 82 of file l6208_class.cpp.
bool L6208_IsSysFlag | ( | uint32_t | mask ) | [protected] |
Check the bit/s of flags according to the specified mask.
- Parameters:
-
[in] mask flag bit mask
- Return values:
-
TRUE if the bit of the mask are set
Definition at line 1456 of file l6208_class.cpp.
void L6208_Move | ( | motorDir_t | direction, |
uint32_t | stepCount | ||
) | [protected] |
Move the motor by the specified number of steps in the specified direction.
- Parameters:
-
[in] direction FORWARD or BACKWARD [in] stepCount 32 bit unsigned step count
- Return values:
-
None
- Note:
- The step count resolution is corresponding to the selected step mode. STEP_MODE_FULL or STEP_MODE_WAVE : 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
Definition at line 503 of file l6208_class.cpp.
void L6208_ReleaseReset | ( | void | ) | [protected] |
Release the L6208 reset (Reset pin set to high level)
- Return values:
-
None
Definition at line 530 of file l6208_class.cpp.
void L6208_Reset | ( | void | ) | [protected] |
Reset the L6208 (Reset pin set to low level)
- Return values:
-
None
Definition at line 539 of file l6208_class.cpp.
void L6208_ResetDevice | ( | void | ) | [protected] |
Call L6208_SetStepMode with current step mode, the L6208_SetStepMode function along with setting the step mode resets the L6208 device.
- Return values:
-
None
Definition at line 551 of file l6208_class.cpp.
void L6208_ResetSteps | ( | void | ) | [protected] |
Stepper driver device step state reset subroutine.
- Return values:
-
None
Definition at line 1465 of file l6208_class.cpp.
void L6208_Run | ( | motorDir_t | direction ) | [protected] |
Run the motor in the specified direction according to the speed profile defined by the minimum speed, maximum speed, and acceleration parameters.
The device accelerates from the minimum speed up to the maximum speed by using the device acceleration.
- Parameters:
-
[in] direction FORWARD or BACKWARD
- Return values:
-
None
Definition at line 565 of file l6208_class.cpp.
uint32_t L6208_ScaleWaveformSample | ( | uint8_t | sampleIndex ) | [protected] |
Compute the specified micro stepping waveform sample with the current selected torque and pwm period.
- Parameters:
-
[in] sampleIndex sample Index
- Return values:
-
scaled sample value
Definition at line 1483 of file l6208_class.cpp.
void L6208_ScaleWaveformTable | ( | void | ) | [protected] |
Compute the micro stepping waveform sample table samples with the current selected torque and pwm period.
- Return values:
-
None
Definition at line 1502 of file l6208_class.cpp.
bool L6208_SetAcceleration | ( | uint16_t | newAcc ) | [protected] |
Set the stepper acceleration rate in step/s^2 and step/tick^2 for full, half and wave modes in microsteps/s^2 and microsteps/tick^2 for microstep modes.
- Parameters:
-
[in] newAcc new acceleration rate in step/s^2 or microstep/s^2
- Return values:
-
TRUE
- Note:
Definition at line 588 of file l6208_class.cpp.
void L6208_SetDecayMode | ( | motorDecayMode_t | decayMode ) | [protected] |
Select the motor decay mode.
- Parameters:
-
[in] decayMode (SLOW_DECAY or FAST_DECAY)
- Return values:
-
None
Definition at line 608 of file l6208_class.cpp.
bool L6208_SetDeceleration | ( | uint16_t | newDec ) | [protected] |
Set the stepper deceleration rate in step/s^2 and step/tick^2 for full, half and wave modes in microsteps/s^2 and microsteps/tick^2 for microstep modes.
- Parameters:
-
[in] newDec new deceleration rate in step/s^2 or microstep/s^2
- Return values:
-
TRUE
- Note:
Definition at line 630 of file l6208_class.cpp.
void L6208_SetDeviceParamsToGivenValues | ( | l6208_Init_t * | pInitDevicePrm ) | [protected] |
Set the parameters of the device to values of the structure pointed by pInitDevicePrm.
Set GPIO according to these values.
- Parameters:
-
pInitDevicePrm pointer onto the structure containing values to initialize the device parameters.
- Return values:
-
None
Definition at line 1519 of file l6208_class.cpp.
void L6208_SetDeviceParamsToPredefinedValues | ( | void | ) | [protected] |
Set the parameters of the device to predefined values Set GPIO according to these values from l6208_target_config.h.
- Return values:
-
None
Definition at line 1548 of file l6208_class.cpp.
void L6208_SetDirection | ( | motorDir_t | dir ) | [protected] |
Specify the direction.
- Parameters:
-
[in] dir FORWARD or BACKWARD
- Note:
- In velocity mode a direction change forces the device to stop and then run in the new direction. In position mode, if the device is running, a direction change will generate an error.
- Return values:
-
None
Definition at line 653 of file l6208_class.cpp.
void L6208_SetHome | ( | void | ) | [protected] |
Set current position to be the home position.
- Return values:
-
None
Definition at line 715 of file l6208_class.cpp.
void L6208_SetMark | ( | void | ) | [protected] |
Set current position to be the mark position.
- Return values:
-
None
Definition at line 731 of file l6208_class.cpp.
bool L6208_SetMaxSpeed | ( | uint16_t volatile | newSpeed ) | [protected] |
Set the user selected maximum speed in step/s and step/tick for full, half and wave modes in microsteps/s and microsteps/tick for microstep modes.
- Parameters:
-
[in] newSpeed speed value (step/s or microstep/s)
- Return values:
-
TRUE
- Note:
- One microstep is 1/16 step
Definition at line 744 of file l6208_class.cpp.
void L6208_SetMicrostepSample2Scale | ( | uint8_t | value ) | [protected] |
Set the number of micro stepping waveform samples to rescale.
- Parameters:
-
[in] value number of micro stepping waveform samples
- Return values:
-
None
Definition at line 1576 of file l6208_class.cpp.
void L6208_SetMicrostepSample2Update | ( | uint8_t | value ) | [protected] |
Set the number of micro stepping waveform samples to update into scanning.
- Parameters:
-
[in] value number of micro stepping waveform samples
- Return values:
-
None
Definition at line 1590 of file l6208_class.cpp.
bool L6208_SetMinSpeed | ( | uint16_t volatile | newSpeed ) | [protected] |
Set the user selected minimum speed in step/s and step/tick for full, half and wave modes in microsteps/s and microsteps/tick for microstep modes.
- Parameters:
-
[in] newSpeed speed value (step/s or microstep/s)
- Return values:
-
TRUE
- Note:
- One microstep is 1/16 step
Definition at line 765 of file l6208_class.cpp.
void L6208_SetMotionState | ( | motorState_t | newMotionState ) | [protected] |
Set the stepper state machine index.
- Parameters:
-
[in] newMotionState
- Return values:
-
None
Definition at line 1606 of file l6208_class.cpp.
bool L6208_SetSpeed | ( | uint16_t | newSpeed, |
uint32_t volatile * | pSpeed | ||
) | [protected] |
Set the user selected speed in step/tick.
- Parameters:
-
[in] newSpeed speed value (step/s) [in] pSpeed pointer to the selected speed field
- Return values:
-
return FALSE if the speed is too low or too high or if the device is running in position mode, else TRUE
Definition at line 1619 of file l6208_class.cpp.
bool L6208_SetStepMode | ( | motorStepMode_t | stepMode ) | [protected] |
Set the step mode.
- Parameters:
-
[in] stepMode
- Return values:
-
true if the command is successfully executed, else false
- Note:
- Every time the step mode is changed, the step state machine is reset
Definition at line 784 of file l6208_class.cpp.
void L6208_SetStopMode | ( | motorStopMode_t | stopMode ) | [protected] |
Select the mode to stop the motor.
When the motor is stopped, if autoHiZ is TRUE, the power bridges are disabled if autoHiZ is FALSE, the power bridges are kept enabled.
- Parameters:
-
[in] stopMode HOLD_MODE to let power bridge enabled
- Return values:
-
None
Definition at line 859 of file l6208_class.cpp.
void L6208_SetSysFlag | ( | uint32_t | mask ) | [protected] |
Set the bit/s of flags according to the specified mask.
- Parameters:
-
[in] mask flag bit mask
- Return values:
-
None
Definition at line 1649 of file l6208_class.cpp.
bool L6208_SoftStop | ( | void | ) | [protected] |
Stop the motor by using the device deceleration and set deceleration torque.
- Return values:
-
true if the command is successfully executed, else false
- Note:
- .
Definition at line 876 of file l6208_class.cpp.
bool L6208_StartMovement | ( | void | ) | [protected] |
Stepper motor start command.
- Return values:
-
true on correct command execution
Definition at line 1658 of file l6208_class.cpp.
void L6208_TickHandler | ( | void | ) | [protected] |
Handle the device state machine at each tick timer pulse end.
- Return values:
-
None
Definition at line 887 of file l6208_class.cpp.
void L6208_UpdateScanWaveformTable | ( | void | ) | [protected] |
Update the micro stepping waveform samples table with the values previously scaled with current selected torque and tick period.
- Return values:
-
None
Definition at line 1727 of file l6208_class.cpp.
void L6208_UstepWaveformHandling | ( | void | ) | [protected] |
Check if there are waveform samples to rescale and if so, perform the rescaling.
- Return values:
-
None
Definition at line 1745 of file l6208_class.cpp.
bool L6208_VectorCalc | ( | uint8_t | newTorque ) | [protected] |
Set the current torque value (Vref)
- Parameters:
-
[in] newTorque Selected torque value
- Return values:
-
always TRUE
Definition at line 1767 of file l6208_class.cpp.
bool L6208_VrefPwmComputePulseWidth | ( | uint8_t | bridgeId, |
uint16_t | value, | ||
bool | valueIsPwmDutyCycle | ||
) | [protected] |
Compute the pulse width of VREFA or VREFB PWM.
- Parameters:
-
[in] bridgeId 0 for BRIDGE_A 1 for BRIDGE_B [in] value pulse length in 1/256th of microsecond or PWM duty cycle: 0 - 100 % [in] valueIsPwmDutyCycle must be TRUE if value is a PWM duty cycle
- Return values:
-
FALSE if wrong timer handle is used, else TRUE
Definition at line 1814 of file l6208_class.cpp.
uint32_t L6208_VrefPwmGetFreq | ( | void | ) | [protected] |
Get the frequency of VREFA and VREFB PWM.
- Return values:
-
the frequency of VREFA and VREFB PWM in Hz
- Note:
Definition at line 1183 of file l6208_class.cpp.
void L6208_VrefPwmSetFreq | ( | uint32_t | newFreq ) | [protected] |
Set the frequency of the VREFA and VREFB PWM.
- Parameters:
-
[in] newFreq in Hz
- Return values:
-
None
- Note:
Definition at line 1194 of file l6208_class.cpp.
void L6208_VrefPwmUpdatePulseWidth | ( | void | ) | [protected] |
Update the pulse width of VREFA or VREFB PWM.
- Parameters:
-
None
- Return values:
-
None
Definition at line 1843 of file l6208_class.cpp.
void L6208_WaitWhileActive | ( | void | ) | [protected] |
virtual void Move | ( | direction_t | direction, |
unsigned int | steps | ||
) | [virtual] |
Moving the motor towards a specified direction for a certain number of steps.
- Parameters:
-
direction The direction of rotation. steps The desired number of steps.
- Return values:
-
None.
Definition at line 423 of file l6208_class.h.
virtual int ReadID | ( | uint8_t * | id = NULL ) |
[virtual] |
Getting the ID of the component.
- Parameters:
-
id Pointer to an allocated variable to store the ID into.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 166 of file l6208_class.h.
virtual void ReleaseReset | ( | void | ) | [virtual] |
Release the L6208 reset (Reset pin set to high level).
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 601 of file l6208_class.h.
virtual void Reset | ( | void | ) | [virtual] |
Reset the device with current step mode, resets current speed, positions and microstep variables.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 612 of file l6208_class.h.
virtual void ResetDevice | ( | void | ) | [virtual] |
Reset the L6208 (Reset pin set to low level).
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 622 of file l6208_class.h.
virtual void Run | ( | direction_t | direction ) | [virtual] |
Running the motor towards a specified direction.
- Parameters:
-
direction The direction of rotation.
- Return values:
-
None.
Definition at line 412 of file l6208_class.h.
virtual bool SetAcceleration | ( | unsigned int | acceleration ) | [virtual] |
Setting the acceleration in pps^2.
- Parameters:
-
acceleration The acceleration in pps/s^2.
- Return values:
-
true in case of success, "false" otherwise.
Definition at line 331 of file l6208_class.h.
virtual void SetDecayMode | ( | motorDecayMode_t | decayMode ) | [virtual] |
Set the motor decay mode.
- Parameters:
-
decayMode The desired decay mode (SLOW_DECAY or FAST_DECAY).
- Return values:
-
None.
Definition at line 632 of file l6208_class.h.
virtual bool SetDeceleration | ( | unsigned int | deceleration ) | [virtual] |
Setting the deceleration in pps^2.
- Parameters:
-
deceleration The deceleration in pps^2.
- Return values:
-
true in case of success, "false" otherwise.
Definition at line 348 of file l6208_class.h.
virtual void SetDirection | ( | direction_t | direction ) | [virtual] |
Set the motor direction.
- Parameters:
-
direction The desired direction.
- Return values:
-
None.
Definition at line 642 of file l6208_class.h.
virtual void SetFreqVrefPwm | ( | uint32_t | frequency ) | [virtual] |
Set the frequency of the VREFA and VREFB PWM.
- Parameters:
-
frequency in Hz
- Return values:
-
None.
Definition at line 652 of file l6208_class.h.
virtual void SetHome | ( | void | ) | [virtual] |
Setting the current position to be the home position.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 277 of file l6208_class.h.
virtual void SetMark | ( | void | ) | [virtual] |
Setting the current position to be the marked position.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 287 of file l6208_class.h.
virtual bool SetMaxSpeed | ( | unsigned int | speed ) | [virtual] |
Setting the maximum speed in pps.
- Parameters:
-
speed The maximum speed in pps.
- Return values:
-
true in case of success, "false" otherwise.
Definition at line 297 of file l6208_class.h.
virtual bool SetMinSpeed | ( | unsigned int | speed ) | [virtual] |
Setting the minimum speed in pps.
- Parameters:
-
speed The minimum speed in pps.
- Return values:
-
true in case of success, "false" otherwise.
Definition at line 314 of file l6208_class.h.
virtual bool SetStepMode | ( | step_mode_t | step_mode ) | [virtual] |
Setting the Step Mode.
- Parameters:
-
step_mode The Step Mode.
- Return values:
-
true in case of success, "false" otherwise.
- Note:
- step_mode can be one of the following: + STEP_MODE_FULL + STEP_MODE_WAVE + STEP_MODE_HALF + STEP_MODE_1_4 + STEP_MODE_1_8 + STEP_MODE_1_16
Definition at line 372 of file l6208_class.h.
virtual void SetStopMode | ( | motorStopMode_t | stopMode ) | [virtual] |
Set the motor stop mode.
- Parameters:
-
stopMode The desired stop mode (HOLD_MODE or HIZ_MODE).
- Return values:
-
None.
Definition at line 662 of file l6208_class.h.
virtual void SoftHiZ | ( | void | ) | [virtual] |
Disabling the power bridge after performing a deceleration to zero.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 453 of file l6208_class.h.
virtual void SoftStop | ( | void | ) | [virtual] |
Stopping the motor through an immediate deceleration up to zero speed.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 433 of file l6208_class.h.
virtual void WaitWhileActive | ( | void | ) | [virtual] |
Waiting while the motor is active.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 483 of file l6208_class.h.
Field Documentation
uint16_t microTable1[L6208_USTEPS_PER_QUARTER_PERIOD *3+1] [protected] |
waveform scanning microstepping PWM period sample arrays for VREFA wave
Definition at line 1167 of file l6208_class.h.
uint16_t* pMicroTable2 [protected] |
waveform scanning microstepping PWM period sample array for VREFB wave
Definition at line 1169 of file l6208_class.h.
const uint16_t RefMicroTable [static, protected] |
{ 0,3212,6393,9512,12540,15447,18205,20788,23170,25330,27246,28899,30274,31357,32138,32610, 32768,32610,32138,31357,30274,28899,27246,25330,23170,20788,18205,15447,12540,9512,6393,3212, 0,3212,6393,9512,12540,15447,18205,20788,23170,25330,27246,28899,30274,31357,32138,32610 }
RefMicroTable values are 2^L6208_SINE_WAVEFORM_POWER_OF_TWO_MAX_VALUE*|sin(n/16*PI/2)| where n is the index in the table.
Definition at line 1173 of file l6208_class.h.
uint16_t updatedMicroTable[L6208_USTEPS_PER_QUARTER_PERIOD+1] [protected] |
microstepping PWM period and torque scaled waveform samples array
Definition at line 1165 of file l6208_class.h.
Generated on Thu Jul 21 2022 19:36:08 by 1.7.2