1 /* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2018-12-24 zylx first version 9 * 2023-04-08 Wangyuqiang complete PWM defination 10 */ 11 12 #ifndef __PWM_CONFIG_H__ 13 #define __PWM_CONFIG_H__ 14 15 #include <rtthread.h> 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #ifdef BSP_USING_PWM1 22 #define PWM1_CONFIG \ 23 { \ 24 .tim_handle.Instance = TIM1, \ 25 .name = "pwm1", \ 26 .channel = RT_NULL \ 27 } 28 #endif /* BSP_USING_PWM1 */ 29 30 #ifdef BSP_USING_PWM2 31 #define PWM2_CONFIG \ 32 { \ 33 .tim_handle.Instance = TIM2, \ 34 .name = "pwm2", \ 35 .channel = RT_NULL \ 36 } 37 #endif /* BSP_USING_PWM2 */ 38 39 #ifdef BSP_USING_PWM3 40 #define PWM3_CONFIG \ 41 { \ 42 .tim_handle.Instance = TIM3, \ 43 .name = "pwm3", \ 44 .channel = RT_NULL \ 45 } 46 #endif /* BSP_USING_PWM3 */ 47 48 #ifdef BSP_USING_PWM4 49 #define PWM4_CONFIG \ 50 { \ 51 .tim_handle.Instance = TIM4, \ 52 .name = "pwm4", \ 53 .channel = RT_NULL \ 54 } 55 #endif /* BSP_USING_PWM4 */ 56 57 #ifdef BSP_USING_PWM5 58 #define PWM5_CONFIG \ 59 { \ 60 .tim_handle.Instance = TIM5, \ 61 .name = "pwm5", \ 62 .channel = RT_NULL \ 63 } 64 #endif /* BSP_USING_PWM5 */ 65 66 #ifdef BSP_USING_PWM6 67 #define PWM6_CONFIG \ 68 { \ 69 .tim_handle.Instance = TIM6, \ 70 .name = "pwm6", \ 71 .channel = RT_NULL \ 72 } 73 #endif /* BSP_USING_PWM6 */ 74 75 #ifdef BSP_USING_PWM7 76 #define PWM7_CONFIG \ 77 { \ 78 .tim_handle.Instance = TIM7, \ 79 .name = "pwm7", \ 80 .channel = RT_NULL \ 81 } 82 #endif /* BSP_USING_PWM7 */ 83 84 #ifdef BSP_USING_PWM8 85 #define PWM8_CONFIG \ 86 { \ 87 .tim_handle.Instance = TIM8, \ 88 .name = "pwm8", \ 89 .channel = RT_NULL \ 90 } 91 #endif /* BSP_USING_PWM8 */ 92 93 #ifdef BSP_USING_PWM9 94 #define PWM9_CONFIG \ 95 { \ 96 .tim_handle.Instance = TIM9, \ 97 .name = "pwm9", \ 98 .channel = RT_NULL \ 99 } 100 #endif /* BSP_USING_PWM9 */ 101 102 #ifdef BSP_USING_PWM10 103 #define PWM10_CONFIG \ 104 { \ 105 .tim_handle.Instance = TIM10, \ 106 .name = "pwm10", \ 107 .channel = RT_NULL \ 108 } 109 #endif /* BSP_USING_PWM10 */ 110 111 #ifdef BSP_USING_PWM11 112 #define PWM11_CONFIG \ 113 { \ 114 .tim_handle.Instance = TIM11, \ 115 .name = "pwm11", \ 116 .channel = RT_NULL \ 117 } 118 #endif /* BSP_USING_PWM11 */ 119 120 #ifdef BSP_USING_PWM12 121 #define PWM12_CONFIG \ 122 { \ 123 .tim_handle.Instance = TIM12, \ 124 .name = "pwm12", \ 125 .channel = RT_NULL \ 126 } 127 #endif /* BSP_USING_PWM12 */ 128 129 #ifdef BSP_USING_PWM13 130 #define PWM13_CONFIG \ 131 { \ 132 .tim_handle.Instance = TIM13, \ 133 .name = "pwm13", \ 134 .channel = RT_NULL \ 135 } 136 #endif /* BSP_USING_PWM13 */ 137 138 #ifdef BSP_USING_PWM14 139 #define PWM14_CONFIG \ 140 { \ 141 .tim_handle.Instance = TIM14, \ 142 .name = "pwm14", \ 143 .channel = RT_NULL \ 144 } 145 #endif /* BSP_USING_PWM14 */ 146 147 #ifdef BSP_USING_PWM15 148 #define PWM15_CONFIG \ 149 { \ 150 .tim_handle.Instance = TIM15, \ 151 .name = "pwm15", \ 152 .channel = RT_NULL \ 153 } 154 #endif /* BSP_USING_PWM15 */ 155 156 #ifdef BSP_USING_PWM16 157 #define PWM16_CONFIG \ 158 { \ 159 .tim_handle.Instance = TIM16, \ 160 .name = "pwm16", \ 161 .channel = RT_NULL \ 162 } 163 #endif /* BSP_USING_PWM16 */ 164 165 #ifdef BSP_USING_PWM17 166 #define PWM17_CONFIG \ 167 { \ 168 .tim_handle.Instance = TIM17, \ 169 .name = "pwm17", \ 170 .channel = RT_NULL \ 171 } 172 #endif /* BSP_USING_PWM17 */ 173 174 #ifdef BSP_USING_PWM18 175 #define PWM18_CONFIG \ 176 { \ 177 .tim_handle.Instance = TIM18, \ 178 .name = "pwm18", \ 179 .channel = RT_NULL \ 180 } 181 #endif /* BSP_USING_PWM18 */ 182 183 #ifdef BSP_USING_PWM19 184 #define PWM19_CONFIG \ 185 { \ 186 .tim_handle.Instance = TIM19, \ 187 .name = "pwm19", \ 188 .channel = RT_NULL \ 189 } 190 #endif /* BSP_USING_PWM19 */ 191 192 #ifdef __cplusplus 193 } 194 #endif 195 196 #endif /* __PWM_CONFIG_H__ */ 197