[bsp][stm32] update f7 series bsp
This commit is contained in:
parent
b92f45f85d
commit
5321d2fb7e
|
@ -44,7 +44,7 @@
|
|||
| QSPI Flash | 支持 | |
|
||||
| 电位器 | 支持 | 使用 ADC1 |
|
||||
| 以太网 | 暂不支持 | 移植中 |
|
||||
| MPU6050六轴传感器 | 支持 | |
|
||||
| MPU6050六轴传感器 | 支持 | |
|
||||
| SDRAM | 支持 | |
|
||||
| SD卡 | 即将支持 | |
|
||||
| CAN | 即将支持 | |
|
||||
|
@ -58,7 +58,7 @@
|
|||
| RTC | 支持 | |
|
||||
| WDT | 支持 | |
|
||||
| FLASH | 支持 | 已适配 [FAL](https://github.com/RT-Thread-packages/fal) |
|
||||
| SDIO | 支持 | |
|
||||
| SDIO | 暂不支持 | 即将支持 |
|
||||
| PWM | 暂不支持 | 即将支持 |
|
||||
| USB Device | 暂不支持 | 即将支持 |
|
||||
| USB Host | 暂不支持 | 即将支持 |
|
||||
|
|
|
@ -11,14 +11,23 @@
|
|||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PH10 */
|
||||
#define LED0_PIN GET_PIN(H, 10)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
|
|
@ -34,40 +34,6 @@ menu "Onboard Peripheral Drivers"
|
|||
select PKG_USING_MPU6XXX
|
||||
default n
|
||||
|
||||
config BSP_USING_ETH
|
||||
bool "Enable Ethernet"
|
||||
default n
|
||||
select RT_USING_LWIP
|
||||
if BSP_USING_ETH
|
||||
config EXTERNAL_PHY_ADDRESS
|
||||
hex
|
||||
default 0x00
|
||||
endif
|
||||
|
||||
config BSP_USING_RGB
|
||||
bool "Enable RGB LED (timer5 channel1 - 3)"
|
||||
select RT_USING_PWM
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM5
|
||||
select BSP_USING_PWM5_CH1
|
||||
select BSP_USING_PWM5_CH2
|
||||
select BSP_USING_PWM5_CH3
|
||||
default n
|
||||
|
||||
config BSP_USING_POT
|
||||
bool "Enable potentiometer"
|
||||
select BSP_USING_ADC
|
||||
select BSP_USING_ADC1
|
||||
default n
|
||||
|
||||
config BSP_USING_SDCARD
|
||||
bool "Enable SDCARD (sdio)"
|
||||
select BSP_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ELMFAT
|
||||
select RT_USING_PIN
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
|
@ -92,10 +58,6 @@ menu "On-chip Peripheral Drivers"
|
|||
select RT_USING_SERIAL
|
||||
default n
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
bool "Enable on-chip FLASH"
|
||||
default n
|
||||
|
@ -124,47 +86,6 @@ menu "On-chip Peripheral Drivers"
|
|||
select RT_USING_QSPI
|
||||
select RT_USING_SPI
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM11
|
||||
bool "Enable TIM11"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM13
|
||||
bool "Enable TIM13"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM14
|
||||
bool "Enable TIM14"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable pwm"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM5
|
||||
bool "Enable timer5 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM5
|
||||
config BSP_USING_PWM5_CH1
|
||||
bool "Enable PWM5 channel1"
|
||||
default n
|
||||
|
||||
config BSP_USING_PWM5_CH2
|
||||
bool "Enable PWM5 channel2"
|
||||
default n
|
||||
|
||||
config BSP_USING_PWM5_CH3
|
||||
bool "Enable PWM5 channel3"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
|
@ -174,14 +95,24 @@ menu "On-chip Peripheral Drivers"
|
|||
config BSP_USING_ADC1
|
||||
bool "Enable ADC1"
|
||||
default n
|
||||
endif
|
||||
|
||||
config BSP_USING_ADC2
|
||||
bool "Enable ADC2"
|
||||
default n
|
||||
|
||||
config BSP_USING_ADC3
|
||||
bool "Enable ADC3"
|
||||
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
|
||||
comment "Notice: PB6 --> 22; PB7 --> 23"
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "I2C1 scl pin number"
|
||||
range 1 176
|
||||
default 22
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 1 176
|
||||
default 23
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C2
|
||||
|
@ -191,15 +122,33 @@ menu "On-chip Peripheral Drivers"
|
|||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C2
|
||||
comment "Notice: PH4 --> 116; PH5 --> 117"
|
||||
comment "Notice: PC15 --> 47; PD0 --> 48"
|
||||
config BSP_I2C2_SCL_PIN
|
||||
int "i2c2 scl pin number"
|
||||
range 1 176
|
||||
default 116
|
||||
default 47
|
||||
config BSP_I2C2_SDA_PIN
|
||||
int "I2C2 sda pin number"
|
||||
range 1 176
|
||||
default 117
|
||||
default 48
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C3
|
||||
bool "Enable I2C3 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C3
|
||||
comment "Notice: PF12 --> 92; PF13 --> 93"
|
||||
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
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C4
|
||||
|
@ -231,12 +180,6 @@ menu "On-chip Peripheral Drivers"
|
|||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
|
|
@ -18,9 +18,6 @@ if GetDepend(['BSP_USING_ETH']):
|
|||
if GetDepend(['BSP_USING_QSPI_FLASH']):
|
||||
src += Glob('ports/drv_qspi_flash.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SDCARD']):
|
||||
src += Glob('ports/sdcard_port.c')
|
||||
|
||||
path = [cwd]
|
||||
path += [cwd + '/CubeMX_Config/Inc']
|
||||
path += [cwd + '/ports']
|
||||
|
|
|
@ -60,27 +60,3 @@ void SystemClock_Config(void)
|
|||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
void MX_GPIO_Init(void)
|
||||
{
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
int board_pin_init(void)
|
||||
{
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
#include <stm32f7xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE (512)
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
|
@ -39,13 +35,7 @@ extern int __bss_end;
|
|||
|
||||
#define HEAP_END STM32_SRAM_END
|
||||
|
||||
/* Board Pin definitions */
|
||||
#define LED0_PIN GET_PIN(H, 10)
|
||||
#define LED1_PIN GET_PIN(H, 11)
|
||||
#define LED2_PIN GET_PIN(H, 12)
|
||||
|
||||
void SystemClock_Config(void);
|
||||
void MX_GPIO_Init(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 balanceTWK add sdcard port file
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_SDCARD
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
#include "drv_gpio.h"
|
||||
|
||||
#define DBG_ENABLE
|
||||
#define DBG_SECTION_NAME "app.card"
|
||||
#define DBG_COLOR
|
||||
|
||||
#define DBG_LEVEL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#define WIFI_RESET_PIN GET_PIN(G, 9)
|
||||
|
||||
int ewm1062_disable(void)
|
||||
{
|
||||
rt_pin_mode(WIFI_RESET_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(WIFI_RESET_PIN,PIN_LOW);
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_BOARD_EXPORT(ewm1062_disable);
|
||||
|
||||
void sd_mount(void *parameter)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(500);
|
||||
if(rt_device_find("sd0") != RT_NULL)
|
||||
{
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("sd card mount to '/'");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("sd card mount to '/' failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int stm32_sdcard_mount(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
|
||||
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("create sd_mount thread err!");
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(stm32_sdcard_mount);
|
||||
|
||||
#endif /* BSP_USING_SDCARD */
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ if PLATFORM == 'gcc':
|
|||
CC = PREFIX + 'gcc'
|
||||
AS = PREFIX + 'gcc'
|
||||
AR = PREFIX + 'ar'
|
||||
CXX = PREFIX + 'g++'
|
||||
LINK = PREFIX + 'gcc'
|
||||
TARGET_EXT = 'elf'
|
||||
SIZE = PREFIX + 'size'
|
||||
|
|
Loading…
Reference in New Issue