es_conf_info_adc.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Change Logs:
  3. * Date Author Notes
  4. * 2021-04-20 liuhy the first version
  5. *
  6. * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
  7. *
  8. * SPDX-License-Identifier: Apache-2.0
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the License); you may
  11. * not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. *
  22. */
  23. #ifndef __ES_CONF_INFO_ADC_H__
  24. #define __ES_CONF_INFO_ADC_H__
  25. #include "es_conf_info_map.h"
  26. #include <ald_adc.h>
  27. #define ES_C_ADC_CLK_DIV_1 ADC_CKDIV_1
  28. #define ES_C_ADC_CLK_DIV_2 ADC_CKDIV_2
  29. #define ES_C_ADC_CLK_DIV_4 ADC_CKDIV_4
  30. #define ES_C_ADC_CLK_DIV_8 ADC_CKDIV_8
  31. #define ES_C_ADC_CLK_DIV_16 ADC_CKDIV_16
  32. #define ES_C_ADC_CLK_DIV_32 ADC_CKDIV_32
  33. #define ES_C_ADC_CLK_DIV_64 ADC_CKDIV_64
  34. #define ES_C_ADC_CLK_DIV_128 ADC_CKDIV_128
  35. #define ES_C_ADC_ALIGN_RIGHT ADC_DATAALIGN_RIGHT
  36. #define ES_C_ADC_ALIGN_LEFT ADC_DATAALIGN_LEFT
  37. #define ES_C_ADC_CONV_BIT_6 ADC_CONV_BIT_6
  38. #define ES_C_ADC_CONV_BIT_8 ADC_CONV_BIT_8
  39. #define ES_C_ADC_CONV_BIT_10 ADC_CONV_BIT_10
  40. #define ES_C_ADC_CONV_BIT_12 ADC_CONV_BIT_12
  41. #define ES_C_ADC_SAMPLE_TIME_1 ADC_SAMPLETIME_1
  42. #define ES_C_ADC_SAMPLE_TIME_2 ADC_SAMPLETIME_2
  43. #define ES_C_ADC_SAMPLE_TIME_4 ADC_SAMPLETIME_4
  44. #define ES_C_ADC_SAMPLE_TIME_15 ADC_SAMPLETIME_15
  45. /* ADC 配置 */
  46. /* codes_main */
  47. #define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
  48. #define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
  49. #define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
  50. #define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
  51. #ifndef ES_DEVICE_NAME_ADC0
  52. #define ES_DEVICE_NAME_ADC0 "adc0"
  53. #endif
  54. #ifndef ES_DEVICE_NAME_ADC1
  55. #define ES_DEVICE_NAME_ADC1 "adc1"
  56. #endif
  57. #ifndef ES_ADC0_CLK_DIV
  58. #define ES_ADC0_CLK_DIV ES_C_ADC_CLK_DIV_128
  59. #endif
  60. #ifndef ES_ADC0_ALIGN
  61. #define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
  62. #endif
  63. #ifndef ES_ADC0_DATA_BIT
  64. #define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
  65. #endif
  66. #ifndef ES_ADC0_NCH_SAMPLETIME
  67. #define ES_ADC0_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
  68. #endif
  69. #ifndef ES_ADC1_CLK_DIV
  70. #define ES_ADC1_CLK_DIV ES_C_ADC_CLK_DIV_128
  71. #endif
  72. #ifndef ES_ADC1_ALIGN
  73. #define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
  74. #endif
  75. #ifndef ES_ADC1_DATA_BIT
  76. #define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
  77. #endif
  78. #ifndef ES_ADC1_NCH_SAMPLETIME
  79. #define ES_ADC1_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
  80. #endif
  81. #endif