pwm_config.h 5.3 KB
Newer Older
1
/*
mysterywolf's avatar
mysterywolf 已提交
2
 * Copyright (c) 2006-2021, RT-Thread Development Team
3 4 5 6 7 8 9 10 11 12 13 14 15
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2018-12-13     zylx         first version
 */

#ifndef __PWM_CONFIG_H__
#define __PWM_CONFIG_H__

#include <rtthread.h>

16 17 18 19
#ifdef __cplusplus
extern "C" {
#endif

20 21 22 23 24 25
/*
 * .tim_handle.Instance     = TIM1/2/3...,
 * .name					= "your pwm device name",
 * .channel					= 1/2/3/4
 */

26 27 28 29 30 31 32 33 34 35 36
#ifdef BSP_USING_PWM1
#ifndef PWM1_CONFIG
#define PWM1_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM1,         \
       .name                    = "pwm1",       \
       .channel                 = 0             \
    }
#endif /* PWM1_CONFIG */
#endif /* BSP_USING_PWM1 */

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
#ifdef BSP_USING_PWM2
#ifndef PWM2_CONFIG
#define PWM2_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM2,         \
       .name                    = "pwm2",       \
       .channel                 = 0             \
    }
#endif /* PWM2_CONFIG */
#endif /* BSP_USING_PWM2 */

#ifdef BSP_USING_PWM3
#ifndef PWM3_CONFIG
#define PWM3_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM3,         \
       .name                    = "pwm3",       \
       .channel                 = 0             \
    }
#endif /* PWM3_CONFIG */
#endif /* BSP_USING_PWM3 */

#ifdef BSP_USING_PWM4
#ifndef PWM4_CONFIG
#define PWM4_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM4,         \
       .name                    = "pwm4",       \
       .channel                 = 0             \
    }
#endif /* PWM4_CONFIG */
#endif /* BSP_USING_PWM4 */

#ifdef BSP_USING_PWM5
#ifndef PWM5_CONFIG
#define PWM5_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM5,         \
       .name                    = "pwm5",       \
       .channel                 = 0             \
    }
#endif /* PWM5_CONFIG */
#endif /* BSP_USING_PWM5 */

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
#ifdef BSP_USING_PWM6
#ifndef PWM6_CONFIG
#define PWM6_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM6,         \
       .name                    = "pwm6",       \
       .channel                 = 0             \
    }
#endif /* PWM6_CONFIG */
#endif /* BSP_USING_PWM6 */

#ifdef BSP_USING_PWM7
#ifndef PWM7_CONFIG
#define PWM7_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM7,         \
       .name                    = "pwm7",       \
       .channel                 = 0             \
    }
#endif /* PWM7_CONFIG */
#endif /* BSP_USING_PWM7 */

103 104 105 106 107 108 109 110 111 112 113
#ifdef BSP_USING_PWM8
#ifndef PWM8_CONFIG
#define PWM8_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM8,         \
       .name                    = "pwm8",       \
       .channel                 = 0             \
    }
#endif /* PWM8_CONFIG */
#endif /* BSP_USING_PWM8 */

114 115 116 117 118 119 120 121 122 123 124
#ifdef BSP_USING_PWM9
#ifndef PWM9_CONFIG
#define PWM9_CONFIG                             \
    {                                           \
       .tim_handle.Instance     = TIM9,         \
       .name                    = "pwm9",       \
       .channel                 = 0             \
    }
#endif /* PWM9_CONFIG */
#endif /* BSP_USING_PWM9 */

125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
#ifdef BSP_USING_PWM10
#ifndef PWM10_CONFIG
#define PWM10_CONFIG                            \
    {                                           \
       .tim_handle.Instance     = TIM10,        \
       .name                    = "pwm10",      \
       .channel                 = 0             \
    }
#endif /* PWM10_CONFIG */
#endif /* BSP_USING_PWM10 */

#ifdef BSP_USING_PWM11
#ifndef PWM11_CONFIG
#define PWM11_CONFIG                            \
    {                                           \
       .tim_handle.Instance     = TIM11,        \
       .name                    = "pwm11",      \
       .channel                 = 0             \
    }
#endif /* PWM11_CONFIG */
#endif /* BSP_USING_PWM11 */

147 148 149 150 151 152 153 154 155 156 157
#ifdef BSP_USING_PWM12
#ifndef PWM12_CONFIG
#define PWM12_CONFIG                            \
    {                                           \
       .tim_handle.Instance     = TIM12,        \
       .name                    = "pwm12",      \
       .channel                 = 0             \
    }
#endif /* PWM12_CONFIG */
#endif /* BSP_USING_PWM12 */

158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
#ifdef BSP_USING_PWM13
#ifndef PWM13_CONFIG
#define PWM13_CONFIG                            \
    {                                           \
       .tim_handle.Instance     = TIM13,        \
       .name                    = "pwm13",      \
       .channel                 = 0             \
    }
#endif /* PWM13_CONFIG */
#endif /* BSP_USING_PWM13 */

#ifdef BSP_USING_PWM14
#ifndef PWM14_CONFIG
#define PWM14_CONFIG                            \
    {                                           \
       .tim_handle.Instance     = TIM14,        \
       .name                    = "pwm14",      \
       .channel                 = 0             \
    }
#endif /* PWM14_CONFIG */
#endif /* BSP_USING_PWM14 */

180 181 182 183
#ifdef __cplusplus
}
#endif

184
#endif /* __PWM_CONFIG_H__ */