rt-thread-official/bsp/at32/Libraries/rt_drivers/drv_hwtimer.h

81 lines
2.0 KiB
C
Raw Normal View History

/*
2021-03-14 15:15:52 +08:00
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-03-16 Leo first version
*/
#ifndef __TMR_CONFIG_H__
#define __TMR_CONFIG_H__
#include <rtthread.h>
#include <drivers/hwtimer.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TMR_DEV_INFO_CONFIG
#define TMR_DEV_INFO_CONFIG \
{ \
.maxfreq = 1000000, \
.minfreq = 4000, \
.maxcnt = 0xFFFF, \
.cntmode = HWTIMER_CNTMODE_UP, \
}
2021-03-14 15:15:52 +08:00
#endif /* TIM_DEV_INFO_CONFIG */
#ifdef BSP_USING_HWTMR2
#ifndef TMR2_CONFIG
#define TMR2_CONFIG \
{ \
.tim_handle = TMR2, \
.tim_irqn = TMR2_GLOBAL_IRQn, \
.name = "timer2", \
}
2021-03-14 15:15:52 +08:00
#endif /* TMR2_CONFIG */
#endif /* BSP_USING_HWTMR2 */
#ifdef BSP_USING_HWTMR3
#ifndef TMR3_CONFIG
#define TMR3_CONFIG \
{ \
.tim_handle = TMR3, \
.tim_irqn = TMR3_GLOBAL_IRQn, \
.name = "timer3", \
}
2021-03-14 15:15:52 +08:00
#endif /* TMR3_CONFIG */
#endif /* BSP_USING_HWTMR3 */
#ifdef BSP_USING_HWTMR4
#ifndef TMR4_CONFIG
#define TMR4_CONFIG \
{ \
.tim_handle = TMR4, \
.tim_irqn = TMR4_GLOBAL_IRQn, \
.name = "timer4", \
}
2021-03-14 15:15:52 +08:00
#endif /* TMR4_CONFIG */
#endif /* BSP_USING_HWTMR4 */
2021-03-14 15:15:52 +08:00
#ifdef BSP_USING_HWTMR5
#ifndef TMR5_CONFIG
#define TMR5_CONFIG \
{ \
.tim_handle = TMR5, \
.tim_irqn = TMR5_GLOBAL_IRQn, \
.name = "timer5", \
}
2021-03-14 15:15:52 +08:00
#endif /* TMR5_CONFIG */
#endif /* BSP_USING_HWTMR5 */
#ifdef __cplusplus
}
#endif
#endif /* __TMR_CONFIG_H__ */