configs.h 11 KB

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