Updated the documentation

copy past from Marlin_main.cpp doxygen documentation d-codes
This commit is contained in:
3d-gussner 2020-03-25 17:33:10 +01:00
parent 0d00db1c33
commit 4c518545f1
2 changed files with 155 additions and 125 deletions

View File

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

View File

@ -9105,7 +9105,6 @@ Sigma_Exit:
For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf
* *
*/ */
case 2130: case 2130:
dcode_2130(); break; dcode_2130(); break;
#endif //TMC2130 #endif //TMC2130