Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
4d6d16fc
R
rt-thread
项目概览
BaiXuePrincess
/
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看板
提交
4d6d16fc
编写于
12月 26, 2018
作者:
S
SummerGift
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][stm32] update drivers
上级
11dfedec
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
13 deletion
+20
-13
bsp/stm32/libraries/HAL_Drivers/drv_config.h
bsp/stm32/libraries/HAL_Drivers/drv_config.h
+1
-0
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
+2
-2
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
+2
-2
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
+8
-8
bsp/stm32/libraries/HAL_Drivers/drv_sdio.h
bsp/stm32/libraries/HAL_Drivers/drv_sdio.h
+7
-1
未找到文件。
bsp/stm32/libraries/HAL_Drivers/drv_config.h
浏览文件 @
4d6d16fc
...
...
@@ -37,6 +37,7 @@
#elif defined(SOC_SERIES_STM32F7)
#include "f7/uart_config.h"
#include "f7/spi_config.h"
#include "f7/qspi_config.h"
#include "f7/adc_config.h"
#include "f7/tim_config.h"
#include "f7/sdio_config.h"
...
...
bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c
浏览文件 @
4d6d16fc
...
...
@@ -164,7 +164,7 @@ static void timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
tim_device
=
(
struct
stm32_hwtimer
*
)
timer
;
/* time init */
#if defined(SOC_SERIES_STM32F4)
#if defined(SOC_SERIES_STM32F4)
|| defined(SOC_SERIES_STM32F7)
if
(
tim
->
Instance
==
TIM9
||
tim
->
Instance
==
TIM10
||
tim
->
Instance
==
TIM11
)
#elif defined(SOC_SERIES_STM32L4)
if
(
tim
->
Instance
==
TIM15
||
tim
->
Instance
==
TIM16
||
tim
->
Instance
==
TIM17
)
...
...
@@ -278,7 +278,7 @@ static rt_err_t timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)
/* set timer frequence */
freq
=
*
((
rt_uint32_t
*
)
arg
);
#if defined(SOC_SERIES_STM32F4)
#if defined(SOC_SERIES_STM32F4)
|| defined(SOC_SERIES_STM32F7)
if
(
tim
->
Instance
==
TIM9
||
tim
->
Instance
==
TIM10
||
tim
->
Instance
==
TIM11
)
#elif defined(SOC_SERIES_STM32L4)
if
(
tim
->
Instance
==
TIM15
||
tim
->
Instance
==
TIM16
||
tim
->
Instance
==
TIM17
)
...
...
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
浏览文件 @
4d6d16fc
...
...
@@ -185,7 +185,7 @@ static rt_err_t drv_pwm_get(TIM_HandleTypeDef *htim, struct rt_pwm_configuration
rt_uint32_t
channel
=
0x04
*
(
configuration
->
channel
-
1
);
rt_uint64_t
tim_clock
;
#if defined(SOC_SERIES_STM32F4)
#if defined(SOC_SERIES_STM32F4)
|| defined(SOC_SERIES_STM32F7)
if
(
htim
->
Instance
==
TIM9
||
htim
->
Instance
==
TIM10
||
htim
->
Instance
==
TIM11
)
#elif defined(SOC_SERIES_STM32L4)
if
(
htim
->
Instance
==
TIM15
||
htim
->
Instance
==
TIM16
||
htim
->
Instance
==
TIM17
)
...
...
@@ -230,7 +230,7 @@ static rt_err_t drv_pwm_set(TIM_HandleTypeDef *htim, struct rt_pwm_configuration
/* Converts the channel number to the channel number of Hal library */
rt_uint32_t
channel
=
0x04
*
(
configuration
->
channel
-
1
);
#if defined(SOC_SERIES_STM32F4)
#if defined(SOC_SERIES_STM32F4)
|| defined(SOC_SERIES_STM32F7)
if
(
htim
->
Instance
==
TIM9
||
htim
->
Instance
==
TIM10
||
htim
->
Instance
==
TIM11
)
#elif defined(SOC_SERIES_STM32L4)
if
(
htim
->
Instance
==
TIM15
||
htim
->
Instance
==
TIM16
||
htim
->
Instance
==
TIM17
)
...
...
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
浏览文件 @
4d6d16fc
...
...
@@ -24,8 +24,8 @@ static RTC_HandleTypeDef RTC_Handler;
static
time_t
get_rtc_timestamp
(
void
)
{
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
RTC_TimeTypeDef
RTC_TimeStruct
=
{
0
}
;
RTC_DateTypeDef
RTC_DateStruct
=
{
0
}
;
struct
tm
tm_new
;
HAL_RTC_GetTime
(
&
RTC_Handler
,
&
RTC_TimeStruct
,
RTC_FORMAT_BIN
);
...
...
@@ -44,9 +44,9 @@ static time_t get_rtc_timestamp(void)
static
rt_err_t
set_rtc_time_stamp
(
time_t
time_stamp
)
{
RCC_PeriphCLKInitTypeDef
PeriphClkInitStruct
;
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
RCC_PeriphCLKInitTypeDef
PeriphClkInitStruct
=
{
0
}
;
RTC_TimeTypeDef
RTC_TimeStruct
=
{
0
}
;
RTC_DateTypeDef
RTC_DateStruct
=
{
0
}
;
struct
tm
*
p_tm
;
HAL_PWR_EnableBkUpAccess
();
...
...
@@ -86,7 +86,7 @@ static void rt_rtc_init(void)
{
__HAL_RCC_PWR_CLK_ENABLE
();
RCC_OscInitTypeDef
RCC_OscInitStruct
;
RCC_OscInitTypeDef
RCC_OscInitStruct
=
{
0
}
;
RCC_OscInitStruct
.
OscillatorType
=
RCC_OSCILLATORTYPE_LSE
;
RCC_OscInitStruct
.
PLL
.
PLLState
=
RCC_PLL_NONE
;
RCC_OscInitStruct
.
LSEState
=
RCC_LSE_ON
;
...
...
@@ -95,7 +95,7 @@ static void rt_rtc_init(void)
static
rt_err_t
rt_rtc_config
(
struct
rt_device
*
dev
)
{
RCC_PeriphCLKInitTypeDef
PeriphClkInitStruct
;
RCC_PeriphCLKInitTypeDef
PeriphClkInitStruct
=
{
0
}
;
HAL_PWR_EnableBkUpAccess
();
PeriphClkInitStruct
.
PeriphClockSelection
=
RCC_PERIPHCLK_RTC
;
...
...
@@ -110,7 +110,7 @@ static rt_err_t rt_rtc_config(struct rt_device *dev)
#if defined(SOC_SERIES_STM32F1)
RTC_Handler
.
Init
.
OutPut
=
RTC_OUTPUTSOURCE_NONE
;
RTC_Handler
.
Init
.
AsynchPrediv
=
RTC_AUTO_1_SECOND
;
#elif defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32L4)
#elif defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32
F7) || defined(SOC_SERIES_STM32
L4)
RTC_Handler
.
Init
.
AsynchPrediv
=
0X7F
;
#ifndef SOC_SERIES_STM32F0
RTC_Handler
.
Init
.
SynchPrediv
=
0XFF
;
...
...
bsp/stm32/libraries/HAL_Drivers/drv_sdio.h
浏览文件 @
4d6d16fc
...
...
@@ -25,8 +25,14 @@
#define SDCARD_INSTANCE_TYPE SDMMC_TypeDef
#endif
/* defined(SOC_SERIES_STM32F1) || defined(SOC_SERIES_STM32F4) */
#if defined(SOC_SERIES_STM32F1) || defined(SOC_SERIES_STM32F4)
#define SDCARD_INSTANCE SDIO
#elif defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F7)
#define SDCARD_INSTANCE SDMMC1
#endif
/* defined(SOC_SERIES_STM32F1) || defined(SOC_SERIES_STM32F4) */
#define SDIO_BUFF_SIZE 4096
#define SDIO_MAX_FREQ
2
000000
#define SDIO_MAX_FREQ
1
000000
#define SDIO_ALIGN_LEN 32
#ifndef SDIO_BASE_ADDRESS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录