Prusa MINI Firmware overview
I2CPositionEncodersMgr Class Reference

#include <I2CPositionEncoder.h>

Collaboration diagram for I2CPositionEncodersMgr:

Static Public Member Functions

static void init ()
 
static void update ()
 
static void homed (const AxisEnum axis)
 
static void unhomed (const AxisEnum axis)
 
static void report_position (const int8_t idx, const bool units, const bool noOffset)
 
static void report_status (const int8_t idx)
 
static void report_error (const int8_t idx)
 
static void test_axis (const int8_t idx)
 
static void calibrate_steps_mm (const int8_t idx, const int iterations)
 
static void change_module_address (const uint8_t oldaddr, const uint8_t newaddr)
 
static void report_module_firmware (const uint8_t address)
 
static void report_error_count (const int8_t idx, const AxisEnum axis)
 
static void reset_error_count (const int8_t idx, const AxisEnum axis)
 
static void enable_ec (const int8_t idx, const bool enabled, const AxisEnum axis)
 
static void set_ec_threshold (const int8_t idx, const float newThreshold, const AxisEnum axis)
 
static void get_ec_threshold (const int8_t idx, const AxisEnum axis)
 
static int8_t idx_from_axis (const AxisEnum axis)
 
static int8_t idx_from_addr (const uint8_t addr)
 
static int8_t parse ()
 
static void M860 ()
 
static void M861 ()
 
static void M862 ()
 
static void M863 ()
 
static void M864 ()
 
static void M865 ()
 
static void M866 ()
 
static void M867 ()
 
static void M868 ()
 
static void M869 ()
 

Static Public Attributes

static I2CPositionEncoder encoders [I2CPE_ENCODER_CNT]
 

Member Function Documentation

◆ init()

static void I2CPositionEncodersMgr::init ( )
static
Here is the caller graph for this function:

◆ update()

static void I2CPositionEncodersMgr::update ( )
static
223 { LOOP_PE(i) encoders[i].update(); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ homed()

static void I2CPositionEncodersMgr::homed ( const AxisEnum  axis)
static
225  {
226  LOOP_PE(i)
227  if (encoders[i].get_axis() == axis) encoders[i].set_homed();
228  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unhomed()

static void I2CPositionEncodersMgr::unhomed ( const AxisEnum  axis)
static
230  {
231  LOOP_PE(i)
232  if (encoders[i].get_axis() == axis) encoders[i].set_unhomed();
233  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ report_position()

static void I2CPositionEncodersMgr::report_position ( const int8_t  idx,
const bool  units,
const bool  noOffset 
)
static

◆ report_status()

static void I2CPositionEncodersMgr::report_status ( const int8_t  idx)
static
237  {
238  CHECK_IDX();
239  SERIAL_ECHOLNPAIR("Encoder ", idx, ": ");
240  encoders[idx].get_raw_count();
241  encoders[idx].passes_test(true);
242  }
Here is the call graph for this function:

◆ report_error()

static void I2CPositionEncodersMgr::report_error ( const int8_t  idx)
static
244  {
245  CHECK_IDX();
246  encoders[idx].get_axis_error_steps(true);
247  }
Here is the call graph for this function:

◆ test_axis()

static void I2CPositionEncodersMgr::test_axis ( const int8_t  idx)
static
249  {
250  CHECK_IDX();
251  encoders[idx].test_axis();
252  }
Here is the call graph for this function:

◆ calibrate_steps_mm()

static void I2CPositionEncodersMgr::calibrate_steps_mm ( const int8_t  idx,
const int  iterations 
)
static
254  {
255  CHECK_IDX();
256  encoders[idx].calibrate_steps_mm(iterations);
257  }
Here is the call graph for this function:

◆ change_module_address()

static void I2CPositionEncodersMgr::change_module_address ( const uint8_t  oldaddr,
const uint8_t  newaddr 
)
static

◆ report_module_firmware()

static void I2CPositionEncodersMgr::report_module_firmware ( const uint8_t  address)
static

◆ report_error_count()

static void I2CPositionEncodersMgr::report_error_count ( const int8_t  idx,
const AxisEnum  axis 
)
static
262  {
263  CHECK_IDX();
264  SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis is ", encoders[idx].get_error_count());
265  }

◆ reset_error_count()

static void I2CPositionEncodersMgr::reset_error_count ( const int8_t  idx,
const AxisEnum  axis 
)
static
267  {
268  CHECK_IDX();
269  encoders[idx].set_error_count(0);
270  SERIAL_ECHOLNPAIR("Error count on ", axis_codes[axis], " axis has been reset.");
271  }
Here is the call graph for this function:

◆ enable_ec()

static void I2CPositionEncodersMgr::enable_ec ( const int8_t  idx,
const bool  enabled,
const AxisEnum  axis 
)
static
273  {
274  CHECK_IDX();
275  encoders[idx].set_ec_enabled(enabled);
276  SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]);
277  SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n");
278  }
Here is the call graph for this function:

◆ set_ec_threshold()

static void I2CPositionEncodersMgr::set_ec_threshold ( const int8_t  idx,
const float  newThreshold,
const AxisEnum  axis 
)
static
280  {
281  CHECK_IDX();
282  encoders[idx].set_ec_threshold(newThreshold);
283  SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis set to ", FIXFLOAT(newThreshold), "mm.");
284  }
Here is the call graph for this function:

◆ get_ec_threshold()

static void I2CPositionEncodersMgr::get_ec_threshold ( const int8_t  idx,
const AxisEnum  axis 
)
static
286  {
287  CHECK_IDX();
288  const float threshold = encoders[idx].get_ec_threshold();
289  SERIAL_ECHOLNPAIR("Error correct threshold for ", axis_codes[axis], " axis is ", FIXFLOAT(threshold), "mm.");
290  }
Here is the call graph for this function:

◆ idx_from_axis()

static int8_t I2CPositionEncodersMgr::idx_from_axis ( const AxisEnum  axis)
static
292  {
293  LOOP_PE(i)
294  if (encoders[i].get_axis() == axis) return i;
295  return -1;
296  }

◆ idx_from_addr()

static int8_t I2CPositionEncodersMgr::idx_from_addr ( const uint8_t  addr)
static
298  {
299  LOOP_PE(i)
300  if (encoders[i].get_address() == addr) return i;
301  return -1;
302  }

◆ parse()

static int8_t I2CPositionEncodersMgr::parse ( )
static

◆ M860()

static void I2CPositionEncodersMgr::M860 ( )
static

◆ M861()

static void I2CPositionEncodersMgr::M861 ( )
static

◆ M862()

static void I2CPositionEncodersMgr::M862 ( )
static

◆ M863()

static void I2CPositionEncodersMgr::M863 ( )
static

◆ M864()

static void I2CPositionEncodersMgr::M864 ( )
static

◆ M865()

static void I2CPositionEncodersMgr::M865 ( )
static

◆ M866()

static void I2CPositionEncodersMgr::M866 ( )
static

◆ M867()

static void I2CPositionEncodersMgr::M867 ( )
static

◆ M868()

static void I2CPositionEncodersMgr::M868 ( )
static

◆ M869()

static void I2CPositionEncodersMgr::M869 ( )
static

Member Data Documentation

◆ encoders

I2CPositionEncoder I2CPositionEncodersMgr::encoders[I2CPE_ENCODER_CNT]
static
SERIAL_ECHO_TERNARY
#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST)
Definition: serial.h:188
I2CPositionEncoder::calibrate_steps_mm
void calibrate_steps_mm(const uint8_t iter)
I2CPositionEncoder::set_homed
void set_homed()
CHECK_IDX
#define CHECK_IDX()
Definition: I2CPositionEncoder.h:94
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
i
uint8_t i
Definition: screen_test_graph.c:72
I2CPositionEncoder::get_raw_count
int32_t get_raw_count()
I2CPositionEncoder::get_ec_threshold
FORCE_INLINE float get_ec_threshold()
Definition: I2CPositionEncoder.h:190
I2CPositionEncoder::set_ec_threshold
FORCE_INLINE void set_ec_threshold(const float newThreshold)
Definition: I2CPositionEncoder.h:191
I2CPositionEncodersMgr::encoders
static I2CPositionEncoder encoders[I2CPE_ENCODER_CNT]
Definition: I2CPositionEncoder.h:317
I2CPositionEncoder::passes_test
bool passes_test(const bool report)
FIXFLOAT
#define FIXFLOAT(f)
Definition: macros.h:274
I2CPositionEncoder::set_unhomed
void set_unhomed()
I2CPositionEncoder::set_error_count
FORCE_INLINE void set_error_count(const int newCount)
Definition: I2CPositionEncoder.h:172
I2CPositionEncoder::update
void update()
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
LOOP_PE
#define LOOP_PE(VAR)
Definition: I2CPositionEncoder.h:93
I2CPositionEncoder::get_axis_error_steps
int32_t get_axis_error_steps(const bool report)
axis_codes
const xyze_char_t axis_codes
Definition: types.h:486
I2CPositionEncoder::set_ec_enabled
FORCE_INLINE void set_ec_enabled(const bool enabled)
Definition: I2CPositionEncoder.h:185
I2CPositionEncoder::test_axis
bool test_axis()