Skip to content

Add TMC2240 temperature reading #27903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Marlin/src/feature/tmc_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,12 @@
TMC_HSTRT,
TMC_SGT,
TMC_MSCNT,
TMC_INTERPOLATE
TMC_INTERPOLATE,
TMC_VAIN,
TMC_VSUPPLY,
TMC_TEMP,
TMC_OVERTEMP,
TMC_OVERVOLT_THD
};
enum TMC_drv_status_enum : char {
TMC_DRV_CODES,
Expand Down Expand Up @@ -701,6 +706,11 @@
case TMC_PWM_GRAD_AUTO: SERIAL_ECHO(st.pwm_grad_auto()); break;
case TMC_STEALTHCHOP: print_true_or_false(st.stealth()); break;
case TMC_INTERPOLATE: print_true_or_false(st.intpol()); break;
case TMC_VAIN: SERIAL_ECHO(st.get_ain_voltage()); break;
case TMC_VSUPPLY: SERIAL_ECHO(st.get_vsupply_voltage()); break;
case TMC_TEMP: SERIAL_ECHO(st.get_chip_temperature()); break;
case TMC_OVERTEMP: SERIAL_ECHO(st.get_overtemp_prewarn_celsius()); break;
case TMC_OVERVOLT_THD: SERIAL_ECHO(st.get_overvoltage_threshold_voltage()); break;
default: break;
}
}
Expand Down Expand Up @@ -978,6 +988,13 @@
DRV_REPORT("s2vsb\t", TMC_S2VSB);
#endif
DRV_REPORT("Driver registers:\n",TMC_DRV_STATUS_HEX);
#if HAS_DRIVER(TMC2240)
TMC_REPORT("Analog in (v)", TMC_VAIN);
TMC_REPORT("Supply (v)", TMC_VSUPPLY);
TMC_REPORT("Temp (°C)", TMC_TEMP);
TMC_REPORT("OT pre warn (°C)", TMC_OVERTEMP);
TMC_REPORT("OV theshold (v)", TMC_OVERVOLT_THD);
#endif
SERIAL_EOL();
}

Expand Down
2 changes: 1 addition & 1 deletion ini/features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MARLIN_TEST_BUILD = build_src_filter=+<src/tests>
POSTMORTEM_DEBUGGING = build_src_filter=+<src/HAL/shared/cpu_exception> +<src/HAL/shared/backtrace>
build_flags=-funwind-tables
MKS_WIFI_MODULE = QRCode=https://github.com/makerbase-mks/QRCode/archive/261c5a696a.zip
HAS_TRINAMIC_CONFIG = TMCStepper=https://github.com/MarlinFirmware/TMCStepper/archive/v0.8.5.zip
HAS_TRINAMIC_CONFIG = TMCStepper=https://github.com/MarlinFirmware/TMCStepper/archive/v0.8.6.zip
build_src_filter=+<src/module/stepper/trinamic.cpp> +<src/gcode/feature/trinamic/M122.cpp> +<src/gcode/feature/trinamic/M906.cpp> +<src/gcode/feature/trinamic/M911-M914.cpp> +<src/gcode/feature/trinamic/M919.cpp>
HAS_STEPPER_CONTROL = build_src_filter=+<src/module/stepper/control.cpp>
HAS_T(RINAMIC_CONFIG|MC_SPI) = build_src_filter=+<src/feature/tmc_util.cpp>
Expand Down
Loading