config_define.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 : VDDIO等级定义
  10. *****************************************************************************/
  11. #define PMU_VDDIO_2V4 0x0 //2.4V
  12. #define PMU_VDDIO_2V5 0x1
  13. #define PMU_VDDIO_2V6 0x2
  14. #define PMU_VDDIO_2V7 0x3
  15. #define PMU_VDDIO_2V8 0x4
  16. #define PMU_VDDIO_2V9 0x5
  17. #define PMU_VDDIO_3V0 0x6
  18. #define PMU_VDDIO_3V1 0x7
  19. #define PMU_VDDIO_3V2 0x8
  20. #define PMU_VDDIO_3V3 0x9
  21. #define PMU_VDDIO_3V4 0xA
  22. #define PMU_VDDIO_3V5 0xB
  23. #define PMU_VDDIO_3V6 0xC
  24. #define PMU_VDDIO_3V7 0xD
  25. #define PMU_VDDIO_3V8 0xE
  26. #define PMU_VDDIO_3V9 0xF
  27. /*****************************************************************************
  28. * Module : MIC相关定义
  29. *****************************************************************************/
  30. #define MIC_BIAS_1V8 0x0 //1.8V
  31. #define MIC_BIAS_2V0 0x1
  32. #define MIC_BIAS_2V2 0x2
  33. #define MIC_BIAS_2V4 0x3
  34. #define MIC_BIAS_2V5 0x4
  35. #define MIC_BIAS_2V6 0x5
  36. #define MIC_BIAS_2V7 0x6
  37. #define MIC_BIAS_2V8 0x7
  38. #define MIC_BIAS_RES_0K 0x0
  39. #define MIC_BIAS_RES_1K 0x1
  40. #define MIC_BIAS_RES_2K 0x2
  41. #define MIC_BIAS_RES_4K 0x4
  42. #define MIC_BIAS_RES_8K 0x8
  43. #define MIC_ANA_GAIN_0 0x0
  44. #define MIC_ANA_GAIN_1 0x1
  45. #define MIC_ANA_GAIN_2 0x2
  46. #define MIC_ANA_GAIN_3 0x3
  47. #define MIC_ANA_GAIN_4 0x4
  48. #define MIC_ANA_GAIN_5 0x5
  49. #define MIC_ANA_GAIN_6 0x6
  50. #define MIC_ANA_GAIN_7 0x7
  51. /*****************************************************************************
  52. * Module : FLASH大小定义
  53. *****************************************************************************/
  54. #define FSIZE_1M 0x100000
  55. #define FSIZE_2M 0x200000
  56. #define FSIZE_512K 0x80000
  57. #define FSIZE_256K 0x40000
  58. #define FSIZE_128K 0x20000
  59. /*****************************************************************************
  60. * Module : FOTA升级方式选择列表
  61. *****************************************************************************/
  62. #define AB_FOT_TYPE_PACK 1 //FOTA压缩升级(代码做压缩处理,升级完成需做解压才可正常运行)
  63. #define AB_FOT_TYPE_NORMAL 2 //FOTA非压缩升级(代码完全双备份,不做压缩处理,升级完成可直接运行)
  64. #define AB_FOT_CHANNEL_BLE 0x01 //BLE->Device
  65. #define AB_FOT_CHANNEL_USB 0x02 //USB->Device
  66. #define AB_FOT_CHANNEL_ALL 0xff
  67. /*****************************************************************************
  68. * Module : SLEEP模式定义
  69. *****************************************************************************/
  70. #define SLEEP_DISABLE 0x00
  71. #define SLEEP_LEVEL_LV1 0x01
  72. #define SLEEP_LEVEL_LV2 0x02
  73. /*****************************************************************************
  74. * Module : Printf IO 定义
  75. *****************************************************************************/
  76. /* IO INDEX */
  77. #define PRINTF_NULL 0x00
  78. #define PRINTF_PA0 0xA0
  79. #define PRINTF_PA1 0xA1
  80. #define PRINTF_PA2 0xA2
  81. #define PRINTF_PA3 0xA3
  82. #define PRINTF_PA4 0xA4
  83. #define PRINTF_PA5 0xA5
  84. #define PRINTF_PA6 0xA6
  85. #define PRINTF_PA7 0xA7
  86. #define PRINTF_PA8 0xA8
  87. #define PRINTF_PA9 0xA9
  88. #define PRINTF_PA10 0xAA
  89. #define PRINTF_PA11 0xAB
  90. #define PRINTF_PA12 0xAC
  91. #define PRINTF_PA13 0xAD
  92. #define PRINTF_PA14 0xAE
  93. #define PRINTF_PA15 0xAF
  94. #define PRINTF_PB0 0xB0
  95. #define PRINTF_PB1 0xB1
  96. #define PRINTF_PB2 0xB2
  97. #define PRINTF_PB3 0xB3
  98. #define PRINTF_PB4 0xB4
  99. #define PRINTF_PB5 0xB5
  100. #define PRINTF_PB6 0xB6
  101. #define PRINTF_PB7 0xB7
  102. #define PRINTF_PB8 0xB8
  103. #define PRINTF_PB9 0xB9
  104. /* IO SWAPPER */
  105. #define GPIO_PORT_GET(x) (((x & 0xF0) == 0xA0)? GPIOA_REG: GPIOB_REG)
  106. #define GPIO_PIN_GET(x) (1 << (x & 0x0F))
  107. #endif //CONFIG_DEFINE_H