You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parafraktor-stm32/Inc/stepper.h

25 lines
491 B
C

#include "stm32g0b1xx.h"
typedef struct {
GPIO_TypeDef* en_port;
uint8_t en_pin;
GPIO_TypeDef* dir_port;
uint8_t dir_pin;
GPIO_TypeDef* step_port;
uint8_t step_pin;
GPIO_TypeDef* home_port;
uint8_t home_pin;
uint8_t homed:1;
uint8_t trigger_step:1;
int16_t pos;
int32_t speed;
int32_t ramp_to_speed;
uint32_t next_step;
} stepper_T;
#define STEPPER_SPEED_LIMIT 300
void Timer1_Init(void);
void stepper_gpio_init();
void do_steps();