Prusa3d Marlin fork
eeprom.h
Go to the documentation of this file.
1 
9 
10 
11 #ifndef EEPROM_H
12 #define EEPROM_H
13 
14 #include <stdint.h>
15 #include "Configuration_var.h"
16 
17 // Custom Mendel Name
18 #ifndef CUSTOM_MENDEL_NAME
19  #define CUSTOM_MENDEL_NAME "Prusa i3"
20 #endif
21 
22 #define MAX_CUSTOM_MENDEL_NAME_LENGTH 17
23 
24 
25 // Sheets
26 #define MAX_SHEETS 8
27 #define MAX_SHEET_NAME_LENGTH 7
28 
29 typedef struct
30 {
31  unsigned char name[MAX_SHEET_NAME_LENGTH];
32  int16_t z_offset;
33  uint8_t bed_temp;
34  uint8_t pinda_temp;
35 } Sheet;
36 
37 typedef struct
38 {
39  Sheet s[MAX_SHEETS];
40  uint8_t active_sheet;
41 } Sheets;
42 // sizeof(Sheets). Do not change it unless EEPROM_Sheets_base is last item in EEPROM.
43 // Otherwise it would move following items.
44 #define EEPROM_SHEETS_SIZEOF 89
45 
46 #ifdef __cplusplus
47 static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEPROM_SHEETS_SIZEOF.");
48 #endif
398 #define EEPROM_EMPTY_VALUE 0xFF
399 #define EEPROM_EMPTY_VALUE16 0xFFFF
400 #define EEPROM_EMPTY_VALUE32 0xFFFFFFFFl
401 // The total size of the EEPROM is
402 // 4096 for the Atmega2560
403 #define EEPROM_TOP 4096
404 #define EEPROM_SILENT 4095
405 #define EEPROM_LANG 4094
406 #define _EEPROM_FREE_NR10_ 4092 // uint16_t
407 #define _EEPROM_FREE_NR11_ 4090 // uint16_t
408 #define EEPROM_BABYSTEP_Z 4088 //legacy, multiple values stored now in EEPROM_Sheets_base
409 #define EEPROM_CALIBRATION_STATUS_V1 4087 // legacy, used up to v3.11
410 #define EEPROM_BABYSTEP_Z0 4085
411 #define EEPROM_FILAMENTUSED 4081
412 // uint32_t
413 #define EEPROM_TOTALTIME 4077
414 
415 #define EEPROM_BED_CALIBRATION_CENTER (EEPROM_TOTALTIME-2*4)
416 #define EEPROM_BED_CALIBRATION_VEC_X (EEPROM_BED_CALIBRATION_CENTER-2*4)
417 #define EEPROM_BED_CALIBRATION_VEC_Y (EEPROM_BED_CALIBRATION_VEC_X-2*4)
418 
419 // Offsets of the Z heiths of the calibration points from the first point.
420 // The offsets are saved as 16bit signed int, scaled to tenths of microns.
421 #define EEPROM_BED_CALIBRATION_Z_JITTER (EEPROM_BED_CALIBRATION_VEC_Y-2*8)
422 #define EEPROM_FARM_MODE (EEPROM_BED_CALIBRATION_Z_JITTER-1)
423 #define EEPROM_FREE_NR1 (EEPROM_FARM_MODE-1) // uint8_t
424 #define _EEPROM_FREE_NR2_ (EEPROM_FREE_NR1 - 2) // int16_t
425 
426 // Correction of the bed leveling, in micrometers.
427 // Maximum 50 micrometers allowed.
428 // Bed correction is valid if set to 1. If set to zero or 255, the successive 4 bytes are invalid.
429 #define EEPROM_BED_CORRECTION_VALID (_EEPROM_FREE_NR2_ - 1)
430 #define EEPROM_BED_CORRECTION_LEFT (EEPROM_BED_CORRECTION_VALID-1)
431 #define EEPROM_BED_CORRECTION_RIGHT (EEPROM_BED_CORRECTION_LEFT-1)
432 #define EEPROM_BED_CORRECTION_FRONT (EEPROM_BED_CORRECTION_RIGHT-1)
433 #define EEPROM_BED_CORRECTION_REAR (EEPROM_BED_CORRECTION_FRONT-1)
434 #define EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY (EEPROM_BED_CORRECTION_REAR-1) // bool
435 
436 #define _EEPROM_FREE_NR3_ (EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY - 1) // uint8_t
437 
438 #define EEPROM_PROBE_TEMP_SHIFT (_EEPROM_FREE_NR3_ - 2*5) //5 x int for storing pinda probe temp shift relative to 50 C; unit: motor steps
439 #define EEPROM_TEMP_CAL_ACTIVE (EEPROM_PROBE_TEMP_SHIFT - 1)
440 #define _EEPROM_FREE_NR6_ (EEPROM_TEMP_CAL_ACTIVE - 2*4) //4 x int
441 #define EEPROM_CALIBRATION_STATUS_PINDA (_EEPROM_FREE_NR6_ - 1) //0 - not calibrated; 1 - calibrated
442 
443 #define EEPROM_UVLO (EEPROM_CALIBRATION_STATUS_PINDA - 1) // uint8_t
444 #define EEPROM_UVLO_CURRENT_POSITION (EEPROM_UVLO-2*4) // 2 x float for current_position in X and Y axes
445 #define EEPROM_FILENAME (EEPROM_UVLO_CURRENT_POSITION - 8) //8chars to store filename without extension
446 #define EEPROM_FILE_POSITION (EEPROM_FILENAME - 4) //32 bit for uint32_t file position
447 #define EEPROM_UVLO_CURRENT_POSITION_Z (EEPROM_FILE_POSITION - 4) //float for current position in Z
448 #define EEPROM_UVLO_PRINT_TYPE (EEPROM_UVLO_CURRENT_POSITION_Z - 1) // uint8_t
449 #define EEPROM_UVLO_TARGET_BED (EEPROM_UVLO_PRINT_TYPE - 1)
450 #define EEPROM_UVLO_FEEDRATE (EEPROM_UVLO_TARGET_BED - 2) //uint16_t
451 #define EEPROM_UVLO_FAN_SPEED (EEPROM_UVLO_FEEDRATE - 1)
452 #define EEPROM_FAN_CHECK_ENABLED (EEPROM_UVLO_FAN_SPEED - 1)
453 
454 #define _EEPROM_FREE_NR7_ (EEPROM_FAN_CHECK_ENABLED - 9*2) // 9 x uint16_t
455 #define _EEPROM_FREE_NR8_ (_EEPROM_FREE_NR7_ - 2) // uint16_t
456 
457 #define EEPROM_UVLO_E_ABS (_EEPROM_FREE_NR8_ - 1) // uint8_t
458 #define EEPROM_UVLO_CURRENT_POSITION_E (EEPROM_UVLO_E_ABS - 4) // float
459 #define EEPROM_UVLO_SAVED_SEGMENT_IDX (EEPROM_UVLO_CURRENT_POSITION_E - 2) //uint16_t
460 
461 #define EEPROM_FREE_NR4 (EEPROM_UVLO_SAVED_SEGMENT_IDX - 1) // uint8_t
462 #define EEPROM_FREE_NR5 (EEPROM_FREE_NR4 - 1) // uint8_t
463 
464 #define EEPROM_CRASH_DET (EEPROM_FREE_NR5 - 1) // uint8_t
465 #define EEPROM_CRASH_COUNT_Y (EEPROM_CRASH_DET - 1) // uint8_t
466 #define EEPROM_FSENSOR (EEPROM_CRASH_COUNT_Y - 1) // uint8_t
467 #define EEPROM_CRASH_COUNT_X (EEPROM_FSENSOR - 1) // uint8_t
468 #define EEPROM_FERROR_COUNT (EEPROM_CRASH_COUNT_X - 1) // uint8_t
469 #define EEPROM_POWER_COUNT (EEPROM_FERROR_COUNT - 1) // uint8_t
470 
471 #define EEPROM_XYZ_CAL_SKEW (EEPROM_POWER_COUNT - 4) // float for skew backup
472 #define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1) // 0: wizard not active, 1: wizard active, 2: wizard active without yes/no = forced calibrate Z after shipping/service prep.
473 #define EEPROM_BELTSTATUS_X (EEPROM_WIZARD_ACTIVE - 2) // uint16
474 #define EEPROM_BELTSTATUS_Y (EEPROM_BELTSTATUS_X - 2) // uint16
475 
476 #define EEPROM_DIR_DEPTH (EEPROM_BELTSTATUS_Y-1)
477 #define EEPROM_DIRS (EEPROM_DIR_DEPTH-80) //8 chars for each dir name, max 10 levels
478 #define EEPROM_SD_SORT (EEPROM_DIRS - 1) //0 -time, 1-alpha, 2-none
479 #define EEPROM_SECOND_SERIAL_ACTIVE (EEPROM_SD_SORT - 1)
480 
481 #define EEPROM_FSENS_AUTOLOAD_ENABLED (EEPROM_SECOND_SERIAL_ACTIVE - 1)
482 
483 // Crash detection counter X (total)
484 #define EEPROM_CRASH_COUNT_X_TOT (EEPROM_FSENS_AUTOLOAD_ENABLED - 2) // uint16
485 // Crash detection counter Y (total)
486 #define EEPROM_CRASH_COUNT_Y_TOT (EEPROM_CRASH_COUNT_X_TOT - 2) // uint16
487 // Filament runout/error coutner (total)
488 #define EEPROM_FERROR_COUNT_TOT (EEPROM_CRASH_COUNT_Y_TOT - 2) // uint16
489 // Power loss errors (total)
490 #define EEPROM_POWER_COUNT_TOT (EEPROM_FERROR_COUNT_TOT - 2) // uint16
491 
493 // TMC2130 Accurate sensorless homing
494 
495 // X-axis home origin (stepper phase in microsteps, 0..63 for 16ustep resolution)
496 #define EEPROM_TMC2130_HOME_X_ORIGIN (EEPROM_POWER_COUNT_TOT - 1) // uint8
497 // X-axis home bsteps (number of microsteps backward)
498 #define EEPROM_TMC2130_HOME_X_BSTEPS (EEPROM_TMC2130_HOME_X_ORIGIN - 1) // uint8
499 // X-axis home fsteps (number of microsteps forward)
500 #define EEPROM_TMC2130_HOME_X_FSTEPS (EEPROM_TMC2130_HOME_X_BSTEPS - 1) // uint8
501 // Y-axis home origin (stepper phase in microsteps, 0..63 for 16ustep resolution)
502 #define EEPROM_TMC2130_HOME_Y_ORIGIN (EEPROM_TMC2130_HOME_X_FSTEPS - 1) // uint8
503 // X-axis home bsteps (number of microsteps backward)
504 #define EEPROM_TMC2130_HOME_Y_BSTEPS (EEPROM_TMC2130_HOME_Y_ORIGIN - 1) // uint8
505 // X-axis home fsteps (number of microsteps forward)
506 #define EEPROM_TMC2130_HOME_Y_FSTEPS (EEPROM_TMC2130_HOME_Y_BSTEPS - 1) // uint8
507 // Accurate homing enabled
508 #define EEPROM_TMC2130_HOME_ENABLED (EEPROM_TMC2130_HOME_Y_FSTEPS - 1) // uint8
509 
510 
512 // TMC2130 uStep linearity correction
513 
514 // Linearity correction factor (XYZE)
515 #define EEPROM_TMC2130_WAVE_X_FAC (EEPROM_TMC2130_HOME_ENABLED - 1) // uint8
516 #define EEPROM_TMC2130_WAVE_Y_FAC (EEPROM_TMC2130_WAVE_X_FAC - 1) // uint8
517 #define EEPROM_TMC2130_WAVE_Z_FAC (EEPROM_TMC2130_WAVE_Y_FAC - 1) // uint8
518 #define EEPROM_TMC2130_WAVE_E_FAC (EEPROM_TMC2130_WAVE_Z_FAC - 1) // uint8
519 
520 
522 // TMC2130 uStep resolution
523 
524 // microstep resolution (XYZE): usteps = (256 >> mres)
525 #define EEPROM_TMC2130_X_MRES (EEPROM_TMC2130_WAVE_E_FAC - 1) // uint8
526 #define EEPROM_TMC2130_Y_MRES (EEPROM_TMC2130_X_MRES - 1) // uint8
527 #define EEPROM_TMC2130_Z_MRES (EEPROM_TMC2130_Y_MRES - 1) // uint8
528 #define EEPROM_TMC2130_E_MRES (EEPROM_TMC2130_Z_MRES - 1) // uint8
529 
530 // HW
531 #define EEPROM_PRINTER_TYPE (EEPROM_TMC2130_E_MRES - 2) // uint16
532 #define EEPROM_BOARD_TYPE (EEPROM_PRINTER_TYPE - 2) // uint16
533 
534 // Extruder multiplier for power panic
535 #define EEPROM_EXTRUDER_MULTIPLIER_0 (EEPROM_BOARD_TYPE - 4) //float
536 #define EEPROM_EXTRUDER_MULTIPLIER_1 (EEPROM_EXTRUDER_MULTIPLIER_0 - 4) //float
537 #define EEPROM_EXTRUDER_MULTIPLIER_2 (EEPROM_EXTRUDER_MULTIPLIER_1 - 4) //float
538 #define EEPROM_EXTRUDEMULTIPLY (EEPROM_EXTRUDER_MULTIPLIER_2 - 2) // uint16
539 
540 #define EEPROM_UVLO_TINY_CURRENT_POSITION_Z (EEPROM_EXTRUDEMULTIPLY-4) // float
541 #define EEPROM_UVLO_TARGET_HOTEND (EEPROM_UVLO_TINY_CURRENT_POSITION_Z-2) // uint16
542 
543 // Sound Mode
544 #define EEPROM_SOUND_MODE (EEPROM_UVLO_TARGET_HOTEND-1) // uint8
545 #define EEPROM_SPOOL_JOIN (EEPROM_SOUND_MODE-1) //bool
546 
547 #define EEPROM_FSENS_RUNOUT_ENABLED (EEPROM_SPOOL_JOIN - 1) //bool
548 
549 #define EEPROM_MMU_FAIL_TOT (EEPROM_FSENS_RUNOUT_ENABLED - 2) //uint16_t
550 #define EEPROM_MMU_FAIL (EEPROM_MMU_FAIL_TOT - 1) //uint8_t
551 
552 #define EEPROM_MMU_LOAD_FAIL_TOT (EEPROM_MMU_FAIL - 2) // uint16_t
553 #define EEPROM_MMU_LOAD_FAIL (EEPROM_MMU_LOAD_FAIL_TOT - 1) // uint8_t
554 #define EEPROM_MMU_CUTTER_ENABLED (EEPROM_MMU_LOAD_FAIL - 1) // bool
555 #define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_CUTTER_ENABLED - 12*12*2) //allow 12 calibration points for future expansion
556 
557 #define _EEPROM_FREE_NR9_ (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) // uint8_t
558 
559 #define EEPROM_MBL_MAGNET_ELIMINATION (_EEPROM_FREE_NR9_ - 1)
560 #define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling
561 #define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point
562 
563 #define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1) // bool
564 
565 #define EEPROM_CHECK_MODE (EEPROM_MMU_STEALTH-1) // uint8
566 #define EEPROM_NOZZLE_DIAMETER (EEPROM_CHECK_MODE-1) // uint8
567 #define EEPROM_NOZZLE_DIAMETER_uM (EEPROM_NOZZLE_DIAMETER-2) // uint16
568 #define EEPROM_CHECK_MODEL (EEPROM_NOZZLE_DIAMETER_uM-1) // uint8
569 #define EEPROM_CHECK_VERSION (EEPROM_CHECK_MODEL-1) // uint8
570 #define EEPROM_CHECK_GCODE (EEPROM_CHECK_VERSION-1) // uint8
571 
572 #define EEPROM_SHEETS_BASE (EEPROM_CHECK_GCODE - EEPROM_SHEETS_SIZEOF) // Sheets
573 static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE);
574 
575 #define EEPROM_FSENSOR_PCB (EEPROM_SHEETS_BASE-1) // uint8
576 #define EEPROM_FSENSOR_ACTION_NA (EEPROM_FSENSOR_PCB-1) // uint8
577 
578 #define EEPROM_UVLO_SAVED_START_POSITION (EEPROM_FSENSOR_ACTION_NA - 4*4) // 4 x float for saved start position for all axes
579 #define EEPROM_UVLO_FEEDMULTIPLY (EEPROM_UVLO_SAVED_START_POSITION - 2) // uint16_t for feedmultiply
580 
581 #define EEPROM_BACKLIGHT_LEVEL_HIGH (EEPROM_UVLO_FEEDMULTIPLY-1) // uint8
582 #define EEPROM_BACKLIGHT_LEVEL_LOW (EEPROM_BACKLIGHT_LEVEL_HIGH-1) // uint8
583 #define EEPROM_BACKLIGHT_MODE (EEPROM_BACKLIGHT_LEVEL_LOW-1) // uint8
584 #define EEPROM_BACKLIGHT_TIMEOUT (EEPROM_BACKLIGHT_MODE-2) // uint16
585 
586 #define EEPROM_UVLO_LA_K (EEPROM_BACKLIGHT_TIMEOUT-4) // float
587 
588 #define EEPROM_ALTFAN_OVERRIDE (EEPROM_UVLO_LA_K-1) //uint8
589 #define EEPROM_EXPERIMENTAL_VISIBILITY (EEPROM_ALTFAN_OVERRIDE-1) //uint8
590 #define EEPROM_PINDA_TEMP_COMPENSATION (EEPROM_EXPERIMENTAL_VISIBILITY-1) //uint8
591 #define EEPROM_PRUSA_SN (EEPROM_PINDA_TEMP_COMPENSATION-20) //char[20]
592 
593 #define EEPROM_UVLO_ACCELL (EEPROM_PRUSA_SN-4) // float
594 #define EEPROM_UVLO_RETRACT_ACCELL (EEPROM_UVLO_ACCELL-4) // float
595 #define EEPROM_UVLO_TRAVEL_ACCELL (EEPROM_UVLO_RETRACT_ACCELL-4) // float
596 
597 #define EEPROM_JOB_ID (EEPROM_UVLO_TRAVEL_ACCELL-4) //uint32_t
598 
599 #define EEPROM_ECOOL_ENABLE (EEPROM_JOB_ID-1) // uint8_t
600 #define EEPROM_FW_CRASH_FLAG (EEPROM_ECOOL_ENABLE-1) // uint8_t
601 
602 #define EEPROM_THERMAL_MODEL_ENABLE (EEPROM_FW_CRASH_FLAG-1) // uint8_t
603 #define EEPROM_THERMAL_MODEL_P (EEPROM_THERMAL_MODEL_ENABLE-4) // float
604 #define EEPROM_THERMAL_MODEL_C (EEPROM_THERMAL_MODEL_P-4) // float
605 #define EEPROM_THERMAL_MODEL_R (EEPROM_THERMAL_MODEL_C-4*16) // float[16]
606 #define EEPROM_THERMAL_MODEL_Ta_corr (EEPROM_THERMAL_MODEL_R-4) // float
607 #define EEPROM_THERMAL_MODEL_W (EEPROM_THERMAL_MODEL_Ta_corr-4) // float
608 #define EEPROM_THERMAL_MODEL_E (EEPROM_THERMAL_MODEL_W-4) // float
609 
610 #define EEPROM_FSENSOR_JAM_DETECTION (EEPROM_THERMAL_MODEL_E-1) // uint8_t
611 #define EEPROM_MMU_ENABLED (EEPROM_FSENSOR_JAM_DETECTION-1) // uint8_t
612 #define EEPROM_MMU_MATERIAL_CHANGES (EEPROM_MMU_ENABLED-4) // uint32_t
613 #define EEPROM_HEAT_BED_ON_LOAD_FILAMENT (EEPROM_MMU_MATERIAL_CHANGES-1) //uint8
614 #define EEPROM_CALIBRATION_STATUS_V2 (EEPROM_HEAT_BED_ON_LOAD_FILAMENT-1) //uint8
615 
616 #define EEPROM_THERMAL_MODEL_U (EEPROM_CALIBRATION_STATUS_V2-4) //float
617 #define EEPROM_THERMAL_MODEL_V (EEPROM_THERMAL_MODEL_U-4) //float
618 #define EEPROM_THERMAL_MODEL_D (EEPROM_THERMAL_MODEL_V-4) //float
619 #define EEPROM_THERMAL_MODEL_L (EEPROM_THERMAL_MODEL_D-2) //uint16_t
620 #define EEPROM_THERMAL_MODEL_VER (EEPROM_THERMAL_MODEL_L-1) //uint8_t
621 
622 #define EEPROM_KILL_MESSAGE (EEPROM_THERMAL_MODEL_VER-2) //PGM_P
623 #define EEPROM_KILL_PENDING_FLAG (EEPROM_KILL_MESSAGE-1) //uint8
624 #define EEPROM_FILENAME_EXTENSION (EEPROM_KILL_PENDING_FLAG - 3) // 3 x char
625 #define EEPROM_CUSTOM_MENDEL_NAME (EEPROM_FILENAME_EXTENSION-17) //char[17]
626 #define EEPROM_UVLO_Z_LIFTED (EEPROM_CUSTOM_MENDEL_NAME-1) //bool
627 
628 //This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items.
629 #define EEPROM_LAST_ITEM EEPROM_UVLO_Z_LIFTED
630 // !!!!!
631 // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
632 // !!!!!
633 
634 
635 
636 // Currently running firmware, each digit stored as uint16_t.
637 // The flavor differentiates a dev, alpha, beta, release candidate or a release version.
638 #define EEPROM_FIRMWARE_VERSION_END (FW_PRUSA3D_MAGIC_LEN+8)
639 #define EEPROM_FIRMWARE_VERSION_FLAVOR (FW_PRUSA3D_MAGIC_LEN+6)
640 #define EEPROM_FIRMWARE_VERSION_REVISION (FW_PRUSA3D_MAGIC_LEN+4)
641 #define EEPROM_FIRMWARE_VERSION_MINOR (FW_PRUSA3D_MAGIC_LEN+2)
642 #define EEPROM_FIRMWARE_VERSION_MAJOR FW_PRUSA3D_MAGIC_LEN
643 // Magic string, indicating that the current or the previous firmware running was the Prusa3D firmware.
644 #define EEPROM_FIRMWARE_PRUSA_MAGIC 0
645 #define EEPROM_ECOOL_MAGIC_NUMBER 42
646 
647 #ifdef __cplusplus
648 #include "ConfigurationStore.h"
649 static_assert(EEPROM_FIRMWARE_VERSION_END < 20, "Firmware version EEPROM address conflicts with EEPROM_M500_base");
650 static M500_conf * const EEPROM_M500_base = reinterpret_cast<M500_conf*>(20); //offset for storing settings using M500
651 static_assert(((sizeof(M500_conf) + 20) < EEPROM_LAST_ITEM), "M500_conf address space conflicts with previous items.");
652 #endif
653 
654 enum
655 {
656  EEPROM_MMU_CUTTER_ENABLED_enabled = 1,
657  EEPROM_MMU_CUTTER_ENABLED_always = 2,
658 };
659 
660 #ifdef __cplusplus
661 void eeprom_init();
662 void eeprom_adjust_bed_reset();
663 struct SheetName
664 {
665  char c[sizeof(Sheet::name) + 1];
666 };
667 void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName);
668 int8_t eeprom_next_initialized_sheet(int8_t sheet);
669 void eeprom_switch_to_next_sheet();
670 bool eeprom_is_sheet_initialized(uint8_t sheet_num);
671 
672 bool eeprom_is_initialized_block(const void *__p, size_t __n);
673 void eeprom_update_block_P(const void *__src, void *__dst, size_t __n);
674 void eeprom_toggle(uint8_t *__p);
675 
676 void eeprom_increment_byte(uint8_t *__p);
677 void eeprom_increment_word(uint16_t *__p);
678 void eeprom_increment_dword(uint32_t *__p);
679 
680 void eeprom_add_byte(uint8_t *__p, uint8_t add);
681 void eeprom_add_word(uint16_t *__p, uint16_t add);
682 void eeprom_add_dword(uint32_t *__p, uint32_t add);
683 
684 uint8_t eeprom_init_default_byte(uint8_t *__p, uint8_t def);
685 uint16_t eeprom_init_default_word(uint16_t *__p, uint16_t def);
686 uint32_t eeprom_init_default_dword(uint32_t *__p, uint32_t def);
687 void eeprom_init_default_float(float *__p, float def);
688 void eeprom_init_default_block(void *__p, size_t __n, const void *def);
689 void eeprom_init_default_block_P(void *__p, size_t __n, const void *def);
691 #ifndef DEBUG_EEPROM_CHANGES
692 void eeprom_write_byte_notify(uint8_t *dst, uint8_t value);
693 void eeprom_update_byte_notify(uint8_t *dst, uint8_t value);
694 void eeprom_write_word_notify(uint16_t *dst, uint16_t value);
695 void eeprom_update_word_notify(uint16_t *dst, uint16_t value);
696 void eeprom_write_dword_notify(uint32_t *dst, uint32_t value);
697 void eeprom_update_dword_notify(uint32_t *dst, uint32_t value);
698 void eeprom_write_float_notify(float *dst, float value);
699 void eeprom_update_float_notify(float *dst, float value);
700 void eeprom_write_block_notify(const void *__src, void *__dst , size_t __size);
701 void eeprom_update_block_notify(const void *__src, void *__dst, size_t __size);
702 #else
703 void eeprom_write_byte_notify(uint8_t *dst, uint8_t value, bool active = true);
704 void eeprom_update_byte_notify(uint8_t *dst, uint8_t value, bool active = true);
705 void eeprom_write_word_notify(uint16_t *dst, uint16_t value, bool active = true);
706 void eeprom_update_word_notify(uint16_t *dst, uint16_t value, bool active = true);
707 void eeprom_write_dword_notify(uint32_t *dst, uint32_t value, bool active = true);
708 void eeprom_update_dword_notify(uint32_t *dst, uint32_t value, bool active = true);
709 void eeprom_write_float_notify(float *dst, float value, bool active = true);
710 void eeprom_update_float_notify(float *dst, float value, bool active = true);
711 void eeprom_write_block_notify(const void *__src, void *__dst , size_t __size, bool active = true);
712 void eeprom_update_block_notify(const void *__src, void *__dst, size_t __size , bool active = true);
713 #endif //DEBUG_EEPROM_CHANGES
714 #endif
715 
716 #endif // EEPROM_H
void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName)
Get default sheet name for index.
Definition: eeprom.cpp:91
int8_t eeprom_next_initialized_sheet(int8_t sheet)
Get next initialized sheet.
Definition: eeprom.cpp:129
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value)
Updates eeprom byte and notifies the changed eeprom address (just the address!) onto the serial line.
Definition: eeprom.cpp:167
Definition: ConfigurationStore.h:10
Definition: eeprom.h:664
Definition: eeprom.h:30
uint8_t bed_temp
0 .. 254 [°C] NOTE: currently only written-to and never used
Definition: eeprom.h:33
int16_t z_offset
Z_BABYSTEP_MIN .. Z_BABYSTEP_MAX = Z_BABYSTEP_MIN*2/1000 [mm] .. Z_BABYSTEP_MAX*2/1000 [mm].
Definition: eeprom.h:32
unsigned char name[MAX_SHEET_NAME_LENGTH]
Can be null terminated, doesn't need to be null terminated.
Definition: eeprom.h:31
uint8_t pinda_temp
0 .. 254 [°C] NOTE: currently only written-to and never used
Definition: eeprom.h:34
Definition: eeprom.h:38