diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 4d40956f..9c62acff 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -763,10 +763,10 @@ The following commands are available when an is used. This command is useful to test the connection to the ADXL345 accelerometer: one of the returned values should be a free-fall acceleration (+/- some noise of the chip). -- `ADXL345_DEBUG_READ [CHIP=] REG=`: queries +- `ACCELEROMETER_DEBUG_READ [CHIP=] REG=`: queries ADXL345 register (e.g. 44 or 0x2C). Can be useful for debugging purposes. -- `ADXL345_DEBUG_WRITE [CHIP=] REG= VAL=`: +- `ACCELEROMETER_DEBUG_WRITE [CHIP=] REG= VAL=`: writes raw into a register . Both and can be a decimal or a hexadecimal integer. Use with care, and refer to ADXL345 data sheet for the reference. diff --git a/klippy/extras/adxl345.py b/klippy/extras/adxl345.py index 6a66acca..a4132573 100644 --- a/klippy/extras/adxl345.py +++ b/klippy/extras/adxl345.py @@ -96,12 +96,12 @@ class ADXLCommandHelper: gcode.register_mux_command("ACCELEROMETER_QUERY", "CHIP", name, self.cmd_ACCELEROMETER_QUERY, desc=self.cmd_ACCELEROMETER_QUERY_help) - gcode.register_mux_command("ADXL345_DEBUG_READ", "CHIP", name, - self.cmd_ADXL345_DEBUG_READ, - desc=self.cmd_ADXL345_DEBUG_READ_help) - gcode.register_mux_command("ADXL345_DEBUG_WRITE", "CHIP", name, - self.cmd_ADXL345_DEBUG_WRITE, - desc=self.cmd_ADXL345_DEBUG_WRITE_help) + gcode.register_mux_command("ACCELEROMETER_DEBUG_READ", "CHIP", name, + self.cmd_ACCELEROMETER_DEBUG_READ, + desc=self.cmd_ACCELEROMETER_DEBUG_READ_help) + gcode.register_mux_command("ACCELEROMETER_DEBUG_WRITE", "CHIP", name, + self.cmd_ACCELEROMETER_DEBUG_WRITE, + desc=self.cmd_ACCELEROMETER_DEBUG_WRITE_help) cmd_ACCELEROMETER_MEASURE_help = "Start/stop accelerometer" def cmd_ACCELEROMETER_MEASURE(self, gcmd): if self.bg_client is None: @@ -135,13 +135,13 @@ class ADXLCommandHelper: _, accel_x, accel_y, accel_z = values[-1] gcmd.respond_info("adxl345 values (x, y, z): %.6f, %.6f, %.6f" % (accel_x, accel_y, accel_z)) - cmd_ADXL345_DEBUG_READ_help = "Query accelerometer register (for debugging)" - def cmd_ADXL345_DEBUG_READ(self, gcmd): + cmd_ACCELEROMETER_DEBUG_READ_help = "Query adxl345 register (for debugging)" + def cmd_ACCELEROMETER_DEBUG_READ(self, gcmd): reg = gcmd.get("REG", minval=29, maxval=57, parser=lambda x: int(x, 0)) val = self.chip.read_reg(reg) gcmd.respond_info("ADXL345 REG[0x%x] = 0x%x" % (reg, val)) - cmd_ADXL345_DEBUG_WRITE_help = "Set accelerometer register (for debugging)" - def cmd_ADXL345_DEBUG_WRITE(self, gcmd): + cmd_ACCELEROMETER_DEBUG_WRITE_help = "Set adxl345 register (for debugging)" + def cmd_ACCELEROMETER_DEBUG_WRITE(self, gcmd): reg = gcmd.get("REG", minval=29, maxval=57, parser=lambda x: int(x, 0)) val = gcmd.get("VAL", minval=0, maxval=255, parser=lambda x: int(x, 0)) self.chip.set_reg(reg, val)