cfg_timer_tim2.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef CFG_TIMER_TIM2_H
20 #define CFG_TIMER_TIM2_H
21 
22 #include "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 static const timer_conf_t timer_config[] = {
33  {
34  .dev = TIM2,
35 #if defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1)
36  .max = 0x0000ffff,
37 #else
38  .max = 0xffffffff,
39 #endif
40 #if CPU_FAM_STM32L4
41  .rcc_mask = RCC_APB1ENR1_TIM2EN,
42 #else
43  .rcc_mask = RCC_APB1ENR_TIM2EN,
44 #endif
45  .bus = APB1,
46  .irqn = TIM2_IRQn
47  }
48 };
49 
50 #define TIMER_0_ISR isr_tim2
51 
52 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
53 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif /* CFG_TIMER_TIM2_H */
60 
APB1 bus.
NRF_TIMER_Type * dev
timer device
Timer configuration.
Definition: periph_cpu.h:286