Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
199f73c7
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
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,发现更多精彩内容 >>
未验证
提交
199f73c7
编写于
4月 02, 2021
作者:
B
Bernard Xiong
提交者:
GitHub
4月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4547 from rtthread-bot/rtt_bot
[update] RT-Thread Robot automatic submission
上级
a98d81ab
11dd63e9
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
2176 addition
and
96 deletion
+2176
-96
bsp/hc32f4a0/board/board.h
bsp/hc32f4a0/board/board.h
+2
-2
bsp/hc32f4a0/drivers/drv_soft_i2c.c
bsp/hc32f4a0/drivers/drv_soft_i2c.c
+3
-14
bsp/stm32/stm32l431-BearPi/.config
bsp/stm32/stm32l431-BearPi/.config
+21
-1
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/.mxproject
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/.mxproject
+4
-4
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/CubeMX_Config.ioc
...32/stm32l431-BearPi/board/CubeMX_Config/CubeMX_Config.ioc
+21
-7
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Inc/stm32l4xx_hal_conf.h
...2l431-BearPi/board/CubeMX_Config/Inc/stm32l4xx_hal_conf.h
+2
-2
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Src/main.c
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Src/main.c
+45
-0
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
...32l431-BearPi/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
+75
-0
bsp/stm32/stm32l431-BearPi/board/Kconfig
bsp/stm32/stm32l431-BearPi/board/Kconfig
+29
-0
bsp/stm32/stm32l431-BearPi/board/SConscript
bsp/stm32/stm32l431-BearPi/board/SConscript
+5
-2
bsp/stm32/stm32l431-BearPi/board/ports/SConscript
bsp/stm32/stm32l431-BearPi/board/ports/SConscript
+12
-0
bsp/stm32/stm32l431-BearPi/board/ports/lcd/SConscript
bsp/stm32/stm32l431-BearPi/board/ports/lcd/SConscript
+13
-0
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.c
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.c
+821
-0
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.h
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.h
+44
-0
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd_font.h
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd_font.h
+780
-0
bsp/stm32/stm32l431-BearPi/project.uvoptx
bsp/stm32/stm32l431-BearPi/project.uvoptx
+144
-60
bsp/stm32/stm32l431-BearPi/project.uvprojx
bsp/stm32/stm32l431-BearPi/project.uvprojx
+106
-2
bsp/stm32/stm32l431-BearPi/rtconfig.h
bsp/stm32/stm32l431-BearPi/rtconfig.h
+7
-0
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
+35
-1
components/drivers/spi/SConscript
components/drivers/spi/SConscript
+4
-1
libcpu/arm/cortex-m4/SConscript
libcpu/arm/cortex-m4/SConscript
+3
-0
未找到文件。
bsp/hc32f4a0/board/board.h
浏览文件 @
199f73c7
...
...
@@ -6,8 +6,8 @@
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
* 2021-01-18 CDT MOdify SRAM_SIZE
*/
#ifndef __BOARD_H__
#define __BOARD_H__
...
...
@@ -18,7 +18,7 @@
/* board configuration */
#define SRAM_BASE 0x1FFE0000
#define SRAM_SIZE 0x
2
0000
#define SRAM_SIZE 0x
8
0000
#define SRAM_END (SRAM_BASE + SRAM_SIZE)
/* High speed sram. */
...
...
bsp/hc32f4a0/drivers/drv_soft_i2c.c
浏览文件 @
199f73c7
...
...
@@ -6,9 +6,9 @@
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
* 2021-01-18 CDT modify i2c gpio init
*/
/*******************************************************************************
* Include files
******************************************************************************/
...
...
@@ -65,10 +65,8 @@ static const struct hc32_soft_i2c_config soft_i2c_config[] =
#endif
};
static
struct
hc32_i2c
i2c_obj
[
sizeof
(
soft_i2c_config
)
/
sizeof
(
soft_i2c_config
[
0
])];
/*******************************************************************************
* Function implementation - global ('extern') and local ('static')
******************************************************************************/
...
...
@@ -81,8 +79,8 @@ static void hc32_i2c_gpio_init(struct hc32_i2c *i2c)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
i2c
->
ops
.
data
;
rt_pin_mode
(
cfg
->
scl_pin
,
PIN_MODE_OUTPUT
);
rt_pin_mode
(
cfg
->
sda_pin
,
PIN_MODE_OUTPUT
);
rt_pin_mode
(
cfg
->
scl_pin
,
PIN_MODE_OUTPUT
_OD
);
rt_pin_mode
(
cfg
->
sda_pin
,
PIN_MODE_OUTPUT
_OD
);
rt_pin_write
(
cfg
->
scl_pin
,
PIN_HIGH
);
rt_pin_write
(
cfg
->
sda_pin
,
PIN_HIGH
);
...
...
@@ -98,8 +96,6 @@ static void hc32_set_sda(void *data, rt_int32_t state)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
rt_pin_mode
(
cfg
->
sda_pin
,
PIN_MODE_OUTPUT
);
if
(
state
)
rt_pin_write
(
cfg
->
sda_pin
,
PIN_HIGH
);
else
...
...
@@ -116,8 +112,6 @@ static void hc32_set_scl(void *data, rt_int32_t state)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
rt_pin_mode
(
cfg
->
scl_pin
,
PIN_MODE_OUTPUT
);
if
(
state
)
rt_pin_write
(
cfg
->
scl_pin
,
PIN_HIGH
);
else
...
...
@@ -133,8 +127,6 @@ static rt_int32_t hc32_get_sda(void *data)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
rt_pin_mode
(
cfg
->
sda_pin
,
PIN_MODE_INPUT
);
return
rt_pin_read
(
cfg
->
sda_pin
);
}
...
...
@@ -147,8 +139,6 @@ static rt_int32_t hc32_get_scl(void *data)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
rt_pin_mode
(
cfg
->
scl_pin
,
PIN_MODE_INPUT
);
return
rt_pin_read
(
cfg
->
scl_pin
);
}
...
...
@@ -210,7 +200,6 @@ int hc32_hw_i2c_init(void)
}
INIT_BOARD_EXPORT
(
hc32_hw_i2c_init
);
#endif
/* RT_USING_I2C */
/*******************************************************************************
...
...
bsp/stm32/stm32l431-BearPi/.config
浏览文件 @
199f73c7
...
...
@@ -134,7 +134,12 @@ CONFIG_RT_USING_RTC=y
# CONFIG_RT_USING_ALARM is not set
# CONFIG_RT_USING_SOFT_RTC is not set
# CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SPI is not set
CONFIG_RT_USING_SPI
=
y
# CONFIG_RT_USING_QSPI is not set
# CONFIG_RT_USING_SPI_MSD is not set
# CONFIG_RT_USING_SFUD is not set
# CONFIG_RT_USING_ENC28J60 is not set
# CONFIG_RT_USING_SPI_WIFI is not set
CONFIG_RT_USING_WDT
=
y
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
...
...
@@ -316,6 +321,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
# CONFIG_PKG_USING_ULOG_FILE is not set
# CONFIG_PKG_USING_ADBD is not set
# CONFIG_PKG_USING_COREMARK is not set
# CONFIG_PKG_USING_DHRYSTONE is not set
...
...
@@ -331,6 +337,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_CPU_USAGE is not set
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
#
# system packages
...
...
@@ -370,6 +377,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# CONFIG_PKG_USING_RT_PRINTF is not set
#
# peripheral libraries and drivers
...
...
@@ -378,6 +386,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_SHT3X is not set
# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
...
...
@@ -430,6 +439,7 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_NES is not set
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
# CONFIG_PKG_USING_VDEVICE is not set
# CONFIG_PKG_USING_SGM706 is not set
#
# miscellaneous packages
...
...
@@ -494,6 +504,16 @@ CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_UART
=
y
CONFIG_BSP_USING_UART1
=
y
# CONFIG_BSP_UART1_RX_USING_DMA is not set
# CONFIG_BSP_USING_I2C is not set
CONFIG_BSP_USING_SPI
=
y
CONFIG_BSP_USING_SPI2
=
y
# CONFIG_BSP_SPI2_TX_USING_DMA is not set
# CONFIG_BSP_SPI2_RX_USING_DMA is not set
# CONFIG_BSP_USING_CRC is not set
# CONFIG_BSP_USING_RNG is not set
# CONFIG_BSP_USING_UDID is not set
#
# Onboard Peripheral Drivers
#
CONFIG_BSP_USING_SPI_LCD
=
y
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/.mxproject
浏览文件 @
199f73c7
[PreviousGenFiles]
HeaderPath=D:/
Users/rtt/Desktop
/CubeMX_Config/Inc
HeaderPath=D:/
Rtt_doc/rt-thread/bsp/stm32/stm32l431-BearPi/board
/CubeMX_Config/Inc
HeaderFiles=stm32l4xx_it.h;stm32l4xx_hal_conf.h;main.h;
SourcePath=D:/
Users/rtt/Desktop
/CubeMX_Config/Src
SourcePath=D:/
Rtt_doc/rt-thread/bsp/stm32/stm32l431-BearPi/board
/CubeMX_Config/Src
SourceFiles=stm32l4xx_it.c;stm32l4xx_hal_msp.c;main.c;
[PreviousLibFiles]
LibFiles=Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_
tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.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_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/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.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/Inc/stm32l4xx_hal_tim.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.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_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/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.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_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.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_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_
spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_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_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/Src/stm32l4xx_hal_spi.c;Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_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_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/Inc/stm32l4xx_hal_spi.h;Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_spi_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_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/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.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_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.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_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;
[PreviousUsedKeilFiles]
SourceFiles=..\Src\main.c;..\Src\stm32l4xx_it.c;..\Src\stm32l4xx_hal_msp.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.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;..\\Src/system_stm32l4xx.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.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;..\\Src/system_stm32l4xx.c;..\Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;;
SourceFiles=..\Src\main.c;..\Src\stm32l4xx_it.c;..\Src\stm32l4xx_hal_msp.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.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_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;..\\Src/system_stm32l4xx.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.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_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;..\\Src/system_stm32l4xx.c;..\Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c;;
HeaderPath=..\Drivers\STM32L4xx_HAL_Driver\Inc;..\Drivers\STM32L4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32L4xx\Include;..\Drivers\CMSIS\Include;..\Inc;
CDefines=USE_HAL_DRIVER;STM32L431xx;USE_HAL_DRIVER;USE_HAL_DRIVER;
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/CubeMX_Config.ioc
浏览文件 @
199f73c7
...
...
@@ -5,19 +5,22 @@ KeepUserPlacement=false
Mcu.Family=STM32L4
Mcu.IP0=NVIC
Mcu.IP1=RCC
Mcu.IP2=SYS
Mcu.IP3=USART1
Mcu.IPNb=4
Mcu.IP2=SPI2
Mcu.IP3=SYS
Mcu.IP4=USART1
Mcu.IPNb=5
Mcu.Name=STM32L431R(B-C)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PC14-OSC32_IN (PC14)
Mcu.Pin1=PC15-OSC32_OUT (PC15)
Mcu.Pin2=PH0-OSC_IN (PH0)
Mcu.Pin3=PH1-OSC_OUT (PH1)
Mcu.Pin4=PA9
Mcu.Pin5=PA10
Mcu.Pin6=VP_SYS_VS_Systick
Mcu.PinsNb=7
Mcu.Pin4=PC3
Mcu.Pin5=PB13
Mcu.Pin6=PA9
Mcu.Pin7=PA10
Mcu.Pin8=VP_SYS_VS_Systick
Mcu.PinsNb=9
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32L431RCTx
...
...
@@ -40,12 +43,18 @@ PA10.Signal=USART1_RX
PA9.Locked=true
PA9.Mode=Asynchronous
PA9.Signal=USART1_TX
PB13.Locked=true
PB13.Mode=Simplex_Bidirectional_Master
PB13.Signal=SPI2_SCK
PC14-OSC32_IN\ (PC14).Locked=true
PC14-OSC32_IN\ (PC14).Mode=LSE-External-Oscillator
PC14-OSC32_IN\ (PC14).Signal=RCC_OSC32_IN
PC15-OSC32_OUT\ (PC15).Locked=true
PC15-OSC32_OUT\ (PC15).Mode=LSE-External-Oscillator
PC15-OSC32_OUT\ (PC15).Signal=RCC_OSC32_OUT
PC3.Locked=true
PC3.Mode=Simplex_Bidirectional_Master
PC3.Signal=SPI2_MOSI
PH0-OSC_IN\ (PH0).Locked=true
PH0-OSC_IN\ (PH0).Mode=HSE-External-Oscillator
PH0-OSC_IN\ (PH0).Signal=RCC_OSC_IN
...
...
@@ -121,6 +130,11 @@ RCC.USART3Freq_Value=80000000
RCC.VCOInputFreq_Value=4000000
RCC.VCOOutputFreq_Value=160000000
RCC.VCOSAI1OutputFreq_Value=32000000
SPI2.CalculateBaudRate=40.0 MBits/s
SPI2.Direction=SPI_DIRECTION_1LINE
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
SPI2.Mode=SPI_MODE_MASTER
SPI2.VirtualType=VM_MASTER
USART1.IPParameters=VirtualMode-Asynchronous
USART1.VirtualMode-Asynchronous=VM_ASYNC
VP_SYS_VS_Systick.Mode=SysTick
...
...
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Inc/stm32l4xx_hal_conf.h
浏览文件 @
199f73c7
...
...
@@ -5,7 +5,7 @@
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 202
0
STMicroelectronics</center></h2>
* <h2><center>© COPYRIGHT(c) 202
1
STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
...
...
@@ -86,7 +86,7 @@
/*#define HAL_SD_MODULE_ENABLED */
/*#define HAL_SMBUS_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
/*#define HAL_SRAM_MODULE_ENABLED */
/*#define HAL_SWPMI_MODULE_ENABLED */
/*#define HAL_TIM_MODULE_ENABLED */
...
...
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Src/main.c
浏览文件 @
199f73c7
...
...
@@ -41,6 +41,8 @@
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef
hspi2
;
UART_HandleTypeDef
huart1
;
/* USER CODE BEGIN PV */
...
...
@@ -50,6 +52,7 @@ UART_HandleTypeDef huart1;
/* Private function prototypes -----------------------------------------------*/
void
SystemClock_Config
(
void
);
static
void
MX_GPIO_Init
(
void
);
static
void
MX_SPI2_Init
(
void
);
static
void
MX_USART1_UART_Init
(
void
);
/* USER CODE BEGIN PFP */
...
...
@@ -88,6 +91,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init
();
MX_SPI2_Init
();
MX_USART1_UART_Init
();
/* USER CODE BEGIN 2 */
...
...
@@ -166,6 +170,46 @@ void SystemClock_Config(void)
HAL_RCCEx_EnableMSIPLLMode
();
}
/**
* @brief SPI2 Initialization Function
* @param None
* @retval None
*/
static
void
MX_SPI2_Init
(
void
)
{
/* USER CODE BEGIN SPI2_Init 0 */
/* USER CODE END SPI2_Init 0 */
/* USER CODE BEGIN SPI2_Init 1 */
/* USER CODE END SPI2_Init 1 */
/* SPI2 parameter configuration*/
hspi2
.
Instance
=
SPI2
;
hspi2
.
Init
.
Mode
=
SPI_MODE_MASTER
;
hspi2
.
Init
.
Direction
=
SPI_DIRECTION_1LINE
;
hspi2
.
Init
.
DataSize
=
SPI_DATASIZE_4BIT
;
hspi2
.
Init
.
CLKPolarity
=
SPI_POLARITY_LOW
;
hspi2
.
Init
.
CLKPhase
=
SPI_PHASE_1EDGE
;
hspi2
.
Init
.
NSS
=
SPI_NSS_SOFT
;
hspi2
.
Init
.
BaudRatePrescaler
=
SPI_BAUDRATEPRESCALER_2
;
hspi2
.
Init
.
FirstBit
=
SPI_FIRSTBIT_MSB
;
hspi2
.
Init
.
TIMode
=
SPI_TIMODE_DISABLE
;
hspi2
.
Init
.
CRCCalculation
=
SPI_CRCCALCULATION_DISABLE
;
hspi2
.
Init
.
CRCPolynomial
=
7
;
hspi2
.
Init
.
CRCLength
=
SPI_CRC_LENGTH_DATASIZE
;
hspi2
.
Init
.
NSSPMode
=
SPI_NSS_PULSE_ENABLE
;
if
(
HAL_SPI_Init
(
&
hspi2
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN SPI2_Init 2 */
/* USER CODE END SPI2_Init 2 */
}
/**
* @brief USART1 Initialization Function
* @param None
...
...
@@ -212,6 +256,7 @@ static void MX_GPIO_Init(void)
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
}
...
...
bsp/stm32/stm32l431-BearPi/board/CubeMX_Config/Src/stm32l4xx_hal_msp.c
浏览文件 @
199f73c7
...
...
@@ -77,6 +77,81 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
/**
* @brief SPI MSP Initialization
* This function configures the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void
HAL_SPI_MspInit
(
SPI_HandleTypeDef
*
hspi
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
hspi
->
Instance
==
SPI2
)
{
/* USER CODE BEGIN SPI2_MspInit 0 */
/* USER CODE END SPI2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI2_CLK_ENABLE
();
__HAL_RCC_GPIOC_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
/**SPI2 GPIO Configuration
PC3 ------> SPI2_MOSI
PB13 ------> SPI2_SCK
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_3
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF5_SPI2
;
HAL_GPIO_Init
(
GPIOC
,
&
GPIO_InitStruct
);
GPIO_InitStruct
.
Pin
=
GPIO_PIN_13
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF5_SPI2
;
HAL_GPIO_Init
(
GPIOB
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN SPI2_MspInit 1 */
/* USER CODE END SPI2_MspInit 1 */
}
}
/**
* @brief SPI MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void
HAL_SPI_MspDeInit
(
SPI_HandleTypeDef
*
hspi
)
{
if
(
hspi
->
Instance
==
SPI2
)
{
/* USER CODE BEGIN SPI2_MspDeInit 0 */
/* USER CODE END SPI2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_SPI2_CLK_DISABLE
();
/**SPI2 GPIO Configuration
PC3 ------> SPI2_MOSI
PB13 ------> SPI2_SCK
*/
HAL_GPIO_DeInit
(
GPIOC
,
GPIO_PIN_3
);
HAL_GPIO_DeInit
(
GPIOB
,
GPIO_PIN_13
);
/* USER CODE BEGIN SPI2_MspDeInit 1 */
/* USER CODE END SPI2_MspDeInit 1 */
}
}
/**
* @brief UART MSP Initialization
* This function configures the hardware resources used in this example
...
...
bsp/stm32/stm32l431-BearPi/board/Kconfig
浏览文件 @
199f73c7
...
...
@@ -29,8 +29,37 @@ menu "On-chip Peripheral Drivers"
default n
endif
menuconfig BSP_USING_SPI
bool "Enable SPI BUS"
default n
select RT_USING_SPI
if BSP_USING_SPI
config BSP_USING_SPI2
bool "Enable SPI2 BUS"
default n
config BSP_SPI2_TX_USING_DMA
bool "Enable SPI2 TX DMA"
depends on BSP_USING_SPI2
default n
config BSP_SPI2_RX_USING_DMA
bool "Enable SPI2 RX DMA"
depends on BSP_USING_SPI2
select BSP_SPI2_TX_USING_DMA
default n
endif
source "../libraries/HAL_Drivers/Kconfig"
endmenu
menu "Onboard Peripheral Drivers"
config BSP_USING_SPI_LCD
bool "Enable LCD (spi2)"
select BSP_USING_SPI
select BSP_USING_SPI2
default n
endmenu
endmenu
bsp/stm32/stm32l431-BearPi/board/SConscript
浏览文件 @
199f73c7
...
...
@@ -12,9 +12,12 @@ board.c
CubeMX_Config/Src/stm32l4xx_hal_msp.c
'''
)
if
GetDepend
(
'BSP_USING_SPI_LCD'
):
src
+=
[
'ports/lcd/drv_lcd.c'
]
path
=
[
cwd
]
path
+=
[
cwd
+
'/CubeMX_Config/Inc'
]
path
+=
[
cwd
+
'/ports/lcd'
]
startup_path_prefix
=
SDK_LIB
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
...
...
@@ -33,7 +36,7 @@ elif rtconfig.CROSS_TOOL == 'iar':
# STM32L4R7xx || STM32L4R9xx || STM32L4S5xx
# STM32L4S7xx || STM32L4S9xx
# You can select chips from the list above
CPPDEFINES
=
[
'STM32L43
2
xx'
]
CPPDEFINES
=
[
'STM32L43
1
xx'
]
group
=
DefineGroup
(
'Drivers'
,
src
,
depend
=
[
''
],
CPPPATH
=
path
,
CPPDEFINES
=
CPPDEFINES
)
Return
(
'group'
)
bsp/stm32/stm32l431-BearPi/board/ports/SConscript
0 → 100644
浏览文件 @
199f73c7
import
os
from
building
import
*
objs
=
[]
cwd
=
GetCurrentDir
()
list
=
os
.
listdir
(
cwd
)
for
item
in
list
:
if
os
.
path
.
isfile
(
os
.
path
.
join
(
cwd
,
item
,
'SConscript'
)):
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
item
,
'SConscript'
))
Return
(
'objs'
)
bsp/stm32/stm32l431-BearPi/board/ports/lcd/SConscript
0 → 100644
浏览文件 @
199f73c7
Import
(
'RTT_ROOT'
)
Import
(
'rtconfig'
)
from
building
import
*
cwd
=
GetCurrentDir
()
src
+=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
group
=
DefineGroup
(
'devices'
,
src
,
depend
=
[
'BSP_USING_SPI_LCD'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.c
0 → 100644
浏览文件 @
199f73c7
此差异已折叠。
点击以展开。
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd.h
0 → 100644
浏览文件 @
199f73c7
#ifndef __DRV_LCD_H__
#define __DRV_LCD_H__
#include <board.h>
#define LCD_W 240
#define LCD_H 240
//POINT_COLOR
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40
#define BRRED 0XFC07
#define GRAY 0X8430
#define GRAY175 0XAD75
#define GRAY151 0X94B2
#define GRAY187 0XBDD7
#define GRAY240 0XF79E
void
lcd_clear
(
rt_uint16_t
color
);
void
lcd_address_set
(
rt_uint16_t
x1
,
rt_uint16_t
y1
,
rt_uint16_t
x2
,
rt_uint16_t
y2
);
void
lcd_set_color
(
rt_uint16_t
back
,
rt_uint16_t
fore
);
void
lcd_draw_point
(
rt_uint16_t
x
,
rt_uint16_t
y
);
void
lcd_draw_point_color
(
rt_uint16_t
x
,
rt_uint16_t
y
,
rt_uint16_t
color
);
void
lcd_draw_circle
(
rt_uint16_t
x0
,
rt_uint16_t
y0
,
rt_uint8_t
r
);
void
lcd_draw_line
(
rt_uint16_t
x1
,
rt_uint16_t
y1
,
rt_uint16_t
x2
,
rt_uint16_t
y2
);
void
lcd_draw_rectangle
(
rt_uint16_t
x1
,
rt_uint16_t
y1
,
rt_uint16_t
x2
,
rt_uint16_t
y2
);
void
lcd_fill
(
rt_uint16_t
x_start
,
rt_uint16_t
y_start
,
rt_uint16_t
x_end
,
rt_uint16_t
y_end
,
rt_uint16_t
color
);
void
lcd_show_num
(
rt_uint16_t
x
,
rt_uint16_t
y
,
rt_uint32_t
num
,
rt_uint8_t
len
,
rt_uint32_t
size
);
rt_err_t
lcd_show_string
(
rt_uint16_t
x
,
rt_uint16_t
y
,
rt_uint32_t
size
,
const
char
*
fmt
,
...);
rt_err_t
lcd_show_image
(
rt_uint16_t
x
,
rt_uint16_t
y
,
rt_uint16_t
length
,
rt_uint16_t
wide
,
const
rt_uint8_t
*
p
);
#endif
bsp/stm32/stm32l431-BearPi/board/ports/lcd/drv_lcd_font.h
0 → 100644
浏览文件 @
199f73c7
此差异已折叠。
点击以展开。
bsp/stm32/stm32l431-BearPi/project.uvoptx
浏览文件 @
199f73c7
...
...
@@ -183,7 +183,7 @@
<Group>
<GroupName>
Applications
</GroupName>
<tvExp>
1
</tvExp>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<cbSel>
0
</cbSel>
<RteFlg>
0
</RteFlg>
...
...
@@ -318,6 +318,30 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\..\components\drivers\spi\spi_core.c
</PathWithFileName>
<FilenameWithoutPath>
spi_core.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
11
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\..\components\drivers\spi\spi_dev.c
</PathWithFileName>
<FilenameWithoutPath>
spi_dev.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
12
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\..\components\drivers\src\completion.c
</PathWithFileName>
<FilenameWithoutPath>
completion.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
...
...
@@ -325,7 +349,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
1
</FileNumber>
<FileNumber>
1
3
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -337,7 +361,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
2
</FileNumber>
<FileNumber>
1
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -349,7 +373,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
3
</FileNumber>
<FileNumber>
1
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -361,7 +385,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
4
</FileNumber>
<FileNumber>
1
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -373,7 +397,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
5
</FileNumber>
<FileNumber>
1
7
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -385,7 +409,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
6
</FileNumber>
<FileNumber>
1
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -397,7 +421,7 @@
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
1
7
</FileNumber>
<FileNumber>
1
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -417,7 +441,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
18
</FileNumber>
<FileNumber>
20
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -429,7 +453,7 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
19
</FileNumber>
<FileNumber>
21
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -441,7 +465,19 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
20
</FileNumber>
<FileNumber>
22
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
1
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
board\ports\lcd\drv_lcd.c
</PathWithFileName>
<FilenameWithoutPath>
drv_lcd.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
23
</FileNumber>
<FileType>
2
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -453,7 +489,7 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
2
1
</FileNumber>
<FileNumber>
2
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -465,7 +501,7 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
2
2
</FileNumber>
<FileNumber>
2
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -477,7 +513,19 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
23
</FileNumber>
<FileNumber>
26
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\libraries\HAL_Drivers\drv_spi.c
</PathWithFileName>
<FilenameWithoutPath>
drv_spi.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
27
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -497,7 +545,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
2
4
</FileNumber>
<FileNumber>
2
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -509,7 +557,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
2
5
</FileNumber>
<FileNumber>
2
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -521,7 +569,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
26
</FileNumber>
<FileNumber>
30
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -541,7 +589,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
27
</FileNumber>
<FileNumber>
31
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -553,7 +601,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
28
</FileNumber>
<FileNumber>
32
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -565,7 +613,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
29
</FileNumber>
<FileNumber>
33
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -577,7 +625,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
0
</FileNumber>
<FileNumber>
3
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -589,7 +637,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
1
</FileNumber>
<FileNumber>
3
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -601,7 +649,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
2
</FileNumber>
<FileNumber>
3
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -613,7 +661,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
3
</FileNumber>
<FileNumber>
3
7
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -625,7 +673,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
4
</FileNumber>
<FileNumber>
3
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -637,7 +685,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
3
5
</FileNumber>
<FileNumber>
3
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -649,7 +697,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
36
</FileNumber>
<FileNumber>
40
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -661,7 +709,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
37
</FileNumber>
<FileNumber>
41
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -673,7 +721,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
38
</FileNumber>
<FileNumber>
42
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -685,7 +733,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
39
</FileNumber>
<FileNumber>
43
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -697,7 +745,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
4
0
</FileNumber>
<FileNumber>
4
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -717,7 +765,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
7
</GroupNumber>
<FileNumber>
4
1
</FileNumber>
<FileNumber>
4
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -729,7 +777,7 @@
</File>
<File>
<GroupNumber>
7
</GroupNumber>
<FileNumber>
4
2
</FileNumber>
<FileNumber>
4
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -741,7 +789,7 @@
</File>
<File>
<GroupNumber>
7
</GroupNumber>
<FileNumber>
4
3
</FileNumber>
<FileNumber>
4
7
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -753,7 +801,7 @@
</File>
<File>
<GroupNumber>
7
</GroupNumber>
<FileNumber>
4
4
</FileNumber>
<FileNumber>
4
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -773,7 +821,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
4
5
</FileNumber>
<FileNumber>
4
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -785,7 +833,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
46
</FileNumber>
<FileNumber>
50
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -797,7 +845,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
47
</FileNumber>
<FileNumber>
51
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -809,7 +857,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
48
</FileNumber>
<FileNumber>
52
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -821,7 +869,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
49
</FileNumber>
<FileNumber>
53
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -833,7 +881,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
0
</FileNumber>
<FileNumber>
5
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -845,7 +893,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
1
</FileNumber>
<FileNumber>
5
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -857,7 +905,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
2
</FileNumber>
<FileNumber>
5
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -869,7 +917,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
3
</FileNumber>
<FileNumber>
5
7
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -881,7 +929,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
4
</FileNumber>
<FileNumber>
5
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -893,7 +941,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
5
5
</FileNumber>
<FileNumber>
5
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -905,7 +953,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
56
</FileNumber>
<FileNumber>
60
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -917,7 +965,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
57
</FileNumber>
<FileNumber>
61
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -929,7 +977,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
58
</FileNumber>
<FileNumber>
62
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -941,7 +989,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
59
</FileNumber>
<FileNumber>
63
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -953,7 +1001,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
0
</FileNumber>
<FileNumber>
6
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -965,7 +1013,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
1
</FileNumber>
<FileNumber>
6
5
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -977,7 +1025,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
2
</FileNumber>
<FileNumber>
6
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -989,7 +1037,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
3
</FileNumber>
<FileNumber>
6
7
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1001,7 +1049,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
4
</FileNumber>
<FileNumber>
6
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1013,7 +1061,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
6
5
</FileNumber>
<FileNumber>
6
9
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1025,7 +1073,43 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
66
</FileNumber>
<FileNumber>
70
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c
</PathWithFileName>
<FilenameWithoutPath>
stm32l4xx_hal_spi.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
71
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c
</PathWithFileName>
<FilenameWithoutPath>
stm32l4xx_hal_spi_ex.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
72
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c
</PathWithFileName>
<FilenameWithoutPath>
stm32l4xx_hal_qspi.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
73
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1037,7 +1121,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
67
</FileNumber>
<FileNumber>
74
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1049,7 +1133,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
68
</FileNumber>
<FileNumber>
75
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1061,7 +1145,7 @@
</File>
<File>
<GroupNumber>
8
</GroupNumber>
<FileNumber>
69
</FileNumber>
<FileNumber>
76
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
bsp/stm32/stm32l431-BearPi/project.uvprojx
浏览文件 @
199f73c7
...
...
@@ -336,9 +336,9 @@
<v6Rtti>
0
</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>
RT_USING_ARM_LIBC, USE_HAL_DRIVER,
STM32L432xx, __RTTHREAD__
</Define>
<Define>
RT_USING_ARM_LIBC, USE_HAL_DRIVER,
__RTTHREAD__, STM32L431xx
</Define>
<Undefine></Undefine>
<IncludePath>
.;applications;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\
include;..\..\..\components\drivers\include;board;board\CubeMX_Config\Inc
;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\armlibc;..\..\..\components\libc\compilers\common;..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Inc;..\libraries\STM32L4xx_HAL\CMSIS\Device\ST\STM32L4xx\Include;..\libraries\STM32L4xx_HAL\CMSIS\Include
</IncludePath>
<IncludePath>
.;applications;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\
spi;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;board\CubeMX_Config\Inc;board\ports\lcd
;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\armlibc;..\..\..\components\libc\compilers\common;..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Inc;..\libraries\STM32L4xx_HAL\CMSIS\Device\ST\STM32L4xx\Include;..\libraries\STM32L4xx_HAL\CMSIS\Include
</IncludePath>
</VariousControls>
</Cads>
<Aads>
...
...
@@ -421,6 +421,75 @@
</Group>
<Group>
<GroupName>
DeviceDrivers
</GroupName>
<GroupOption>
<CommonProperty>
<UseCPPCompiler>
0
</UseCPPCompiler>
<RVCTCodeConst>
0
</RVCTCodeConst>
<RVCTZI>
0
</RVCTZI>
<RVCTOtherData>
0
</RVCTOtherData>
<ModuleSelection>
0
</ModuleSelection>
<IncludeInBuild>
1
</IncludeInBuild>
<AlwaysBuild>
0
</AlwaysBuild>
<GenerateAssemblyFile>
0
</GenerateAssemblyFile>
<AssembleAssemblyFile>
0
</AssembleAssemblyFile>
<PublicsOnly>
0
</PublicsOnly>
<StopOnExitCode>
3
</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>
0
</ComprImg>
</CommonProperty>
<GroupArmAds>
<Cads>
<interw>
2
</interw>
<Optim>
0
</Optim>
<oTime>
2
</oTime>
<SplitLS>
2
</SplitLS>
<OneElfS>
2
</OneElfS>
<Strict>
2
</Strict>
<EnumInt>
2
</EnumInt>
<PlainCh>
2
</PlainCh>
<Ropi>
2
</Ropi>
<Rwpi>
2
</Rwpi>
<wLevel>
0
</wLevel>
<uThumb>
2
</uThumb>
<uSurpInc>
2
</uSurpInc>
<uC99>
2
</uC99>
<uGnu>
2
</uGnu>
<useXO>
2
</useXO>
<v6Lang>
0
</v6Lang>
<v6LangP>
0
</v6LangP>
<vShortEn>
2
</vShortEn>
<vShortWch>
2
</vShortWch>
<v6Lto>
2
</v6Lto>
<v6WtE>
2
</v6WtE>
<v6Rtti>
2
</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>
</Define>
<Undefine>
</Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>
2
</interw>
<Ropi>
2
</Ropi>
<Rwpi>
2
</Rwpi>
<thumb>
2
</thumb>
<SplitLS>
2
</SplitLS>
<SwStkChk>
2
</SwStkChk>
<NoWarn>
2
</NoWarn>
<uSurpInc>
2
</uSurpInc>
<useXO>
2
</useXO>
<uClangAs>
2
</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
</GroupArmAds>
</GroupOption>
<Files>
<File>
<FileName>
pin.c
</FileName>
...
...
@@ -437,6 +506,16 @@
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\serial\serial.c
</FilePath>
</File>
<File>
<FileName>
spi_core.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\spi\spi_core.c
</FilePath>
</File>
<File>
<FileName>
spi_dev.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\spi\spi_dev.c
</FilePath>
</File>
<File>
<FileName>
completion.c
</FileName>
<FileType>
1
</FileType>
...
...
@@ -492,6 +571,11 @@
<FileType>
1
</FileType>
<FilePath>
board\CubeMX_Config\Src\stm32l4xx_hal_msp.c
</FilePath>
</File>
<File>
<FileName>
drv_lcd.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
board\ports\lcd\drv_lcd.c
</FilePath>
</File>
<File>
<FileName>
startup_stm32l431xx.s
</FileName>
<FileType>
2
</FileType>
...
...
@@ -507,6 +591,11 @@
<FileType>
1
</FileType>
<FilePath>
..\libraries\HAL_Drivers\drv_usart.c
</FilePath>
</File>
<File>
<FileName>
drv_spi.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\libraries\HAL_Drivers\drv_spi.c
</FilePath>
</File>
<File>
<FileName>
drv_common.c
</FileName>
<FileType>
1
</FileType>
...
...
@@ -742,6 +831,21 @@
<FileType>
1
</FileType>
<FilePath>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_usart_ex.c
</FilePath>
</File>
<File>
<FileName>
stm32l4xx_hal_spi.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c
</FilePath>
</File>
<File>
<FileName>
stm32l4xx_hal_spi_ex.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c
</FilePath>
</File>
<File>
<FileName>
stm32l4xx_hal_qspi.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c
</FilePath>
</File>
<File>
<FileName>
stm32l4xx_hal_rtc.c
</FileName>
<FileType>
1
</FileType>
...
...
bsp/stm32/stm32l431-BearPi/rtconfig.h
浏览文件 @
199f73c7
...
...
@@ -83,6 +83,7 @@
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_PIN
#define RT_USING_RTC
#define RT_USING_SPI
#define RT_USING_WDT
/* Using USB */
...
...
@@ -169,5 +170,11 @@
#define BSP_USING_GPIO
#define BSP_USING_UART
#define BSP_USING_UART1
#define BSP_USING_SPI
#define BSP_USING_SPI2
/* Onboard Peripheral Drivers */
#define BSP_USING_SPI_LCD
#endif
bsp/stm32/stm32l475-atk-pandora/rtconfig.py
浏览文件 @
199f73c7
...
...
@@ -73,7 +73,8 @@ elif PLATFORM == 'armcc':
DEVICE
=
' --cpu Cortex-M4.fp '
CFLAGS
=
'-c '
+
DEVICE
+
' --apcs=interwork --c99'
AFLAGS
=
DEVICE
+
' --apcs=interwork '
LFLAGS
=
DEVICE
+
' --info sizes --info totals --info unused --info veneers --list rt-thread.map --strict --scatter "board\linker_scripts\link.sct"'
LFLAGS
=
DEVICE
+
' --info sizes --info totals --info unused --info veneers --list rt-thread.map '
LFLAGS
+=
r
' --strict --scatter "board\linker_scripts\link.sct" '
CFLAGS
+=
' -I'
+
EXEC_PATH
+
'/ARM/ARMCC/include'
LFLAGS
+=
' --libpath='
+
EXEC_PATH
+
'/ARM/ARMCC/lib'
...
...
@@ -94,6 +95,39 @@ elif PLATFORM == 'armcc':
POST_ACTION
=
'fromelf --bin $TARGET --output rtthread.bin
\n
fromelf -z $TARGET'
elif
PLATFORM
==
'armclang'
:
# toolchains
CC
=
'armclang'
CXX
=
'armclang'
AS
=
'armasm'
AR
=
'armar'
LINK
=
'armlink'
TARGET_EXT
=
'axf'
DEVICE
=
' --cpu Cortex-M4.fp '
CFLAGS
=
' -xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 '
CFLAGS
+=
' -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 '
CFLAGS
+=
' -mfloat-abi=hard -c -fno-rtti -funsigned-char -fshort-enums -fshort-wchar '
CFLAGS
+=
' -gdwarf-3 -ffunction-sections '
AFLAGS
=
DEVICE
+
' --apcs=interwork '
LFLAGS
=
DEVICE
+
' --info sizes --info totals --info unused --info veneers '
LFLAGS
+=
' --list rt-thread.map '
LFLAGS
+=
r
' --strict --scatter "board\linker_scripts\link.sct" '
CFLAGS
+=
' -I'
+
EXEC_PATH
+
'/ARM/ARMCLANG/include'
LFLAGS
+=
' --libpath='
+
EXEC_PATH
+
'/ARM/ARMCLANG/lib'
EXEC_PATH
+=
'/ARM/ARMCLANG/bin/'
if
BUILD
==
'debug'
:
CFLAGS
+=
' -g -O1'
# armclang recommend
AFLAGS
+=
' -g'
else
:
CFLAGS
+=
' -O2'
CXXFLAGS
=
CFLAGS
POST_ACTION
=
'fromelf --bin $TARGET --output rtthread.bin
\n
fromelf -z $TARGET'
elif
PLATFORM
==
'iar'
:
# toolchains
CC
=
'iccarm'
...
...
components/drivers/spi/SConscript
浏览文件 @
199f73c7
...
...
@@ -28,7 +28,10 @@ if GetDepend('RT_USING_SFUD'):
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
LOCAL_CCFLAGS
+=
' -std=c99'
elif
rtconfig
.
CROSS_TOOL
==
'keil'
:
LOCAL_CCFLAGS
+=
' --c99'
if
rtconfig
.
PLATFORM
==
'armcc'
:
LOCAL_CCFLAGS
+=
' --c99'
elif
rtconfig
.
PLATFORM
==
'armclang'
:
LOCAL_CCFLAGS
+=
' -std=c99'
src
+=
src_device
...
...
libcpu/arm/cortex-m4/SConscript
浏览文件 @
199f73c7
...
...
@@ -11,6 +11,9 @@ CPPPATH = [cwd]
if
rtconfig
.
PLATFORM
==
'armcc'
:
src
+=
Glob
(
'*_rvds.S'
)
if
rtconfig
.
PLATFORM
==
'armclang'
:
src
+=
Glob
(
'*_rvds.S'
)
if
rtconfig
.
PLATFORM
==
'gcc'
:
src
+=
Glob
(
'*_init.S'
)
src
+=
Glob
(
'*_gcc.S'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录