es_conf_info_adc.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 ALD_ADC_CKDIV_1
  28. #define ES_C_ADC_CLK_DIV_2 ALD_ADC_CKDIV_2
  29. #define ES_C_ADC_CLK_DIV_4 ALD_ADC_CKDIV_4
  30. #define ES_C_ADC_CLK_DIV_8 ALD_ADC_CKDIV_8
  31. #define ES_C_ADC_CLK_DIV_16 ALD_ADC_CKDIV_16
  32. #define ES_C_ADC_CLK_DIV_32 ALD_ADC_CKDIV_32
  33. #define ES_C_ADC_CLK_DIV_64 ALD_ADC_CKDIV_64
  34. #define ES_C_ADC_CLK_DIV_128 ALD_ADC_CKDIV_128
  35. #define ES_C_ADC_ALIGN_RIGHT ALD_ADC_DATAALIGN_RIGHT
  36. #define ES_C_ADC_ALIGN_LEFT ALD_ADC_DATAALIGN_LEFT
  37. #define ES_C_ADC_CONV_BIT_6 ALD_ADC_CONV_BIT_6
  38. #define ES_C_ADC_CONV_BIT_8 ALD_ADC_CONV_BIT_8
  39. #define ES_C_ADC_CONV_BIT_10 ALD_ADC_CONV_BIT_10
  40. #define ES_C_ADC_CONV_BIT_12 ALD_ADC_CONV_BIT_12
  41. #define ES_C_ADC_SAMPLE_TIME_1 ALD_ADC_SAMPLETIME_1
  42. #define ES_C_ADC_SAMPLE_TIME_2 ALD_ADC_SAMPLETIME_2
  43. #define ES_C_ADC_SAMPLE_TIME_4 ALD_ADC_SAMPLETIME_4
  44. #define ES_C_ADC_SAMPLE_TIME_15 ALD_ADC_SAMPLETIME_15
  45. /* ADC 配置 */
  46. /* codes_main */
  47. #define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
  48. #define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
  49. #ifndef ES_DEVICE_NAME_ADC0
  50. #define ES_DEVICE_NAME_ADC0 "adc0"
  51. #endif
  52. #ifndef ES_ADC0_CLK_DIV
  53. #define ES_ADC0_CLK_DIV ES_C_ADC_CLK_DIV_16
  54. #endif
  55. #ifndef ES_ADC0_ALIGN
  56. #define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
  57. #endif
  58. #ifndef ES_ADC0_DATA_BIT
  59. #define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
  60. #endif
  61. #ifndef ES_ADC0_NCH_SAMPLETIME
  62. #define ES_ADC0_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
  63. #endif
  64. #endif