summaryrefslogtreecommitdiff
path: root/bsp/Infineon/libraries/HAL_Drivers/drv_timer.h
blob: 68016814e75db2e17013e29d2c8e01396dd52101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (c) 2006-2024 RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author             Notes
 * 2022-07-29     rtthread qiu      first version
 */

#ifndef __DRV_CLOCK_TIMER_H__
#define __DRV_CLOCK_TIMER_H__

#include <rtthread.h>

#include "cy_pdl.h"
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"

#ifndef TIM_DEV_INFO_CONFIG
#define TIM_DEV_INFO_CONFIG            \
    {                                  \
        .maxfreq = 1000000,            \
        .minfreq = 2000,               \
        .maxcnt = 0xFFFF,              \
        .cntmode = CLOCK_TIMER_CNTMODE_UP, \
    }
#endif /* TIM_DEV_INFO_CONFIG */

#ifdef BSP_USING_TIM1
#ifndef TIM1_CONFIG
#define TIM1_CONFIG                            \
    {                                          \
        .tim_irqn = tcpwm_0_interrupts_0_IRQn, \
        .name = "time1",                       \
    }
#endif /*TIM1_CONFIG*/
#endif /* BSP_USING_TIM1 */

#ifdef BSP_USING_TIM2
#ifndef TIM2_CONFIG
#define TIM2_CONFIG                            \
    {                                          \
        .tim_irqn = tcpwm_1_interrupts_0_IRQn, \
        .name = "time2",                       \
    }
#endif /*TIM2_CONFIG*/
#endif /* BSP_USING_TIM2 */

#endif /* __DRV_CLOCK_TIMER_H__ */