configs.h 11 KB

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