From 3d422a930fde20bf1de177d663d93eb532c9a117 Mon Sep 17 00:00:00 2001 From: Eric Van Albert Date: Mon, 10 Jun 2019 23:06:33 -0400 Subject: stm32l4: add common DAC support Replace the DAC1_BASE style, only used on l4 with the standard DAC_BASE used on all other targets. Reviewed-by: Karl Palsson --- include/libopencm3/stm32/dac.h | 2 ++ include/libopencm3/stm32/l4/dac.h | 37 +++++++++++++++++++++++++++++++++ include/libopencm3/stm32/l4/memorymap.h | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 include/libopencm3/stm32/l4/dac.h (limited to 'include') diff --git a/include/libopencm3/stm32/dac.h b/include/libopencm3/stm32/dac.h index 962210f3..6a17a738 100644 --- a/include/libopencm3/stm32/dac.h +++ b/include/libopencm3/stm32/dac.h @@ -34,6 +34,8 @@ # include #elif defined(STM32L1) # include +#elif defined(STM32L4) +# include #else # error "stm32 family not defined." #endif diff --git a/include/libopencm3/stm32/l4/dac.h b/include/libopencm3/stm32/l4/dac.h new file mode 100644 index 00000000..10b275a7 --- /dev/null +++ b/include/libopencm3/stm32/l4/dac.h @@ -0,0 +1,37 @@ +/** @defgroup dac_defines DAC Defines + +@brief Defined Constants and Types for the STM32L4xx DAC + +@ingroup STM32L4xx_defines + +@version 1.0.0 + +@date 8 June 2019 + +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_DAC_H +#define LIBOPENCM3_DAC_H + +#include + +#endif + diff --git a/include/libopencm3/stm32/l4/memorymap.h b/include/libopencm3/stm32/l4/memorymap.h index 40567a34..baaa32f5 100644 --- a/include/libopencm3/stm32/l4/memorymap.h +++ b/include/libopencm3/stm32/l4/memorymap.h @@ -61,7 +61,7 @@ #define USB_DEV_FS_BASE (PERIPH_BASE_APB1 + 0x6800) #define USB_PMA_BASE (PERIPH_BASE_APB1 + 0x6c00) #define POWER_CONTROL_BASE (PERIPH_BASE_APB1 + 0x7000) -#define DAC1_BASE (PERIPH_BASE_APB1 + 0x7400) +#define DAC_BASE (PERIPH_BASE_APB1 + 0x7400) #define OPAMP_BASE (PERIPH_BASE_APB1 + 0x7800) #define LPTIM1_BASE (PERIPH_BASE_APB1 + 0x7c00) #define LPUART1_BASE (PERIPH_BASE_APB1 + 0x8000) -- cgit v1.2.3