diff --git a/F3:F303/Multistepper/commonproto.c b/F3:F303/Multistepper/commonproto.c index 9bd6966..169c51c 100644 --- a/F3:F303/Multistepper/commonproto.c +++ b/F3:F303/Multistepper/commonproto.c @@ -87,6 +87,17 @@ errcodes cu_diagn(uint8_t _U_ par, int32_t _U_ *val){ return ERR_BADCMD; } +errcodes cu_drvtype(uint8_t par, int32_t *val){ + uint8_t n; CHECKN(n, par); + motflags_t *fl = &the_conf.motflags[n]; + if(ISSETTER(par)){ + if(*val >= DRVTYPE_AMOUNT) return ERR_BADVAL; + fl->drvtype = *val; + } + *val = fl->drvtype; + return ERR_OK; +} + errcodes cu_emstop(uint8_t _U_ par, int32_t _U_ *val){ uint8_t n; CHECKN(n, par); emstopmotor(n); @@ -235,6 +246,10 @@ errcodes cu_microsteps(uint8_t _U_ par, int32_t _U_ *val){ if(m != 1< PCLK/(MOTORTIM_PSC+1)/(MOTORTIM_ARRMIN+1)) return ERR_BADVAL; the_conf.microsteps[n] = m; + motflags_t *f = the_conf.motflags; + if(f->drvtype == DRVTYPE_UART){ + if(!pdnuart_microsteps(n, m)) return ERR_CANTRUN; + } update_stepper(n); } *val = the_conf.microsteps[n]; @@ -244,7 +259,7 @@ errcodes cu_microsteps(uint8_t _U_ par, int32_t _U_ *val){ errcodes cu_minspeed(uint8_t _U_ par, int32_t _U_ *val){ uint8_t n; CHECKN(n, par); if(ISSETTER(par)){ - if(*val >= the_conf.maxspd[n]) return ERR_BADVAL; + if(*val >= the_conf.maxspd[n] || *val < 0) return ERR_BADVAL; the_conf.minspd[n] = getSPD(n, *val); update_stepper(n); } @@ -252,6 +267,20 @@ errcodes cu_minspeed(uint8_t _U_ par, int32_t _U_ *val){ return ERR_OK; } +errcodes cu_motcurrent(uint8_t par, int32_t *val){ + uint8_t n; CHECKN(n, par); + if(ISSETTER(par)){ + if(*val < 1 || *val > 32) return ERR_BADVAL; + the_conf.motcurrent[n] = *val; + motflags_t *f = the_conf.motflags; + if(f->drvtype == DRVTYPE_UART){ + if(!pdnuart_setcurrent(n, *val)) return ERR_CANTRUN; + } + } + *val = the_conf.motcurrent[n]; + return ERR_OK; +} + errcodes cu_motflags(uint8_t _U_ par, int32_t _U_ *val){ uint8_t n; CHECKN(n, par); if(ISSETTER(par)){ @@ -262,6 +291,15 @@ errcodes cu_motflags(uint8_t _U_ par, int32_t _U_ *val){ return ERR_OK; } +errcodes cu_motno(uint8_t _U_ par, int32_t _U_ *val){ + if(*val < 0 || *val >= MOTORSNO) return ERR_BADVAL; + if(ISSETTER(par)){ + if(!pdnuart_setmotno(*val)) return ERR_CANTRUN; + } + *val = pdnuart_getmotno(); + return ERR_OK; +} + errcodes cu_motmul(uint8_t _U_ par, int32_t _U_ *val){ return ERR_BADCMD; } @@ -275,9 +313,9 @@ errcodes cu_motreinit(uint8_t _U_ par, int32_t _U_ *val){ errcodes cu_pdn(uint8_t par, int32_t *val){ uint8_t n = PARBASE(par); if(ISSETTER(par)){ - if(!pdnuart_writereg(0, n, *val)) return ERR_CANTRUN; + if(!pdnuart_writereg(n, *val)) return ERR_CANTRUN; } - if(!pdnuart_readreg(0, n, (uint32_t*)val)) return ERR_CANTRUN; + if(!pdnuart_readreg(n, (uint32_t*)val)) return ERR_CANTRUN; return ERR_OK; } @@ -449,5 +487,8 @@ const char* cancmds[CCMD_AMOUNT] = { [CCMD_USARTSTATUS] = "usartstatus", [CCMD_VDRIVE] = "vdrive", [CCMD_VFIVE] = "vfive", - [CCMD_PDN] = "pdn" + [CCMD_PDN] = "pdn", + [CCMD_MOTNO] = "motno", + [CCMD_DRVTYPE] = "drvtype", + [CCMD_MOTCURRENT] = "motcurrent", }; diff --git a/F3:F303/Multistepper/commonproto.h b/F3:F303/Multistepper/commonproto.h index e9788bb..0b369bb 100644 --- a/F3:F303/Multistepper/commonproto.h +++ b/F3:F303/Multistepper/commonproto.h @@ -86,14 +86,17 @@ enum{ ,CCMD_MOTORSTATE // motor state ,CCMD_ENCPOS // position of encoder (independing on settings) ,CCMD_SETPOS // set motor position - ,CCMD_MOTMUL - ,CCMD_DIAGN - ,CCMD_ERASEFLASH - ,CCMD_UDATA - ,CCMD_USARTSTATUS - ,CCMD_VDRIVE - ,CCMD_VFIVE - ,CCMD_PDN + ,CCMD_MOTMUL // operations with motor multiplexer + ,CCMD_DIAGN // DIAGN state for all motors + ,CCMD_ERASEFLASH // erase full storage + ,CCMD_UDATA // incoming data by USART1 + ,CCMD_USARTSTATUS // current status of USART1 + ,CCMD_VDRIVE // Vdrive voltage + ,CCMD_VFIVE // 5V voltage + ,CCMD_PDN // write/read TMC2209 registers over UART + ,CCMD_MOTNO // motor number for next PDN command + ,CCMD_DRVTYPE // driver type (0 - only step/dir, 1 - UART, 2 - SPI, 3 - reserved) + ,CCMD_MOTCURRENT // motor current (1..32 for 1/32..32/32 of max current) // should be the last: ,CCMD_AMOUNT // amount of common commands }; @@ -108,6 +111,7 @@ errcodes cu_adc(uint8_t par, int32_t *val); errcodes cu_button(uint8_t par, int32_t *val); errcodes cu_canid(uint8_t par, int32_t *val); errcodes cu_diagn(uint8_t par, int32_t *val); +errcodes cu_drvtype(uint8_t par, int32_t *val); errcodes cu_emstop(uint8_t par, int32_t *val); errcodes cu_eraseflash(uint8_t par, int32_t *val); errcodes cu_esw(uint8_t par, int32_t *val); @@ -122,7 +126,9 @@ errcodes cu_mcut(uint8_t par, int32_t *val); errcodes cu_mcuvdd(uint8_t par, int32_t *val); errcodes cu_microsteps(uint8_t par, int32_t *val); errcodes cu_minspeed(uint8_t par, int32_t *val); +errcodes cu_motcurrent(uint8_t par, int32_t *val); errcodes cu_motflags(uint8_t par, int32_t *val); +errcodes cu_motno(uint8_t par, int32_t *val); errcodes cu_motmul(uint8_t par, int32_t *val); errcodes cu_motreinit(uint8_t par, int32_t *val); errcodes cu_pdn(uint8_t par, int32_t *val); diff --git a/F3:F303/Multistepper/flash.c b/F3:F303/Multistepper/flash.c index d963443..c120c35 100644 --- a/F3:F303/Multistepper/flash.c +++ b/F3:F303/Multistepper/flash.c @@ -32,7 +32,7 @@ static const uint32_t FLASH_blocksize = (uint32_t)&_BLOCKSIZE; // max amount of Config records stored (will be recalculate in flashstorage_init() static uint32_t maxCnum = 1024 / sizeof(user_conf); // can't use blocksize here -#define DEFMF {.donthold = 1} +#define DEFMF {.donthold = 1, .drvtype = DRVTYPE_UART} #define USERCONF_INITIALIZER { \ .userconf_sz = sizeof(user_conf) \ @@ -226,6 +226,8 @@ int fn_dumpconf(uint32_t _U_ hash, char _U_ *args){ // "dumpconf" (3271513185) printu(the_conf.minspd[i]); PROPNAME("maxsteps"); printu(the_conf.maxsteps[i]); + PROPNAME("motcurrent"); + printu(the_conf.motcurrent[i]); PROPNAME("motflags"); printuhex(*((uint8_t*)&the_conf.motflags[i])); PROPNAME("eswreaction"); diff --git a/F3:F303/Multistepper/flash.h b/F3:F303/Multistepper/flash.h index 21fcf75..c59322b 100644 --- a/F3:F303/Multistepper/flash.h +++ b/F3:F303/Multistepper/flash.h @@ -38,7 +38,16 @@ #define FLASH_SIZE *((uint16_t*)FLASH_SIZE_REG) -#define MOTFLAGS_AMOUNT 6 +#define MOTFLAGS_AMOUNT 7 + +enum{ + DRVTYPE_SIMPLE, + DRVTYPE_UART, + DRVTYPE_SPI, + DRVTYPE_RESERVED, + DRVTYPE_AMOUNT +}; + // motor flags typedef struct{ uint8_t reverse : 1; // bit0 - reversing motor rotation @@ -47,6 +56,7 @@ typedef struct{ uint8_t donthold : 1; // bit3 - clear power @ stop (don't hold motor when stopped) uint8_t eswinv : 1; // bit4 - inverse end-switches uint8_t keeppos : 1; // bit5 - keep current position (as servo motor) - NOT USED HERE!!! + uint8_t drvtype : 2; // bits 6,7 - driver type (0 - only step/dir, 1 - UART, 2 - SPI, 3 - reserved) } motflags_t; /* @@ -63,6 +73,7 @@ typedef struct __attribute__((packed, aligned(4))){ uint32_t maxsteps[MOTORSNO]; // maximal amount of steps motflags_t motflags[MOTORSNO]; // motor's flags uint8_t ESW_reaction[MOTORSNO]; // end-switches reaction (esw_react) + uint8_t motcurrent[MOTORSNO]; // IRUN as fraction of max current (1..32) uint8_t isSPI; // ==1 if there's SPI drivers instead of UART } user_conf; diff --git a/F3:F303/Multistepper/hashgen/hdr.c b/F3:F303/Multistepper/hashgen/hdr.c index 8e9ca17..0f6e5bf 100644 --- a/F3:F303/Multistepper/hashgen/hdr.c +++ b/F3:F303/Multistepper/hashgen/hdr.c @@ -46,6 +46,8 @@ int fn_canstat(uint32_t _U_ hash, char _U_ *args) WAL; // "canstat" (237384179) int fn_diagn(uint32_t _U_ hash, char _U_ *args) WAL; // "diagn" (2334137736) +int fn_drvtype(uint32_t _U_ hash, char _U_ *args) WAL; // "drvtype" (3930242451) + int fn_dumpcmd(uint32_t _U_ hash, char _U_ *args) WAL; // "dumpcmd" (1223955823) int fn_dumpconf(uint32_t _U_ hash, char _U_ *args) WAL; // "dumpconf" (3271513185) @@ -84,10 +86,14 @@ int fn_microsteps(uint32_t _U_ hash, char _U_ *args) WAL; // "microsteps" (39743 int fn_minspeed(uint32_t _U_ hash, char _U_ *args) WAL; // "minspeed" (3234848090) +int fn_motcurrent(uint32_t _U_ hash, char _U_ *args) WAL; // "motcurrent" (1926997848) + int fn_motflags(uint32_t _U_ hash, char _U_ *args) WAL; // "motflags" (2153634658) int fn_motmul(uint32_t _U_ hash, char _U_ *args) WAL; // "motmul" (1543400099) +int fn_motno(uint32_t _U_ hash, char _U_ *args) WAL; // "motno" (544673586) + int fn_motreinit(uint32_t _U_ hash, char _U_ *args) WAL; // "motreinit" (199682784) int fn_pdn(uint32_t _U_ hash, char _U_ *args) WAL; // "pdn" (2963275719) @@ -197,6 +203,9 @@ int parsecmd(const char *str){ case CMD_DIAGN: return fn_diagn(h, args); break; + case CMD_DRVTYPE: + return fn_drvtype(h, args); + break; case CMD_DUMPCMD: return fn_dumpcmd(h, args); break; @@ -254,12 +263,18 @@ int parsecmd(const char *str){ case CMD_MINSPEED: return fn_minspeed(h, args); break; + case CMD_MOTCURRENT: + return fn_motcurrent(h, args); + break; case CMD_MOTFLAGS: return fn_motflags(h, args); break; case CMD_MOTMUL: return fn_motmul(h, args); break; + case CMD_MOTNO: + return fn_motno(h, args); + break; case CMD_MOTREINIT: return fn_motreinit(h, args); break; diff --git a/F3:F303/Multistepper/hashgen/hdr.h b/F3:F303/Multistepper/hashgen/hdr.h index a4c134a..872029f 100644 --- a/F3:F303/Multistepper/hashgen/hdr.h +++ b/F3:F303/Multistepper/hashgen/hdr.h @@ -31,6 +31,7 @@ int parsecmd(const char *cmdwargs); #define CMD_CANSPEED (549265992) #define CMD_CANSTAT (237384179) #define CMD_DIAGN (2334137736) +#define CMD_DRVTYPE (3930242451) #define CMD_DUMPCMD (1223955823) #define CMD_DUMPCONF (3271513185) #define CMD_DUMPERR (1223989764) @@ -50,8 +51,10 @@ int parsecmd(const char *cmdwargs); #define CMD_MCUVDD (2517587080) #define CMD_MICROSTEPS (3974395854) #define CMD_MINSPEED (3234848090) +#define CMD_MOTCURRENT (1926997848) #define CMD_MOTFLAGS (2153634658) #define CMD_MOTMUL (1543400099) +#define CMD_MOTNO (544673586) #define CMD_MOTREINIT (199682784) #define CMD_PDN (2963275719) #define CMD_PING (10561715) diff --git a/F3:F303/Multistepper/hashgen/helpcmds.in b/F3:F303/Multistepper/hashgen/helpcmds.in index e557709..d03b2aa 100644 --- a/F3:F303/Multistepper/hashgen/helpcmds.in +++ b/F3:F303/Multistepper/hashgen/helpcmds.in @@ -16,6 +16,7 @@ "canspeed - GS CAN speed (reinit if setter)\n" "canstat - G CAN status\n" "diagn[N]* - G DIAG state of motor N (or all)\n" + "drvtypeN - GS driver type (0 - only step/dir, 1 - UART, 2 - SPI, 3 - reserved)\n" "dumperr - dump error codes\n" "dumpcmd - dump command codes\n" "dumpconf - dump current configuration\n" @@ -35,8 +36,10 @@ "mcuvdd - G MCU Vdd\n" "microstepsN - GS microsteps settings (2^0..2^9)\n" "minspeedN - min speed (steps per sec)\n" + "motcurrentN - GS motor current (1..32 for 1/32..32/32 of max current)\n" "motflagsN - motorN flags\n" "motmul* - GS external multiplexer status (<0 - disable, 0..7 - enable and set address)\n" + "motno - GS motor number for next `pdn` commands\n" "motreinit - re-init motors after configuration changed\n" "pdnN - GS read/write TMC2209 registers over uart @ motor0\n" "ping - echo given command back\n" diff --git a/F3:F303/Multistepper/hashgen/testdic b/F3:F303/Multistepper/hashgen/testdic index 1c1ff4f..daaab7e 100644 --- a/F3:F303/Multistepper/hashgen/testdic +++ b/F3:F303/Multistepper/hashgen/testdic @@ -16,6 +16,7 @@ cansend canspeed canstat diagn +drvtype dumperr dumpcmd dumpconf @@ -35,8 +36,10 @@ mcut mcuvdd microsteps minspeed +motcurrent motflags motmul +motno motreinit pdn ping diff --git a/F3:F303/Multistepper/main.c b/F3:F303/Multistepper/main.c index 6fa117f..86aaa0c 100644 --- a/F3:F303/Multistepper/main.c +++ b/F3:F303/Multistepper/main.c @@ -51,6 +51,10 @@ int main(void){ adc_setup(); pdnuart_setup(); USBPU_ON(); + for(int i = 0; i < MOTORSNO; ++i){ + motflags_t flag = the_conf.motflags[i]; + if(flag.drvtype == DRVTYPE_UART) pdnuart_init(i); + } uint32_t ctr = 0; CAN_message *can_mesg; while(1){ diff --git a/F3:F303/Multistepper/multistepper.bin b/F3:F303/Multistepper/multistepper.bin index d4b0917..0fc5ae4 100755 Binary files a/F3:F303/Multistepper/multistepper.bin and b/F3:F303/Multistepper/multistepper.bin differ diff --git a/F3:F303/Multistepper/pdnuart.c b/F3:F303/Multistepper/pdnuart.c index e05335e..e510f9e 100644 --- a/F3:F303/Multistepper/pdnuart.c +++ b/F3:F303/Multistepper/pdnuart.c @@ -18,10 +18,13 @@ #include +#include "flash.h" #include "hardware.h" #include "proto.h" +#include "tmc2209.h" extern volatile uint32_t Tms; +static uint8_t motorno = 0; #define MAXBUFLEN (8) // timeout, milliseconds @@ -66,16 +69,18 @@ void pdnuart_setup(){ setup_usart(1); } -static int rwreg(uint8_t motorno, uint8_t reg, uint32_t data, int w){ +static int rwreg(uint8_t reg, uint32_t data, int w){ if(motorno >= MOTORSNO || reg & 0x80) return FALSE; + uint32_t x = Tms; + while(Tms - x < 1); int no = motorno >> 2; uint8_t outbuf[MAXBUFLEN]; - outbuf[0] = 0xa0; + outbuf[0] = 0x05; outbuf[1] = motorno - (no << 2); - outbuf[2] = reg << 1; + outbuf[2] = reg; int nbytes = 3; if(w){ - outbuf[2] |= 1; + outbuf[2] |= 0x80; for(int i = 6; i > 2; --i){ outbuf[i] = data & 0xff; data >>= 8; @@ -85,20 +90,25 @@ static int rwreg(uint8_t motorno, uint8_t reg, uint32_t data, int w){ calcCRC(outbuf, nbytes); ++nbytes; for(int i = 0; i < nbytes; ++i){ + USB_sendstr("Send byte "); USB_putbyte('0'+i); USB_sendstr(": "); printuhex(outbuf[i]); newline(); USART[no]->TDR = outbuf[i]; // transmit while(!(USART[no]->ISR & USART_ISR_TXE)); + int l = 0; + for(; l < 10000; ++l) if(USART[no]->ISR & USART_ISR_RXNE) break; + if(l == 10000) USND("Nothing received"); + else {USB_sendstr("Rcv: "); printuhex(USART[no]->RDR); newline();} } return TRUE; } // return FALSE if failed -int pdnuart_writereg(uint8_t motorno, uint8_t reg, uint32_t data){ - return rwreg(motorno, reg, data, 1); +int pdnuart_writereg(uint8_t reg, uint32_t data){ + return rwreg(reg, data, 1); } // return FALSE if failed -int pdnuart_readreg(uint8_t motorno, uint8_t reg, uint32_t *data){ - if(!rwreg(motorno, reg, 0, 0)) return FALSE; +int pdnuart_readreg(uint8_t reg, uint32_t *data){ + if(!rwreg(reg, 0, 0)) return FALSE; uint32_t Tstart = Tms; uint8_t buf[8]; int no = motorno >> 2; @@ -117,6 +127,60 @@ int pdnuart_readreg(uint8_t motorno, uint8_t reg, uint32_t *data){ return TRUE; } +static int readregister(uint8_t no, uint8_t reg, uint32_t *data){ + int n = motorno; motorno = no; + int r = pdnuart_readreg(reg, data); + motorno = n; + return r; +} + +static int writeregister(uint8_t no, uint8_t reg, uint32_t data){ + int n = motorno; motorno = no; + int r = pdnuart_writereg(reg, data); + motorno = n; + return r; +} + +uint8_t pdnuart_getmotno(){ + return motorno; +} + +int pdnuart_setmotno(uint8_t no){ + if(no >= MOTORSNO) return FALSE; + motorno = no; + return TRUE; +} + +// write val into IHOLD_IRUN over UART to n'th motor +int pdnuart_setcurrent(uint8_t no, uint8_t val){ + TMC2209_ihold_irun_reg_t regval; + if(!readregister(no, TMC2209Reg_IHOLD_IRUN, ®val.value)) return FALSE; + regval.irun = val; + return writeregister(no, TMC2209Reg_IHOLD_IRUN, regval.value); +} + +// set microsteps over UART +int pdnuart_microsteps(uint8_t no, uint32_t val){ + if(val > 256) return FALSE; + TMC2209_chopconf_reg_t regval; + if(!readregister(no, TMC2209Reg_CHOPCONF, ®val.value)) return FALSE; + if(val == 256) regval.mres = 0; + else regval.mres = MSB(val) + 1; + return writeregister(no, TMC2209Reg_CHOPCONF, regval.value); +} + +// init driver number `no` +int pdnuart_init(uint8_t no){ + TMC2209_gconf_reg_t gconf; + if(!readregister(no, TMC2209Reg_GCONF, &gconf.value)) return FALSE; + gconf.pdn_disable = 1; // PDN now is UART + gconf.mstep_reg_select = 1; // microsteps are by MSTEP + if(!writeregister(no, TMC2209Reg_GCONF, gconf.value)) return FALSE; + if(!pdnuart_microsteps(no, the_conf.microsteps[no])) return FALSE; + if(!pdnuart_setcurrent(no, the_conf.motcurrent[no])) return FALSE; + return TRUE; +} + /* static void parseRx(int no){ USB_sendstr("Got from "); diff --git a/F3:F303/Multistepper/pdnuart.h b/F3:F303/Multistepper/pdnuart.h index 3636f22..c036beb 100644 --- a/F3:F303/Multistepper/pdnuart.h +++ b/F3:F303/Multistepper/pdnuart.h @@ -21,5 +21,10 @@ #include void pdnuart_setup(); -int pdnuart_writereg(uint8_t motorno, uint8_t reg, uint32_t data); -int pdnuart_readreg(uint8_t motorno, uint8_t reg, uint32_t *data); +int pdnuart_writereg(uint8_t reg, uint32_t data); +int pdnuart_readreg(uint8_t reg, uint32_t *data); +int pdnuart_setmotno(uint8_t no); +uint8_t pdnuart_getmotno(); +int pdnuart_setcurrent(uint8_t no, uint8_t val); +int pdnuart_microsteps(uint8_t no, uint32_t val); +int pdnuart_init(uint8_t no); diff --git a/F3:F303/Multistepper/proto.c b/F3:F303/Multistepper/proto.c index 1311e12..d79191b 100644 --- a/F3:F303/Multistepper/proto.c +++ b/F3:F303/Multistepper/proto.c @@ -405,12 +405,13 @@ int fn_time(uint32_t _U_ hash, char _U_ *args){ // "time" (19148340) static const char* motfl[MOTFLAGS_AMOUNT] = { - "reverse - invert motor's rotation", - "[reserved]", - "[reserved]", - "donthold - clear motor's power after stop", - "eswinv - inverse end-switches (1->0 instead of 0->1)", - "[reserved]" + "0: reverse - invert motor's rotation", + "1: [reserved]", + "2: [reserved]", + "3: donthold - clear motor's power after stop", + "4: eswinv - inverse end-switches (1->0 instead of 0->1)", + "5: [reserved]", + "6,7: drvtype - driver type (0 - only step/dir, 1 - UART, 2 - SPI, 3 - reserved)" }; static const char *eswfl[ESW_AMOUNT] = { [ESW_IGNORE] = "ignore end-switches", @@ -568,6 +569,9 @@ static int canusb_function(uint32_t hash, char *args){ case CMD_DIAGN: e = cu_diagn(par, &val); break; + case CMD_DRVTYPE: + e = cu_drvtype(par, &val); + break; case CMD_EMSTOP: e = cu_emstop(par, &val); break; @@ -612,12 +616,18 @@ static int canusb_function(uint32_t hash, char *args){ case CMD_MINSPEED: e = cu_minspeed(par, &val); break; + case CMD_MOTCURRENT: + e = cu_motcurrent(par, &val); + break; case CMD_MOTFLAGS: e = cu_motflags(par, &val); break; case CMD_MOTMUL: e = cu_motmul(par, &val); break; + case CMD_MOTNO: + e = cu_motno(par, &val); + break; case CMD_MOTREINIT: e = cu_motreinit(par, &val); break; @@ -674,7 +684,7 @@ static int canusb_function(uint32_t hash, char *args){ USB_sendstr(errtxt[e]); newline(); }else{ USB_sendstr("OK par"); - if(par != CANMESG_NOPAR) printu(PARBASE(par)); + if(PARBASE(par) != CANMESG_NOPAR) printu(PARBASE(par)); USB_putbyte('='); printi(val); newline(); } @@ -689,6 +699,7 @@ int fn_accel(uint32_t _U_ hash, char _U_ *args) AL; //* "accel" (1490521981) int fn_adc(uint32_t _U_ hash, char _U_ *args) AL; // "adc" (2963026093) int fn_button(uint32_t _U_ hash, char _U_ *args) AL; // "button" (1093508897) int fn_diagn(uint32_t _U_ hash, char _U_ *args) AL; //* "diagn" (2334137736) +int fn_drvtype(uint32_t _U_ hash, char _U_ *args) AL; // "drvtype" (3930242451) int fn_emstop(uint32_t _U_ hash, char _U_ *args) AL; //* "emstop" (2965919005) int fn_eraseflash(uint32_t _U_ hash, char _U_ *args) AL; //* "eraseflash" (3177247267) int fn_esw(uint32_t _U_ hash, char _U_ *args) AL; // "esw" (2963094612) @@ -703,8 +714,10 @@ int fn_mcut(uint32_t _U_ hash, char _U_ *args) AL; // "mcut" (4022718) int fn_mcuvdd(uint32_t _U_ hash, char _U_ *args) AL; // "mcuvdd" (2517587080) int fn_microsteps(uint32_t _U_ hash, char _U_ *args) AL; //* "microsteps" (3974395854) int fn_minspeed(uint32_t _U_ hash, char _U_ *args) AL; //* "minspeed" (3234848090) +int fn_motcurrent(uint32_t _U_ hash, char _U_ *args) AL; // "motcurrent" (1926997848) int fn_motflags(uint32_t _U_ hash, char _U_ *args) AL; //* "motflags" (2153634658) int fn_motmul(uint32_t _U_ hash, char _U_ *args) AL; //* "motmul" (1543400099) +int fn_motno(uint32_t _U_ hash, char _U_ *args) AL; // "motno" (544673586) int fn_motreinit(uint32_t _U_ hash, char _U_ *args) AL; //* "motreinit" (199682784) int fn_pdn(uint32_t _U_ hash, char _U_ *args) AL; // "pdn" (2963275719) int fn_ping(uint32_t _U_ hash, char _U_ *args) AL; // "ping" (10561715) diff --git a/F3:F303/Multistepper/tmc2209.h b/F3:F303/Multistepper/tmc2209.h index 8448bcd..bb486b3 100644 --- a/F3:F303/Multistepper/tmc2209.h +++ b/F3:F303/Multistepper/tmc2209.h @@ -707,7 +707,7 @@ typedef struct { TMC2209_status_t driver_status; - trinamic_config_t config; +// trinamic_config_t config; } TMC2209_t; #pragma pack(pop) diff --git a/F3:F303/Multistepper/version.inc b/F3:F303/Multistepper/version.inc index e6cecc3..29c91ef 100644 --- a/F3:F303/Multistepper/version.inc +++ b/F3:F303/Multistepper/version.inc @@ -1,2 +1,2 @@ -#define BUILD_NUMBER "84" -#define BUILD_DATE "2023-02-26" +#define BUILD_NUMBER "95" +#define BUILD_DATE "2023-03-01"