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 <karlp@tweak.net.au>
This commit is contained in:
Eric Van Albert 2019-06-10 23:06:33 -04:00 committed by Karl Palsson
parent 209dea96e7
commit 3d422a930f
4 changed files with 41 additions and 1 deletions

View File

@ -34,6 +34,8 @@
# include <libopencm3/stm32/f7/dac.h>
#elif defined(STM32L1)
# include <libopencm3/stm32/l1/dac.h>
#elif defined(STM32L4)
# include <libopencm3/stm32/l4/dac.h>
#else
# error "stm32 family not defined."
#endif

View File

@ -0,0 +1,37 @@
/** @defgroup dac_defines DAC Defines
@brief <b>Defined Constants and Types for the STM32L4xx DAC</b>
@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 <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_DAC_H
#define LIBOPENCM3_DAC_H
#include <libopencm3/stm32/common/dac_common_all.h>
#endif

View File

@ -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)

View File

@ -54,6 +54,7 @@ OBJS += dma_common_l1f013.o
OBJS += iwdg_common_all.o
OBJS += rtc_common_l1f024.o
OBJS += spi_common_all.o spi_common_v2.o
OBJS += dac_common_all.o
OBJS += usb.o usb_control.o usb_standard.o usb_msc.o
OBJS += st_usbfs_core.o st_usbfs_v2.o