My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

pic_manager.h 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #ifdef __cplusplus
  24. extern "C" { /* C-declarations for C++ */
  25. #endif
  26. #include "../../../../inc/MarlinConfig.h"
  27. #include <lvgl.h>
  28. #include <stdint.h>
  29. #include <string.h>
  30. #ifndef HAS_SPI_FLASH_FONT
  31. #define HAS_SPI_FLASH_FONT 1 // Disabled until fix the font load code
  32. #endif
  33. #ifndef HAS_GCODE_PREVIEW
  34. #define HAS_GCODE_PREVIEW 1
  35. #endif
  36. #ifndef HAS_LANG_SELECT_SCREEN
  37. #define HAS_LANG_SELECT_SCREEN 1
  38. #endif
  39. #ifndef HAS_BAK_VIEW_IN_FLASH
  40. #define HAS_BAK_VIEW_IN_FLASH 1
  41. #endif
  42. #ifndef HAS_GCODE_DEFAULT_VIEW_IN_FLASH
  43. #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 1
  44. #endif
  45. #ifndef HAS_LOGO_IN_FLASH
  46. #define HAS_LOGO_IN_FLASH 1
  47. #endif
  48. #ifndef SPI_FLASH_SIZE
  49. #define SPI_FLASH_SIZE 0x1000000 // 16MB
  50. #endif
  51. #define PIC_MAX_CN 100 // Maximum number of pictures
  52. #define PIC_NAME_MAX_LEN 50 // Picture name maximum length
  53. #define LOGO_MAX_SIZE_TFT35 (300*1024)
  54. #define LOGO_MAX_SIZE_TFT32 (150*1024)
  55. #define TITLELOGO_MAX_SIZE (150*1024) // Little logo maximum
  56. #define DEFAULT_VIEW_MAX_SIZE (200*200*2)
  57. #define FLASH_VIEW_MAX_SIZE (200*200*2)
  58. #define PER_PIC_MAX_SPACE_TFT35 (9*1024)
  59. #define PER_PIC_MAX_SPACE_TFT32 (16*1024)
  60. #define PER_FONT_MAX_SPACE (16*1024)
  61. #if SPI_FLASH_SIZE == 0x200000
  62. //pic
  63. //Robin_pro pic addr
  64. #define PIC_NAME_ADDR 0x001000 // Pic information addr
  65. #define PIC_SIZE_ADDR 0x001800 // Pic size information addr
  66. #define PIC_COUNTER_ADDR 0x002000 // Pic total number
  67. #define PER_PIC_SAVE_ADDR 0x000000 // Storage address of each picture
  68. #define PIC_LOGO_ADDR 0x000000 // Logo addr
  69. #define PIC_DATA_ADDR 0x003000 //
  70. // TFT35
  71. #define DEFAULT_VIEW_ADDR_TFT35 0x1ea070
  72. #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
  73. #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
  74. #define PIC_DATA_ADDR_TFT35 0x003000 // (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
  75. #define PIC_DATA_ADDR_TFT32 0x00F000
  76. #define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
  77. #define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
  78. // font
  79. #define FONTINFOADDR 0x150000 // 6M -- font addr
  80. #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
  81. #else
  82. //pic
  83. //Robin_pro pic addr
  84. #define PIC_NAME_ADDR 0x003000 // Pic information addr
  85. #define PIC_SIZE_ADDR 0x007000 // Pic size information addr
  86. #define PIC_COUNTER_ADDR 0x008000 // Pic total number
  87. //#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture
  88. #define PIC_LOGO_ADDR 0x009000 // Logo addr
  89. //#define PIC_DATA_ADDR 0x02F000 //
  90. // TFT35
  91. #define DEFAULT_VIEW_ADDR_TFT35 0xC5800
  92. #define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
  93. #define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
  94. #define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
  95. // TFT32
  96. #define PIC_DATA_ADDR_TFT32 0x02F000
  97. #define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
  98. #define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
  99. // font
  100. #define FONTINFOADDR 0x600000 // 6M -- font addr
  101. #define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
  102. #define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024
  103. #endif
  104. // Flash flag
  105. #define REFLSHE_FLGA_ADD (0X800000-32)
  106. #define FLASH_INF_VALID_FLAG 0xAA558761
  107. // SD card information first addr
  108. #define VAR_INF_ADDR 0x000000
  109. union union32 {
  110. uint8_t bytes[4];
  111. uint32_t dwords;
  112. };
  113. // pic information
  114. struct pic_msg {
  115. uint8_t name[PIC_NAME_MAX_LEN];
  116. union union32 size;
  117. };
  118. typedef struct pic_msg PIC_MSG;
  119. #define BMP_WRITE_BUF_LEN 512
  120. #define PICINFOADDR 0x1000
  121. #define PIC_SIZE_xM 6
  122. #define FONT_SIZE_xM 2
  123. extern void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff);
  124. extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize);
  125. extern void lv_pic_test(uint8_t *P_Rbuff, uint32_t addr, uint32_t size);
  126. extern uint32_t lv_get_pic_addr(uint8_t *Pname);
  127. extern void get_spi_flash_data(const char *rec_buf, int offset, int size);
  128. extern void spi_flash_read_test();
  129. extern void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize);
  130. extern void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize);
  131. #ifdef __cplusplus
  132. } /* C-declarations for C++ */
  133. #endif