Browse Source

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 <mars@montik.net>
pull/923/head
Martin Sivak 7 years ago
committed by Karl Palsson
parent
commit
f0e128673d
  1. 2
      include/libopencm3/stm32/dma.h
  2. 37
      include/libopencm3/stm32/l0/dma.h
  3. 1
      lib/stm32/l0/Makefile

2
include/libopencm3/stm32/dma.h

@ -30,6 +30,8 @@
# include <libopencm3/stm32/f3/dma.h> # include <libopencm3/stm32/f3/dma.h>
#elif defined(STM32F4) #elif defined(STM32F4)
# include <libopencm3/stm32/f4/dma.h> # include <libopencm3/stm32/f4/dma.h>
#elif defined(STM32L0)
# include <libopencm3/stm32/l0/dma.h>
#elif defined(STM32L1) #elif defined(STM32L1)
# include <libopencm3/stm32/l1/dma.h> # include <libopencm3/stm32/l1/dma.h>
#elif defined(STM32L4) #elif defined(STM32L4)

37
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 <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_DMA_H
#define LIBOPENCM3_DMA_H
#include <libopencm3/stm32/common/dma_common_l1f013.h>
#endif

1
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 += gpio_common_all.o gpio_common_f0234.o rcc_common_all.o
OBJS += adc_common_v2.o OBJS += adc_common_v2.o
OBJS += crs_common_all.o OBJS += crs_common_all.o
OBJS += dma_common_l1f013.o
OBJS += exti_common_all.o OBJS += exti_common_all.o
OBJS += flash.o flash_common_l01.o OBJS += flash.o flash_common_l01.o
OBJS += i2c_common_v2.o OBJS += i2c_common_v2.o

Loading…
Cancel
Save