cfg_timer_tim2.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Inria
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "periph_cpu.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
28 static const timer_conf_t timer_config[] = {
29  {
30  .dev = TIM2,
31 #if defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1)
32  .max = 0x0000ffff,
33 #else
34  .max = 0xffffffff,
35 #endif
36 #if defined(RCC_APB1ENR1_TIM2EN)
37  .rcc_mask = RCC_APB1ENR1_TIM2EN,
38 #elif defined(RCC_MC_APB1ENSETR_TIM2EN)
39  .rcc_mask = RCC_MC_APB1ENSETR_TIM2EN,
40 #else
41  .rcc_mask = RCC_APB1ENR_TIM2EN,
42 #endif
43  .bus = APB1,
44  .irqn = TIM2_IRQn
45  }
46 };
47 
48 #define TIMER_0_ISR isr_tim2
49 
50 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
53 #ifdef __cplusplus
54 }
55 #endif
56 
@ APB1
Advanced Peripheral Bus 1
Definition: periph_cpu.h:78
Timer device configuration.
Definition: periph_cpu.h:263
TC0_t * dev
Pointer to the used as Timer device.
Definition: periph_cpu.h:264