My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Max7219_Debug_LEDs.h 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. /**
  23. * This module is normally not enabled and does not generate any code. But it
  24. * can be enabled to facilitate the display of extra debug information during
  25. * code development. It assumes the existance of a Max7219 LED Matrix. You
  26. * can get one on eBay similar to this: http://www.ebay.com/itm/191781645249
  27. * for under $2.00 including shipping.
  28. *
  29. * Just connect up +5v and Gnd to give it power. And then 3 wires declared in the
  30. * #define's below. Actual pin assignments can be changed in MAX7219_DEBUG section
  31. * of configuration_adv.h
  32. *
  33. * You first call Max7219_init() and then you have 3 support functions available
  34. * to control the LED's in the 8x8 grid.
  35. *
  36. * void Max7219_init();
  37. * void Max7219_PutByte(uint8_t data);
  38. * void Max7219(uint8_t reg, uint8_t data);
  39. * void Max7219_LED_On( int8_t row, int8_t col);
  40. * void Max7219_LED_Off( int8_t row, int8_t col);
  41. * void Max7219_LED_Toggle( int8_t row, int8_t col);
  42. * void Max7219_Clear_Row( int8_t row);
  43. * void Max7219_Clear_Column( int8_t col);
  44. * void Max7219_Set_Row( int8_t row, int8_t val);
  45. * void Max7219_Set_Column( int8_t column, int8_t val);
  46. * void Max7219_idle_tasks();
  47. */
  48. #if ENABLED(MAX7219_DEBUG)
  49. //
  50. // define max7219 registers
  51. //
  52. #define max7219_reg_noop 0x00
  53. #define max7219_reg_digit0 0x01
  54. #define max7219_reg_digit1 0x02
  55. #define max7219_reg_digit2 0x03
  56. #define max7219_reg_digit3 0x04
  57. #define max7219_reg_digit4 0x05
  58. #define max7219_reg_digit5 0x06
  59. #define max7219_reg_digit6 0x07
  60. #define max7219_reg_digit7 0x08
  61. #define max7219_reg_intensity 0x0a
  62. #define max7219_reg_displayTest 0x0f
  63. #define max7219_reg_decodeMode 0x09
  64. #define max7219_reg_scanLimit 0x0b
  65. #define max7219_reg_shutdown 0x0c
  66. void Max7219_init();
  67. void Max7219_PutByte(uint8_t data);
  68. void Max7219(uint8_t reg, uint8_t data);
  69. void Max7219_LED_On( int8_t row, int8_t col);
  70. void Max7219_LED_Off( int8_t row, int8_t col);
  71. void Max7219_LED_Toggle( int8_t row, int8_t col);
  72. void Max7219_Clear_Row( int8_t row);
  73. void Max7219_Clear_Column( int8_t col);
  74. void Max7219_Set_Row( int8_t row, uint8_t val);
  75. void Max7219_Set_Column( int8_t col, uint8_t val);
  76. void Max7219_idle_tasks();
  77. #endif