1 /* 2 * Copyright (c) 2006-2024 RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2022-07-13 Rbb666 first version 9 */ 10 11 #ifndef __PWM_CONFIG_H__ 12 #define __PWM_CONFIG_H__ 13 14 #include <rtthread.h> 15 #include <board.h> 16 17 #ifdef __cplusplus 18 extern "C" 19 { 20 #endif 21 22 #define MAX_PERIOD 65535 23 24 #ifdef BSP_USING_PWM0 25 #ifndef PWM0_CH0_PORT0_CONFIG 26 #define PWM0_CH0_PORT0_CONFIG \ 27 { \ 28 .name = "pwm0", \ 29 .channel = 0, \ 30 .gpio = GET_PIN(0, 0), \ 31 } 32 #endif /* PWM0_CH0_PORT2_CONFIG */ 33 34 #ifndef PWM0_CH2_PORT11_COMPL_CONFIG 35 #define PWM0_CH2_PORT11_COMPL_CONFIG \ 36 { \ 37 .name = "pwm0", \ 38 .channel = 2, \ 39 .gpio = GET_PIN(11, 3), \ 40 } 41 #endif /*PWM0_CH2_PORT11_COMPL_CONFIG*/ 42 43 #ifndef PWM0_CH3_PORT11_CONFIG 44 #define PWM0_CH3_PORT11_CONFIG \ 45 { \ 46 .name = "pwm0", \ 47 .channel = 3, \ 48 .gpio = GET_PIN(11, 4), \ 49 } 50 #endif /*PWM0_CH3_PORT11_CONFIG*/ 51 52 #ifndef PWM0_CH4_PORT5_COMPL_CONFIG 53 #define PWM0_CH4_PORT5_COMPL_CONFIG \ 54 { \ 55 .name = "pwm0", \ 56 .channel = 4, \ 57 .gpio = GET_PIN(5, 1), \ 58 } 59 #endif /*PWM0_CH4_PORT5_COMPL_CONFIG*/ 60 61 #ifndef PWM0_CH7_PORT2_CONFIG 62 #define PWM0_CH7_PORT2_CONFIG \ 63 { \ 64 .name = "pwm0", \ 65 .channel = 7, \ 66 .gpio = GET_PIN(2, 2), \ 67 } 68 #endif /* PWM0_CH7_PORT2_CONFIG */ 69 70 #ifndef PWM0_CH7_PORT5_CONFIG 71 #define PWM0_CH7_PORT5_CONFIG \ 72 { \ 73 .name = "pwm0", \ 74 .channel = 7, \ 75 .gpio = GET_PIN(5, 6), \ 76 } 77 #endif /* PWM0_CH7_PORT5_CONFIG */ 78 79 #ifndef PWM0_CH7_PORT5_COMPL_CONFIG 80 #define PWM0_CH7_PORT5_COMPL_CONFIG \ 81 { \ 82 .name = "pwm0", \ 83 .channel = 7, \ 84 .gpio = GET_PIN(5, 7), \ 85 } 86 #endif /*PWM0_CH7_PORT5_COMPL_CONFIG*/ 87 88 #ifndef PWM0_CH7_PORT7_CONFIG 89 #define PWM0_CH7_PORT7_CONFIG \ 90 { \ 91 .name = "pwm0", \ 92 .channel = 7, \ 93 .gpio = GET_PIN(7, 7), \ 94 } 95 #endif /* PWM0_CH7_PORT7_CONFIG */ 96 97 #ifndef PWM0_CH7_PORT9_CONFIG 98 #define PWM0_CH7_PORT9_CONFIG \ 99 { \ 100 .name = "pwm0", \ 101 .channel = 7, \ 102 .gpio = GET_PIN(9, 4), \ 103 } 104 #endif /* PWM0_CH7_PORT9_CONFIG */ 105 106 #ifndef PWM0_CH7_PORT10_CONFIG 107 #define PWM0_CH7_PORT10_CONFIG \ 108 { \ 109 .name = "pwm0", \ 110 .channel = 7, \ 111 .gpio = GET_PIN(10, 2), \ 112 } 113 #endif /* PWM0_CH7_PORT10_CONFIG */ 114 115 #ifndef PWM0_CH7_PORT12_CONFIG 116 #define PWM0_CH7_PORT12_CONFIG \ 117 { \ 118 .name = "pwm0", \ 119 .channel = 7, \ 120 .gpio = GET_PIN(12, 6), \ 121 } 122 #endif /* PWM0_CH7_PORT12_CONFIG */ 123 124 #ifndef PWM0_CH3_PORT13_CONFIG 125 #define PWM0_CH3_PORT13_CONFIG \ 126 { \ 127 .name = "pwm0", \ 128 .channel = 3, \ 129 .gpio = GET_PIN(13, 7), \ 130 } 131 #endif /* PWM0_CH3_PORT13_CONFIG */ 132 #endif /* BSP_USING_PWM0 */ 133 134 #ifdef __cplusplus 135 } 136 #endif 137 138 #endif 139