| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /**
- * @file MOTOR_STEP_O_ATY.h
- *
- * @param Project DEVICE_GENERAL_ATY_LIB
- *
- * @author ATY
- *
- * @copyright
- * - Copyright 2017 - 2026 MZ-ATY
- * - This code follows:
- * - MZ-ATY Various Contents Joint Statement -
- * <a href="https://mengze.top/MZ-ATY_VCJS">
- * https://mengze.top/MZ-ATY_VCJS</a>
- * - CC 4.0 BY-NC-SA -
- * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
- * - Your use will be deemed to have accepted the terms of this statement.
- *
- * @brief functions of open loop stepper motor control for C platform
- *
- * @version
- * - 1_00_260109 > ATY
- * -# Preliminary version
- ********************************************************************************
- */
- #ifndef __MOTOR_STEP_O_ATY_H
- #define __MOTOR_STEP_O_ATY_H
- #include "INCLUDE_ATY.h"
- /******************************* For user *************************************/
- /******************************************************************************/
- struct MOTOR_STEP_O_ATY_Dev{
- uint8_t (*enSet)(uint8_t en);
- uint8_t (*dirSet)(uint8_t dir);
- void (*pwmSet)(float frequency, float dutycycle);
- void (*pwmSetCount)(float frequency, float dutycycle, uint16_t step);
- uint8_t mode;
- uint8_t enable;
- uint8_t direction;
- uint16_t stepCount;
- float frequency; // Hz
- float dutyCycle; // 0-100f
- float speed; // rpm
- uint16_t fullSteps; // steps per revolution, 360 / 1.8 degree = 200 steps
- uint8_t microstepping; // 1/8 = 8, 1/16, 1/32, 1/64, 1/128, 1/256
- uint8_t lock;
- };
- #define MOTOR_OPEN_MODE_COUNT 0x00 // Count mode - run for specified steps, step set 1 to continuous
- #define MOTOR_OPEN_MODE_NOCOUNT 0x01 // Continuous mode - run continuously
- uint8_t MSO_Cycle(struct MOTOR_STEP_O_ATY_Dev* dev,
- uint8_t mode, uint8_t enable, uint8_t direction,
- uint16_t stepCount,
- float frequency, float dutyCycle, float speed);
- #endif /* __MOTOR_STEP_O_ATY_H */
- /******************************** End Of File *********************************/
|