Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions bsp/stm32/libraries/HAL_Drivers/config/l4/dac_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-06-16 thread-liu first version
*/

#ifndef __DAC_CONFIG_H__
#define __DAC_CONFIG_H__

#include <rtthread.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef BSP_USING_DAC1
#ifndef DAC1_CONFIG
#define DAC1_CONFIG \
{ \
.Instance = DAC1, \
}
#endif /* DAC2_CONFIG */
#endif /* BSP_USING_DAC2 */

#ifdef BSP_USING_DAC2
#ifndef DAC2_CONFIG
#define DAC2_CONFIG \
{ \
.Instance = DAC2, \
}
#endif /* DAC2_CONFIG */
#endif /* BSP_USING_DAC2 */

#ifdef __cplusplus
}
#endif

#endif /* __DAC_CONFIG_H__ */
1 change: 1 addition & 0 deletions bsp/stm32/libraries/HAL_Drivers/drv_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ extern "C" {
#include "l4/spi_config.h"
#include "l4/qspi_config.h"
#include "l4/adc_config.h"
#include "l4/dac_config.h"
#include "l4/tim_config.h"
#include "l4/sdio_config.h"
#include "l4/pwm_config.h"
Expand Down
8 changes: 4 additions & 4 deletions bsp/stm32/libraries/HAL_Drivers/drv_dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static rt_err_t stm32_dac_enabled(struct rt_dac_device *device, rt_uint32_t chan
RT_ASSERT(device != RT_NULL);
stm32_dac_handler = device->parent.user_data;

#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
HAL_DAC_Start(stm32_dac_handler, channel);
#endif

Expand All @@ -56,7 +56,7 @@ static rt_err_t stm32_dac_disabled(struct rt_dac_device *device, rt_uint32_t cha
RT_ASSERT(device != RT_NULL);
stm32_dac_handler = device->parent.user_data;

#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
HAL_DAC_Stop(stm32_dac_handler, channel);
#endif

Expand Down Expand Up @@ -96,7 +96,7 @@ static rt_err_t stm32_set_dac_value(struct rt_dac_device *device, rt_uint32_t ch

rt_memset(&DAC_ChanConf, 0, sizeof(DAC_ChanConf));

#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
if ((channel <= 2) && (channel > 0))
{
/* set stm32 dac channel */
Expand All @@ -109,7 +109,7 @@ static rt_err_t stm32_set_dac_value(struct rt_dac_device *device, rt_uint32_t ch
}
#endif

#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
DAC_ChanConf.DAC_Trigger = DAC_TRIGGER_NONE;
DAC_ChanConf.DAC_OutputBuffer = DAC_OUTPUTBUFFER_DISABLE;
#endif
Expand Down
4 changes: 4 additions & 0 deletions bsp/stm32/libraries/STM32L4xx_HAL/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ if GetDepend(['RT_USING_ADC']):
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c']

if GetDepend(['RT_USING_DAC']):
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac_ex.c']

if GetDepend(['RT_USING_RTC']):
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c']
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c']
Expand Down
14 changes: 7 additions & 7 deletions bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/.mxproject

Large diffs are not rendered by default.

Loading