configs.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. #ifndef configs_h
  2. #define configs_h
  3. #define POLISH_POTATO
  4. //#define MARAUDER_MINI
  5. //#define MARAUDER_V4
  6. //#define MARAUDER_V6
  7. //#define MARAUDER_KIT
  8. //#define GENERIC_ESP32
  9. #define MARAUDER_FLIPPER
  10. //#define ESP32_LDDB
  11. //#define MARAUDER_DEV_BOARD_PRO
  12. #define MARAUDER_VERSION "v0.10.1"
  13. //// BUTTON DEFINITIONS
  14. #ifdef MARAUDER_MINI
  15. #define L_BTN 13
  16. #define C_BTN 34
  17. #define U_BTN 36
  18. #define R_BTN 39
  19. #define D_BTN 35
  20. #endif
  21. #ifdef MARAUDER_V4
  22. #endif
  23. //// END BUTTON DEFINITIONS
  24. //// DISPLAY DEFINITIONS
  25. #ifdef MARAUDER_V4
  26. #define BANNER_TEXT_SIZE 2
  27. #ifndef TFT_WIDTH
  28. #define TFT_WIDTH 240
  29. #endif
  30. #ifndef TFT_HEIGHT
  31. #define TFT_HEIGHT 320
  32. #endif
  33. #define TFT_SHIELD
  34. #define SCREEN_WIDTH TFT_WIDTH
  35. #define SCREEN_HEIGHT TFT_HEIGHT
  36. #define HEIGHT_1 TFT_WIDTH
  37. #define WIDTH_1 TFT_HEIGHT
  38. #define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
  39. #define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
  40. #define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
  41. #define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
  42. #define YMAX 320 // Bottom of screen area
  43. #define minimum(a,b) (((a) < (b)) ? (a) : (b))
  44. //#define MENU_FONT NULL
  45. #define MENU_FONT &FreeMono9pt7b // Winner
  46. //#define MENU_FONT &FreeMonoBold9pt7b
  47. //#define MENU_FONT &FreeSans9pt7b
  48. //#define MENU_FONT &FreeSansBold9pt7b
  49. #define BUTTON_ARRAY_LEN 10
  50. #define STATUS_BAR_WIDTH 16
  51. #define LVGL_TICK_PERIOD 6
  52. #define FRAME_X 100
  53. #define FRAME_Y 64
  54. #define FRAME_W 120
  55. #define FRAME_H 50
  56. // Red zone size
  57. #define REDBUTTON_X FRAME_X
  58. #define REDBUTTON_Y FRAME_Y
  59. #define REDBUTTON_W (FRAME_W/2)
  60. #define REDBUTTON_H FRAME_H
  61. // Green zone size
  62. #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
  63. #define GREENBUTTON_Y FRAME_Y
  64. #define GREENBUTTON_W (FRAME_W/2)
  65. #define GREENBUTTON_H FRAME_H
  66. #define STATUSBAR_COLOR 0x4A49
  67. #define KIT_LED_BUILTIN 13
  68. #endif
  69. #ifdef MARAUDER_V6
  70. #define BANNER_TEXT_SIZE 2
  71. #ifndef TFT_WIDTH
  72. #define TFT_WIDTH 240
  73. #endif
  74. #ifndef TFT_HEIGHT
  75. #define TFT_HEIGHT 320
  76. #endif
  77. #define TFT_DIY
  78. #define SCREEN_WIDTH TFT_WIDTH
  79. #define SCREEN_HEIGHT TFT_HEIGHT
  80. #define HEIGHT_1 TFT_WIDTH
  81. #define WIDTH_1 TFT_HEIGHT
  82. #define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
  83. #define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
  84. #define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
  85. #define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
  86. #define YMAX 320 // Bottom of screen area
  87. #define minimum(a,b) (((a) < (b)) ? (a) : (b))
  88. //#define MENU_FONT NULL
  89. #define MENU_FONT &FreeMono9pt7b // Winner
  90. //#define MENU_FONT &FreeMonoBold9pt7b
  91. //#define MENU_FONT &FreeSans9pt7b
  92. //#define MENU_FONT &FreeSansBold9pt7b
  93. #define BUTTON_ARRAY_LEN 10
  94. #define STATUS_BAR_WIDTH 16
  95. #define LVGL_TICK_PERIOD 6
  96. #define FRAME_X 100
  97. #define FRAME_Y 64
  98. #define FRAME_W 120
  99. #define FRAME_H 50
  100. // Red zone size
  101. #define REDBUTTON_X FRAME_X
  102. #define REDBUTTON_Y FRAME_Y
  103. #define REDBUTTON_W (FRAME_W/2)
  104. #define REDBUTTON_H FRAME_H
  105. // Green zone size
  106. #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
  107. #define GREENBUTTON_Y FRAME_Y
  108. #define GREENBUTTON_W (FRAME_W/2)
  109. #define GREENBUTTON_H FRAME_H
  110. #define STATUSBAR_COLOR 0x4A49
  111. #define KIT_LED_BUILTIN 13
  112. #endif
  113. #ifdef MARAUDER_KIT
  114. #define BANNER_TEXT_SIZE 2
  115. #ifndef TFT_WIDTH
  116. #define TFT_WIDTH 240
  117. #endif
  118. #ifndef TFT_HEIGHT
  119. #define TFT_HEIGHT 320
  120. #endif
  121. #define TFT_DIY
  122. #define KIT
  123. #define SCREEN_WIDTH TFT_WIDTH
  124. #define SCREEN_HEIGHT TFT_HEIGHT
  125. #define HEIGHT_1 TFT_WIDTH
  126. #define WIDTH_1 TFT_HEIGHT
  127. #define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
  128. #define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
  129. #define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
  130. #define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
  131. #define YMAX 320 // Bottom of screen area
  132. #define minimum(a,b) (((a) < (b)) ? (a) : (b))
  133. //#define MENU_FONT NULL
  134. #define MENU_FONT &FreeMono9pt7b // Winner
  135. //#define MENU_FONT &FreeMonoBold9pt7b
  136. //#define MENU_FONT &FreeSans9pt7b
  137. //#define MENU_FONT &FreeSansBold9pt7b
  138. #define BUTTON_ARRAY_LEN 10
  139. #define STATUS_BAR_WIDTH 16
  140. #define LVGL_TICK_PERIOD 6
  141. #define FRAME_X 100
  142. #define FRAME_Y 64
  143. #define FRAME_W 120
  144. #define FRAME_H 50
  145. // Red zone size
  146. #define REDBUTTON_X FRAME_X
  147. #define REDBUTTON_Y FRAME_Y
  148. #define REDBUTTON_W (FRAME_W/2)
  149. #define REDBUTTON_H FRAME_H
  150. // Green zone size
  151. #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
  152. #define GREENBUTTON_Y FRAME_Y
  153. #define GREENBUTTON_W (FRAME_W/2)
  154. #define GREENBUTTON_H FRAME_H
  155. #define STATUSBAR_COLOR 0x4A49
  156. #define KIT_LED_BUILTIN 13
  157. #endif
  158. #ifdef MARAUDER_MINI
  159. #define TFT_MISO 19
  160. #define TFT_MOSI 23
  161. #define TFT_SCLK 18
  162. #define TFT_CS 27
  163. #define TFT_DC 26
  164. #define TFT_RST 5
  165. #define TFT_BL 32
  166. #define TOUCH_CS 21
  167. #define SD_CS 4
  168. #define SCREEN_BUFFER
  169. #define MAX_SCREEN_BUFFER 9
  170. #define BANNER_TEXT_SIZE 1
  171. #ifndef TFT_WIDTH
  172. #define TFT_WIDTH 128
  173. #endif
  174. #ifndef TFT_HEIGHT
  175. #define TFT_HEIGHT 128
  176. #endif
  177. #define CHAR_WIDTH 6
  178. #define SCREEN_WIDTH TFT_WIDTH // Originally 240
  179. #define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
  180. #define HEIGHT_1 TFT_WIDTH
  181. #define WIDTH_1 TFT_WIDTH
  182. #define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
  183. #define TEXT_HEIGHT (TFT_HEIGHT/10) // Height of text to be printed and scrolled
  184. #define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
  185. #define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
  186. #define YMAX TFT_HEIGHT // Bottom of screen area
  187. #define minimum(a,b) (((a) < (b)) ? (a) : (b))
  188. //#define MENU_FONT NULL
  189. #define MENU_FONT &FreeMono9pt7b // Winner
  190. //#define MENU_FONT &FreeMonoBold9pt7b
  191. //#define MENU_FONT &FreeSans9pt7b
  192. //#define MENU_FONT &FreeSansBold9pt7b
  193. #define BUTTON_ARRAY_LEN 10
  194. #define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
  195. #define LVGL_TICK_PERIOD 6
  196. #define FRAME_X 100
  197. #define FRAME_Y 64
  198. #define FRAME_W 120
  199. #define FRAME_H 50
  200. // Red zone size
  201. #define REDBUTTON_X FRAME_X
  202. #define REDBUTTON_Y FRAME_Y
  203. #define REDBUTTON_W (FRAME_W/2)
  204. #define REDBUTTON_H FRAME_H
  205. // Green zone size
  206. #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
  207. #define GREENBUTTON_Y FRAME_Y
  208. #define GREENBUTTON_W (FRAME_W/2)
  209. #define GREENBUTTON_H FRAME_H
  210. #define STATUSBAR_COLOR 0x4A49
  211. #endif
  212. //// END DISPLAY DEFINITIONS
  213. //// MENU DEFINITIONS
  214. #ifdef MARAUDER_V4
  215. #define BANNER_TIME 100
  216. #define COMMAND_PREFIX "!"
  217. // Keypad start position, key sizes and spacing
  218. #define KEY_X 120 // Centre of key
  219. #define KEY_Y 50
  220. #define KEY_W 240 // Width and height
  221. #define KEY_H 22
  222. #define KEY_SPACING_X 0 // X and Y gap
  223. #define KEY_SPACING_Y 1
  224. #define KEY_TEXTSIZE 1 // Font size multiplier
  225. #define ICON_W 22
  226. #define ICON_H 22
  227. #define BUTTON_PADDING 22
  228. //#define BUTTON_ARRAY_LEN 5
  229. #endif
  230. #ifdef MARAUDER_V6
  231. #define BANNER_TIME 100
  232. #define COMMAND_PREFIX "!"
  233. // Keypad start position, key sizes and spacing
  234. #define KEY_X 120 // Centre of key
  235. #define KEY_Y 50
  236. #define KEY_W 240 // Width and height
  237. #define KEY_H 22
  238. #define KEY_SPACING_X 0 // X and Y gap
  239. #define KEY_SPACING_Y 1
  240. #define KEY_TEXTSIZE 1 // Font size multiplier
  241. #define ICON_W 22
  242. #define ICON_H 22
  243. #define BUTTON_PADDING 22
  244. //#define BUTTON_ARRAY_LEN 5
  245. #endif
  246. #ifdef MARAUDER_KIT
  247. #define BANNER_TIME 100
  248. #define COMMAND_PREFIX "!"
  249. // Keypad start position, key sizes and spacing
  250. #define KEY_X 120 // Centre of key
  251. #define KEY_Y 50
  252. #define KEY_W 240 // Width and height
  253. #define KEY_H 22
  254. #define KEY_SPACING_X 0 // X and Y gap
  255. #define KEY_SPACING_Y 1
  256. #define KEY_TEXTSIZE 1 // Font size multiplier
  257. #define ICON_W 22
  258. #define ICON_H 22
  259. #define BUTTON_PADDING 22
  260. //#define BUTTON_ARRAY_LEN 5
  261. #endif
  262. #ifdef MARAUDER_MINI
  263. #define BANNER_TIME 50
  264. #define COMMAND_PREFIX "!"
  265. // Keypad start position, key sizes and spacing
  266. #define KEY_X (TFT_WIDTH/2) // Centre of key
  267. #define KEY_Y (TFT_HEIGHT/4.5)
  268. #define KEY_W TFT_WIDTH // Width and height
  269. #define KEY_H (TFT_HEIGHT/12.8)
  270. #define KEY_SPACING_X 0 // X and Y gap
  271. #define KEY_SPACING_Y 1
  272. #define KEY_TEXTSIZE 1 // Font size multiplier
  273. #define ICON_W 22
  274. #define ICON_H 22
  275. #define BUTTON_PADDING 10
  276. #endif
  277. //// END MENU DEFINITIONS
  278. //// SD DEFINITIONS
  279. #ifdef MARAUDER_V4
  280. #define SD_CS 12
  281. #endif
  282. #ifdef MARAUDER_V6
  283. #define SD_CS 12
  284. #endif
  285. #ifdef MARAUDER_KIT
  286. #define SD_CS 12
  287. #endif
  288. #ifdef MARAUDER_MINI
  289. #define SD_CS 4
  290. #endif
  291. #ifdef MARAUDER_FLIPPER
  292. #define SD_CS 10
  293. #endif
  294. #ifdef ESP32_LDDB
  295. #define SD_CS 4
  296. #endif
  297. #ifdef MARAUDER_DEV_BOARD_PRO
  298. #define SD_CS 4
  299. #endif
  300. //// END SD DEFINITIONS
  301. //// SCREEN STUFF
  302. #ifdef MARAUDER_MINI
  303. #define HAS_SCREEN
  304. #define HAS_BT
  305. #endif
  306. #ifdef MARAUDER_V4
  307. #define HAS_SCREEN
  308. #define HAS_BT
  309. #endif
  310. #ifdef MARAUDER_V6
  311. #define HAS_SCREEN
  312. #define HAS_BT
  313. #endif
  314. #ifdef MARAUDER_KIT
  315. #define HAS_SCREEN
  316. #define HAS_BT
  317. #endif
  318. #ifdef GENERIC_ESP32
  319. #define HAS_BT
  320. #endif
  321. #ifndef HAS_SCREEN
  322. #define TFT_WHITE 0
  323. #define TFT_CYAN 0
  324. #define TFT_BLUE 0
  325. #define TFT_RED 0
  326. #define TFT_GREEN 0
  327. #define TFT_GREY 0
  328. #define TFT_GRAY 0
  329. #define TFT_MAGENTA 0
  330. #define TFT_VIOLET 0
  331. #define TFT_ORANGE 0
  332. #define TFT_YELLOW 0
  333. #define STANDARD_FONT_CHAR_LIMIT 40
  334. #define FLASH_BUTTON -1
  335. #include <FS.h>
  336. #include <functional>
  337. #include <LinkedList.h>
  338. #include "SPIFFS.h"
  339. #include "Assets.h"
  340. #endif
  341. //// END SCREEN STUFF
  342. //// NEOPIXEL STUFF
  343. #if defined(ESP32_LDDB)
  344. #define PIN 17
  345. #elif defined(MARAUDER_DEV_BOARD_PRO)
  346. #define PIN 16
  347. #else
  348. #define PIN 25
  349. #endif
  350. #endif