![]() |
![]() |
|
StepperMotorControlLibrary
1.0
|
#include <stdint.h>#include <ti/devices/msp/msp.h>#include <ti/iqmath/include/IQmathLib.h>

Go to the source code of this file.
Data Structures | |
| struct | INDEXER_Instance |
| Define indexer structure. More... | |
Macros | |
| #define | STEPPER_INDEXER_MAX_COUNT (1024) |
| Maximum count for the indexer. | |
| #define | STEPPER_INDEXER_0_BY_8 (0) |
| Value corresponding to 0/8 of indexer max count. | |
| #define | STEPPER_INDEXER_1_BY_8 (STEPPER_INDEXER_MAX_COUNT >> 3) |
| Value corresponding to 1/8 of indexer max count. | |
| #define | STEPPER_INDEXER_2_BY_8 (2 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 2/8 of indexer max count. | |
| #define | STEPPER_INDEXER_3_BY_8 (3 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 3/8 of indexer max count. | |
| #define | STEPPER_INDEXER_4_BY_8 (4 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 4/8 of indexer max count. | |
| #define | STEPPER_INDEXER_5_BY_8 (5 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 5/8 of indexer max count. | |
| #define | STEPPER_INDEXER_6_BY_8 (6 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 6/8 of indexer max count. | |
| #define | STEPPER_INDEXER_7_BY_8 (7 * STEPPER_INDEXER_1_BY_8) |
| Value corresponding to 7/8 of indexer max count. | |
| #define | STEPPER_2PI (6.2831853071f) |
| Value for 2*Pi. | |
Enumerations | |
| enum | STEPPER_STEP_INC_DEC { STEPPER_STEP_INC_DEC_FULL_STEP = 256, STEPPER_STEP_INC_DEC_HALF_STEP = 128, STEPPER_STEP_INC_DEC_1BY4_STEP = 64, STEPPER_STEP_INC_DEC_1BY8_STEP = 32, STEPPER_STEP_INC_DEC_1BY16_STEP = 16, STEPPER_STEP_INC_DEC_1BY32_STEP = 8, STEPPER_STEP_INC_DEC_1BY64_STEP = 4, STEPPER_STEP_INC_DEC_1BY128_STEP = 2, STEPPER_STEP_INC_DEC_1BY256_STEP = 1 } |
| enum | STEPPER_DRIVE { STEPPER_DRIVE_DISABLE = 0, STEPPER_DRIVE_DECAY, STEPPER_DRIVE_FORWARD, STEPPER_DRIVE_REVERSE } |
| enum | STEPPER_STEP_TYPE { STEPPER_STEP_TYPE_CIR = 0, STEPPER_STEP_TYPE_NONCIR } |
| enum | STEPPER_DIR { STEPPER_DIR_FORWARD = 0, STEPPER_DIR_REVERSE } |
Functions | |
| void | STEPPER_init (void) |
| Calculates the angle scale factor. | |
| __STATIC_INLINE void | STEPPER_setIndexerDir (INDEXER_Instance *handle, STEPPER_DIR dir) |
| Sets the direction for the indexer. More... | |
| __STATIC_INLINE void | STEPPER_setIndexerIncVal (INDEXER_Instance *handle, STEPPER_STEP_INC_DEC incDecVal) |
| Sets the direction for the indexer. More... | |
| __STATIC_INLINE void | STEPPER_setStepType (INDEXER_Instance *handle, STEPPER_STEP_TYPE stepType) |
| Sets the step type. More... | |
| __STATIC_INLINE void | STEPPER_setMotorDrives (INDEXER_Instance *handle, STEPPER_DRIVE IaDrive, STEPPER_DRIVE IbDrive) |
| Sets the motor drive states. More... | |
| __STATIC_INLINE void | STEPPER_cirStepPhaseGen (INDEXER_Instance *handle) |
| Updates phase drive state in circular mode. More... | |
| __STATIC_INLINE void | STEPPER_nonCirPhaseGen (INDEXER_Instance *handle) |
| Updates phase drive state in non circular mode. More... | |
| __STATIC_INLINE void | STEPPER_indexer (INDEXER_Instance *handle) |
| Increments the indexer counter and updates the phase reference calculation. More... | |
Variables | |
| _iq18 | angleSf |
| Extern angleSf. | |