Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wwsmg1
rt-thread
提交
8edb7c31
R
rt-thread
项目概览
wwsmg1
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8edb7c31
编写于
10月 09, 2020
作者:
T
thread-liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[add] stm32h7 adc and dac driver.
上级
aeff91b2
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
388 addition
and
165 deletion
+388
-165
bsp/stm32/libraries/HAL_Drivers/config/h7/adc_config.h
bsp/stm32/libraries/HAL_Drivers/config/h7/adc_config.h
+51
-45
bsp/stm32/libraries/HAL_Drivers/config/h7/dac_config.h
bsp/stm32/libraries/HAL_Drivers/config/h7/dac_config.h
+42
-0
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
+8
-5
bsp/stm32/libraries/HAL_Drivers/drv_config.h
bsp/stm32/libraries/HAL_Drivers/drv_config.h
+1
-0
bsp/stm32/libraries/HAL_Drivers/drv_dac.c
bsp/stm32/libraries/HAL_Drivers/drv_dac.c
+13
-8
bsp/stm32/libraries/STM32H7xx_HAL/SConscript
bsp/stm32/libraries/STM32H7xx_HAL/SConscript
+6
-2
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/CubeMX_Config.ioc
...tm32h743-atk-apollo/board/CubeMX_Config/CubeMX_Config.ioc
+106
-86
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h
...3-atk-apollo/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h
+18
-18
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c
...43-atk-apollo/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c
+122
-0
bsp/stm32/stm32h743-atk-apollo/board/Kconfig
bsp/stm32/stm32h743-atk-apollo/board/Kconfig
+21
-1
未找到文件。
bsp/stm32/libraries/HAL_Drivers/config/h7/adc_config.h
浏览文件 @
8edb7c31
...
...
@@ -19,63 +19,69 @@ extern "C" {
#ifdef BSP_USING_ADC1
#ifndef ADC1_CONFIG
#define ADC1_CONFIG \
{ \
.Instance = ADC1, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_12B, \
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
.Init.ScanConvMode = DISABLE, \
.Init.EOCSelection = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 0, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.DMAContinuousRequests = DISABLE, \
#define ADC1_CONFIG \
{ \
.Instance = ADC1, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_16B, \
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
.Init.EOCSelection = ADC_EOC_SINGLE_CONV, \
.Init.LowPowerAutoWait = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 1, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR, \
.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN, \
.Init.OversamplingMode = DISABLE, \
}
#endif
/* ADC1_CONFIG */
#endif
/* BSP_USING_ADC1 */
#ifdef BSP_USING_ADC2
#ifndef ADC2_CONFIG
#define ADC2_CONFIG \
{ \
.Instance = ADC2, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_12B, \
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
.Init.ScanConvMode = DISABLE, \
.Init.EOCSelection = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 0, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.DMAContinuousRequests = DISABLE, \
#define ADC2_CONFIG \
{ \
.Instance = ADC2, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_16B, \
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
.Init.EOCSelection = ADC_EOC_SINGLE_CONV, \
.Init.LowPowerAutoWait = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 1, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR, \
.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN, \
.Init.OversamplingMode = DISABLE, \
}
#endif
/* ADC2_CONFIG */
#endif
/* BSP_USING_ADC2 */
#ifdef BSP_USING_ADC3
#ifndef ADC3_CONFIG
#define ADC3_CONFIG \
{ \
.Instance = ADC3, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_12B, \
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
.Init.ScanConvMode = DISABLE, \
.Init.EOCSelection = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 0, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.DMAContinuousRequests = DISABLE, \
#define ADC3_CONFIG \
{ \
.Instance = ADC3, \
.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4, \
.Init.Resolution = ADC_RESOLUTION_16B, \
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
.Init.EOCSelection = ADC_EOC_SINGLE_CONV, \
.Init.LowPowerAutoWait = DISABLE, \
.Init.ContinuousConvMode = DISABLE, \
.Init.NbrOfConversion = 1, \
.Init.DiscontinuousConvMode = DISABLE, \
.Init.NbrOfDiscConversion = 1, \
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE, \
.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR, \
.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN, \
.Init.OversamplingMode = DISABLE, \
}
#endif
/* ADC3_CONFIG */
#endif
/* BSP_USING_ADC3 */
...
...
bsp/stm32/libraries/HAL_Drivers/config/h7/dac_config.h
0 → 100644
浏览文件 @
8edb7c31
/*
* 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__ */
bsp/stm32/libraries/HAL_Drivers/drv_adc.c
浏览文件 @
8edb7c31
...
...
@@ -9,6 +9,7 @@
* 2018-12-12 greedyhao Porting for stm32f7xx
* 2019-02-01 yuneizhilin fix the stm32_adc_init function initialization issue
* 2020-06-17 thread-liu Porting for stm32mp1xx
* 2020-10-09 thread-liu Porting for stm32h7xx
*/
#include <board.h>
...
...
@@ -51,7 +52,7 @@ static rt_err_t stm32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chan
if
(
enabled
)
{
#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32G0) || defined
(SOC_SERIES_STM32MP1
)
#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32G0) || defined
(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7
)
ADC_Enable
(
stm32_adc_handler
);
#else
__HAL_ADC_ENABLE
(
stm32_adc_handler
);
...
...
@@ -59,7 +60,7 @@ static rt_err_t stm32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chan
}
else
{
#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32G0) || defined
(SOC_SERIES_STM32MP1
)
#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32G0) || defined
(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7
)
ADC_Disable
(
stm32_adc_handler
);
#else
__HAL_ADC_DISABLE
(
stm32_adc_handler
);
...
...
@@ -192,7 +193,7 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
return
-
RT_ERROR
;
}
#if defined(SOC_SERIES_STM32MP1)
#if defined(SOC_SERIES_STM32MP1)
|| defined (SOC_SERIES_STM32H7)
ADC_ChanConf
.
Rank
=
ADC_REGULAR_RANK_1
;
#else
ADC_ChanConf
.
Rank
=
1
;
...
...
@@ -208,6 +209,8 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_247CYCLES_5
;
#elif defined(SOC_SERIES_STM32MP1)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_810CYCLES_5
;
#elif defined(SOC_SERIES_STM32H7)
ADC_ChanConf
.
SamplingTime
=
ADC_SAMPLETIME_64CYCLES_5
;
#endif
#if defined(SOC_SERIES_STM32F2) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F7) || defined(SOC_SERIES_STM32L4)
...
...
@@ -217,7 +220,7 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
#if defined(SOC_SERIES_STM32L4)
ADC_ChanConf
.
OffsetNumber
=
ADC_OFFSET_NONE
;
ADC_ChanConf
.
SingleDiff
=
LL_ADC_SINGLE_ENDED
;
#elif defined(SOC_SERIES_STM32MP1)
#elif defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
ADC_ChanConf
.
OffsetNumber
=
ADC_OFFSET_NONE
;
/* ADC channel affected to offset number */
ADC_ChanConf
.
Offset
=
0
;
ADC_ChanConf
.
SingleDiff
=
ADC_SINGLE_ENDED
;
/* ADC channel differential mode */
...
...
@@ -231,7 +234,7 @@ static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t ch
LOG_E
(
"ADC calibration error!
\n
"
);
return
-
RT_ERROR
;
}
#elif defined(SOC_SERIES_STM32MP1)
#elif defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
/* Run the ADC linear calibration in single-ended mode */
if
(
HAL_ADCEx_Calibration_Start
(
stm32_adc_handler
,
ADC_CALIB_OFFSET_LINEARITY
,
ADC_ChanConf
.
SingleDiff
)
!=
HAL_OK
)
{
...
...
bsp/stm32/libraries/HAL_Drivers/drv_config.h
浏览文件 @
8edb7c31
...
...
@@ -100,6 +100,7 @@ extern "C" {
#include "h7/spi_config.h"
#include "h7/qspi_config.h"
#include "h7/adc_config.h"
#include "h7/dac_config.h"
#include "h7/tim_config.h"
#include "h7/sdio_config.h"
#include "h7/pwm_config.h"
...
...
bsp/stm32/libraries/HAL_Drivers/drv_dac.c
浏览文件 @
8edb7c31
...
...
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2020-06-18 thread-liu the first version
* 2020-10-09 thread-liu Porting for stm32h7xx
*/
#include <board.h>
...
...
@@ -22,6 +23,10 @@ static DAC_HandleTypeDef dac_config[] =
#ifdef BSP_USING_DAC1
DAC1_CONFIG
,
#endif
#ifdef BSP_USING_DAC2
DAC2_CONFIG
,
#endif
};
struct
stm32_dac
...
...
@@ -38,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)
#if defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
HAL_DAC_Start
(
stm32_dac_handler
,
channel
);
#endif
...
...
@@ -51,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)
#if defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
HAL_DAC_Stop
(
stm32_dac_handler
,
channel
);
#endif
...
...
@@ -91,22 +96,22 @@ 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)
if
(
channel
<=
2
&&
channel
>
0
)
#if defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
if
(
(
channel
<=
2
)
&&
(
channel
>
0
)
)
{
/* set stm32 dac channel */
dac_channel
=
stm32_dac_get_channel
(
channel
);
}
else
{
LOG_E
(
"dac channel must be
between 1 and
2."
);
LOG_E
(
"dac channel must be
1 or
2."
);
return
-
RT_ERROR
;
}
#endif
#if defined(SOC_SERIES_STM32MP1)
DAC_ChanConf
.
DAC_Trigger
=
DAC_TRIGGER_NONE
;
DAC_ChanConf
.
DAC_OutputBuffer
=
DAC_OUTPUTBUFFER_DISABLE
;
#if defined(SOC_SERIES_STM32MP1)
|| defined(SOC_SERIES_STM32H7)
DAC_ChanConf
.
DAC_Trigger
=
DAC_TRIGGER_NONE
;
DAC_ChanConf
.
DAC_OutputBuffer
=
DAC_OUTPUTBUFFER_DISABLE
;
#endif
/* config dac out channel*/
if
(
HAL_DAC_ConfigChannel
(
stm32_dac_handler
,
&
DAC_ChanConf
,
dac_channel
)
!=
HAL_OK
)
...
...
bsp/stm32/libraries/STM32H7xx_HAL/SConscript
浏览文件 @
8edb7c31
...
...
@@ -27,7 +27,7 @@ STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rng.c
STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sram.c
STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c
'''
)
if
GetDepend
([
'RT_USING_SERIAL'
]):
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_usart.c'
]
...
...
@@ -43,7 +43,7 @@ if GetDepend(['RT_USING_SPI']):
if
GetDepend
([
'RT_USING_USB_HOST'
])
or
GetDepend
([
'RT_USING_USB_DEVICE'
]):
# src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pccard.c']
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hcd.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c'
]
...
...
@@ -64,6 +64,10 @@ if GetDepend(['RT_USING_ADC']):
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c'
]
if
GetDepend
([
'RT_USING_DAC'
]):
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c'
]
if
GetDepend
([
'RT_USING_RTC'
]):
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc.c'
]
src
+=
[
'STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc_ex.c'
]
...
...
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/CubeMX_Config.ioc
浏览文件 @
8edb7c31
#MicroXplorer Configuration settings - do not modify
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_19
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSignedSaturation-0\#ChannelRegularConversion,NbrOfConversionFlag,master
ADC1.NbrOfConversionFlag=1
ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetSignedSaturation-0\#ChannelRegularConversion=DISABLE
ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5
ADC1.master=1
CORTEX_M7.CPU_DCache=Enabled
CORTEX_M7.CPU_ICache=Enabled
CORTEX_M7.IPParameters=CPU_ICache,CPU_DCache
...
...
@@ -21,22 +29,24 @@ FMC.WriteRecoveryTime1=4
File.Version=6
KeepUserPlacement=false
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M7
Mcu.IP1=DEBUG
Mcu.IP10=SDMMC1
Mcu.IP11=SPI2
Mcu.IP12=SYS
Mcu.IP13=USART1
Mcu.IP14=USART2
Mcu.IP2=DMA2D
Mcu.IP3=FMC
Mcu.IP4=IWDG1
Mcu.IP5=LTDC
Mcu.IP6=NVIC
Mcu.IP7=QUADSPI
Mcu.IP8=RCC
Mcu.IP9=RTC
Mcu.IPNb=15
Mcu.IP0=ADC1
Mcu.IP1=CORTEX_M7
Mcu.IP10=RCC
Mcu.IP11=RTC
Mcu.IP12=SDMMC1
Mcu.IP13=SPI2
Mcu.IP14=SYS
Mcu.IP15=USART1
Mcu.IP16=USART2
Mcu.IP2=DAC1
Mcu.IP3=DEBUG
Mcu.IP4=DMA2D
Mcu.IP5=FMC
Mcu.IP6=IWDG1
Mcu.IP7=LTDC
Mcu.IP8=NVIC
Mcu.IP9=QUADSPI
Mcu.IPNb=17
Mcu.Name=STM32H743IITx
Mcu.Package=LQFP176
Mcu.Pin0=PC13
...
...
@@ -55,85 +65,87 @@ Mcu.Pin2=PC15-OSC32_OUT (OSC32_OUT)
Mcu.Pin20=PC3_C
Mcu.Pin21=PA2
Mcu.Pin22=PA3
Mcu.Pin23=P
B2
Mcu.Pin24=P
F11
Mcu.Pin25=P
F1
2
Mcu.Pin26=PF1
3
Mcu.Pin27=PF1
4
Mcu.Pin28=PF1
5
Mcu.Pin29=P
G0
Mc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VP_DMA2D_VS_DMA2D
Mcu.Pin88=VP_IWDG1_VS_IWDG
Mcu.Pin89=VP_RTC_VS_RTC_Activate
Mcu.Pin9=PF4
Mcu.PinsNb=89
Mcu.Pin90=VP_SYS_VS_Systick
Mcu.PinsNb=91
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32H743IITx
MxCube.Version=
5.6
.1
MxDb.Version=DB.
5.0.6
0
MxCube.Version=
6.0
.1
MxDb.Version=DB.
6.0.
0
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.ForceEnableDMAVector=true
...
...
@@ -159,6 +171,9 @@ PA2.Mode=Asynchronous
PA2.Signal=USART2_TX
PA3.Mode=Asynchronous
PA3.Signal=USART2_RX
PA4.Signal=COMP_DAC11_group
PA5.Locked=true
PA5.Signal=ADCx_INP19
PA9.Locked=true
PA9.Mode=Asynchronous
PA9.Signal=USART1_TX
...
...
@@ -350,11 +365,12 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=CubeMX_Config.ioc
ProjectManager.ProjectName=CubeMX_Config
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,
4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_FMC_Init-FMC-false-HAL-true,6-MX_DMA2D_Init-DMA2D-false-HAL-true,7-MX_LTDC_Init-LTDC-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_IWDG1_Init-IWDG1-false-HAL-true,10-MX_QUADSPI_Init-QUADSPI-false-HAL-true,11-MX_SPI2_Init-SPI2-false-HAL-true,12-MX_USART2_UART_Init-USART2
-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,
3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_DMA2D_Init-DMA2D-false-HAL-true,6-MX_LTDC_Init-LTDC-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_IWDG1_Init-IWDG1-false-HAL-true,9-MX_QUADSPI_Init-QUADSPI-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART2_UART_Init-USART2-false-HAL-true,12-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,13-MX_ADC1_Init-ADC1
-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
RCC.ADCFreq_Value=50390625
RCC.AHB12Freq_Value=200000000
RCC.AHB4Freq_Value=200000000
...
...
@@ -438,6 +454,10 @@ RCC.VCO3OutputFreq_Value=800000000
RCC.VCOInput1Freq_Value=5000000
RCC.VCOInput2Freq_Value=781250
RCC.VCOInput3Freq_Value=5000000
SH.ADCx_INP19.0=ADC1_INP19,IN19-Single-Ended
SH.ADCx_INP19.ConfNb=1
SH.COMP_DAC11_group.0=DAC1_OUT1,DAC_OUT1
SH.COMP_DAC11_group.ConfNb=1
SH.FMC_A0.0=FMC_A0,13b-sda1
SH.FMC_A0.ConfNb=1
SH.FMC_A1.0=FMC_A1,13b-sda1
...
...
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/Inc/stm32h7xx_hal_conf.h
浏览文件 @
8edb7c31
...
...
@@ -15,7 +15,7 @@
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32H7xx_HAL_CONF_H
...
...
@@ -30,17 +30,17 @@
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
* @brief This is the list of modules to be used in the HAL driver
*/
#define HAL_MODULE_ENABLED
#define HAL_MODULE_ENABLED
/* #define HAL_ADC_MODULE_ENABLED */
#define HAL_ADC_MODULE_ENABLED
/* #define HAL_FDCAN_MODULE_ENABLED */
/* #define HAL_CEC_MODULE_ENABLED */
/* #define HAL_COMP_MODULE_ENABLED */
/* #define HAL_CRC_MODULE_ENABLED */
/* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */
#define HAL_DAC_MODULE_ENABLED
/* #define HAL_DCMI_MODULE_ENABLED */
#define HAL_DMA2D_MODULE_ENABLED
/* #define HAL_ETH_MODULE_ENABLED */
...
...
@@ -100,9 +100,9 @@
/**
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSE is used as system clock source, directly or through the PLL).
* (when HSE is used as system clock source, directly or through the PLL).
*/
#if !defined (HSE_VALUE)
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000)
/*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
#endif
/* HSE_VALUE */
...
...
@@ -117,11 +117,11 @@
#if !defined (CSI_VALUE)
#define CSI_VALUE ((uint32_t)4000000)
/*!< Value of the Internal oscillator in Hz*/
#endif
/* CSI_VALUE */
/**
* @brief Internal High Speed oscillator (HSI) value.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSI is used as system clock source, directly or through the PLL).
* (when HSI is used as system clock source, directly or through the PLL).
*/
#if !defined (HSI_VALUE)
#define HSI_VALUE ((uint32_t)64000000)
/*!< Value of the Internal oscillator in Hz*/
...
...
@@ -141,8 +141,8 @@
/**
* @brief External clock source for I2S peripheral
* This value is used by the I2S HAL module to compute the I2S clock source
* frequency, this source is inserted directly through I2S_CKIN pad.
* This value is used by the I2S HAL module to compute the I2S clock source
* frequency, this source is inserted directly through I2S_CKIN pad.
*/
#if !defined (EXTERNAL_CLOCK_VALUE)
#define EXTERNAL_CLOCK_VALUE 12288000U
/*!< Value of the External clock in Hz*/
...
...
@@ -154,7 +154,7 @@
/* ########################### System Configuration ######################### */
/**
* @brief This is the HAL system configuration section
*/
*/
#define VDD_VALUE ((uint32_t)3300U)
/*!< Value of VDD in mv */
#define TICK_INT_PRIORITY ((uint32_t)0U)
/*!< tick interrupt priority */
#define USE_RTOS 0U
...
...
@@ -220,14 +220,14 @@
/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
* @brief Uncomment the line below to expanse the "assert_param" macro in the
* HAL drivers code
*/
/* #define USE_FULL_ASSERT 1U */
/* #define USE_FULL_ASSERT 1U */
/* Includes ------------------------------------------------------------------*/
/**
* @brief Include module's header file
* @brief Include module's header file
*/
#ifdef HAL_RCC_MODULE_ENABLED
...
...
@@ -373,7 +373,7 @@
#ifdef HAL_OSPI_MODULE_ENABLED
#include "stm32h7xx_hal_ospi.h"
#endif
/* HAL_OSPI_MODULE_ENABLED */
#ifdef HAL_OTFDEC_MODULE_ENABLED
#include "stm32h7xx_hal_otfdec.h"
#endif
/* HAL_OTFDEC_MODULE_ENABLED */
...
...
@@ -472,7 +472,7 @@
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
...
...
@@ -488,6 +488,6 @@
#endif
#endif
/* __STM32H7xx_HAL_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
bsp/stm32/stm32h743-atk-apollo/board/CubeMX_Config/Src/stm32h7xx_hal_msp.c
浏览文件 @
8edb7c31
...
...
@@ -96,6 +96,128 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
/**
* @brief ADC MSP Initialization
* This function configures the hardware resources used in this example
* @param hadc: ADC handle pointer
* @retval None
*/
void
HAL_ADC_MspInit
(
ADC_HandleTypeDef
*
hadc
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
hadc
->
Instance
==
ADC1
)
{
/* USER CODE BEGIN ADC1_MspInit 0 */
/* USER CODE END ADC1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_ADC12_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
/**ADC1 GPIO Configuration
PA5 ------> ADC1_INP19
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_5
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_ANALOG
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
HAL_GPIO_Init
(
GPIOA
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN ADC1_MspInit 1 */
/* USER CODE END ADC1_MspInit 1 */
}
}
/**
* @brief ADC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hadc: ADC handle pointer
* @retval None
*/
void
HAL_ADC_MspDeInit
(
ADC_HandleTypeDef
*
hadc
)
{
if
(
hadc
->
Instance
==
ADC1
)
{
/* USER CODE BEGIN ADC1_MspDeInit 0 */
/* USER CODE END ADC1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC12_CLK_DISABLE
();
/**ADC1 GPIO Configuration
PA5 ------> ADC1_INP19
*/
HAL_GPIO_DeInit
(
GPIOA
,
GPIO_PIN_5
);
/* USER CODE BEGIN ADC1_MspDeInit 1 */
/* USER CODE END ADC1_MspDeInit 1 */
}
}
/**
* @brief DAC MSP Initialization
* This function configures the hardware resources used in this example
* @param hdac: DAC handle pointer
* @retval None
*/
void
HAL_DAC_MspInit
(
DAC_HandleTypeDef
*
hdac
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
hdac
->
Instance
==
DAC1
)
{
/* USER CODE BEGIN DAC1_MspInit 0 */
/* USER CODE END DAC1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_DAC12_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
/**DAC1 GPIO Configuration
PA4 ------> DAC1_OUT1
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_4
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_ANALOG
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
HAL_GPIO_Init
(
GPIOA
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN DAC1_MspInit 1 */
/* USER CODE END DAC1_MspInit 1 */
}
}
/**
* @brief DAC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hdac: DAC handle pointer
* @retval None
*/
void
HAL_DAC_MspDeInit
(
DAC_HandleTypeDef
*
hdac
)
{
if
(
hdac
->
Instance
==
DAC1
)
{
/* USER CODE BEGIN DAC1_MspDeInit 0 */
/* USER CODE END DAC1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_DAC12_CLK_DISABLE
();
/**DAC1 GPIO Configuration
PA4 ------> DAC1_OUT1
*/
HAL_GPIO_DeInit
(
GPIOA
,
GPIO_PIN_4
);
/* USER CODE BEGIN DAC1_MspDeInit 1 */
/* USER CODE END DAC1_MspDeInit 1 */
}
}
/**
* @brief DMA2D MSP Initialization
* This function configures the hardware resources used in this example
...
...
bsp/stm32/stm32h743-atk-apollo/board/Kconfig
浏览文件 @
8edb7c31
...
...
@@ -138,6 +138,26 @@ menu "On-chip Peripheral Drivers"
endchoice
endif
menuconfig BSP_USING_ADC
bool "Enable ADC"
default n
select RT_USING_ADC
if BSP_USING_ADC
config BSP_USING_ADC1
bool "Enable ADC1"
default n
endif
menuconfig BSP_USING_DAC
bool "Enable DAC"
default n
select RT_USING_DAC
if BSP_USING_DAC
config BSP_USING_DAC1
bool "Enable DAC1"
default n
endif
config BSP_USING_WDT
bool "Enable Watchdog Timer"
select RT_USING_WDT
...
...
@@ -151,5 +171,5 @@ endmenu
menu "Board extended module Drivers"
endmenu
endmenu
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录