esxxx_common.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef __ESCODEC_COMMON_H__
  2. #define __ESCODEC_COMMON_H__
  3. typedef enum BitsLength {
  4. BIT_LENGTH_MIN = -1,
  5. BIT_LENGTH_16BITS = 0x03,
  6. BIT_LENGTH_18BITS = 0x02,
  7. BIT_LENGTH_20BITS = 0x01,
  8. BIT_LENGTH_24BITS = 0x00,
  9. BIT_LENGTH_32BITS = 0x04,
  10. BIT_LENGTH_MAX,
  11. } BitsLength;
  12. typedef enum {
  13. SAMPLE_RATE_MIN = -1,
  14. SAMPLE_RATE_16K,
  15. SAMPLE_RATE_32K,
  16. SAMPLE_RATE_44_1K,
  17. SAMPLE_RATE_MAX,
  18. } SampleRate;
  19. typedef enum {
  20. MclkDiv_MIN = -1,
  21. MclkDiv_1 = 1,
  22. MclkDiv_2 = 2,
  23. MclkDiv_3 = 3,
  24. MclkDiv_4 = 4,
  25. MclkDiv_6 = 5,
  26. MclkDiv_8 = 6,
  27. MclkDiv_9 = 7,
  28. MclkDiv_11 = 8,
  29. MclkDiv_12 = 9,
  30. MclkDiv_16 = 10,
  31. MclkDiv_18 = 11,
  32. MclkDiv_22 = 12,
  33. MclkDiv_24 = 13,
  34. MclkDiv_33 = 14,
  35. MclkDiv_36 = 15,
  36. MclkDiv_44 = 16,
  37. MclkDiv_48 = 17,
  38. MclkDiv_66 = 18,
  39. MclkDiv_72 = 19,
  40. MclkDiv_5 = 20,
  41. MclkDiv_10 = 21,
  42. MclkDiv_15 = 22,
  43. MclkDiv_17 = 23,
  44. MclkDiv_20 = 24,
  45. MclkDiv_25 = 25,
  46. MclkDiv_30 = 26,
  47. MclkDiv_32 = 27,
  48. MclkDiv_34 = 28,
  49. MclkDiv_7 = 29,
  50. MclkDiv_13 = 30,
  51. MclkDiv_14 = 31,
  52. MclkDiv_MAX,
  53. } SclkDiv;
  54. typedef enum {
  55. LclkDiv_MIN = -1,
  56. LclkDiv_128 = 0,
  57. LclkDiv_192 = 1,
  58. LclkDiv_256 = 2,
  59. LclkDiv_384 = 3,
  60. LclkDiv_512 = 4,
  61. LclkDiv_576 = 5,
  62. LclkDiv_768 = 6,
  63. LclkDiv_1024 = 7,
  64. LclkDiv_1152 = 8,
  65. LclkDiv_1408 = 9,
  66. LclkDiv_1536 = 10,
  67. LclkDiv_2112 = 11,
  68. LclkDiv_2304 = 12,
  69. LclkDiv_125 = 16,
  70. LclkDiv_136 = 17,
  71. LclkDiv_250 = 18,
  72. LclkDiv_272 = 19,
  73. LclkDiv_375 = 20,
  74. LclkDiv_500 = 21,
  75. LclkDiv_544 = 22,
  76. LclkDiv_750 = 23,
  77. LclkDiv_1000 = 24,
  78. LclkDiv_1088 = 25,
  79. LclkDiv_1496 = 26,
  80. LclkDiv_1500 = 27,
  81. LclkDiv_MAX,
  82. } LclkDiv;
  83. typedef enum {
  84. ADC_INPUT_MIN = -1,
  85. ADC_INPUT_LINPUT1_RINPUT1 = 0x00,
  86. ADC_INPUT_MIC1 = 0x05,
  87. ADC_INPUT_MIC2 = 0x06,
  88. ADC_INPUT_LINPUT2_RINPUT2 = 0x50,
  89. ADC_INPUT_DIFFERENCE = 0xf0,
  90. ADC_INPUT_MAX,
  91. } AdcInput;
  92. typedef enum {
  93. DAC_OUTPUT_MIN = -1,
  94. DAC_OUTPUT_LOUT1 = 0x04,
  95. DAC_OUTPUT_LOUT2 = 0x08,
  96. DAC_OUTPUT_SPK = 0x09,
  97. DAC_OUTPUT_ROUT1 = 0x10,
  98. DAC_OUTPUT_ROUT2 = 0x20,
  99. DAC_OUTPUT_ALL = 0x3c,
  100. DAC_OUTPUT_MAX,
  101. } DacOutput;
  102. typedef enum {
  103. D2SE_PGA_GAIN_MIN = -1,
  104. D2SE_PGA_GAIN_DIS = 0,
  105. D2SE_PGA_GAIN_EN = 1,
  106. D2SE_PGA_GAIN_MAX = 2,
  107. } D2SEPGA;
  108. typedef enum {
  109. MIC_GAIN_MIN = -1,
  110. MIC_GAIN_0DB = 0,
  111. MIC_GAIN_3DB = 3,
  112. MIC_GAIN_6DB = 6,
  113. MIC_GAIN_9DB = 9,
  114. MIC_GAIN_12DB = 12,
  115. MIC_GAIN_15DB = 15,
  116. MIC_GAIN_18DB = 18,
  117. MIC_GAIN_21DB = 21,
  118. MIC_GAIN_24DB = 24,
  119. #if defined CONFIG_CODEC_CHIP_IS_ES8311
  120. MIC_GAIN_30DB = 30,
  121. MIC_GAIN_36DB = 36,
  122. MIC_GAIN_42DB = 42,
  123. #endif
  124. MIC_GAIN_MAX,
  125. } MicGain;
  126. typedef enum {
  127. ES_MODULE_MIN = -1,
  128. ES_MODULE_ADC = 0x01,
  129. ES_MODULE_DAC = 0x02,
  130. ES_MODULE_ADC_DAC = 0x03,
  131. ES_MODULE_LINE = 0x04,
  132. ES_MODULE_MAX
  133. } ESCodecModule;
  134. typedef enum {
  135. ES_MODE_MIN = -1,
  136. ES_MODE_SLAVE = 0x00,
  137. ES_MODE_MASTER = 0x01,
  138. ES_MODE_MAX,
  139. } ESCodecMode;
  140. typedef enum {
  141. ES_ = -1,
  142. ES_I2S_NORMAL = 0,
  143. ES_I2S_LEFT = 1,
  144. ES_I2S_RIGHT = 2,
  145. ES_I2S_DSP = 3,
  146. ES_I2S_MAX
  147. } ESCodecI2SFmt;
  148. typedef struct {
  149. SclkDiv sclkDiv;
  150. LclkDiv lclkDiv;
  151. } ESCodecI2sClock;
  152. #endif //__ESCODEC_COMMON_H__