Official interfaces for ST components.
Dependents: X_NUCLEO_IKS01A1 mDot_X_NUCLEO_IKS01A1 53L0A1 X_NUCLEO_IKS01A1 ... more
Fork of ST_INTERFACES by
StepperMotor Class Reference
An abstract class for StepperMotor components. More...
#include <StepperMotor.h>
Inherits Component.
Public Types | |
enum | direction_t |
Rotation modes. More... | |
enum | step_mode_t |
Step modes. More... | |
Public Member Functions | |
virtual unsigned int | get_status (void)=0 |
Getting the status. | |
virtual signed int | get_position (void)=0 |
Getting the position. | |
virtual signed int | get_mark (void)=0 |
Getting the marked position. | |
virtual unsigned int | get_speed (void)=0 |
Getting the current speed in pps. | |
virtual unsigned int | get_max_speed (void)=0 |
Getting the maximum speed in pps. | |
virtual unsigned int | get_min_speed (void)=0 |
Getting the minimum speed in pps. | |
virtual unsigned int | get_acceleration (void)=0 |
Getting the acceleration in pps^2. | |
virtual unsigned int | get_deceleration (void)=0 |
Getting the deceleration in pps^2. | |
virtual direction_t | get_direction (void)=0 |
Getting the direction of rotation. | |
virtual void | set_home (void)=0 |
Setting the current position to be the home position. | |
virtual void | set_mark (void)=0 |
Setting the current position to be the marked position. | |
virtual bool | set_max_speed (unsigned int speed)=0 |
Setting the maximum speed in pps. | |
virtual bool | set_min_speed (unsigned int speed)=0 |
Setting the minimum speed in pps. | |
virtual bool | set_acceleration (unsigned int acceleration)=0 |
Setting the acceleration in pps^2. | |
virtual bool | set_deceleration (unsigned int deceleration)=0 |
Setting the deceleration in pps^2. | |
virtual bool | set_step_mode (step_mode_t step_mode)=0 |
Setting the Step Mode. | |
virtual void | go_to (signed int position)=0 |
Going to a specified position. | |
virtual void | go_home (void)=0 |
Going to the home position. | |
virtual void | go_mark (void)=0 |
Going to the marked position. | |
virtual void | run (direction_t direction)=0 |
Running the motor towards a specified direction. | |
virtual void | move (direction_t direction, unsigned int steps)=0 |
Moving the motor towards a specified direction for a certain number of steps. | |
virtual void | soft_stop (void)=0 |
Stopping the motor through an immediate deceleration up to zero speed. | |
virtual void | hard_stop (void)=0 |
Stopping the motor through an immediate infinite deceleration. | |
virtual void | soft_hiz (void)=0 |
Disabling the power bridge after performing a deceleration to zero. | |
virtual void | hard_hiz (void)=0 |
Disabling the power bridge immediately. | |
virtual void | wait_while_active (void)=0 |
Waiting while the motor is active. | |
virtual | ~StepperMotor () |
Destructor. | |
virtual int | init (void *init)=0 |
Initializing the component. | |
virtual int | read_id (uint8_t *id)=0 |
Getting the ID of the component. |
Detailed Description
An abstract class for StepperMotor components.
Definition at line 56 of file StepperMotor.h.
Member Enumeration Documentation
enum direction_t |
Rotation modes.
Definition at line 62 of file StepperMotor.h.
enum step_mode_t |
Step modes.
Definition at line 70 of file StepperMotor.h.
Constructor & Destructor Documentation
virtual ~StepperMotor | ( | ) | [virtual] |
Destructor.
Definition at line 270 of file StepperMotor.h.
Member Function Documentation
virtual unsigned int get_acceleration | ( | void | ) | [pure virtual] |
Getting the acceleration in pps^2.
- Parameters:
-
None.
- Return values:
-
The acceleration in pps^2.
virtual unsigned int get_deceleration | ( | void | ) | [pure virtual] |
Getting the deceleration in pps^2.
- Parameters:
-
None.
- Return values:
-
The deceleration in pps^2.
virtual direction_t get_direction | ( | void | ) | [pure virtual] |
Getting the direction of rotation.
- Parameters:
-
None.
- Return values:
-
The direction of rotation.
virtual signed int get_mark | ( | void | ) | [pure virtual] |
Getting the marked position.
- Parameters:
-
None.
- Return values:
-
The marked position.
virtual unsigned int get_max_speed | ( | void | ) | [pure virtual] |
Getting the maximum speed in pps.
- Parameters:
-
None.
- Return values:
-
The maximum speed in pps.
virtual unsigned int get_min_speed | ( | void | ) | [pure virtual] |
Getting the minimum speed in pps.
- Parameters:
-
None.
- Return values:
-
The minimum speed in pps.
virtual signed int get_position | ( | void | ) | [pure virtual] |
Getting the position.
- Parameters:
-
None.
- Return values:
-
The position.
virtual unsigned int get_speed | ( | void | ) | [pure virtual] |
Getting the current speed in pps.
- Parameters:
-
None.
- Return values:
-
The current speed in pps.
virtual unsigned int get_status | ( | void | ) | [pure virtual] |
Getting the status.
- Parameters:
-
None.
- Return values:
-
The status.
virtual void go_home | ( | void | ) | [pure virtual] |
Going to the home position.
- Parameters:
-
None.
- Return values:
-
None.
virtual void go_mark | ( | void | ) | [pure virtual] |
Going to the marked position.
- Parameters:
-
None.
- Return values:
-
None.
virtual void go_to | ( | signed int | position ) | [pure virtual] |
Going to a specified position.
- Parameters:
-
position The desired position.
- Return values:
-
None.
virtual void hard_hiz | ( | void | ) | [pure virtual] |
Disabling the power bridge immediately.
- Parameters:
-
None.
- Return values:
-
None.
virtual void hard_stop | ( | void | ) | [pure virtual] |
Stopping the motor through an immediate infinite deceleration.
- Parameters:
-
None.
- Return values:
-
None.
virtual int init | ( | void * | init ) | [pure virtual, inherited] |
Initializing the component.
- Parameters:
-
[in] init pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
virtual void move | ( | direction_t | direction, |
unsigned int | steps | ||
) | [pure 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.
virtual int read_id | ( | uint8_t * | id ) | [pure virtual, inherited] |
Getting the ID of the component.
- Parameters:
-
[out] id pointer to an allocated variable to store the ID into.
- Return values:
-
0 in case of success, an error code otherwise.
virtual void run | ( | direction_t | direction ) | [pure virtual] |
Running the motor towards a specified direction.
- Parameters:
-
direction The direction of rotation.
- Return values:
-
None.
virtual bool set_acceleration | ( | unsigned int | acceleration ) | [pure virtual] |
Setting the acceleration in pps^2.
- Parameters:
-
acceleration The acceleration in pps^2.
- Return values:
-
true in case of success, "false" otherwise.
virtual bool set_deceleration | ( | unsigned int | deceleration ) | [pure virtual] |
Setting the deceleration in pps^2.
- Parameters:
-
deceleration The deceleration in pps^2.
- Return values:
-
true in case of success, "false" otherwise.
virtual void set_home | ( | void | ) | [pure virtual] |
Setting the current position to be the home position.
- Parameters:
-
None.
- Return values:
-
None.
virtual void set_mark | ( | void | ) | [pure virtual] |
Setting the current position to be the marked position.
- Parameters:
-
None.
- Return values:
-
None.
virtual bool set_max_speed | ( | unsigned int | speed ) | [pure virtual] |
Setting the maximum speed in pps.
- Parameters:
-
speed The maximum speed in pps.
- Return values:
-
true in case of success, "false" otherwise.
virtual bool set_min_speed | ( | unsigned int | speed ) | [pure virtual] |
Setting the minimum speed in pps.
- Parameters:
-
speed The minimum speed in pps.
- Return values:
-
true in case of success, "false" otherwise.
virtual bool set_step_mode | ( | step_mode_t | step_mode ) | [pure virtual] |
Setting the Step Mode.
- Parameters:
-
step_mode The Step Mode.
- Return values:
-
true in case of success, "false" otherwise.
virtual void soft_hiz | ( | void | ) | [pure virtual] |
Disabling the power bridge after performing a deceleration to zero.
- Parameters:
-
None.
- Return values:
-
None.
virtual void soft_stop | ( | void | ) | [pure virtual] |
Stopping the motor through an immediate deceleration up to zero speed.
- Parameters:
-
None.
- Return values:
-
None.
virtual void wait_while_active | ( | void | ) | [pure virtual] |
Waiting while the motor is active.
- Parameters:
-
None.
- Return values:
-
None.
Generated on Tue Jul 12 2022 18:43:53 by 1.7.2