summaryrefslogtreecommitdiff
path: root/bsp/airm2m/air32f103/libraries/rt_drivers/drv_timer.h
blob: d7de7c915e3104ccdcaf4afa2b72f641c0ac2af6 (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
52
53
54
55
56
57
58
59
60
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-22     airm2m       first version
 */

#ifndef __DRV_CLOCK_TIMER_H__
#define __DRV_CLOCK_TIMER_H__

#include <rtthread.h>

#ifdef BSP_USING_TIM
#include <board.h>

struct clock_timer_device
{
    struct rt_clock_timer_device parent;
    TIM_TypeDef *periph;
    IRQn_Type irqn;
    char *name;
};

#ifdef BSP_USING_TIM1
struct clock_timer_device clock_timer_device1 =
    {
        .periph = TIM1,
        .irqn = TIM1_UP_IRQn,
        .name = "timer1"};
#endif

#ifdef BSP_USING_TIM2
struct clock_timer_device clock_timer_device2 =
    {
        .periph = TIM2,
        .irqn = TIM2_IRQn,
        .name = "timer2"};
#endif

#ifdef BSP_USING_TIM3
struct clock_timer_device clock_timer_device3 =
    {
        .periph = TIM3,
        .irqn = TIM3_IRQn,
        .name = "timer3"};
#endif

#ifdef BSP_USING_TIM4
struct clock_timer_device clock_timer_device4 =
    {
        .periph = TIM4,
        .irqn = TIM4_IRQn,
        .name = "timer4"};
#endif

#endif /* BSP_USING_CLOCK_TIMER */
#endif /* __DRV_CLOCK_TIMER_H__ */