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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 off by default, but can be enabled to facilitate the display of
  24. * extra debug information during code development. It assumes the existence of a
  25. * Max7219 LED Matrix. A suitable device can be obtained on eBay similar to this:
  26. * http://www.ebay.com/itm/191781645249 for under $2.00 including shipping.
  27. *
  28. * Just connect up +5v and GND to give it power, then connect up the pins assigned
  29. * in Configuration_adv.h. For example, on the Re-ARM you could use:
  30. *
  31. * #define MAX7219_CLK_PIN 77
  32. * #define MAX7219_DIN_PIN 78
  33. * #define MAX7219_LOAD_PIN 79
  34. *
  35. * Max7219_init() is called automatically at startup, and then there are a number of
  36. * support functions available to control the LEDs in the 8x8 grid.
  37. *
  38. * void Max7219_init();
  39. * void Max7219_PutByte(uint8_t data);
  40. * void Max7219(uint8_t reg, uint8_t data);
  41. * void Max7219_LED_Set(uint8_t row, uint8_t col, bool on);
  42. * void Max7219_LED_On(uint8_t col, uint8_t row);
  43. * void Max7219_LED_Off(uint8_t col, uint8_t row);
  44. * void Max7219_LED_Toggle(uint8_t row, uint8_t col);
  45. * void Max7219_Clear_Row(uint8_t row);
  46. * void Max7219_Clear_Column(uint8_t col);
  47. * void Max7219_Set_Row(uint8_t row, uint8_t val);
  48. * void Max7219_Set_2_Rows(uint8_t row, uint16_t val);
  49. * void Max7219_Set_4_Rows(uint8_t row, uint32_t val);
  50. * void Max7219_Set_Column(uint8_t col, uint8_t val);
  51. * void Max7219_idle_tasks();
  52. */
  53. #ifndef __MAX7219_DEBUG_LEDS_H__
  54. #define __MAX7219_DEBUG_LEDS_H__
  55. //
  56. // define max7219 registers
  57. //
  58. #define max7219_reg_noop 0x00
  59. #define max7219_reg_digit0 0x01
  60. #define max7219_reg_digit1 0x02
  61. #define max7219_reg_digit2 0x03
  62. #define max7219_reg_digit3 0x04
  63. #define max7219_reg_digit4 0x05
  64. #define max7219_reg_digit5 0x06
  65. #define max7219_reg_digit6 0x07
  66. #define max7219_reg_digit7 0x08
  67. #define max7219_reg_intensity 0x0A
  68. #define max7219_reg_displayTest 0x0F
  69. #define max7219_reg_decodeMode 0x09
  70. #define max7219_reg_scanLimit 0x0B
  71. #define max7219_reg_shutdown 0x0C
  72. void Max7219_init();
  73. void Max7219_PutByte(uint8_t data);
  74. void Max7219(const uint8_t reg, const uint8_t data);
  75. void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on);
  76. void Max7219_LED_On(const uint8_t row, const uint8_t col);
  77. void Max7219_LED_Off(const uint8_t row, const uint8_t col);
  78. void Max7219_LED_Toggle(const uint8_t row, const uint8_t col);
  79. void Max7219_Clear_Row(const uint8_t row);
  80. void Max7219_Clear_Column(const uint8_t col);
  81. void Max7219_Set_Row(const uint8_t row, const uint8_t val);
  82. void Max7219_Set_Column(const uint8_t col, const uint8_t val);
  83. void Max7219_idle_tasks();
  84. #endif // __MAX7219_DEBUG_LEDS_H__