diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index 70ffe2c4..ebf34b4f 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -100,16 +100,22 @@ void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperl #ifdef DEBUG_DCODE3 #define EEPROM_SIZE 0x1000 /*! - * ### D3 - Read/Write EEPROM D3: Read/Write EEPROM This command can be used without any additional parameters. It will read the entire eeprom. - - D3 [ A | C | X ] - - - `A` - Address (0x0000-0x0fff) - - `C` - Count (0x0001-0x1000) - - `X` - Data - * + #### Usage + + D3 [ A | C | X ] + + #### Parameters + - `A` - Address (x0000-x0fff) + - `C` - Count (1-4096) + - `X` - Data (hex) + + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase + */ void dcode_3() { @@ -206,13 +212,13 @@ void dcode__1() #ifdef DEBUG_DCODES /*! - * ### D0 - Reset D0: Reset - - D0 [ B ] - - - `B` - Bootloader - * + #### Usage + + D0 [ B ] + + #### Parameters + - `B` - Bootloader */ void dcode_0() { @@ -251,16 +257,22 @@ void dcode_1() } /*! - * - ### D2 - Read/Write RAM D2: Read/Write RAM + ### D2 - Read/Write RAM D3: Read/Write RAM This command can be used without any additional parameters. It will read the entire RAM. - - D2 [ A | C | X ] - - - `A` - Address (0x0000-0x1fff) - - `C` - Count (0x0001-0x2000) - - `X` - Data - * + #### Usage + + D2 [ A | C | X ] + + #### Parameters + - `A` - Address (x0000-x1fff) + - `C` - Count (1-8192) + - `X` - Data + + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase + */ void dcode_2() { @@ -306,17 +318,17 @@ void dcode_2() } /*! - * - ### D4 - Read/Write PIN D4: Read/Write PIN + ### D4 - Read/Write PIN D4: Read/Write PIN To read the digital value of a pin you need only to define the pin number. - - D4 [ P | F | V ] - - - `P` - Pin (0-255) - - `F` - Function in/out (0/1) - - `V` - Value (0/1) - * + #### Usage + + D4 [ P | F | V ] + + #### Parameters + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) */ void dcode_4() { @@ -351,18 +363,24 @@ void dcode_4() #ifdef DEBUG_DCODE5 /*! - * ### D5 - Read/Write FLASH D5: Read/Write Flash This command can be used without any additional parameters. It will read the 1kb FLASH. - - D5 [ A | C | X | E ] - - - `A` - Address (0x00000-0x3ffff) - - `C` - Count (0x0001-0x2000) - - `X` - Data - - `E` - Erase - * - */ + #### Usage + + D5 [ A | C | X | E ] + + #### Parameters + - `A` - Address (x00000-x3ffff) + - `C` - Count (1-8192) + - `X` - Data + - `E` - Erase + + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase + + */ void dcode_5() { printf_P(PSTR("D5 - Read/Write FLASH\n")); @@ -427,24 +445,18 @@ void dcode_5() #ifdef DEBUG_DCODES /*! - * ### D6 - Read/Write external FLASH D6: Read/Write external Flash - Reserved - * - */ + */ void dcode_6() { LOG("D6 - Read/Write external FLASH\n"); } /*! - * ### D7 - Read/Write Bootloader D7: Read/Write Bootloader - Reserved - * - */ + */ void dcode_7() { LOG("D7 - Read/Write Bootloader\n"); @@ -461,16 +473,16 @@ void dcode_7() } /*! - * ### D8 - Read/Write PINDA D8: Read/Write PINDA - - D8 [ ? | ! | P | Z ] - - - `?` - Read PINDA temperature shift values - - `!` - Reset PINDA temperature shift values to default - - `P` - Pinda temperature [C] - - `Z` - Z Offset [mm] - * + #### Usage + + D8 [ ? | ! | P | Z ] + + #### Parameters + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] */ void dcode_8() { @@ -514,21 +526,21 @@ void dcode_8() } /*! - * ### D9 - Read ADC D9: Read ADC - - D9 [ I | V ] - - - `I` - ADC channel index - - `0` - Heater 0 temperature - - `1` - Heater 1 temperature - - `2` - Bed temperature - - `3` - PINDA temperature - - `4` - PWR voltage - - `5` - Ambient temperature - - `6` - BED voltage - - `V` Value to be written as simulated - * + #### Usage + + D9 [ I | V ] + + #### Parameters + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated */ const char* dcode_9_ADC_name(uint8_t i) { @@ -604,11 +616,8 @@ void dcode_9() } /*! - * ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK - - * - */ + */ void dcode_10() {//Tell the printer that XYZ calibration went OK LOG("D10 - XYZ calibration = OK\n"); @@ -616,11 +625,10 @@ void dcode_10() } /*! - * ### D12 - Time D12: Time - - * - */ + Writes the actual time in the log file. + */ + void dcode_12() {//Time LOG("D12 - Time\n"); @@ -632,38 +640,61 @@ void dcode_12() #include "planner.h" #include "tmc2130.h" extern void st_synchronize(); -/** - * @brief D2130 Trinamic stepper controller - * D2130[subcommand][value] - * * Axis - * * * 'X' - * * * 'Y' - * * * 'Z' - * * * 'E' - * * command - * * * '0' current off - * * * '1' current on - * * * '+' single step - * * * * value sereval steps - * * * '-' dtto oposite direction - * * * '?' read register - * * * * "mres" - * * * * "step" - * * * * "mscnt" - * * * * "mscuract" - * * * * "wave" - * * * '!' set register - * * * * "mres" - * * * * "step" - * * * * "wave" - * * * * *0, 180..250 meaning: off, 0.9..1.25, recommended value is 1.1 - * * * '@' home calibrate axis - * - * Example: - * D2130E?wave //print extruder microstep linearity compensation curve - * D2130E!wave0 //disable extruder linearity compensation curve, (sine curve is used) - * D2130E!wave220 // (sin(x))^1.1 extruder microstep compensation curve used - */ + /*! + ### D2130 - Trinamic stepper controller D2130: Trinamic stepper controller + @todo Please review by owner of the code. RepRap Wiki Gcode needs to be updated after review of owner as well. + + #### Usage + + D2130 [ Axis | Command | Subcommand | Value ] + + #### Parameters + - Axis + - `X` - X stepper driver + - `Y` - Y stepper driver + - `Z` - Z stepper driver + - `E` - Extruder stepper driver + - Commands + - `0` - Current off + - `1` - Current on + - `+` - Single step + - `-` - Single step oposite direction + - `NNN` - Value sereval steps + - `?` - Read register + - Subcommands for read register + - `mres` - Micro step resolution. More information in datasheet '5.5.2 CHOPCONF – Chopper Configuration' + - `step` - Step + - `mscnt` - Microstep counter. More information in datasheet '5.5 Motor Driver Registers' + - `mscuract` - Actual microstep current for motor. More information in datasheet '5.5 Motor Driver Registers' + - `wave` - Microstep linearity compensation curve + - `!` - Set register + - Subcommands for set register + - `mres` - Micro step resolution + - `step` - Step + - `wave` - Microstep linearity compensation curve + - Values for set register + - `0, 180 --> 250` - Off + - `0.9 --> 1.25` - Valid values (recommended is 1.1) + - `@` - Home calibrate axis + + Examples: + + D2130E?wave + + Print extruder microstep linearity compensation curve + + D2130E!wave0 + + Disable extruder linearity compensation curve, (sine curve is used) + + D2130E!wave220 + + (sin(x))^1.1 extruder microstep compensation curve used + + Notes: + For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf + * + */ void dcode_2130() { printf_P(PSTR("D2130 - TMC2130\n")); @@ -767,18 +798,18 @@ void dcode_2130() #ifdef PAT9125 /*! - * ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor - - D9125 [ ? | ! | R | X | Y | L ] - - - `?` - Print values - - `!` - Print values - - `R` - Resolution. Not active in code - - `X` - X values - - `Y` - Y values - - `L` - Activate filament sensor log - * + #### Usage + + D9125 [ ? | ! | R | X | Y | L ] + + #### Parameters + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log */ void dcode_9125() { diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 413781b6..1a17e40d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9105,7 +9105,6 @@ Sigma_Exit: For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf * */ - case 2130: dcode_2130(); break; #endif //TMC2130