configs.h 11 KB

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