My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../../inc/MarlinConfig.h"
  24. #include <L6470.h>
  25. #define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P)
  26. enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5, MAX_L6470 };
  27. #define L6470_ERROR_MASK (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)
  28. #define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK
  29. #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1
  30. class L6470_Marlin {
  31. public:
  32. static bool index_to_dir[MAX_L6470];
  33. static uint8_t axis_xref[MAX_L6470];
  34. static char index_to_axis[MAX_L6470][3];
  35. static uint8_t dir_commands[MAX_L6470];
  36. // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
  37. static volatile bool spi_abort;
  38. static bool spi_active;
  39. L6470_Marlin() {}
  40. static uint16_t get_status(const uint8_t axis);
  41. static uint32_t get_param(uint8_t axis, uint8_t param);
  42. static void set_param(uint8_t axis, uint8_t param, uint32_t value);
  43. static bool get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3],
  44. float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold,
  45. bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold);
  46. static void error_status_decode(const uint16_t status, const uint8_t axis);
  47. static void monitor_driver();
  48. static void init();
  49. static void init_to_defaults();
  50. static void say_axis(const uint8_t axis, const bool label=true);
  51. private:
  52. void populate_chain_array();
  53. };
  54. extern L6470_Marlin L6470;