#ifndef _TMC5160_H #define _TMC5160_H #include "main.h" void TMC5160_SPIWriteInt(uint8_t addr, uint32_t data,uint8_t rw); void TMC5160_SPIReadInt(uint8_t addr, uint8_t record[5]); void tmc5160_init(void); void tmc5160_act(void); void TMC5160A_Init_Gpio(void); signed int Raw_32(uint8_t raw[5]); void tmc5160_operate(char operate_mode, uint32_t steps); extern char tmc5160_sw; extern char busy_flag; extern char ocin1; extern char ocin2; extern float Xads_temp[2]; extern char temp_cnt; extern char str_print[20]; extern uint8_t XA[5],VA[5],RAMP_STAT[5],DRV_STAT[5]; extern signed int XA_32,VA_32,RAMP_STAT_32,DRV_STAT_32 ; //ÓÐÕý¸º extern uint16_t SG_RESULT_16; extern char tmc5160_sw; #define RAMPMODE_ADDR 0x20 #define XTARGET_ADDR 0x2D #define A1_ADDR 0x24 #define AMAX_ADDR 0x26 #define V1_ADDR 0x25 #define VMAX_ADDR 0x27 #define D1_ADDR 0x2A #define DMAX_ADDR 0x28 #define XACTUAL_ADDR 0x21 #define VACTUAL_ADDR 0x22 #define RAMP_STAT_ADDR 0X35 //ramp status #define DRV_STAT_ADDR 0x6F //driver status - stallguard2 value #endif