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-12     zylx         first version
9  */
10 
11 #ifndef __TIM_CONFIG_H__
12 #define __TIM_CONFIG_H__
13 
14 #include <rtthread.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #ifndef TIM_DEV_INFO_CONFIG
21 #define TIM_DEV_INFO_CONFIG                     \
22     {                                           \
23         .maxfreq = 1000000,                     \
24         .minfreq = 2000,                        \
25         .maxcnt  = 0xFFFF,                      \
26         .cntmode = HWTIMER_CNTMODE_UP,          \
27     }
28 #endif /* TIM_DEV_INFO_CONFIG */
29 
30 #ifdef BSP_USING_TIM7
31 #ifndef TIM7_CONFIG
32 #define TIM7_CONFIG                                        \
33     {                                                      \
34        .tim_handle.Instance     = TIM7,                    \
35        .tim_irqn                = TIM7_IRQn,               \
36        .name                    = "timer7",                \
37     }
38 #endif /* TIM7_CONFIG */
39 #endif /* BSP_USING_TIM7 */
40 
41 #ifdef BSP_USING_TIM15
42 #ifndef TIM15_CONFIG
43 #define TIM15_CONFIG                                        \
44     {                                                       \
45        .tim_handle.Instance     = TIM15,                    \
46        .tim_irqn                = TIM1_BRK_TIM15_IRQn,      \
47        .name                    = "timer15",                \
48     }
49 #endif /* TIM15_CONFIG */
50 #endif /* BSP_USING_TIM15 */
51 
52 #ifdef BSP_USING_TIM16
53 #ifndef TIM16_CONFIG
54 #define TIM16_CONFIG                                        \
55     {                                                       \
56        .tim_handle.Instance     = TIM16,                    \
57        .tim_irqn                = TIM1_UP_TIM16_IRQn,       \
58        .name                    = "timer16",                \
59     }
60 #endif /* TIM16_CONFIG */
61 #endif /* BSP_USING_TIM16 */
62 
63 #ifdef BSP_USING_TIM17
64 #ifndef TIM17_CONFIG
65 #define TIM17_CONFIG                                        \
66     {                                                       \
67        .tim_handle.Instance     = TIM17,                    \
68        .tim_irqn                = TIM1_TRG_COM_TIM17_IRQn,  \
69        .name                    = "timer17",                \
70     }
71 #endif /* TIM17_CONFIG */
72 #endif /* BSP_USING_TIM17 */
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* __TIM_CONFIG_H__ */
79