config.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. #ifndef _BOARD_CONFIG_H_
  2. #define _BOARD_CONFIG_H_
  3. #include <driver/gpio.h>
  4. /* ---------------------------------------------------------------- */
  5. // Audio CODEC ES7210 + ES8311
  6. #define AUDIO_INPUT_SAMPLE_RATE 24000
  7. #define AUDIO_OUTPUT_SAMPLE_RATE 24000
  8. #define AUDIO_INPUT_REFERENCE true
  9. #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_30
  10. #define AUDIO_I2S_GPIO_WS GPIO_NUM_29
  11. #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_27
  12. #define AUDIO_I2S_GPIO_DIN GPIO_NUM_28
  13. #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_26
  14. #define AUDIO_CODEC_PA_PIN GPIO_NUM_NC // PI4IOE 控制
  15. #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_31
  16. #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_32
  17. #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
  18. #define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR
  19. #define BUILTIN_LED_GPIO GPIO_NUM_NC
  20. #define BOOT_BUTTON_GPIO GPIO_NUM_0
  21. #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
  22. #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
  23. /* ---------------------------------------------------------------- */
  24. // 显示屏相关参数配置
  25. #define DISPLAY_WIDTH 720
  26. #define DISPLAY_HEIGHT 1280
  27. #define DISPLAY_MIRROR_X false
  28. #define DISPLAY_MIRROR_Y false
  29. #define DISPLAY_SWAP_XY false
  30. #define DISPLAY_OFFSET_X 0
  31. #define DISPLAY_OFFSET_Y 0
  32. #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_22
  33. #define DISPLAY_BACKLIGHT_OUTPUT_INVERT true
  34. #define TOUCH_INT_GPIO GPIO_NUM_23 // 触摸中断
  35. const ili9881c_lcd_init_cmd_t tab5_lcd_ili9881c_specific_init_code_default[] = {
  36. // {cmd, { data }, data_size, delay}
  37. /**** CMD_Page 1 ****/
  38. {0xFF, (uint8_t[]){0x98, 0x81, 0x01}, 3, 0},
  39. {0xB7, (uint8_t[]){0x03}, 1, 0}, // set 2 lane
  40. /**** CMD_Page 3 ****/
  41. {0xFF, (uint8_t[]){0x98, 0x81, 0x03}, 3, 0},
  42. {0x01, (uint8_t[]){0x00}, 1, 0},
  43. {0x02, (uint8_t[]){0x00}, 1, 0},
  44. {0x03, (uint8_t[]){0x73}, 1, 0},
  45. {0x04, (uint8_t[]){0x00}, 1, 0},
  46. {0x05, (uint8_t[]){0x00}, 1, 0},
  47. {0x06, (uint8_t[]){0x08}, 1, 0},
  48. {0x07, (uint8_t[]){0x00}, 1, 0},
  49. {0x08, (uint8_t[]){0x00}, 1, 0},
  50. {0x09, (uint8_t[]){0x1B}, 1, 0},
  51. {0x0a, (uint8_t[]){0x01}, 1, 0},
  52. {0x0b, (uint8_t[]){0x01}, 1, 0},
  53. {0x0c, (uint8_t[]){0x0D}, 1, 0},
  54. {0x0d, (uint8_t[]){0x01}, 1, 0},
  55. {0x0e, (uint8_t[]){0x01}, 1, 0},
  56. {0x0f, (uint8_t[]){0x26}, 1, 0},
  57. {0x10, (uint8_t[]){0x26}, 1, 0},
  58. {0x11, (uint8_t[]){0x00}, 1, 0},
  59. {0x12, (uint8_t[]){0x00}, 1, 0},
  60. {0x13, (uint8_t[]){0x02}, 1, 0},
  61. {0x14, (uint8_t[]){0x00}, 1, 0},
  62. {0x15, (uint8_t[]){0x00}, 1, 0},
  63. {0x16, (uint8_t[]){0x00}, 1, 0},
  64. {0x17, (uint8_t[]){0x00}, 1, 0},
  65. {0x18, (uint8_t[]){0x00}, 1, 0},
  66. {0x19, (uint8_t[]){0x00}, 1, 0},
  67. {0x1a, (uint8_t[]){0x00}, 1, 0},
  68. {0x1b, (uint8_t[]){0x00}, 1, 0},
  69. {0x1c, (uint8_t[]){0x00}, 1, 0},
  70. {0x1d, (uint8_t[]){0x00}, 1, 0},
  71. {0x1e, (uint8_t[]){0x40}, 1, 0},
  72. {0x1f, (uint8_t[]){0x00}, 1, 0},
  73. {0x20, (uint8_t[]){0x06}, 1, 0},
  74. {0x21, (uint8_t[]){0x01}, 1, 0},
  75. {0x22, (uint8_t[]){0x00}, 1, 0},
  76. {0x23, (uint8_t[]){0x00}, 1, 0},
  77. {0x24, (uint8_t[]){0x00}, 1, 0},
  78. {0x25, (uint8_t[]){0x00}, 1, 0},
  79. {0x26, (uint8_t[]){0x00}, 1, 0},
  80. {0x27, (uint8_t[]){0x00}, 1, 0},
  81. {0x28, (uint8_t[]){0x33}, 1, 0},
  82. {0x29, (uint8_t[]){0x03}, 1, 0},
  83. {0x2a, (uint8_t[]){0x00}, 1, 0},
  84. {0x2b, (uint8_t[]){0x00}, 1, 0},
  85. {0x2c, (uint8_t[]){0x00}, 1, 0},
  86. {0x2d, (uint8_t[]){0x00}, 1, 0},
  87. {0x2e, (uint8_t[]){0x00}, 1, 0},
  88. {0x2f, (uint8_t[]){0x00}, 1, 0},
  89. {0x30, (uint8_t[]){0x00}, 1, 0},
  90. {0x31, (uint8_t[]){0x00}, 1, 0},
  91. {0x32, (uint8_t[]){0x00}, 1, 0},
  92. {0x33, (uint8_t[]){0x00}, 1, 0},
  93. {0x34, (uint8_t[]){0x00}, 1, 0},
  94. {0x35, (uint8_t[]){0x00}, 1, 0},
  95. {0x36, (uint8_t[]){0x00}, 1, 0},
  96. {0x37, (uint8_t[]){0x00}, 1, 0},
  97. {0x38, (uint8_t[]){0x00}, 1, 0},
  98. {0x39, (uint8_t[]){0x00}, 1, 0},
  99. {0x3a, (uint8_t[]){0x00}, 1, 0},
  100. {0x3b, (uint8_t[]){0x00}, 1, 0},
  101. {0x3c, (uint8_t[]){0x00}, 1, 0},
  102. {0x3d, (uint8_t[]){0x00}, 1, 0},
  103. {0x3e, (uint8_t[]){0x00}, 1, 0},
  104. {0x3f, (uint8_t[]){0x00}, 1, 0},
  105. {0x40, (uint8_t[]){0x00}, 1, 0},
  106. {0x41, (uint8_t[]){0x00}, 1, 0},
  107. {0x42, (uint8_t[]){0x00}, 1, 0},
  108. {0x43, (uint8_t[]){0x00}, 1, 0},
  109. {0x44, (uint8_t[]){0x00}, 1, 0},
  110. {0x50, (uint8_t[]){0x01}, 1, 0},
  111. {0x51, (uint8_t[]){0x23}, 1, 0},
  112. {0x52, (uint8_t[]){0x45}, 1, 0},
  113. {0x53, (uint8_t[]){0x67}, 1, 0},
  114. {0x54, (uint8_t[]){0x89}, 1, 0},
  115. {0x55, (uint8_t[]){0xab}, 1, 0},
  116. {0x56, (uint8_t[]){0x01}, 1, 0},
  117. {0x57, (uint8_t[]){0x23}, 1, 0},
  118. {0x58, (uint8_t[]){0x45}, 1, 0},
  119. {0x59, (uint8_t[]){0x67}, 1, 0},
  120. {0x5a, (uint8_t[]){0x89}, 1, 0},
  121. {0x5b, (uint8_t[]){0xab}, 1, 0},
  122. {0x5c, (uint8_t[]){0xcd}, 1, 0},
  123. {0x5d, (uint8_t[]){0xef}, 1, 0},
  124. {0x5e, (uint8_t[]){0x11}, 1, 0},
  125. {0x5f, (uint8_t[]){0x02}, 1, 0},
  126. {0x60, (uint8_t[]){0x00}, 1, 0},
  127. {0x61, (uint8_t[]){0x07}, 1, 0},
  128. {0x62, (uint8_t[]){0x06}, 1, 0},
  129. {0x63, (uint8_t[]){0x0E}, 1, 0},
  130. {0x64, (uint8_t[]){0x0F}, 1, 0},
  131. {0x65, (uint8_t[]){0x0C}, 1, 0},
  132. {0x66, (uint8_t[]){0x0D}, 1, 0},
  133. {0x67, (uint8_t[]){0x02}, 1, 0},
  134. {0x68, (uint8_t[]){0x02}, 1, 0},
  135. {0x69, (uint8_t[]){0x02}, 1, 0},
  136. {0x6a, (uint8_t[]){0x02}, 1, 0},
  137. {0x6b, (uint8_t[]){0x02}, 1, 0},
  138. {0x6c, (uint8_t[]){0x02}, 1, 0},
  139. {0x6d, (uint8_t[]){0x02}, 1, 0},
  140. {0x6e, (uint8_t[]){0x02}, 1, 0},
  141. {0x6f, (uint8_t[]){0x02}, 1, 0},
  142. {0x70, (uint8_t[]){0x02}, 1, 0},
  143. {0x71, (uint8_t[]){0x02}, 1, 0},
  144. {0x72, (uint8_t[]){0x02}, 1, 0},
  145. {0x73, (uint8_t[]){0x05}, 1, 0},
  146. {0x74, (uint8_t[]){0x01}, 1, 0},
  147. {0x75, (uint8_t[]){0x02}, 1, 0},
  148. {0x76, (uint8_t[]){0x00}, 1, 0},
  149. {0x77, (uint8_t[]){0x07}, 1, 0},
  150. {0x78, (uint8_t[]){0x06}, 1, 0},
  151. {0x79, (uint8_t[]){0x0E}, 1, 0},
  152. {0x7a, (uint8_t[]){0x0F}, 1, 0},
  153. {0x7b, (uint8_t[]){0x0C}, 1, 0},
  154. {0x7c, (uint8_t[]){0x0D}, 1, 0},
  155. {0x7d, (uint8_t[]){0x02}, 1, 0},
  156. {0x7e, (uint8_t[]){0x02}, 1, 0},
  157. {0x7f, (uint8_t[]){0x02}, 1, 0},
  158. {0x80, (uint8_t[]){0x02}, 1, 0},
  159. {0x81, (uint8_t[]){0x02}, 1, 0},
  160. {0x82, (uint8_t[]){0x02}, 1, 0},
  161. {0x83, (uint8_t[]){0x02}, 1, 0},
  162. {0x84, (uint8_t[]){0x02}, 1, 0},
  163. {0x85, (uint8_t[]){0x02}, 1, 0},
  164. {0x86, (uint8_t[]){0x02}, 1, 0},
  165. {0x87, (uint8_t[]){0x02}, 1, 0},
  166. {0x88, (uint8_t[]){0x02}, 1, 0},
  167. {0x89, (uint8_t[]){0x05}, 1, 0},
  168. {0x8A, (uint8_t[]){0x01}, 1, 0},
  169. /**** CMD_Page 4 ****/
  170. {0xFF, (uint8_t[]){0x98, 0x81, 0x04}, 3, 0},
  171. {0x38, (uint8_t[]){0x01}, 1, 0},
  172. {0x39, (uint8_t[]){0x00}, 1, 0},
  173. {0x6C, (uint8_t[]){0x15}, 1, 0},
  174. {0x6E, (uint8_t[]){0x1A}, 1, 0},
  175. {0x6F, (uint8_t[]){0x25}, 1, 0},
  176. {0x3A, (uint8_t[]){0xA4}, 1, 0},
  177. {0x8D, (uint8_t[]){0x20}, 1, 0},
  178. {0x87, (uint8_t[]){0xBA}, 1, 0},
  179. {0x3B, (uint8_t[]){0x98}, 1, 0},
  180. /**** CMD_Page 1 ****/
  181. {0xFF, (uint8_t[]){0x98, 0x81, 0x01}, 3, 0},
  182. {0x22, (uint8_t[]){0x0A}, 1, 0},
  183. {0x31, (uint8_t[]){0x00}, 1, 0},
  184. {0x50, (uint8_t[]){0x6B}, 1, 0},
  185. {0x51, (uint8_t[]){0x66}, 1, 0},
  186. {0x53, (uint8_t[]){0x73}, 1, 0},
  187. {0x55, (uint8_t[]){0x8B}, 1, 0},
  188. {0x60, (uint8_t[]){0x1B}, 1, 0},
  189. {0x61, (uint8_t[]){0x01}, 1, 0},
  190. {0x62, (uint8_t[]){0x0C}, 1, 0},
  191. {0x63, (uint8_t[]){0x00}, 1, 0},
  192. // Gamma P
  193. {0xA0, (uint8_t[]){0x00}, 1, 0},
  194. {0xA1, (uint8_t[]){0x15}, 1, 0},
  195. {0xA2, (uint8_t[]){0x1F}, 1, 0},
  196. {0xA3, (uint8_t[]){0x13}, 1, 0},
  197. {0xA4, (uint8_t[]){0x11}, 1, 0},
  198. {0xA5, (uint8_t[]){0x21}, 1, 0},
  199. {0xA6, (uint8_t[]){0x17}, 1, 0},
  200. {0xA7, (uint8_t[]){0x1B}, 1, 0},
  201. {0xA8, (uint8_t[]){0x6B}, 1, 0},
  202. {0xA9, (uint8_t[]){0x1E}, 1, 0},
  203. {0xAA, (uint8_t[]){0x2B}, 1, 0},
  204. {0xAB, (uint8_t[]){0x5D}, 1, 0},
  205. {0xAC, (uint8_t[]){0x19}, 1, 0},
  206. {0xAD, (uint8_t[]){0x14}, 1, 0},
  207. {0xAE, (uint8_t[]){0x4B}, 1, 0},
  208. {0xAF, (uint8_t[]){0x1D}, 1, 0},
  209. {0xB0, (uint8_t[]){0x27}, 1, 0},
  210. {0xB1, (uint8_t[]){0x49}, 1, 0},
  211. {0xB2, (uint8_t[]){0x5D}, 1, 0},
  212. {0xB3, (uint8_t[]){0x39}, 1, 0},
  213. // Gamma N
  214. {0xC0, (uint8_t[]){0x00}, 1, 0},
  215. {0xC1, (uint8_t[]){0x01}, 1, 0},
  216. {0xC2, (uint8_t[]){0x0C}, 1, 0},
  217. {0xC3, (uint8_t[]){0x11}, 1, 0},
  218. {0xC4, (uint8_t[]){0x15}, 1, 0},
  219. {0xC5, (uint8_t[]){0x28}, 1, 0},
  220. {0xC6, (uint8_t[]){0x1B}, 1, 0},
  221. {0xC7, (uint8_t[]){0x1C}, 1, 0},
  222. {0xC8, (uint8_t[]){0x62}, 1, 0},
  223. {0xC9, (uint8_t[]){0x1C}, 1, 0},
  224. {0xCA, (uint8_t[]){0x29}, 1, 0},
  225. {0xCB, (uint8_t[]){0x60}, 1, 0},
  226. {0xCC, (uint8_t[]){0x16}, 1, 0},
  227. {0xCD, (uint8_t[]){0x17}, 1, 0},
  228. {0xCE, (uint8_t[]){0x4A}, 1, 0},
  229. {0xCF, (uint8_t[]){0x23}, 1, 0},
  230. {0xD0, (uint8_t[]){0x24}, 1, 0},
  231. {0xD1, (uint8_t[]){0x4F}, 1, 0},
  232. {0xD2, (uint8_t[]){0x5F}, 1, 0},
  233. {0xD3, (uint8_t[]){0x39}, 1, 0},
  234. /**** CMD_Page 0 ****/
  235. {0xFF, (uint8_t[]){0x98, 0x81, 0x00}, 3, 0},
  236. {0x35, (uint8_t[]){0x00}, 0, 0},
  237. // {0x11, (uint8_t []){0x00}, 0},
  238. {0xFE, (uint8_t[]){0x00}, 0, 0},
  239. {0x29, (uint8_t[]){0x00}, 0, 0},
  240. //============ Gamma END===========
  241. };
  242. #endif // _BOARD_CONFIG_H_