stm32g0: Support DAC

Nothing extra needed to be defined here - this might've just been missed
when adding STM32G0 support. Tested and works well on an STM32G051. Registers
in `stm32/common/dac_common_v1.h` match the STM32G0x1 reference manual.
This commit is contained in:
Stephen Holdaway
2021-06-29 23:40:23 +12:00
committed by Karl Palsson
parent e9c68ff9e8
commit 3ab83bc078
3 changed files with 44 additions and 0 deletions

View File

@@ -36,6 +36,8 @@
# include <libopencm3/stm32/l1/dac.h> # include <libopencm3/stm32/l1/dac.h>
#elif defined(STM32L4) #elif defined(STM32L4)
# include <libopencm3/stm32/l4/dac.h> # include <libopencm3/stm32/l4/dac.h>
#elif defined(STM32G0)
# include <libopencm3/stm32/g0/dac.h>
#elif defined(STM32G4) #elif defined(STM32G4)
# include <libopencm3/stm32/g4/dac.h> # include <libopencm3/stm32/g4/dac.h>
#elif defined(STM32H7) #elif defined(STM32H7)

View File

@@ -0,0 +1,41 @@
/** @defgroup dac_defines DAC Defines
*
* @brief <b>Defined Constants and Types for the STM32G0xx Digital-to-Analog Converter</b>
*
* @ingroup STM32G0xx_defines
*
* 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_v1.h>
/**@{*/
/** @defgroup dac_reg_base DAC register base addresses
@{*/
#define DAC1 DAC_BASE
/**@}*/
/**@}*/
#endif

View File

@@ -35,6 +35,7 @@ TGT_CFLAGS += $(STANDARD_FLAGS)
ARFLAGS = rcs ARFLAGS = rcs
OBJS += adc.o adc_common_v2.o OBJS += adc.o adc_common_v2.o
OBJS += crc_common_all.o OBJS += crc_common_all.o
OBJS += dac_common_all.o dac_common_v1.o
OBJS += desig_common_all.o desig_common_v1.o OBJS += desig_common_all.o desig_common_v1.o
OBJS += dma_common_l1f013.o OBJS += dma_common_l1f013.o
OBJS += dmamux.o OBJS += dmamux.o