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-11 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_TIM2 31 #ifndef TIM2_CONFIG 32 #define TIM2_CONFIG \ 33 { \ 34 .tim_handle.Instance = TIM2, \ 35 .tim_irqn = TIM2_IRQn, \ 36 .name = "timer2", \ 37 } 38 #endif /* TIM2_CONFIG */ 39 #endif /* BSP_USING_TIM2 */ 40 41 #ifdef BSP_USING_TIM3 42 #ifndef TIM3_CONFIG 43 #define TIM3_CONFIG \ 44 { \ 45 .tim_handle.Instance = TIM3, \ 46 .tim_irqn = TIM3_IRQn, \ 47 .name = "timer3", \ 48 } 49 #endif /* TIM3_CONFIG */ 50 #endif /* BSP_USING_TIM3 */ 51 52 #ifdef BSP_USING_TIM4 53 #ifndef TIM4_CONFIG 54 #define TIM4_CONFIG \ 55 { \ 56 .tim_handle.Instance = TIM4, \ 57 .tim_irqn = TIM4_IRQn, \ 58 .name = "timer4", \ 59 } 60 #endif /* TIM4_CONFIG */ 61 #endif /* BSP_USING_TIM4 */ 62 63 #ifdef BSP_USING_TIM5 64 #ifndef TIM5_CONFIG 65 #define TIM5_CONFIG \ 66 { \ 67 .tim_handle.Instance = TIM5, \ 68 .tim_irqn = TIM5_IRQn, \ 69 .name = "timer5", \ 70 } 71 #endif /* TIM5_CONFIG */ 72 #endif /* BSP_USING_TIM5 */ 73 74 #ifdef __cplusplus 75 } 76 #endif 77 78 #endif /* __TIM_CONFIG_H__ */ 79