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-01-05     zylx         first version
9  * 2019-01-08     SummerGift   clean up the code
10  */
11 
12 #ifndef __TIM_CONFIG_H__
13 #define __TIM_CONFIG_H__
14 
15 #include <rtthread.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #ifndef TIM_DEV_INFO_CONFIG
22 #define TIM_DEV_INFO_CONFIG                     \
23     {                                           \
24         .maxfreq = 1000000,                     \
25         .minfreq = 2000,                        \
26         .maxcnt  = 0xFFFF,                      \
27         .cntmode = HWTIMER_CNTMODE_UP,          \
28     }
29 #endif /* TIM_DEV_INFO_CONFIG */
30 
31 #ifdef BSP_USING_TIM2
32 #ifndef TIM2_CONFIG
33 #define TIM2_CONFIG                             \
34     {                                           \
35        .tim_handle.Instance     = TIM2,         \
36        .tim_irqn                = TIM2_IRQn,    \
37        .name                    = "timer2",     \
38     }
39 #endif /* TIM2_CONFIG */
40 #endif /* BSP_USING_TIM2 */
41 
42 #ifdef BSP_USING_TIM3
43 #ifndef TIM3_CONFIG
44 #if defined(STM32G0B0xx) || defined(STM32G0B1xx) || defined(STM32G0C1xx)
45 #define TIM3_CONFIG                             \
46     {                                           \
47        .tim_handle.Instance     = TIM3,         \
48        .tim_irqn                = TIM3_TIM4_IRQn, \
49        .name                    = "timer3",     \
50     }
51 #else
52 #define TIM3_CONFIG                             \
53     {                                           \
54        .tim_handle.Instance     = TIM3,         \
55        .tim_irqn                = TIM3_IRQn,    \
56        .name                    = "timer3",     \
57     }
58 #endif /* defined(STM32G0B0xx) || defined(STM32G0B1xx) || defined(STM32G0C1xx) */
59 #endif /* TIM3_CONFIG */
60 #endif /* BSP_USING_TIM3 */
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* __TIM_CONFIG_H__ */
67