1 /* 2 * Copyright (c) 2006-2024 RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2022-07-29 rtthread qiu first version 9 */ 10 11 #ifndef __DRV_HWTIMER_H__ 12 #define __DRV_HWTIMER_H__ 13 14 #include <rtthread.h> 15 16 #include "cy_pdl.h" 17 #include "cyhal.h" 18 #include "cybsp.h" 19 #include "cy_retarget_io.h" 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_TIM1 32 #ifndef TIM1_CONFIG 33 #define TIM1_CONFIG \ 34 { \ 35 .tim_irqn = tcpwm_0_interrupts_0_IRQn, \ 36 .name = "time1", \ 37 } 38 #endif /*TIM1_CONFIG*/ 39 #endif /* BSP_USING_TIM1 */ 40 41 #ifdef BSP_USING_TIM2 42 #ifndef TIM2_CONFIG 43 #define TIM2_CONFIG \ 44 { \ 45 .tim_irqn = tcpwm_1_interrupts_0_IRQn, \ 46 .name = "time2", \ 47 } 48 #endif /*TIM2_CONFIG*/ 49 #endif /* BSP_USING_TIM2 */ 50 51 #endif /* __DRV_HWTIMER_H__ */ 52