2018-05-15 13:55:34 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Inria
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup boards_stm32l476g-disco
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Peripheral MCU configuration for the STM32L476G-DISCO board
|
|
|
|
*
|
|
|
|
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PERIPH_CONF_H
|
|
|
|
#define PERIPH_CONF_H
|
|
|
|
|
2020-08-26 19:55:03 +02:00
|
|
|
/* Add specific clock configuration (HSE, LSE) for this board here */
|
|
|
|
#ifndef CONFIG_BOARD_HAS_LSE
|
2020-09-01 16:04:40 +02:00
|
|
|
#define CONFIG_BOARD_HAS_LSE 1
|
2020-08-26 19:55:03 +02:00
|
|
|
#endif
|
|
|
|
|
2018-05-15 13:55:34 +02:00
|
|
|
#include "periph_cpu.h"
|
2020-10-22 08:51:13 +02:00
|
|
|
#include "clk_conf.h"
|
2019-03-31 16:35:20 +02:00
|
|
|
#include "cfg_rtt_default.h"
|
2019-10-24 16:53:25 +02:00
|
|
|
#include "cfg_usb_otg_fs.h"
|
2018-05-15 13:55:34 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Timer configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
static const timer_conf_t timer_config[] = {
|
|
|
|
{
|
|
|
|
.dev = TIM5,
|
|
|
|
.max = 0xffffffff,
|
|
|
|
.rcc_mask = RCC_APB1ENR1_TIM5EN,
|
|
|
|
.bus = APB1,
|
|
|
|
.irqn = TIM5_IRQn
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TIMER_0_ISR isr_tim5
|
|
|
|
|
2019-07-18 15:14:29 +02:00
|
|
|
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
|
2018-05-15 13:55:34 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name UART configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
static const uart_conf_t uart_config[] = {
|
|
|
|
{
|
|
|
|
.dev = USART2,
|
|
|
|
.rcc_mask = RCC_APB1ENR1_USART2EN,
|
|
|
|
.rx_pin = GPIO_PIN(PORT_D, 6),
|
|
|
|
.tx_pin = GPIO_PIN(PORT_D, 5),
|
|
|
|
.rx_af = GPIO_AF7,
|
|
|
|
.tx_af = GPIO_AF7,
|
|
|
|
.bus = APB1,
|
|
|
|
.irqn = USART2_IRQn,
|
2018-05-21 21:47:31 +02:00
|
|
|
.type = STM32_USART,
|
|
|
|
.clk_src = 0, /* Use APB clock */
|
2018-05-15 13:55:34 +02:00
|
|
|
#ifdef UART_USE_DMA
|
|
|
|
.dma_stream = 6,
|
|
|
|
.dma_chan = 4
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define UART_0_ISR (isr_usart2)
|
|
|
|
|
2019-07-18 15:14:29 +02:00
|
|
|
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
2018-05-15 13:55:34 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* PERIPH_CONF_H */
|
|
|
|
/** @} */
|