es_conf_info_pwm.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_PWM_H__
  24. #define __ES_CONF_INFO_PWM_H__
  25. #include "es_conf_info_map.h"
  26. #include <ald_cmu.h>
  27. #include <ald_timer.h>
  28. #include <ald_gpio.h>
  29. #define ES_C_PWM_OC_POL_HIGH TIMER_OC_POLARITY_HIGH
  30. #define ES_C_PWM_OC_POL_LOW TIMER_OC_POLARITY_LOW
  31. #define ES_C_PWM_OC_MODE_PWM1 TIMER_OC_MODE_PWM1
  32. #define ES_C_PWM_OC_MODE_PWM2 TIMER_OC_MODE_PWM2
  33. /* PWM 配置 */
  34. /* codes_main */
  35. #define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
  36. #define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM2
  37. #ifndef ES_PWM_OC_POLARITY
  38. #define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
  39. #endif
  40. #ifndef ES_PWM_OC_MODE
  41. #define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM2
  42. #endif
  43. #ifndef ES_DEVICE_NAME_AD16C4T0_PWM
  44. #define ES_DEVICE_NAME_AD16C4T0_PWM "pwm0"
  45. #endif
  46. #ifndef ES_DEVICE_NAME_AD16C4T1_PWM
  47. #define ES_DEVICE_NAME_AD16C4T1_PWM "pwm1"
  48. #endif
  49. #ifndef ES_DEVICE_NAME_GP32C4T0_PWM
  50. #define ES_DEVICE_NAME_GP32C4T0_PWM "pwm2"
  51. #endif
  52. #ifndef ES_DEVICE_NAME_GP32C4T1_PWM
  53. #define ES_DEVICE_NAME_GP32C4T1_PWM "pwm3"
  54. #endif
  55. #ifndef ES_DEVICE_NAME_GP16C4T0_PWM
  56. #define ES_DEVICE_NAME_GP16C4T0_PWM "pwm4"
  57. #endif
  58. #ifndef ES_DEVICE_NAME_GP16C4T1_PWM
  59. #define ES_DEVICE_NAME_GP16C4T1_PWM "pwm5"
  60. #endif
  61. #endif