1 /* 2 * Copyright (c) 2006-2022, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2022-02-22 airm2m first version 9 */ 10 11 #ifndef __DRV_HWTIMER_H__ 12 #define __DRV_HWTIMER_H__ 13 14 #include <rtthread.h> 15 16 #ifdef BSP_USING_TIM 17 #include <board.h> 18 19 struct hwtimer_device 20 { 21 struct rt_hwtimer_device parent; 22 TIM_TypeDef *periph; 23 IRQn_Type irqn; 24 char *name; 25 }; 26 27 #ifdef BSP_USING_TIM1 28 struct hwtimer_device hwtimer_device1 = 29 { 30 .periph = TIM1, 31 .irqn = TIM1_UP_IRQn, 32 .name = "timer1"}; 33 #endif 34 35 #ifdef BSP_USING_TIM2 36 struct hwtimer_device hwtimer_device2 = 37 { 38 .periph = TIM2, 39 .irqn = TIM2_IRQn, 40 .name = "timer2"}; 41 #endif 42 43 #ifdef BSP_USING_TIM3 44 struct hwtimer_device hwtimer_device3 = 45 { 46 .periph = TIM3, 47 .irqn = TIM3_IRQn, 48 .name = "timer3"}; 49 #endif 50 51 #ifdef BSP_USING_TIM4 52 struct hwtimer_device hwtimer_device4 = 53 { 54 .periph = TIM4, 55 .irqn = TIM4_IRQn, 56 .name = "timer4"}; 57 #endif 58 59 #endif /* BSP_USING_HWTIMER */ 60 #endif /* __DRV_HWTIMER_H__ */ 61