boards/nucleo-l4*: use common timer configuration
This commit is contained in:
parent
7ee7315418
commit
564686f882
@ -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
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
@ -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
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
@ -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
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user