config_define.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. /*****************************************************************************
  2. * Module : Configs
  3. * File : config_define.h
  4. * Function : 定义用户参数常量
  5. *****************************************************************************/
  6. #ifndef CONFIG_DEFINE_H
  7. #define CONFIG_DEFINE_H
  8. /*****************************************************************************
  9. * Module : 显示相关配置选择列表
  10. *****************************************************************************/
  11. //显示驱动屏选择
  12. #define DISPLAY_NO 0 //无显示模块
  13. #define DISPLAY_LCD 0x100 //选用LCD点阵屏做为显示驱动
  14. #define DISPLAY_LCDSEG 0x200 //选用断码屏做为显示驱动
  15. #define DISPLAY_LEDSEG 0x300 //选用数码管做为显示驱动
  16. #define GUI_NO DISPLAY_NO //无主题,无显示
  17. #define GUI_LCD_DEFAULT (DISPLAY_LCD | 0x00) //LCD点阵屏默认主题
  18. #define GUI_LCDSEG_DEFAULT (DISPLAY_LCDSEG | 0x00) //断码屏默认主题
  19. #define GUI_LEDSEG_5C7S (DISPLAY_LEDSEG | 0x00) //5C7S 数码管
  20. #define GUI_LEDSEG_7P7S (DISPLAY_LEDSEG | 0x81) //7PIN 数码管 按SEG方式扫描
  21. #define GUI_LEDSEG_7P7C (DISPLAY_LEDSEG | 0xC1) //7PIN 数码管 按COM方式扫描
  22. /*****************************************************************************
  23. * Module : 提示音语言配置选择列表
  24. *****************************************************************************/
  25. #define LANG_EN 0 //英文提示音
  26. #define LANG_ZH 1 //中文提示音
  27. #define LANG_EN_ZH 2 //中英文, 默认英文
  28. #define LANG_ZH_EN 3 //中英文, 默认中文
  29. /*****************************************************************************
  30. * Module : ADC通路选择列表
  31. *****************************************************************************/
  32. #define ADCCH_MIC 0 //SARADC channel 0
  33. #define ADCCH_PA6 1 //SARADC channel 1
  34. #define ADCCH_PA7 2 //SARADC channel 2
  35. #define ADCCH_VTSEN 3 //SARADC channel 3 ts
  36. #define ADCCH_PG5 4 //SARADC channel 4
  37. #define ADCCH_PB3 5 //SARADC channel 5
  38. #define ADCCH_PB4 6 //SARADC channel 6
  39. #define ADCCH_PG1 7 //SARADC channel 7
  40. #define ADCCH_PG2 8 //SARADC channel 8
  41. #define ADCCH_PE7 9 //SARADC channel 9 ADS7844 ADC0
  42. #define ADCCH_PF2 10 //SARADC channel 10
  43. #define ADCCH_VRTC 11 //SARADC channel 11
  44. #define ADCCH_WKO 12 //SARADC channel 12
  45. #define ADCCH_BGOP 13 //SARADC channel 13
  46. #define ADCCH_VBAT 14 //SARADC channel 14
  47. #define ADCCH_VUSB 15 //SARADC channel 15
  48. /*****************************************************************************
  49. * Module : Timer3 Capture Mapping选择列表
  50. *****************************************************************************/
  51. #define TMR3MAP_PA5 (1 << 4) //G1 capture mapping: PA5
  52. #define TMR3MAP_PA6 (2 << 4) //G2 capture mapping: PA6
  53. #define TMR3MAP_PB0 (3 << 4) //G3 capture mapping: PB0
  54. #define TMR3MAP_PB1 (4 << 4) //G4 capture mapping: PB1
  55. #define TMR3MAP_PE0 (5 << 4) //G5 capture mapping: PE0
  56. #define TMR3MAP_PE5 (6 << 4) //G6 capture mapping: PE5
  57. #define TMR3MAP_PE6 (7 << 4) //G7 capture mapping: PE6
  58. /*****************************************************************************
  59. * Module : IRRX Mapping选择列表
  60. *****************************************************************************/
  61. #define IRMAP_PA5 (1 << 20) //G1 capture mapping: PA5
  62. #define IRMAP_PA6 (2 << 20) //G2 capture mapping: PA6
  63. #define IRMAP_PB0 (3 << 20) //G3 capture mapping: PB0
  64. #define IRMAP_PB1 (4 << 20) //G4 capture mapping: PB1
  65. #define IRMAP_PE0 (5 << 20) //G5 capture mapping: PE0
  66. #define IRMAP_PE5 (6 << 20) //G6 capture mapping: PE5
  67. #define IRMAP_PE6 (7 << 20) //G7 capture mapping: PE6
  68. #define IRMAP_PE7 (8 << 20) //G8 capture mapping: PE7
  69. #define IRMAP_PF2 (9 << 20) //G9 capture mapping: PF2
  70. /*****************************************************************************
  71. * Module : LPWM(Breathing-lamp) Mapping选择列表
  72. *****************************************************************************/
  73. #define LPWM0MAP_PE4 (1 << 16) //G1 LPWM0 mapping: PE4
  74. #define LPWM1MAP_PE5 (1 << 20) //G1 LPWM1 mapping: PE5
  75. #define LPWM2MAP_PE6 (1 << 24) //G1 LPWM2 mapping: PE6
  76. #define LPWM3MAP_PE7 (1 << 28) //G1 LPWM3 mapping: PE7
  77. #define LPWM0MAP_PB3 (2 << 16) //G2 LPWM0 mapping: PB3
  78. #define LPWM1MAP_PB4 (2 << 20) //G2 LPWM1 mapping: PB4
  79. #define LPWM2MAP_PE0 (2 << 24) //G2 LPWM2 mapping: PE0
  80. #define LPWM3MAP_PF2 (2 << 28) //G2 LPWM3 mapping: PF2
  81. #define LPWM0MAP_PA0 (3 << 16) //G3 LPWM0 mapping: PA0
  82. #define LPWM1MAP_PA1 (3 << 20) //G3 LPWM1 mapping: PA1
  83. #define LPWM2MAP_PA2 (3 << 24) //G3 LPWM2 mapping: PA2
  84. #define LPWM3MAP_PA3 (3 << 28) //G3 LPWM3 mapping: PA3
  85. /*****************************************************************************
  86. * Module : Clock output Mapping选择列表
  87. *****************************************************************************/
  88. #define CLKOMAP_PA7 (1 << 0) //G1 Clock output mapping: PA7
  89. #define CLKOMAP_PA6 (2 << 0) //G2 Clock output mapping: PA6
  90. #define CLKOMAP_PB3 (3 << 0) //G3 Clock output mapping: PB3
  91. #define CLKOMAP_PB4 (4 << 0) //G4 Clock output mapping: PB4
  92. #define CLKOMAP_PE0 (5 << 0) //G5 Clock output mapping: PE0
  93. #define CLKOMAP_PE7 (6 << 0) //G6 Clock output mapping: PE7
  94. #define CLKOMAP_PF2 (7 << 0) //G6 Clock output mapping: PF2
  95. /*****************************************************************************
  96. * Module : sd0 Mapping选择列表
  97. *****************************************************************************/
  98. #define SD0MAP_G1 (1 << 0) //G1 SDCLK(PA7), SDCMD(PA6), SDDAT0(PB3)
  99. #define SD0MAP_G2 (2 << 0) //G2 SDCLK(PA7), SDCMD(PB4), SDDAT0(PB3)
  100. /*****************************************************************************
  101. * Module : uart0 Mapping选择列表
  102. *****************************************************************************/
  103. #define UTX0MAP_PA7 (1 << 8) //G1 uart0 tx: PA7
  104. #define UTX0MAP_PB3 (3 << 8) //G3 uart0 tx: PB3 //USBDP
  105. #define UTX0MAP_PE7 (4 << 8) //G4 uart0 tx: PE7
  106. #define UTX0MAP_PE0 (6 << 8) //G6 uart0 tx: PE0
  107. #define UTX0MAP_PF2 (7 << 8) //G7 uart0 tx: PF2
  108. #define URX0MAP_TX (7 << 12) //G7 uart0 map to TX pin by UT0TXMAP select(1线模式)
  109. /*****************************************************************************
  110. * Module : 录音文件类型列表
  111. *****************************************************************************/
  112. #define REC_NO 0
  113. #define REC_WAV 1 //PCM WAV
  114. #define REC_ADPCM 2 //ADPCM WAV
  115. #define REC_MP3 3
  116. #define REC_SBC 4
  117. /*****************************************************************************
  118. * Module : I2S设备列表
  119. *****************************************************************************/
  120. #define I2S_DEV_NO 0
  121. #define I2S_DEV_TAS5711 1
  122. #define I2S_DEV_WM8978 2
  123. #define I2S_GPIOA 0
  124. #define I2S_GPIOE 1
  125. /*****************************************************************************
  126. * Module : SPDIF设备列表
  127. *****************************************************************************/
  128. #define SPF_CH0 0
  129. #define SPF_CH1 1
  130. #define SPF_CH2 2
  131. #define SPF_CH3 3
  132. #define SPF_CH4 4
  133. #define SPF_CH5 5
  134. /*****************************************************************************
  135. * Module : DAC SELECT
  136. *****************************************************************************/
  137. #define DAC_VCMBUF_MONO 0 //DAC VCMBUF单声道输出
  138. #define DAC_VCMBUF_DUAL 1 //DAC VCMBUF双声道输出
  139. #define DAC_DIFF_MONO 2 //DAC差分单声道输出
  140. #define DAC_DIFF_DUAL 3 //DAC差分双声道输出
  141. /*****************************************************************************
  142. * Module : DAC OUT Sample Rate
  143. *****************************************************************************/
  144. #define DAC_OUT_44K1 0 //dac out sample rate 44.1K
  145. #define DAC_OUT_48K 1 //dac out sample rate 48K
  146. /*****************************************************************************
  147. * Module : DAC LDOH Select
  148. *****************************************************************************/
  149. #define AU_LDOH_2V4 0 //VDDAUD LDO voltage 2.4V
  150. #define AU_LDOH_2V5 1 //VDDAUD LDO voltage 2.5V
  151. #define AU_LDOH_2V7 2 //VDDAUD LDO voltage 2.7V
  152. #define AU_LDOH_2V9 3 //VDDAUD LDO voltage 2.9V
  153. #define AU_LDOH_3V1 4 //VDDAUD LDO voltage 3.1V
  154. #define AU_LDOH_3V2 5 //VDDAUD LDO voltage 3.2V
  155. /*****************************************************************************
  156. * Module : AUX or MIC Left&Right channel list
  157. * AUX: 可以任意左与右搭配,或只选择左,或只选择右
  158. *****************************************************************************/
  159. #define CH_AUXL_PA6 0x01 //AUXL0(PA6) -> left aux
  160. #define CH_AUXL_PB3 0x02 //AUXL1(PB1) -> left aux
  161. #define CH_AUXL_PE7 0x03 //AUXL2(PE6) -> left aux
  162. #define CH_AUXL_PA7 0x04 //AUXL3(PF0) -> left aux
  163. #define CH_AUXL_VOUTLN 0x05 //VOUTLN -> left aux
  164. #define CH_AUXL_MICL 0x06 //MICL -> left aux
  165. #define CH_MICL0 0x0c //MICL -> left mic
  166. /*****************************************************************************
  167. * Module : 电池低电电压列表
  168. *****************************************************************************/
  169. #define VBAT_2V8 0 //2.8v
  170. #define VBAT_2V9 1 //2.9v
  171. #define VBAT_3V0 2 //3.0v
  172. #define VBAT_3V1 3 //3.1v
  173. #define VBAT_3V2 4 //3.2v
  174. #define VBAT_3V3 5 //3.3v
  175. #define VBAT_3V4 6 //3.4v
  176. #define VBAT_3V5 7 //3.5v
  177. #define VBAT_3V6 8 //3.6v
  178. #define VBAT_3V7 9 //3.7v
  179. #define VBAT_3V8 10 //3.8v
  180. /*****************************************************************************
  181. * Module : uart0 printf IO列表
  182. *****************************************************************************/
  183. #define PRINTF_NONE 0 //关闭UART0打印信息
  184. #define PRINTF_PA7 1
  185. #define PRINTF_PB3 2
  186. #define PRINTF_PE7 3
  187. #define PRINTF_PF2 4
  188. #define PRINTF_PE0 5
  189. /*****************************************************************************
  190. * Module : CRBFMAP
  191. *****************************************************************************/
  192. #define CRBFMAP_DAC 1
  193. #define CRBFMAP_PF2 2
  194. #define CRBFMAP_PB3 3
  195. #define CRBFMAP_PB4 4
  196. #define CRBFMAP_PE7 5
  197. #define CRBFMAP_PA6 6
  198. #define CRBFMAP_PA7 7
  199. /*****************************************************************************
  200. * Module : GPIO list
  201. *****************************************************************************/
  202. #define IO_NONE 0
  203. #define IO_PA0 1
  204. #define IO_PA1 2
  205. #define IO_PA2 3
  206. #define IO_PA3 4
  207. #define IO_PA4 5
  208. #define IO_PA5 6
  209. #define IO_PA6 7
  210. #define IO_PA7 8
  211. #define IO_PB0 9
  212. #define IO_PB1 10
  213. #define IO_PB2 11
  214. #define IO_PB3 12
  215. #define IO_PB4 13
  216. #define IO_PE0 14
  217. #define IO_PE1 15
  218. #define IO_PE2 16
  219. #define IO_PE3 17
  220. #define IO_PE4 18
  221. #define IO_PE5 19
  222. #define IO_PE6 20
  223. #define IO_PE7 21
  224. #define IO_PF0 22
  225. #define IO_PF1 23
  226. #define IO_PF2 24
  227. #define IO_PF3 25
  228. #define IO_PF4 26
  229. #define IO_PG0 27
  230. #define IO_PG1 28
  231. #define IO_PG2 29
  232. #define IO_PG3 30
  233. #define IO_PG4 31
  234. #define IO_PG5 32
  235. #endif //CONFIG_DEFINE_H