add some code to 3steppersLB

This commit is contained in:
Edward Emelianov
2021-11-04 02:03:33 +03:00
parent 263d805bf6
commit 8741e2e428
10 changed files with 435 additions and 71 deletions

View File

@@ -22,6 +22,17 @@
#include <stm32f0.h>
// PCLK frequency
#ifndef PCLK
#define PCLK (48000000)
#endif
// motor frequency in mictosteps - 96kHz
#ifndef MOTORFREQ
#define MOTORFREQ (96000)
#endif
// motors' timer PSC
#define MOTORTIM_PSC (PCLK/MOTORFREQ)
// default CAN bus speed in kbaud
#define DEFAULT_CAN_SPEED (250)
@@ -170,6 +181,12 @@ extern volatile GPIO_TypeDef *DIRports[MOTORSNO];
extern const uint32_t DIRpins[MOTORSNO];
#define MOTOR_CW(x) do{ pin_set(DIRports[x], DIRpins[x]); }while(0)
#define MOTOR_CCW(x) do{ pin_clear(DIRports[x], DIRpins[x]); }while(0)
// minimal motor speed - steps per second
#define MOTORMINSPEED (10)
// interval of velocity checking (10ms)
#define MOTCHKINTERVAL (10)
// maximal ticks of encoder per step
#define MAXENCTICKSPERSTEP (100)
extern volatile uint32_t Tms;
@@ -184,4 +201,6 @@ void timers_setup();
void pause_ms(uint32_t pause);
void Jump2Boot();
uint8_t MSB(uint16_t val);
#endif // __HARDWARE_H__