wip on stepper movement
some bug occurs on reversiong direction when declining in position
This commit is contained in:
22
Inc/stepper.h
Normal file
22
Inc/stepper.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#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 moving:1;
|
||||
int16_t pos;
|
||||
int16_t speed;
|
||||
int16_t ramp_to_speed;
|
||||
uint32_t next_step;
|
||||
} stepper_T;
|
||||
|
||||
void Timer1_Init(void);
|
||||
void stepper_gpio_init();
|
||||
void do_steps();
|
||||
9
Inc/uart_dmx.h
Normal file
9
Inc/uart_dmx.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "stm32g0b1xx.h"
|
||||
|
||||
#define BUFFER_SIZE 515
|
||||
|
||||
extern uint8_t rxBuffer[BUFFER_SIZE];
|
||||
extern uint16_t rxBufferPos;
|
||||
|
||||
void init_UART1_it();
|
||||
void init_UART1_dma();
|
||||
Reference in New Issue
Block a user