Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
a2048b6c
R
rt-thread
项目概览
天中雨水
/
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,发现更多精彩内容 >>
提交
a2048b6c
编写于
5月 08, 2019
作者:
G
guozhanxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][stm32][pandora] 添加 icm20608 及 flash 文件系统支持.
上级
abc5fff6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
109 addition
and
46 deletion
+109
-46
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
+41
-45
bsp/stm32/stm32l475-atk-pandora/board/SConscript
bsp/stm32/stm32l475-atk-pandora/board/SConscript
+3
-0
bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c
bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c
+34
-1
bsp/stm32/stm32l475-atk-pandora/board/ports/sensor_port.c
bsp/stm32/stm32l475-atk-pandora/board/ports/sensor_port.c
+31
-0
未找到文件。
bsp/stm32/stm32l475-atk-pandora/board/Kconfig
浏览文件 @
a2048b6c
...
...
@@ -29,6 +29,15 @@ menu "Onboard Peripheral Drivers"
select RT_USING_DFS_ELMFAT
default n
config BSP_USING_ICM20608
bool "Enable icm20608 (i2c3)"
select BSP_USING_I2C
select BSP_USING_I2C3
select PKG_USING_SENSORS_DRIVERS
select PKG_USING_MPU6XXX
select PKG_USING_MPU6XXX_LATEST_VERSION
default n
endmenu
menu "On-chip Peripheral Drivers"
...
...
@@ -112,55 +121,42 @@ menu "On-chip Peripheral Drivers"
bool "Enable QSPI DMA support"
default n
menuconfig BSP_USING_I2C1
bool "Enable I2C1 BUS (software simulation)"
default n
select RT_USING_I2C
select RT_USING_I2C_BITOPS
select RT_USING_PIN
if BSP_USING_I2C1
config BSP_I2C1_SCL_PIN
int "i2c1 scl pin number"
range 1 176
default 15
config BSP_I2C1_SDA_PIN
int "I2C1 sda pin number"
range 1 176
default 16
endif
menuconfig BSP_USING_I2C2
bool "Enable I2C2 BUS (software simulation)"
menuconfig BSP_USING_I2C
bool "Enable I2C BUS"
default n
select RT_USING_I2C
select RT_USING_I2C_BITOPS
select RT_USING_PIN
if BSP_USING_I2C2
config BSP_I2C2_SCL_PIN
int "i2c2 scl pin number"
range 1 176
default 47
config BSP_I2C2_SDA_PIN
int "I2C2 sda pin number"
range 1 176
default 48
endif
menuconfig BSP_USING_I2C3
bool "Enable I2C3 BUS (software simulation)"
default n
select RT_USING_I2CS
select RT_USING_I2C_BITOPS
select RT_USING_PIN
if BSP_USING_I2C3
config BSP_I2C3_SCL_PIN
int "i2c3 scl pin number"
range 1 176
default 92
config BSP_I2C3_SDA_PIN
int "I2C3 sda pin number"
range 1 176
default 93
if BSP_USING_I2C
menuconfig BSP_USING_I2C3
bool "Enable I2C3 BUS (software simulation)"
default y
if BSP_USING_I2C3
comment "Notice: PC0 --> 32; PC1 --> 33"
config BSP_I2C3_SCL_PIN
int "i2c3 scl pin number"
range 1 176
default 32
config BSP_I2C3_SDA_PIN
int "I2C3 sda pin number"
range 1 176
default 33
endif
menuconfig BSP_USING_I2C4
bool "Enable I2C4 BUS (AHT10)"
default n
if BSP_USING_I2C4
comment "Notice: PC1 --> 33; PD6 --> 54"
config BSP_I2C4_SCL_PIN
int "i2c4 scl pin number"
range 1 176
default 54
config BSP_I2C4_SDA_PIN
int "I2C4 sda pin number"
range 1 176
default 33
endif
endif
menuconfig BSP_USING_TIM
...
...
bsp/stm32/stm32l475-atk-pandora/board/SConscript
浏览文件 @
a2048b6c
...
...
@@ -18,6 +18,9 @@ if GetDepend(['BSP_USING_QSPI_FLASH']):
if
GetDepend
([
'BSP_USING_SDCARD'
]):
src
+=
Glob
(
'ports/sdcard_port.c'
)
if
GetDepend
([
'BSP_USING_ICM20608'
]):
src
+=
Glob
(
'ports/sensor_port.c'
)
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports'
]
...
...
bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c
浏览文件 @
a2048b6c
...
...
@@ -74,4 +74,37 @@ static int rt_hw_qspi_flash_with_sfud_init(void)
}
INIT_COMPONENT_EXPORT
(
rt_hw_qspi_flash_with_sfud_init
);
#endif
/* BSP_USING_QSPI_FLASH */
#if defined(RT_USING_DFS_ELMFAT) && !defined(BSP_USING_SDCARD)
#include <dfs_fs.h>
#define BLK_DEV_NAME "W25Q128"
int
mnt_init
(
void
)
{
rt_thread_delay
(
RT_TICK_PER_SECOND
);
if
(
dfs_mount
(
BLK_DEV_NAME
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
{
rt_kprintf
(
"file system initialization done!
\n
"
);
}
else
{
if
(
dfs_mkfs
(
"elm"
,
BLK_DEV_NAME
)
==
0
)
{
if
(
dfs_mount
(
BLK_DEV_NAME
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
{
rt_kprintf
(
"file system initialization done!
\n
"
);
}
else
{
rt_kprintf
(
"file system initialization failed!
\n
"
);
}
}
}
return
0
;
}
INIT_ENV_EXPORT
(
mnt_init
);
#endif
/* defined(RT_USING_DFS_ELMFAT) && !defined(BSP_USING_SDCARD) */
#endif
/* BSP_USING_QSPI_FLASH */
bsp/stm32/stm32l475-atk-pandora/board/ports/sensor_port.c
0 → 100644
浏览文件 @
a2048b6c
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-05-08 flaybreak add sensor port file
*/
#include <board.h>
#ifdef BSP_USING_ICM20608
#include "sensor_inven_mpu6xxx.h"
int
sensor_init
(
void
)
{
struct
rt_sensor_config
cfg
;
cfg
.
intf
.
type
=
RT_SENSOR_INTF_I2C
;
cfg
.
intf
.
dev_name
=
"i2c3"
;
cfg
.
intf
.
user_data
=
(
void
*
)
MPU6XXX_ADDR_DEFAULT
;
cfg
.
irq_pin
.
pin
=
RT_PIN_NONE
;
rt_hw_mpu6xxx_init
(
"icm"
,
&
cfg
);
return
0
;
}
INIT_ENV_EXPORT
(
sensor_init
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录