Expansion SW library to control a bipolar stepper motor using X-NUCLEO-IHM05A1 expansion board based on L6208.

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_IHM05A1 TAU_ROTATING_PLATFORM_IHM05A1 Amaldi_13_Exercise_IHM05A1 Amaldi_13_Exercise_IHM05A1motore ... more

Fork of X-NUCLEO-IHM05A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

L6208 Class Reference

Class representing a L6208 component. More...

#include <L6208.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 read_id (uint8_t *id=NULL)
 Getting the ID of the component.
virtual unsigned int get_status (void)
 Public functions inherited from the StepperMotor Class.
virtual signed int get_position (void)
 Getting the position.
virtual signed int get_mark (void)
 Getting the marked position.
virtual unsigned int get_speed (void)
 Getting the current speed in pps.
virtual unsigned int get_max_speed (void)
 Getting the maximum speed in pps.
virtual unsigned int get_min_speed (void)
 Getting the minimum speed in pps.
virtual unsigned int get_acceleration (void)
 Getting the acceleration in pps^2.
virtual unsigned int get_deceleration (void)
 Getting the deceleration in pps^2.
virtual direction_t get_direction (void)
 Getting the direction of rotation.
virtual void set_home (void)
 Setting the current position to be the home position.
virtual void set_mark (void)
 Setting the current position to be the marked position.
virtual bool set_max_speed (unsigned int speed)
 Setting the maximum speed in pps.
virtual bool set_min_speed (unsigned int speed)
 Setting the minimum speed in pps.
virtual bool set_acceleration (unsigned int acceleration)
 Setting the acceleration in pps^2.
virtual bool set_deceleration (unsigned int deceleration)
 Setting the deceleration in pps^2.
virtual bool set_step_mode (step_mode_t step_mode)
 Setting the Step Mode.
virtual void go_to (signed int position)
 Going to a specified position.
virtual void go_home (void)
 Going to the home position.
virtual void go_mark (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 soft_stop (void)
 Stopping the motor through an immediate deceleration up to zero speed.
virtual void hard_stop (void)
 Stopping the motor through an immediate infinite deceleration.
virtual void soft_hiz (void)
 Disabling the power bridge after performing a deceleration to zero.
virtual void hard_hiz (void)
 Disabling the power bridge immediately.
virtual void wait_while_active (void)
 Waiting while the motor is active.
virtual void attach_error_handler (void(*fptr)(uint16_t error))
 Public functions NOT inherited.
virtual unsigned int check_status_hw (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 get_decay_mode ()
 Getting the motor decay mode.
virtual uint32_t get_freq_vref_pwm (void)
 Set the frequency of the VREFA and VREFB PWM.
virtual unsigned int get_fw_version (void)
 Getting the version of the firmware.
virtual step_mode_t get_step_mode (void)
 Getting the motor step mode.
virtual motorStopMode_t get_stop_mode (void)
 Getting the motor stop mode.
virtual void go_to (direction_t direction, signed int position)
 Going to a specified position with a specificied direction.
virtual void release_reset (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 reset_device (void)
 Reset the L6208 (Reset pin set to low level).
virtual void set_decay_mode (motorDecayMode_t decayMode)
 Set the motor decay mode.
virtual void set_direction (direction_t direction)
 Set the motor direction.
virtual void set_freq_vref_pwm (uint32_t frequency)
 Set the frequency of the VREFA and VREFB PWM.
virtual void set_stop_mode (motorStopMode_t stopMode)
 Set the motor stop mode.
void attach_flag_irq (void(*fptr)(void))
 Attaching an interrupt handler to the FLAG interrupt.
void enable_flag_irq (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_get_decay_mode (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.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_pinpin name of the EN pin of the component.
reset_pinpin name of the RESET pin of the component.
direction_pinpin name of the CW_CCW pin of the component.
half_full_pinpin name of the HALF_FULL pin of the component.
control_pinpin name of the CONTROL pin of the component.
clock_pinpin name of the CLOCK pin of the component.
vrefA_pwm_pinpin name of the PWM connected to the VREFA pin of the component.
vrefB_pwm_pinpin name of the PWM connected to the VREFB pin of the component.

Definition at line 88 of file L6208.h.

virtual ~L6208 ( void   ) [virtual]

Destructor.

Definition at line 121 of file L6208.h.


Member Function Documentation

virtual void attach_error_handler ( void(*)(uint16_t error)  fptr ) [virtual]

Public functions NOT inherited.

Attaching an error handler.

Parameters:
fptrAn error handler.
Return values:
None.

Definition at line 497 of file L6208.h.

void attach_flag_irq ( void(*)(void)  fptr )

Attaching an interrupt handler to the FLAG interrupt.

Parameters:
fptrAn interrupt handler.
Return values:
None.

Definition at line 710 of file L6208.h.

virtual unsigned int check_status_hw ( 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:
Oneif 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.h.

virtual void disable ( void   ) [virtual]

Disabling the device.

Parameters:
None.
Return values:
None.

Definition at line 526 of file L6208.h.

virtual void enable ( void   ) [virtual]

Enabling the device.

Parameters:
None.
Return values:
None.

Definition at line 536 of file L6208.h.

void enable_flag_irq ( void   )

Enabling the FLAG interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 721 of file L6208.h.

virtual unsigned int get_acceleration ( void   ) [virtual]

Getting the acceleration in pps^2.

Parameters:
None.
Return values:
Theacceleration in pps^2.

Definition at line 240 of file L6208.h.

virtual motorDecayMode_t get_decay_mode (  ) [virtual]

Getting the motor decay mode.

Parameters:
None.
Return values:
Themotor decay mode.

Definition at line 546 of file L6208.h.

virtual unsigned int get_deceleration ( void   ) [virtual]

Getting the deceleration in pps^2.

Parameters:
None.
Return values:
Thedeceleration in pps^2.

Definition at line 250 of file L6208.h.

virtual direction_t get_direction ( void   ) [virtual]

Getting the direction of rotation.

Parameters:
None.
Return values:
Thedirection of rotation.

Definition at line 260 of file L6208.h.

virtual uint32_t get_freq_vref_pwm ( void   ) [virtual]

Set the frequency of the VREFA and VREFB PWM.

Parameters:
frequencyin Hz
Return values:
None.

Definition at line 556 of file L6208.h.

virtual unsigned int get_fw_version ( void   ) [virtual]

Getting the version of the firmware.

Parameters:
None.
Return values:
Theversion of the firmware.

Definition at line 566 of file L6208.h.

virtual signed int get_mark ( void   ) [virtual]

Getting the marked position.

Parameters:
None.
Return values:
Themarked position.

Definition at line 200 of file L6208.h.

virtual unsigned int get_max_speed ( void   ) [virtual]

Getting the maximum speed in pps.

Parameters:
None.
Return values:
Themaximum speed in pps.

Definition at line 220 of file L6208.h.

virtual unsigned int get_min_speed ( void   ) [virtual]

Getting the minimum speed in pps.

Parameters:
None.
Return values:
Theminimum speed in pps.

Definition at line 230 of file L6208.h.

virtual signed int get_position ( void   ) [virtual]

Getting the position.

Parameters:
None.
Return values:
Theposition.

Definition at line 190 of file L6208.h.

virtual unsigned int get_speed ( void   ) [virtual]

Getting the current speed in pps.

Parameters:
None.
Return values:
Thecurrent speed in pps.

Definition at line 210 of file L6208.h.

virtual unsigned int get_status ( void   ) [virtual]

Public functions inherited from the StepperMotor Class.

Getting the value of the motor state .

Parameters:
None.
Return values:
Themotor state accoring to motorState_t in motor.h

Definition at line 180 of file L6208.h.

virtual step_mode_t get_step_mode ( void   ) [virtual]

Getting the motor step mode.

Parameters:
None.
Return values:
Themotor step mode.

Definition at line 576 of file L6208.h.

virtual motorStopMode_t get_stop_mode ( void   ) [virtual]

Getting the motor stop mode.

Parameters:
None.
Return values:
Themotor stop mode.

Definition at line 586 of file L6208.h.

virtual void go_home ( void   ) [virtual]

Going to the home position.

Parameters:
None.
Return values:
None.

Definition at line 392 of file L6208.h.

virtual void go_mark ( void   ) [virtual]

Going to the marked position.

Parameters:
None.
Return values:
None.

Definition at line 402 of file L6208.h.

virtual void go_to ( signed int  position ) [virtual]

Going to a specified position.

Parameters:
positionThe desired position.
Return values:
None.

Definition at line 382 of file L6208.h.

virtual void go_to ( direction_t  direction,
signed int  position 
) [virtual]

Going to a specified position with a specificied direction.

Parameters:
directionThe desired direction.
positionThe desired position.
Return values:
None.

Definition at line 597 of file L6208.h.

virtual void hard_hiz ( void   ) [virtual]

Disabling the power bridge immediately.

Parameters:
None.
Return values:
None.

Definition at line 473 of file L6208.h.

virtual void hard_stop ( void   ) [virtual]

Stopping the motor through an immediate infinite deceleration.

Parameters:
None.
Return values:
None.

Definition at line 443 of file L6208.h.

virtual int init ( void *  init = NULL ) [virtual]

Public functions inherited from the Component Class.

Initialize the component.

Parameters:
initPointer to device specific initalization structure.
Return values:
0in case of success, an error code otherwise.

Definition at line 156 of file L6208.h.

void L6208_Board_CLOCK_PIN_Reset ( void   ) [protected]

Reset the clock pin.

Parameters:
None.
Return values:
None.

Definition at line 830 of file L6208.h.

void L6208_Board_CLOCK_PIN_Set ( void   ) [protected]

Set the clock pin.

Parameters:
None.
Return values:
None.

Definition at line 839 of file L6208.h.

void L6208_Board_CONTROL_PIN_Reset ( void   ) [protected]

Reset the control pin.

Parameters:
None.
Return values:
None.

Definition at line 859 of file L6208.h.

void L6208_Board_CONTROL_PIN_Set ( void   ) [protected]

Set the control pin.

Parameters:
None.
Return values:
None.

Definition at line 849 of file L6208.h.

void L6208_Board_Delay ( uint32_t  delay ) [protected]

Making the CPU wait.

Parameters:
None.
Return values:
None.

Definition at line 869 of file L6208.h.

void L6208_Board_DIR_PIN_Reset ( void   ) [protected]

Reset the dir pin.

Parameters:
None.
Return values:
None.

Definition at line 879 of file L6208.h.

void L6208_Board_DIR_PIN_Set ( void   ) [protected]

Set the dir pin.

Parameters:
None.
Return values:
None.

Definition at line 889 of file L6208.h.

void L6208_Board_Disable ( void   ) [protected]

Disable the power bridges (leave the output bridges HiZ).

Parameters:
None.
Return values:
None.

Definition at line 899 of file L6208.h.

void L6208_Board_DisableIrq ( void   ) [protected]

Disabling interrupts.

Parameters:
None.
Return values:
None.

Definition at line 910 of file L6208.h.

void L6208_Board_Enable ( void   ) [protected]

Enable the power bridges (leave the output bridges HiZ).

Parameters:
None.
Return values:
None.

Definition at line 920 of file L6208.h.

void L6208_Board_EnableIrq ( void   ) [protected]

Enabling interrupts.

Parameters:
None.
Return values:
None.

Definition at line 931 of file L6208.h.

void L6208_Board_HALF_FULL_PIN_Reset ( void   ) [protected]

Reset the half full pin.

Parameters:
None.
Return values:
None.

Definition at line 941 of file L6208.h.

void L6208_Board_HALF_FULL_PIN_Set ( void   ) [protected]

Set the half full pin.

Parameters:
None.
Return values:
None.

Definition at line 951 of file L6208.h.

void L6208_Board_ReleaseReset ( void   ) [protected]

Exit the device from reset mode.

Parameters:
None.
Return values:
None.

Definition at line 968 of file L6208.h.

void L6208_Board_Reset ( void   ) [protected]

Put the device in reset mode.

Parameters:
None.
Return values:
None.

Definition at line 978 of file L6208.h.

uint32_t L6208_Board_TickGetFreq ( void   ) [protected]

Get the tick timer frequency in Hz.

Parameters:
None.
Return values:
Thetick timer frequency in Hz.

Definition at line 988 of file L6208.h.

void L6208_Board_TickInit ( void   ) [protected]

Initialising the tick.

Parameters:
None.
Return values:
None.

Definition at line 998 of file L6208.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:
frequencythe frequency of the tick.
Return values:
None.

Definition at line 1006 of file L6208.h.

void L6208_Board_TickStop ( void   ) [protected]

Stopping the tick.

Parameters:
None.
Return values:
None.

Definition at line 1021 of file L6208.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 961 of file L6208.h.

void L6208_Board_VrefPwmSetPulseWidthA ( uint8_t  pulseWidthInUs ) [protected]

Set the pulse width of the VREFA PWM.

Parameters:
[in]pulseWidthInUspulse width of the PWM in microsecond.
Return values:
None.

Definition at line 1031 of file L6208.h.

void L6208_Board_VrefPwmSetPulseWidthB ( uint8_t  pulseWidthInUs ) [protected]

Set the pulse width of the VREFB PWM.

Parameters:
[in]pulseWidthInUspulse width of the PWM in microsecond.
Return values:
None.

Definition at line 1041 of file L6208.h.

bool L6208_Board_VrefPwmStart ( uint8_t  bridgeId,
uint16_t  pwmPeriod 
) [protected]

Start the timer for the VREFA or VREFB PWM.

Parameters:
[in]bridgeId0 for BRIDGE_A 1 for BRIDGE_B
[in]pwmPeriodperiod of the PWM used to generate the reference voltage for the bridge.
Return values:
truein 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 1057 of file L6208.h.

bool L6208_Board_VrefPwmStop ( uint8_t  bridgeId ) [protected]

Stop the timer for the VREFA or VREFB PWM.

Parameters:
[in]bridgeId0 for BRIDGE_A 1 for BRIDGE_B
Return values:
truein case of success, "false" otherwise.

Definition at line 1083 of file L6208.h.

void L6208_ClearSysFlag ( uint32_t  mask ) [protected]

Clear the bit/s of flags according to the specified mask.

Parameters:
[in]maskflag bit mask
Return values:
None

Definition at line 1237 of file L6208.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:
accOrDecRateacceleration/deceleration rate in steps per second per second (steps/sec^2)
Return values:
endposition or 0xFFFFFFFF on error

Definition at line 1256 of file L6208.cpp.

uint16_t L6208_ConvertAcceDecelRateValue ( uint16_t  newAccOrDecRate ) [protected]

Compute the acceleration/deceleration speed increment value.

Parameters:
[in]newAccOrDecRateacceleration or deceleration value (steps/s^2) greater or equal than 24
Return values:
thespeed (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 1306 of file L6208.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.cpp.

void L6208_DoAccel ( void   ) [protected]

Compute next position and speed according to the acceleration rate.

Return values:
None

Definition at line 1336 of file L6208.cpp.

void L6208_DoDecel ( void   ) [protected]

Compute next position and speed according to the deceleration rate.

Return values:
None

Definition at line 1357 of file L6208.cpp.

void L6208_DoRun ( void   ) [protected]

Compute next position by adding current speed.

Return values:
None

Definition at line 1379 of file L6208.cpp.

void L6208_Enable ( void   ) [protected]

Enable the power bridges.

Return values:
None

Definition at line 172 of file L6208.cpp.

void L6208_ErrorHandler ( uint16_t  error ) [protected]

Error handler which calls the user callback (if defined)

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

Definition at line 153 of file L6208.cpp.

motorDecayMode_t L6208_get_decay_mode ( void   ) [protected]

Get the motor decay mode.

Return values:
decaymode

Definition at line 217 of file L6208.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:
thestepper acceleration rate in step/s^2 or microstep/s^2
Note:

Definition at line 185 of file L6208.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:
returnthe current speed in step/s or microstep/s
Note:

Definition at line 197 of file L6208.cpp.

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:
thestepper deceleration rate in step/s^2 or microstep/s^2
Note:

Definition at line 236 of file L6208.cpp.

motorDir_t L6208_GetDirection ( void   ) [protected]

Get the motor current direction.

Return values:
direction

Definition at line 245 of file L6208.cpp.

uint32_t L6208_GetFwVersion ( void   ) [protected]

Return the FW version.

Return values:
FWversion

Definition at line 261 of file L6208.cpp.

int32_t L6208_GetMark ( void   ) [protected]

Get the mark position (32b signed)

Return values:
markposition

Definition at line 270 of file L6208.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:
returnthe max speed in step/s or microstep/s
Note:

Definition at line 282 of file L6208.cpp.

uint8_t L6208_GetMicrostepSample2Scale ( void   ) [protected]

Get number of samples to rescale.

Return values:
uStepsample2scalethe number of micro stepping waveform samples to rescale

Definition at line 1388 of file L6208.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:
returnthe min speed in step/s or microstep/s
Note:

Definition at line 294 of file L6208.cpp.

motorState_t L6208_GetMotionState ( void   ) [protected]

Get the stepper state machine index.

Return values:
oneof the stepper state machine index in the motorState_t enum

Definition at line 303 of file L6208.cpp.

int32_t L6208_GetPosition ( void   ) [protected]

Get the current position (32b signed)

Return values:
currentabsoulte position

Definition at line 313 of file L6208.cpp.

motorStepMode_t L6208_GetStepMode ( void   ) [protected]

Get the motor step mode.

Return values:
stepmode

Definition at line 322 of file L6208.cpp.

motorStopMode_t L6208_GetStopMode ( void   ) [protected]

Get the selected stop mode.

Return values:
theselected stop mode

Definition at line 331 of file L6208.cpp.

void L6208_GoHome ( void   ) [protected]

Go to the home position.

Return values:
None

Definition at line 347 of file L6208.cpp.

void L6208_GoMark ( void   ) [protected]

Go to the Mark position.

Return values:
None

Definition at line 356 of file L6208.cpp.

void L6208_GoTo ( int32_t  abs_pos ) [protected]

move the motor to the absolute position using the shortest path

Parameters:
[in]abs_pos32 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 373 of file L6208.cpp.

void L6208_GoToDir ( motorDir_t  direction,
int32_t  abs_pos 
) [protected]

move the motor to the absolute position

Parameters:
[in]directionFORWARD or BACKWARD
[in]abs_pos32 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 421 of file L6208.cpp.

void L6208_HardHiZ ( void   ) [protected]

Immediately stop the motor and disables the power bridges.

Return values:
None

Definition at line 459 of file L6208.cpp.

void L6208_HardStop ( void   ) [protected]

Immediately stop the motor and keeps holding torque.

Return values:
None

Definition at line 482 of file L6208.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 1418 of file L6208.cpp.

status_t L6208_Init ( void *  pInit ) [protected]

Start the L6208 library.

Parameters:
[in]pInitpointer to the initialization data
Return values:
COMPONENT_OKin case of success.

Definition at line 82 of file L6208.cpp.

bool L6208_IsSysFlag ( uint32_t  mask ) [protected]

Check the bit/s of flags according to the specified mask.

Parameters:
[in]maskflag bit mask
Return values:
TRUEif the bit of the mask are set

Definition at line 1462 of file L6208.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]directionFORWARD or BACKWARD
[in]stepCount32 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 509 of file L6208.cpp.

void L6208_ReleaseReset ( void   ) [protected]

Release the L6208 reset (Reset pin set to high level)

Return values:
None

Definition at line 536 of file L6208.cpp.

void L6208_Reset ( void   ) [protected]

Reset the L6208 (Reset pin set to low level)

Return values:
None

Definition at line 545 of file L6208.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 557 of file L6208.cpp.

void L6208_ResetSteps ( void   ) [protected]

Stepper driver device step state reset subroutine.

Return values:
None

Definition at line 1471 of file L6208.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]directionFORWARD or BACKWARD
Return values:
None

Definition at line 571 of file L6208.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]sampleIndexsample Index
Return values:
scaledsample value

Definition at line 1489 of file L6208.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 1508 of file L6208.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]newAccnew acceleration rate in step/s^2 or microstep/s^2
Return values:
TRUE
Note:

Definition at line 594 of file L6208.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 614 of file L6208.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]newDecnew deceleration rate in step/s^2 or microstep/s^2
Return values:
TRUE
Note:

Definition at line 636 of file L6208.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:
pInitDevicePrmpointer onto the structure containing values to initialize the device parameters.
Return values:
None

Definition at line 1525 of file L6208.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 1557 of file L6208.cpp.

void L6208_SetDirection ( motorDir_t  dir ) [protected]

Specify the direction.

Parameters:
[in]dirFORWARD 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 659 of file L6208.cpp.

void L6208_SetHome ( void   ) [protected]

Set current position to be the home position.

Return values:
None

Definition at line 721 of file L6208.cpp.

void L6208_SetMark ( void   ) [protected]

Set current position to be the mark position.

Return values:
None

Definition at line 737 of file L6208.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]newSpeedspeed value (step/s or microstep/s)
Return values:
TRUE
Note:
One microstep is 1/16 step

Definition at line 750 of file L6208.cpp.

void L6208_SetMicrostepSample2Scale ( uint8_t  value ) [protected]

Set the number of micro stepping waveform samples to rescale.

Parameters:
[in]valuenumber of micro stepping waveform samples
Return values:
None

Definition at line 1588 of file L6208.cpp.

void L6208_SetMicrostepSample2Update ( uint8_t  value ) [protected]

Set the number of micro stepping waveform samples to update into scanning.

Parameters:
[in]valuenumber of micro stepping waveform samples
Return values:
None

Definition at line 1602 of file L6208.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]newSpeedspeed value (step/s or microstep/s)
Return values:
TRUE
Note:
One microstep is 1/16 step

Definition at line 771 of file L6208.cpp.

void L6208_SetMotionState ( motorState_t  newMotionState ) [protected]

Set the stepper state machine index.

Parameters:
[in]newMotionState
Return values:
None

Definition at line 1618 of file L6208.cpp.

bool L6208_SetSpeed ( uint16_t  newSpeed,
uint32_t volatile *  pSpeed 
) [protected]

Set the user selected speed in step/tick.

Parameters:
[in]newSpeedspeed value (step/s)
[in]pSpeedpointer to the selected speed field
Return values:
returnFALSE if the speed is too low or too high or if the device is running in position mode, else TRUE

Definition at line 1631 of file L6208.cpp.

bool L6208_SetStepMode ( motorStepMode_t  stepMode ) [protected]

Set the step mode.

Parameters:
[in]stepMode
Return values:
trueif the command is successfully executed, else false
Note:
Every time the step mode is changed, the step state machine is reset

Definition at line 790 of file L6208.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]stopModeHOLD_MODE to let power bridge enabled
Return values:
None

Definition at line 865 of file L6208.cpp.

void L6208_SetSysFlag ( uint32_t  mask ) [protected]

Set the bit/s of flags according to the specified mask.

Parameters:
[in]maskflag bit mask
Return values:
None

Definition at line 1661 of file L6208.cpp.

bool L6208_SoftStop ( void   ) [protected]

Stop the motor by using the device deceleration and set deceleration torque.

Return values:
trueif the command is successfully executed, else false
Note:
.

Definition at line 882 of file L6208.cpp.

bool L6208_StartMovement ( void   ) [protected]

Stepper motor start command.

Return values:
trueon correct command execution

Definition at line 1670 of file L6208.cpp.

void L6208_TickHandler ( void   ) [protected]

Handle the device state machine at each tick timer pulse end.

Return values:
None

Definition at line 893 of file L6208.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 1739 of file L6208.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 1757 of file L6208.cpp.

bool L6208_VectorCalc ( uint8_t  newTorque ) [protected]

Set the current torque value (Vref)

Parameters:
[in]newTorqueSelected torque value
Return values:
alwaysTRUE

Definition at line 1779 of file L6208.cpp.

bool L6208_VrefPwmComputePulseWidth ( uint8_t  bridgeId,
uint16_t  value,
bool  valueIsPwmDutyCycle 
) [protected]

Compute the pulse width of VREFA or VREFB PWM.

Parameters:
[in]bridgeId0 for BRIDGE_A 1 for BRIDGE_B
[in]valuepulse length in 1/256th of microsecond or PWM duty cycle: 0 - 100 %
[in]valueIsPwmDutyCyclemust be TRUE if value is a PWM duty cycle
Return values:
FALSEif wrong timer handle is used, else TRUE

Definition at line 1826 of file L6208.cpp.

uint32_t L6208_VrefPwmGetFreq ( void   ) [protected]

Get the frequency of VREFA and VREFB PWM.

Return values:
thefrequency of VREFA and VREFB PWM in Hz
Note:

Definition at line 1189 of file L6208.cpp.

void L6208_VrefPwmSetFreq ( uint32_t  newFreq ) [protected]

Set the frequency of the VREFA and VREFB PWM.

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

Definition at line 1200 of file L6208.cpp.

void L6208_VrefPwmUpdatePulseWidth ( void   ) [protected]

Update the pulse width of VREFA or VREFB PWM.

Parameters:
None
Return values:
None

Definition at line 1858 of file L6208.cpp.

void L6208_WaitWhileActive ( void   ) [protected]

Lock while motor is running.

Return values:
None

Definition at line 1223 of file L6208.cpp.

virtual void move ( direction_t  direction,
unsigned int  steps 
) [virtual]

Moving the motor towards a specified direction for a certain number of steps.

Parameters:
directionThe direction of rotation.
stepsThe desired number of steps.
Return values:
None.

Definition at line 423 of file L6208.h.

virtual int read_id ( uint8_t *  id = NULL ) [virtual]

Getting the ID of the component.

Parameters:
idPointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.

Definition at line 166 of file L6208.h.

virtual void release_reset ( void   ) [virtual]

Release the L6208 reset (Reset pin set to high level).

Parameters:
None.
Return values:
None.

Definition at line 607 of file L6208.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 618 of file L6208.h.

virtual void reset_device ( void   ) [virtual]

Reset the L6208 (Reset pin set to low level).

Parameters:
None.
Return values:
None.

Definition at line 628 of file L6208.h.

virtual void run ( direction_t  direction ) [virtual]

Running the motor towards a specified direction.

Parameters:
directionThe direction of rotation.
Return values:
None.

Definition at line 412 of file L6208.h.

virtual bool set_acceleration ( unsigned int  acceleration ) [virtual]

Setting the acceleration in pps^2.

Parameters:
accelerationThe acceleration in pps/s^2.
Return values:
truein case of success, "false" otherwise.

Definition at line 331 of file L6208.h.

virtual void set_decay_mode ( motorDecayMode_t  decayMode ) [virtual]

Set the motor decay mode.

Parameters:
decayModeThe desired decay mode (SLOW_DECAY or FAST_DECAY).
Return values:
None.

Definition at line 638 of file L6208.h.

virtual bool set_deceleration ( unsigned int  deceleration ) [virtual]

Setting the deceleration in pps^2.

Parameters:
decelerationThe deceleration in pps^2.
Return values:
truein case of success, "false" otherwise.

Definition at line 348 of file L6208.h.

virtual void set_direction ( direction_t  direction ) [virtual]

Set the motor direction.

Parameters:
directionThe desired direction.
Return values:
None.

Definition at line 648 of file L6208.h.

virtual void set_freq_vref_pwm ( uint32_t  frequency ) [virtual]

Set the frequency of the VREFA and VREFB PWM.

Parameters:
frequencyin Hz
Return values:
None.

Definition at line 658 of file L6208.h.

virtual void set_home ( void   ) [virtual]

Setting the current position to be the home position.

Parameters:
None.
Return values:
None.

Definition at line 277 of file L6208.h.

virtual void set_mark ( void   ) [virtual]

Setting the current position to be the marked position.

Parameters:
None.
Return values:
None.

Definition at line 287 of file L6208.h.

virtual bool set_max_speed ( unsigned int  speed ) [virtual]

Setting the maximum speed in pps.

Parameters:
speedThe maximum speed in pps.
Return values:
truein case of success, "false" otherwise.

Definition at line 297 of file L6208.h.

virtual bool set_min_speed ( unsigned int  speed ) [virtual]

Setting the minimum speed in pps.

Parameters:
speedThe minimum speed in pps.
Return values:
truein case of success, "false" otherwise.

Definition at line 314 of file L6208.h.

virtual bool set_step_mode ( step_mode_t  step_mode ) [virtual]

Setting the Step Mode.

Parameters:
step_modeThe Step Mode.
Return values:
truein 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.h.

virtual void set_stop_mode ( motorStopMode_t  stopMode ) [virtual]

Set the motor stop mode.

Parameters:
stopModeThe desired stop mode (HOLD_MODE or HIZ_MODE).
Return values:
None.

Definition at line 668 of file L6208.h.

virtual void soft_hiz ( void   ) [virtual]

Disabling the power bridge after performing a deceleration to zero.

Parameters:
None.
Return values:
None.

Definition at line 453 of file L6208.h.

virtual void soft_stop ( 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.h.

virtual void wait_while_active ( void   ) [virtual]

Waiting while the motor is active.

Parameters:
None.
Return values:
None.

Definition at line 483 of file L6208.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 1179 of file L6208.h.

uint16_t* pMicroTable2 [protected]

waveform scanning microstepping PWM period sample array for VREFB wave

Definition at line 1181 of file L6208.h.

const uint16_t RefMicroTable [static, protected]
Initial value:
{
  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 1185 of file L6208.h.

uint16_t updatedMicroTable[L6208_USTEPS_PER_QUARTER_PERIOD+1] [protected]

microstepping PWM period and torque scaled waveform samples array

Definition at line 1177 of file L6208.h.