Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
352f5993
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
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,发现更多精彩内容 >>
提交
352f5993
编写于
12月 15, 2020
作者:
C
chenjh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dac config for stmf4
上级
22c0dff5
变更
12
展开全部
显示空白变更内容
内联
并排
Showing
12 changed file
with
768 addition
and
615 deletion
+768
-615
bsp/stm32/libraries/HAL_Drivers/config/f4/dac_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/dac_config.h
+42
-0
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
+4
-4
bsp/stm32/libraries/STM32F4xx_HAL/SConscript
bsp/stm32/libraries/STM32F4xx_HAL/SConscript
+4
-0
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/.mxproject
...m32/stm32f407-atk-explorer/board/CubeMX_Config/.mxproject
+7
-7
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/CubeMX_Config.ioc
...32f407-atk-explorer/board/CubeMX_Config/CubeMX_Config.ioc
+410
-411
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
...atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
+90
-47
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_it.h
...2f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_it.h
+1
-1
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/main.c
...m32/stm32f407-atk-explorer/board/CubeMX_Config/Src/main.c
+96
-44
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
...-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
+102
-100
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_it.c
...2f407-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_it.c
+1
-1
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
+10
-0
未找到文件。
bsp/stm32/libraries/HAL_Drivers/config/f4/dac_config.h
0 → 100644
浏览文件 @
352f5993
/*
* 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_config.h
浏览文件 @
352f5993
...
...
@@ -51,6 +51,7 @@ extern "C" {
#include "f4/qspi_config.h"
#include "f4/usbd_config.h"
#include "f4/adc_config.h"
#include "f4/dac_config.h"
#include "f4/tim_config.h"
#include "f4/sdio_config.h"
#include "f4/pwm_config.h"
...
...
bsp/stm32/libraries/HAL_Drivers/drv_dac.c
浏览文件 @
352f5993
...
...
@@ -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) || defined(SOC_SERIES_STM32L4)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
|| defined(SOC_SERIES_STM32F4)
HAL_DAC_Start
(
stm32_dac_handler
,
channel
);
#endif
...
...
@@ -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) || defined(SOC_SERIES_STM32L4)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
|| defined(SOC_SERIES_STM32F4)
HAL_DAC_Stop
(
stm32_dac_handler
,
channel
);
#endif
...
...
@@ -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) || defined(SOC_SERIES_STM32L4)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
|| defined(SOC_SERIES_STM32F4)
if
((
channel
<=
2
)
&&
(
channel
>
0
))
{
/* set stm32 dac channel */
...
...
@@ -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) || defined(SOC_SERIES_STM32L4)
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4)
|| defined(SOC_SERIES_STM32F4)
DAC_ChanConf
.
DAC_Trigger
=
DAC_TRIGGER_NONE
;
DAC_ChanConf
.
DAC_OutputBuffer
=
DAC_OUTPUTBUFFER_DISABLE
;
#endif
...
...
bsp/stm32/libraries/STM32F4xx_HAL/SConscript
浏览文件 @
352f5993
...
...
@@ -58,6 +58,10 @@ if GetDepend(['RT_USING_ADC']):
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c'
]
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c'
]
if
GetDepend
([
'RT_USING_DAC'
]):
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c'
]
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c'
]
if
GetDepend
([
'RT_USING_RTC'
]):
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c'
]
src
+=
[
'STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c'
]
...
...
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/.mxproject
浏览文件 @
352f5993
[PreviousGenFiles]
HeaderPath=D:/rt_thread_learn/rt-thread/bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc
HeaderFiles=stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h;
SourcePath=D:/rt_thread_learn/rt-thread/bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src
SourceFiles=stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c;
[PreviousLibFiles]
LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_
adc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ad
c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;
LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_
dac.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_da
c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;
[PreviousUsedKeilFiles]
SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;..\Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;..\\Src/system_stm32f4xx.c;..\Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;;
...
...
@@ -15,3 +9,9 @@ CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER;
[]
SourceFiles=;;
[PreviousGenFiles]
HeaderPath=G:/workspaces/rt-thread/bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc
HeaderFiles=stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h;
SourcePath=G:/workspaces/rt-thread/bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src
SourceFiles=stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c;
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/CubeMX_Config.ioc
浏览文件 @
352f5993
此差异已折叠。
点击以展开。
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
浏览文件 @
352f5993
...
...
@@ -36,12 +36,13 @@
*/
#define HAL_MODULE_ENABLED
#define HAL_ADC_MODULE_ENABLED
/* #define HAL_ADC_MODULE_ENABLED */
/* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_CAN_MODULE_ENABLED */
/* #define HAL_CRC_MODULE_ENABLED */
/* #define HAL_CAN_LEGACY_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
...
...
@@ -151,6 +152,45 @@
#define INSTRUCTION_CACHE_ENABLE 1U
#define DATA_CACHE_ENABLE 1U
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U
/* ADC register callback disabled */
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U
/* CAN register callback disabled */
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U
/* CEC register callback disabled */
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U
/* CRYP register callback disabled */
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U
/* DAC register callback disabled */
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U
/* DCMI register callback disabled */
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U
/* DFSDM register callback disabled */
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U
/* DMA2D register callback disabled */
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U
/* DSI register callback disabled */
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U
/* ETH register callback disabled */
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U
/* HASH register callback disabled */
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U
/* HCD register callback disabled */
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U
/* I2C register callback disabled */
#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U
/* FMPI2C register callback disabled */
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U
/* I2S register callback disabled */
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U
/* IRDA register callback disabled */
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U
/* LPTIM register callback disabled */
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U
/* LTDC register callback disabled */
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U
/* MMC register callback disabled */
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U
/* NAND register callback disabled */
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U
/* NOR register callback disabled */
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U
/* PCCARD register callback disabled */
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U
/* PCD register callback disabled */
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U
/* QSPI register callback disabled */
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U
/* RNG register callback disabled */
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U
/* RTC register callback disabled */
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U
/* SAI register callback disabled */
#define USE_HAL_SD_REGISTER_CALLBACKS 0U
/* SD register callback disabled */
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U
/* SMARTCARD register callback disabled */
#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U
/* SDRAM register callback disabled */
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U
/* SRAM register callback disabled */
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U
/* SPDIFRX register callback disabled */
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U
/* SMBUS register callback disabled */
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U
/* SPI register callback disabled */
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U
/* TIM register callback disabled */
#define USE_HAL_UART_REGISTER_CALLBACKS 0U
/* UART register callback disabled */
#define USE_HAL_USART_REGISTER_CALLBACKS 0U
/* USART register callback disabled */
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U
/* WWDG register callback disabled */
/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
...
...
@@ -235,14 +275,14 @@
#include "stm32f4xx_hal_rcc.h"
#endif
/* HAL_RCC_MODULE_ENABLED */
#ifdef HAL_EXTI_MODULE_ENABLED
#include "stm32f4xx_hal_exti.h"
#endif
/* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_GPIO_MODULE_ENABLED
#include "stm32f4xx_hal_gpio.h"
#endif
/* HAL_GPIO_MODULE_ENABLED */
#ifdef HAL_EXTI_MODULE_ENABLED
#include "stm32f4xx_hal_exti.h"
#endif
/* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_DMA_MODULE_ENABLED
#include "stm32f4xx_hal_dma.h"
#endif
/* HAL_DMA_MODULE_ENABLED */
...
...
@@ -259,6 +299,10 @@
#include "stm32f4xx_hal_can.h"
#endif
/* HAL_CAN_MODULE_ENABLED */
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
#include "stm32f4xx_hal_can_legacy.h"
#endif
/* HAL_CAN_LEGACY_MODULE_ENABLED */
#ifdef HAL_CRC_MODULE_ENABLED
#include "stm32f4xx_hal_crc.h"
#endif
/* HAL_CRC_MODULE_ENABLED */
...
...
@@ -267,10 +311,6 @@
#include "stm32f4xx_hal_cryp.h"
#endif
/* HAL_CRYP_MODULE_ENABLED */
#ifdef HAL_SMBUS_MODULE_ENABLED
#include "stm32f4xx_hal_smbus.h"
#endif
/* HAL_SMBUS_MODULE_ENABLED */
#ifdef HAL_DMA2D_MODULE_ENABLED
#include "stm32f4xx_hal_dma2d.h"
#endif
/* HAL_DMA2D_MODULE_ENABLED */
...
...
@@ -319,6 +359,10 @@
#include "stm32f4xx_hal_i2c.h"
#endif
/* HAL_I2C_MODULE_ENABLED */
#ifdef HAL_SMBUS_MODULE_ENABLED
#include "stm32f4xx_hal_smbus.h"
#endif
/* HAL_SMBUS_MODULE_ENABLED */
#ifdef HAL_I2S_MODULE_ENABLED
#include "stm32f4xx_hal_i2s.h"
#endif
/* HAL_I2S_MODULE_ENABLED */
...
...
@@ -351,10 +395,6 @@
#include "stm32f4xx_hal_sd.h"
#endif
/* HAL_SD_MODULE_ENABLED */
#ifdef HAL_MMC_MODULE_ENABLED
#include "stm32f4xx_hal_mmc.h"
#endif
/* HAL_MMC_MODULE_ENABLED */
#ifdef HAL_SPI_MODULE_ENABLED
#include "stm32f4xx_hal_spi.h"
#endif
/* HAL_SPI_MODULE_ENABLED */
...
...
@@ -419,11 +459,15 @@
#include "stm32f4xx_hal_lptim.h"
#endif
/* HAL_LPTIM_MODULE_ENABLED */
#ifdef HAL_MMC_MODULE_ENABLED
#include "stm32f4xx_hal_mmc.h"
#endif
/* HAL_MMC_MODULE_ENABLED */
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr
:
If expr is false, it calls assert_failed function
* @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.
* If expr is true, it returns no value.
...
...
@@ -442,5 +486,4 @@
#endif
/* __STM32F4xx_HAL_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_it.h
浏览文件 @
352f5993
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/main.c
浏览文件 @
352f5993
...
...
@@ -37,7 +37,6 @@
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
...
...
@@ -62,7 +61,7 @@
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef
hadc1
;
DAC_HandleTypeDef
hdac
;
ETH_HandleTypeDef
heth
;
...
...
@@ -86,6 +85,8 @@ UART_HandleTypeDef huart3;
PCD_HandleTypeDef
hpcd_USB_OTG_FS
;
SRAM_HandleTypeDef
hsram1
;
/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
...
...
@@ -98,7 +99,6 @@ static void MX_USART1_UART_Init(void);
static
void
MX_SPI1_Init
(
void
);
static
void
MX_ETH_Init
(
void
);
static
void
MX_USART3_UART_Init
(
void
);
static
void
MX_ADC1_Init
(
void
);
static
void
MX_RTC_Init
(
void
);
static
void
MX_IWDG_Init
(
void
);
static
void
MX_TIM14_Init
(
void
);
...
...
@@ -109,6 +109,8 @@ static void MX_TIM2_Init(void);
static
void
MX_SPI2_Init
(
void
);
static
void
MX_TIM4_Init
(
void
);
static
void
MX_USB_OTG_FS_PCD_Init
(
void
);
static
void
MX_FSMC_Init
(
void
);
static
void
MX_DAC_Init
(
void
);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
...
...
@@ -129,7 +131,6 @@ int main(void)
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
...
...
@@ -152,7 +153,6 @@ int main(void)
MX_SPI1_Init
();
MX_ETH_Init
();
MX_USART3_UART_Init
();
MX_ADC1_Init
();
MX_RTC_Init
();
MX_IWDG_Init
();
MX_TIM14_Init
();
...
...
@@ -163,6 +163,8 @@ int main(void)
MX_SPI2_Init
();
MX_TIM4_Init
();
MX_USB_OTG_FS_PCD_Init
();
MX_FSMC_Init
();
MX_DAC_Init
();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
...
...
@@ -194,7 +196,8 @@ void SystemClock_Config(void)
*/
__HAL_RCC_PWR_CLK_ENABLE
();
__HAL_PWR_VOLTAGESCALING_CONFIG
(
PWR_REGULATOR_VOLTAGE_SCALE1
);
/** Initializes the CPU, AHB and APB busses clocks
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct
.
OscillatorType
=
RCC_OSCILLATORTYPE_LSI
|
RCC_OSCILLATORTYPE_HSE
|
RCC_OSCILLATORTYPE_LSE
;
...
...
@@ -211,7 +214,7 @@ void SystemClock_Config(void)
{
Error_Handler
();
}
/** Initializes the CPU, AHB and APB bus
ses clocks
/** Initializes the CPU, AHB and APB bus
es clocks
*/
RCC_ClkInitStruct
.
ClockType
=
RCC_CLOCKTYPE_HCLK
|
RCC_CLOCKTYPE_SYSCLK
|
RCC_CLOCKTYPE_PCLK1
|
RCC_CLOCKTYPE_PCLK2
;
...
...
@@ -233,52 +236,46 @@ void SystemClock_Config(void)
}
/**
* @brief
ADC1
Initialization Function
* @brief
DAC
Initialization Function
* @param None
* @retval None
*/
static
void
MX_
ADC1
_Init
(
void
)
static
void
MX_
DAC
_Init
(
void
)
{
/* USER CODE BEGIN
ADC1
_Init 0 */
/* USER CODE BEGIN
DAC
_Init 0 */
/* USER CODE END
ADC1
_Init 0 */
/* USER CODE END
DAC
_Init 0 */
AD
C_ChannelConfTypeDef
sConfig
=
{
0
};
DA
C_ChannelConfTypeDef
sConfig
=
{
0
};
/* USER CODE BEGIN
ADC1
_Init 1 */
/* USER CODE BEGIN
DAC
_Init 1 */
/* USER CODE END ADC1_Init 1 */
/** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
/* USER CODE END DAC_Init 1 */
/** DAC Initialization
*/
hdac
.
Instance
=
DAC
;
if
(
HAL_DAC_Init
(
&
hdac
)
!=
HAL_OK
)
{
Error_Handler
();
}
/** DAC channel OUT1 config
*/
hadc1
.
Instance
=
ADC1
;
hadc1
.
Init
.
ClockPrescaler
=
ADC_CLOCK_SYNC_PCLK_DIV4
;
hadc1
.
Init
.
Resolution
=
ADC_RESOLUTION_12B
;
hadc1
.
Init
.
ScanConvMode
=
DISABLE
;
hadc1
.
Init
.
ContinuousConvMode
=
DISABLE
;
hadc1
.
Init
.
DiscontinuousConvMode
=
DISABLE
;
hadc1
.
Init
.
ExternalTrigConvEdge
=
ADC_EXTERNALTRIGCONVEDGE_NONE
;
hadc1
.
Init
.
ExternalTrigConv
=
ADC_SOFTWARE_START
;
hadc1
.
Init
.
DataAlign
=
ADC_DATAALIGN_RIGHT
;
hadc1
.
Init
.
NbrOfConversion
=
1
;
hadc1
.
Init
.
DMAContinuousRequests
=
DISABLE
;
hadc1
.
Init
.
EOCSelection
=
ADC_EOC_SINGLE_CONV
;
if
(
HAL_ADC_Init
(
&
hadc1
)
!=
HAL_OK
)
sConfig
.
DAC_Trigger
=
DAC_TRIGGER_NONE
;
sConfig
.
DAC_OutputBuffer
=
DAC_OUTPUTBUFFER_ENABLE
;
if
(
HAL_DAC_ConfigChannel
(
&
hdac
,
&
sConfig
,
DAC_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
/**
Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
/**
DAC channel OUT2 config
*/
sConfig
.
Channel
=
ADC_CHANNEL_5
;
sConfig
.
Rank
=
1
;
sConfig
.
SamplingTime
=
ADC_SAMPLETIME_3CYCLES
;
if
(
HAL_ADC_ConfigChannel
(
&
hadc1
,
&
sConfig
)
!=
HAL_OK
)
if
(
HAL_DAC_ConfigChannel
(
&
hdac
,
&
sConfig
,
DAC_CHANNEL_2
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN
ADC1
_Init 2 */
/* USER CODE BEGIN
DAC
_Init 2 */
/* USER CODE END
ADC1
_Init 2 */
/* USER CODE END
DAC
_Init 2 */
}
...
...
@@ -520,7 +517,7 @@ static void MX_TIM2_Init(void)
htim2
.
Instance
=
TIM2
;
htim2
.
Init
.
Prescaler
=
0
;
htim2
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim2
.
Init
.
Period
=
0
;
htim2
.
Init
.
Period
=
4294967295
;
htim2
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim2
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim2
)
!=
HAL_OK
)
...
...
@@ -578,7 +575,7 @@ static void MX_TIM4_Init(void)
htim4
.
Instance
=
TIM4
;
htim4
.
Init
.
Prescaler
=
0
;
htim4
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim4
.
Init
.
Period
=
0
;
htim4
.
Init
.
Period
=
65535
;
htim4
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim4
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
sConfig
.
EncoderMode
=
TIM_ENCODERMODE_TI1
;
...
...
@@ -624,7 +621,7 @@ static void MX_TIM11_Init(void)
htim11
.
Instance
=
TIM11
;
htim11
.
Init
.
Prescaler
=
0
;
htim11
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim11
.
Init
.
Period
=
0
;
htim11
.
Init
.
Period
=
65535
;
htim11
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim11
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim11
)
!=
HAL_OK
)
...
...
@@ -655,7 +652,7 @@ static void MX_TIM13_Init(void)
htim13
.
Instance
=
TIM13
;
htim13
.
Init
.
Prescaler
=
0
;
htim13
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim13
.
Init
.
Period
=
0
;
htim13
.
Init
.
Period
=
65535
;
htim13
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim13
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim13
)
!=
HAL_OK
)
...
...
@@ -686,7 +683,7 @@ static void MX_TIM14_Init(void)
htim14
.
Instance
=
TIM14
;
htim14
.
Init
.
Prescaler
=
0
;
htim14
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim14
.
Init
.
Period
=
0
;
htim14
.
Init
.
Period
=
65535
;
htim14
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim14
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim14
)
!=
HAL_OK
)
...
...
@@ -810,14 +807,69 @@ static void MX_GPIO_Init(void)
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE
();
__HAL_RCC_GPIOF_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
__HAL_RCC_GPIOG_CLK_ENABLE
();
__HAL_RCC_GPIOE_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
__HAL_RCC_GPIOD_CLK_ENABLE
();
__HAL_RCC_GPIOG_CLK_ENABLE
();
}
/* FSMC initialization function */
static
void
MX_FSMC_Init
(
void
)
{
/* USER CODE BEGIN FSMC_Init 0 */
/* USER CODE END FSMC_Init 0 */
FSMC_NORSRAM_TimingTypeDef
Timing
=
{
0
};
/* USER CODE BEGIN FSMC_Init 1 */
/* USER CODE END FSMC_Init 1 */
/** Perform the SRAM1 memory initialization sequence
*/
hsram1
.
Instance
=
FSMC_NORSRAM_DEVICE
;
hsram1
.
Extended
=
FSMC_NORSRAM_EXTENDED_DEVICE
;
/* hsram1.Init */
hsram1
.
Init
.
NSBank
=
FSMC_NORSRAM_BANK3
;
hsram1
.
Init
.
DataAddressMux
=
FSMC_DATA_ADDRESS_MUX_DISABLE
;
hsram1
.
Init
.
MemoryType
=
FSMC_MEMORY_TYPE_SRAM
;
hsram1
.
Init
.
MemoryDataWidth
=
FSMC_NORSRAM_MEM_BUS_WIDTH_16
;
hsram1
.
Init
.
BurstAccessMode
=
FSMC_BURST_ACCESS_MODE_DISABLE
;
hsram1
.
Init
.
WaitSignalPolarity
=
FSMC_WAIT_SIGNAL_POLARITY_LOW
;
hsram1
.
Init
.
WrapMode
=
FSMC_WRAP_MODE_DISABLE
;
hsram1
.
Init
.
WaitSignalActive
=
FSMC_WAIT_TIMING_BEFORE_WS
;
hsram1
.
Init
.
WriteOperation
=
FSMC_WRITE_OPERATION_ENABLE
;
hsram1
.
Init
.
WaitSignal
=
FSMC_WAIT_SIGNAL_DISABLE
;
hsram1
.
Init
.
ExtendedMode
=
FSMC_EXTENDED_MODE_DISABLE
;
hsram1
.
Init
.
AsynchronousWait
=
FSMC_ASYNCHRONOUS_WAIT_DISABLE
;
hsram1
.
Init
.
WriteBurst
=
FSMC_WRITE_BURST_DISABLE
;
hsram1
.
Init
.
PageSize
=
FSMC_PAGE_SIZE_NONE
;
/* Timing */
Timing
.
AddressSetupTime
=
15
;
Timing
.
AddressHoldTime
=
15
;
Timing
.
DataSetupTime
=
255
;
Timing
.
BusTurnAroundDuration
=
15
;
Timing
.
CLKDivision
=
16
;
Timing
.
DataLatency
=
17
;
Timing
.
AccessMode
=
FSMC_ACCESS_MODE_A
;
/* ExtTiming */
if
(
HAL_SRAM_Init
(
&
hsram1
,
&
Timing
,
NULL
)
!=
HAL_OK
)
{
Error_Handler
(
);
}
/* USER CODE BEGIN FSMC_Init 2 */
/* USER CODE END FSMC_Init 2 */
}
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
...
...
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
浏览文件 @
352f5993
...
...
@@ -100,62 +100,64 @@ void HAL_MspInit(void)
}
/**
* @brief
AD
C MSP Initialization
* @brief
DA
C MSP Initialization
* This function configures the hardware resources used in this example
* @param h
adc: AD
C handle pointer
* @param h
dac: DA
C handle pointer
* @retval None
*/
void
HAL_
ADC_MspInit
(
ADC_HandleTypeDef
*
had
c
)
void
HAL_
DAC_MspInit
(
DAC_HandleTypeDef
*
hda
c
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
h
adc
->
Instance
==
ADC1
)
if
(
h
dac
->
Instance
==
DAC
)
{
/* USER CODE BEGIN
ADC1
_MspInit 0 */
/* USER CODE BEGIN
DAC
_MspInit 0 */
/* USER CODE END
ADC1
_MspInit 0 */
/* USER CODE END
DAC
_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_
ADC1
_CLK_ENABLE
();
__HAL_RCC_
DAC
_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
/**ADC1 GPIO Configuration
PA5 ------> ADC1_IN5
/**DAC GPIO Configuration
PA4 ------> DAC_OUT1
PA5 ------> DAC_OUT2
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_5
;
GPIO_InitStruct
.
Pin
=
GPIO_PIN_
4
|
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 BEGIN
DAC
_MspInit 1 */
/* USER CODE END
ADC1
_MspInit 1 */
/* USER CODE END
DAC
_MspInit 1 */
}
}
/**
* @brief
AD
C MSP De-Initialization
* @brief
DA
C MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param h
adc: AD
C handle pointer
* @param h
dac: DA
C handle pointer
* @retval None
*/
void
HAL_
ADC_MspDeInit
(
ADC_HandleTypeDef
*
had
c
)
void
HAL_
DAC_MspDeInit
(
DAC_HandleTypeDef
*
hda
c
)
{
if
(
h
adc
->
Instance
==
ADC1
)
if
(
h
dac
->
Instance
==
DAC
)
{
/* USER CODE BEGIN
ADC1
_MspDeInit 0 */
/* USER CODE BEGIN
DAC
_MspDeInit 0 */
/* USER CODE END
ADC1
_MspDeInit 0 */
/* USER CODE END
DAC
_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_
ADC1
_CLK_DISABLE
();
__HAL_RCC_
DAC
_CLK_DISABLE
();
/**ADC1 GPIO Configuration
PA5 ------> ADC1_IN5
/**DAC GPIO Configuration
PA4 ------> DAC_OUT1
PA5 ------> DAC_OUT2
*/
HAL_GPIO_DeInit
(
GPIOA
,
GPIO_PIN_5
);
HAL_GPIO_DeInit
(
GPIOA
,
GPIO_PIN_
4
|
GPIO_PIN_
5
);
/* USER CODE BEGIN
ADC1
_MspDeInit 1 */
/* USER CODE BEGIN
DAC
_MspDeInit 1 */
/* USER CODE END
ADC1
_MspDeInit 1 */
/* USER CODE END
DAC
_MspDeInit 1 */
}
}
...
...
@@ -739,7 +741,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_9
|
GPIO_PIN_10
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_
PULLUP
;
GPIO_InitStruct
.
Pull
=
GPIO_
NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF7_USART1
;
HAL_GPIO_Init
(
GPIOA
,
&
GPIO_InitStruct
);
...
...
@@ -766,7 +768,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_10
|
GPIO_PIN_11
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_
PULLUP
;
GPIO_InitStruct
.
Pull
=
GPIO_
NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF7_USART3
;
HAL_GPIO_Init
(
GPIOB
,
&
GPIO_InitStruct
);
...
...
bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Src/stm32f4xx_it.c
浏览文件 @
352f5993
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
浏览文件 @
352f5993
...
...
@@ -273,6 +273,16 @@ menu "On-chip Peripheral Drivers"
default 25
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
menuconfig BSP_USING_ONCHIP_RTC
bool "Enable RTC"
select RT_USING_RTC
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录