boards/nucleo-l4*: use common timer configuration

This commit is contained in:
Alexandre Abadie 2019-07-05 19:22:08 +02:00
parent 7ee7315418
commit 564686f882
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
3 changed files with 3 additions and 57 deletions

View File

@ -25,6 +25,7 @@
#include "periph_cpu.h" #include "periph_cpu.h"
#include "cfg_rtt_default.h" #include "cfg_rtt_default.h"
#include "cfg_timer_tim2.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -74,25 +75,6 @@ extern "C" {
#define CLOCK_APB2 (CLOCK_CORECLOCK / 2) #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
/** @} */ /** @} */
/**
* @name Timer configuration
* @{
*/
static const timer_conf_t timer_config[] = {
{
.dev = TIM2,
.max = 0xffffffff,
.rcc_mask = RCC_APB1ENR1_TIM2EN,
.bus = APB1,
.irqn = TIM2_IRQn
}
};
#define TIMER_0_ISR isr_tim2
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
/** @} */
/** /**
* @name UART configuration * @name UART configuration
* @{ * @{

View File

@ -23,6 +23,7 @@
#include "periph_cpu.h" #include "periph_cpu.h"
#include "cfg_rtt_default.h" #include "cfg_rtt_default.h"
#include "cfg_timer_tim2.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -83,25 +84,6 @@ extern "C" {
#define CLOCK_APB2 (CLOCK_CORECLOCK / 2) #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
/** @} */ /** @} */
/**
* @name Timer configuration
* @{
*/
static const timer_conf_t timer_config[] = {
{
.dev = TIM2,
.max = 0xffffffff,
.rcc_mask = RCC_APB1ENR1_TIM2EN,
.bus = APB1,
.irqn = TIM2_IRQn
}
};
#define TIMER_0_ISR isr_tim2
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
/** @} */
/** /**
* @name UART configuration * @name UART configuration
* @{ * @{

View File

@ -27,6 +27,7 @@
#include "periph_cpu.h" #include "periph_cpu.h"
#include "cfg_rtt_default.h" #include "cfg_rtt_default.h"
#include "cfg_timer_tim2.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -86,25 +87,6 @@ extern "C" {
#define CLOCK_APB2 (CLOCK_CORECLOCK / 2) #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
/** @} */ /** @} */
/**
* @name Timer configuration
* @{
*/
static const timer_conf_t timer_config[] = {
{
.dev = TIM2,
.max = 0xffffffff,
.rcc_mask = RCC_APB1ENR1_TIM2EN,
.bus = APB1,
.irqn = TIM2_IRQn
}
};
#define TIMER_0_ISR isr_tim2
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
/** @} */
/** /**
* @name UART configuration * @name UART configuration
* @{ * @{