From f0e128673d8b38a52a5f6cf24def214fc0c19653 Mon Sep 17 00:00:00 2001 From: Martin Sivak Date: Sun, 29 Apr 2018 17:25:20 +0200 Subject: [PATCH] Add DMA support to STM32L0 STM32L0 uses the same DMA peripheral as STM32F0, F1, L1 and others with some differences. Those are mostly in the number of supported controllers and channels. This patch enables the basic support with no attempt to only expose the available controllers / channels. For more information see the ST Application Note AN2548. Signed-off-by: Martin Sivak --- include/libopencm3/stm32/dma.h | 2 ++ include/libopencm3/stm32/l0/dma.h | 37 +++++++++++++++++++++++++++++++ lib/stm32/l0/Makefile | 1 + 3 files changed, 40 insertions(+) create mode 100644 include/libopencm3/stm32/l0/dma.h diff --git a/include/libopencm3/stm32/dma.h b/include/libopencm3/stm32/dma.h index adffeab6..e4a4ea16 100644 --- a/include/libopencm3/stm32/dma.h +++ b/include/libopencm3/stm32/dma.h @@ -30,6 +30,8 @@ # include #elif defined(STM32F4) # include +#elif defined(STM32L0) +# include #elif defined(STM32L1) # include #elif defined(STM32L4) diff --git a/include/libopencm3/stm32/l0/dma.h b/include/libopencm3/stm32/l0/dma.h new file mode 100644 index 00000000..b39d0610 --- /dev/null +++ b/include/libopencm3/stm32/l0/dma.h @@ -0,0 +1,37 @@ +/** @defgroup dma_defines DMA Defines + * + * @ingroup STM32L0xx_defines + * + * @brief Defined Constants and Types for the STM32L0xx DMA Controller + * + * @version 1.0.0 + * + * @date 29 April 2018 + * + * LGPL License Terms @ref lgpl_license + */ + +/* + * This file is part of the libopencm3 project. + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + */ + +#ifndef LIBOPENCM3_DMA_H +#define LIBOPENCM3_DMA_H + +#include + +#endif + diff --git a/lib/stm32/l0/Makefile b/lib/stm32/l0/Makefile index 1d43e640..2da5fd3a 100644 --- a/lib/stm32/l0/Makefile +++ b/lib/stm32/l0/Makefile @@ -44,6 +44,7 @@ OBJS += spi_common_all.o spi_common_v1.o spi_common_v1_frf.o OBJS += gpio_common_all.o gpio_common_f0234.o rcc_common_all.o OBJS += adc_common_v2.o OBJS += crs_common_all.o +OBJS += dma_common_l1f013.o OBJS += exti_common_all.o OBJS += flash.o flash_common_l01.o OBJS += i2c_common_v2.o