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  * 2020-10-14     Dozingfiretruck   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_TIM15
31 #ifndef TIM15_CONFIG
32 #define TIM15_CONFIG                                        \
33     {                                                       \
34        .tim_handle.Instance     = TIM15,                    \
35        .tim_irqn                = TIM1_BRK_TIM15_IRQn,      \
36        .name                    = "timer15",                \
37     }
38 #endif /* TIM15_CONFIG */
39 #endif /* BSP_USING_TIM15 */
40 
41 #ifdef BSP_USING_TIM16
42 #ifndef TIM16_CONFIG
43 #define TIM16_CONFIG                                        \
44     {                                                       \
45        .tim_handle.Instance     = TIM16,                    \
46        .tim_irqn                = TIM1_UP_TIM16_IRQn,       \
47        .name                    = "timer16",                \
48     }
49 #endif /* TIM16_CONFIG */
50 #endif /* BSP_USING_TIM16 */
51 
52 #ifdef BSP_USING_TIM17
53 #ifndef TIM17_CONFIG
54 #define TIM17_CONFIG                                        \
55     {                                                       \
56        .tim_handle.Instance     = TIM17,                    \
57        .tim_irqn                = TIM1_TRG_COM_TIM17_IRQn,  \
58        .name                    = "timer17",                \
59     }
60 #endif /* TIM17_CONFIG */
61 #endif /* BSP_USING_TIM17 */
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* __TIM_CONFIG_H__ */
68