Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaobo07
rt-thread
提交
0d2b96d7
R
rt-thread
项目概览
Xiaobo07
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0d2b96d7
编写于
5月 09, 2022
作者:
mysterywolf
提交者:
GitHub
5月 09, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[stm32][l4] add tim7 support | 设备框架以及驱动错误码处理逻辑存在问题 (#5901)
上级
96dd783f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
127 addition
and
118 deletion
+127
-118
bsp/stm32/libraries/HAL_Drivers/config/l4/tim_config.h
bsp/stm32/libraries/HAL_Drivers/config/l4/tim_config.h
+11
-0
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
+20
-2
bsp/stm32/stm32l475-atk-pandora/applications/arduino_pinout/pins_arduino.h
...75-atk-pandora/applications/arduino_pinout/pins_arduino.h
+4
-3
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/.mxproject
...tm32/stm32l475-atk-pandora/board/CubeMX_Config/.mxproject
+1
-1
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
...stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
+16
-12
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/Src/main.c
...tm32/stm32l475-atk-pandora/board/CubeMX_Config/Src/main.c
+41
-0
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
...5-atk-pandora/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
+22
-0
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
+6
-0
components/drivers/hwtimer/README_CN.md
components/drivers/hwtimer/README_CN.md
+0
-97
components/drivers/hwtimer/hwtimer.c
components/drivers/hwtimer/hwtimer.c
+6
-2
components/drivers/misc/dac.c
components/drivers/misc/dac.c
+0
-1
未找到文件。
bsp/stm32/libraries/HAL_Drivers/config/l4/tim_config.h
浏览文件 @
0d2b96d7
...
...
@@ -27,6 +27,17 @@ extern "C" {
}
#endif
/* TIM_DEV_INFO_CONFIG */
#ifdef BSP_USING_TIM7
#ifndef TIM7_CONFIG
#define TIM7_CONFIG \
{ \
.tim_handle.Instance = TIM7, \
.tim_irqn = TIM7_IRQn, \
.name = "timer7", \
}
#endif
/* TIM7_CONFIG */
#endif
/* BSP_USING_TIM7 */
#ifdef BSP_USING_TIM15
#ifndef TIM15_CONFIG
#define TIM15_CONFIG \
...
...
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
浏览文件 @
0d2b96d7
...
...
@@ -317,7 +317,7 @@ static void timer_stop(rt_hwtimer_t *timer)
static
rt_err_t
timer_ctrl
(
rt_hwtimer_t
*
timer
,
rt_uint32_t
cmd
,
void
*
arg
)
{
TIM_HandleTypeDef
*
tim
=
RT_NULL
;
rt_err_t
result
=
RT_EOK
;
rt_err_t
result
=
-
RT_ERROR
;
uint32_t
pclk1_doubler
,
pclk2_doubler
;
RT_ASSERT
(
timer
!=
RT_NULL
);
...
...
@@ -361,11 +361,13 @@ static rt_err_t timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)
/* Update frequency value */
tim
->
Instance
->
EGR
|=
TIM_EVENTSOURCE_UPDATE
;
result
=
RT_EOK
;
}
break
;
default:
{
result
=
-
RT_E
NOSYS
;
result
=
-
RT_E
INVAL
;
}
break
;
}
...
...
@@ -435,6 +437,16 @@ void TIM5_IRQHandler(void)
rt_interrupt_leave
();
}
#endif
#ifdef BSP_USING_TIM7
void
TIM7_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_TIM_IRQHandler
(
&
stm32_hwtimer_obj
[
TIM7_INDEX
].
tim_handle
);
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
#ifdef BSP_USING_TIM11
void
TIM1_TRG_COM_TIM11_IRQHandler
(
void
)
{
...
...
@@ -534,6 +546,12 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
rt_device_hwtimer_isr
(
&
stm32_hwtimer_obj
[
TIM5_INDEX
].
time_device
);
}
#endif
#ifdef BSP_USING_TIM7
if
(
htim
->
Instance
==
TIM7
)
{
rt_device_hwtimer_isr
(
&
stm32_hwtimer_obj
[
TIM7_INDEX
].
time_device
);
}
#endif
#ifdef BSP_USING_TIM11
if
(
htim
->
Instance
==
TIM11
)
{
...
...
bsp/stm32/stm32l475-atk-pandora/applications/arduino_pinout/pins_arduino.h
浏览文件 @
0d2b96d7
...
...
@@ -51,8 +51,9 @@
* i2c3 - ICM20608, AP3216C (On Board)
* i2c4 - AHT10 (On Board)
*/
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c4"
#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi2"
#define RTDUINO_SERIAL2_DEVICE_NAME "uart2"
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c4"
#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi2"
#define RTDUINO_DEFAULT_HWTIMER_DEVICE_NAME "timer7"
#define RTDUINO_SERIAL2_DEVICE_NAME "uart2"
#endif
/* Pins_Arduino_h */
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/.mxproject
浏览文件 @
0d2b96d7
[PreviousLibFiles]
LibFiles=Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_def.h;Drivers\STM32L4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ramfunc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_cortex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_exti.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_iwdg.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_lptim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_qspi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_sdmmc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_usb.h;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_exti.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_iwdg.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_lptim.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usb.c;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_def.h;Drivers\STM32L4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ramfunc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_cortex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_exti.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_iwdg.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_lptim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_qspi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_sdmmc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_usb.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l475xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\system_stm32l4xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;
Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_armclang_ltm.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv81mml.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm35p.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
LibFiles=Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_def.h;Drivers\STM32L4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ramfunc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_cortex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_exti.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_iwdg.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_lptim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_qspi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_sdmmc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_usb.h;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_exti.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_iwdg.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_lptim.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd_ex.c;Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usb.c;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_adc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_adc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_def.h;Drivers\STM32L4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_i2c_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rcc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_flash_ramfunc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_gpio_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dma_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pwr_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_cortex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_exti.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_dac_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_iwdg.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_lptim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_qspi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_rtc_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sai_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_sdmmc.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_sd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_spi_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_tim_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_uart_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_hal_pcd_ex.h;Drivers\STM32L4xx_HAL_Driver\Inc\stm32l4xx_ll_usb.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l475xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Include\system_stm32l4xx.h;Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;
[PreviousUsedKeilFiles]
SourceFiles=..\Src\main.c;..\Src\stm32l4xx_it.c;..\Src\stm32l4xx_hal_msp.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_exti.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_iwdg.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_lptim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usb.c;..\Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;..\\Src\system_stm32l4xx.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_exti.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_iwdg.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_lptim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rtc_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sai_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pcd_ex.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usb.c;..\Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;..\\Src\system_stm32l4xx.c;;;
...
...
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
浏览文件 @
0d2b96d7
...
...
@@ -19,13 +19,14 @@ Mcu.IP13=SYS
Mcu.IP14=TIM1
Mcu.IP15=TIM2
Mcu.IP16=TIM4
Mcu.IP17=TIM
15
Mcu.IP18=TIM1
6
Mcu.IP19=TIM1
7
Mcu.IP17=TIM
7
Mcu.IP18=TIM1
5
Mcu.IP19=TIM1
6
Mcu.IP2=IWDG
Mcu.IP20=USART1
Mcu.IP21=USART2
Mcu.IP22=USB_OTG_FS
Mcu.IP20=TIM17
Mcu.IP21=USART1
Mcu.IP22=USART2
Mcu.IP23=USB_OTG_FS
Mcu.IP3=LPTIM1
Mcu.IP4=NVIC
Mcu.IP5=QUADSPI
...
...
@@ -33,7 +34,7 @@ Mcu.IP6=RCC
Mcu.IP7=RTC
Mcu.IP8=SAI1
Mcu.IP9=SDMMC1
Mcu.IPNb=2
3
Mcu.IPNb=2
4
Mcu.Name=STM32L475V(C-E-G)Tx
Mcu.Package=LQFP100
Mcu.Pin0=PE2
...
...
@@ -90,14 +91,15 @@ Mcu.Pin54=VP_SYS_VS_Systick
Mcu.Pin55=VP_TIM1_VS_ClockSourceINT
Mcu.Pin56=VP_TIM2_VS_ClockSourceINT
Mcu.Pin57=VP_TIM4_VS_ClockSourceINT
Mcu.Pin58=VP_TIM
15
_VS_ClockSourceINT
Mcu.Pin59=VP_TIM1
6
_VS_ClockSourceINT
Mcu.Pin58=VP_TIM
7
_VS_ClockSourceINT
Mcu.Pin59=VP_TIM1
5
_VS_ClockSourceINT
Mcu.Pin6=PC15-OSC32_OUT (PC15)
Mcu.Pin60=VP_TIM17_VS_ClockSourceINT
Mcu.Pin60=VP_TIM16_VS_ClockSourceINT
Mcu.Pin61=VP_TIM17_VS_ClockSourceINT
Mcu.Pin7=PH0-OSC_IN (PH0)
Mcu.Pin8=PH1-OSC_OUT (PH1)
Mcu.Pin9=PC2
Mcu.PinsNb=6
1
Mcu.PinsNb=6
2
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32L475VETx
...
...
@@ -237,7 +239,7 @@ ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x200
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=
tru
e
ProjectManager.LastFirmware=
fals
e
ProjectManager.LibraryCopy=0
ProjectManager.MainLocation=Src
ProjectManager.NoMain=false
...
...
@@ -399,4 +401,6 @@ VP_TIM2_VS_ClockSourceINT.Mode=Internal
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
VP_TIM4_VS_ClockSourceINT.Mode=Internal
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
VP_TIM7_VS_ClockSourceINT.Mode=Enable_Timer
VP_TIM7_VS_ClockSourceINT.Signal=TIM7_VS_ClockSourceINT
board=custom
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/Src/main.c
浏览文件 @
0d2b96d7
...
...
@@ -85,6 +85,7 @@ SPI_HandleTypeDef hspi3;
TIM_HandleTypeDef
htim1
;
TIM_HandleTypeDef
htim2
;
TIM_HandleTypeDef
htim4
;
TIM_HandleTypeDef
htim7
;
TIM_HandleTypeDef
htim15
;
TIM_HandleTypeDef
htim16
;
TIM_HandleTypeDef
htim17
;
...
...
@@ -123,6 +124,7 @@ static void MX_USB_OTG_FS_PCD_Init(void);
static
void
MX_LPTIM1_Init
(
void
);
static
void
MX_SDMMC1_SD_Init
(
void
);
static
void
MX_DAC1_Init
(
void
);
static
void
MX_TIM7_Init
(
void
);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
...
...
@@ -184,6 +186,7 @@ int main(void)
MX_LPTIM1_Init
();
MX_SDMMC1_SD_Init
();
MX_DAC1_Init
();
MX_TIM7_Init
();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
...
...
@@ -948,6 +951,44 @@ static void MX_TIM4_Init(void)
}
/**
* @brief TIM7 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM7_Init
(
void
)
{
/* USER CODE BEGIN TIM7_Init 0 */
/* USER CODE END TIM7_Init 0 */
TIM_MasterConfigTypeDef
sMasterConfig
=
{
0
};
/* USER CODE BEGIN TIM7_Init 1 */
/* USER CODE END TIM7_Init 1 */
htim7
.
Instance
=
TIM7
;
htim7
.
Init
.
Prescaler
=
0
;
htim7
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim7
.
Init
.
Period
=
65535
;
htim7
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim7
)
!=
HAL_OK
)
{
Error_Handler
();
}
sMasterConfig
.
MasterOutputTrigger
=
TIM_TRGO_RESET
;
sMasterConfig
.
MasterSlaveMode
=
TIM_MASTERSLAVEMODE_DISABLE
;
if
(
HAL_TIMEx_MasterConfigSynchronization
(
&
htim7
,
&
sMasterConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM7_Init 2 */
/* USER CODE END TIM7_Init 2 */
}
/**
* @brief TIM15 Initialization Function
* @param None
...
...
bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
浏览文件 @
0d2b96d7
...
...
@@ -688,6 +688,17 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM7
)
{
/* USER CODE BEGIN TIM7_MspInit 0 */
/* USER CODE END TIM7_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM7_CLK_ENABLE
();
/* USER CODE BEGIN TIM7_MspInit 1 */
/* USER CODE END TIM7_MspInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM15
)
{
/* USER CODE BEGIN TIM15_MspInit 0 */
...
...
@@ -844,6 +855,17 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspDeInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM7
)
{
/* USER CODE BEGIN TIM7_MspDeInit 0 */
/* USER CODE END TIM7_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM7_CLK_DISABLE
();
/* USER CODE BEGIN TIM7_MspDeInit 1 */
/* USER CODE END TIM7_MspDeInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM15
)
{
/* USER CODE BEGIN TIM15_MspDeInit 0 */
...
...
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
浏览文件 @
0d2b96d7
...
...
@@ -44,6 +44,8 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_DAC1
select BSP_USING_SPI
select BSP_USING_SPI2
select BSP_USING_TIM
select BSP_USING_TIM7
imply BSP_SPI2_TX_USING_DMA
imply BSP_SPI2_RX_USING_DMA
imply RTDUINO_USING_SERVO
...
...
@@ -386,6 +388,10 @@ menu "On-chip Peripheral Drivers"
default n
select RT_USING_HWTIMER
if BSP_USING_TIM
config BSP_USING_TIM7
bool "Enable TIM7"
default n
config BSP_USING_TIM15
bool "Enable TIM15"
default n
...
...
components/drivers/hwtimer/README_CN.md
已删除
100644 → 0
浏览文件 @
96dd783f
# 定时器设备
## 功能
*
时间测量
*
周期或单次执行回调函数
## 编译
1.
在rtconfig.h添加
`#define RT_USING_HWTIMER`
## 使用流程
1.
以读写方式打开设备
2.
设置超时回调函数(如果需要)
3.
根据需要设置定时模式(单次/周期)
4.
设置计数频率(可选)
5.
写入超时值,定时器随即启动
6.
停止定时器(可选)
7.
关闭设备(如果需要)
应用参考 [hwtimer_test] (/examples/test/hwtimer
\_
test.c)
## 驱动编写指南
### 操作接口
```
struct rt_hwtimer_ops
{
void (*init)(struct rt_hwtimer_device *timer, rt_uint32_t state);
rt_err_t (*start)(struct rt_hwtimer_device *timer, rt_uint32_t cnt, rt_hwtimer_mode_t mode);
void (*stop)(struct rt_hwtimer_device *timer);
rt_uint32_t (*count_get)(struct rt_hwtimer_device *timer);
rt_err_t (*control)(struct rt_hwtimer_device *timer, rt_uint32_t cmd, void *args);
};
```
*
init - state
<
1
打开设备
0
关闭设备
>
*
start - cnt
<超时值>
- mode
<单次
/
周期
>
*
stop -
<停止计数>
*
count_get -
<读取计数器值>
*
control -
<设置计数频率
>
### 定时器特征信息
```
struct rt_hwtimer_info
{
rt_int32_t maxfreq;
rt_int32_t minfreq;
rt_uint32_t maxcnt;
rt_uint8_t cntmode;
};
```
*
maxfreq
<设备支持的最大计数频率>
*
minfreq
<设备支持的最小计数频率>
*
maxcnt
<计数器最大计数值>
*
cntmode
<递增计数
/
递减计数
>
### 注册设备
```
static rt_hwtimer_t _timer0;
int stm32_hwtimer_init(void)
{
_timer0.info = &_info;
_timer0.ops = &_ops;
rt_device_hwtimer_register(&_timer0, "timer0", TIM2);
return 0;
}
```
### 定时器中断
```
void timer_irq_handler(void)
{
//其它操作
rt_device_hwtimer_isr(&_timer0);
}
```
## 注意事项
**可能出现定时误差**
误差原因:
假设计数器最大值0xFFFF,计数频率1Mhz,定时时间1秒又1微秒。
由于定时器一次最多只能计时到65535us,对于1000001us的定时要求。
可以50000us定时20次完成,此时将会出现计算误差1us。
components/drivers/hwtimer/hwtimer.c
浏览文件 @
0d2b96d7
...
...
@@ -8,10 +8,13 @@
* 2015-08-31 heyuanjie87 first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <rthw.h>
#define DBG_TAG "hwtimer"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
rt_inline
rt_uint32_t
timeout_calc
(
rt_hwtimer_t
*
timer
,
rt_hwtimerval_t
*
tv
)
{
float
overflow
;
...
...
@@ -234,7 +237,8 @@ static rt_err_t rt_hwtimer_control(struct rt_device *dev, int cmd, void *args)
f
=
(
rt_uint32_t
*
)
args
;
if
((
*
f
>
timer
->
info
->
maxfreq
)
||
(
*
f
<
timer
->
info
->
minfreq
))
{
result
=
-
RT_ERROR
;
LOG_W
(
"frequency setting out of range! It will maintain at %d Hz"
,
timer
->
freq
);
result
=
-
RT_EINVAL
;
break
;
}
...
...
components/drivers/misc/dac.c
浏览文件 @
0d2b96d7
...
...
@@ -8,7 +8,6 @@
* 2020-06-19 thread-liu the first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <string.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录