mirror of https://github.com/RT-Thread/rt-thread
[stm32][rt-spark] support nano version
This commit is contained in:
parent
975af5fd54
commit
0ad5c9585d
|
@ -8,11 +8,13 @@
|
||||||
* 2018-12-22 zylx first version
|
* 2018-12-22 zylx first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -10,11 +10,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
* 2018-12-5 SummerGift first version
|
* 2018-12-5 SummerGift first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
* 2018-12-5 SummerGift first version
|
* 2018-12-5 SummerGift first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -11,11 +11,13 @@
|
||||||
* 2021-8-11 CX fix the sector calculation error bug
|
* 2021-8-11 CX fix the sector calculation error bug
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
* 2020-06-27 NU-LL first version
|
* 2020-06-27 NU-LL first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -12,11 +12,13 @@
|
||||||
* 2021-3-3 zhuyf233 fix some bugs
|
* 2021-3-3 zhuyf233 fix some bugs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
* 2018-12-5 SummerGift first version
|
* 2018-12-5 SummerGift first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
* 2020-10-14 Dozingfiretruck first version
|
* 2020-10-14 Dozingfiretruck first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include <rtconfig.h>
|
||||||
|
#include <rtdef.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_ON_CHIP_FLASH
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
#include "drv_config.h"
|
#include "drv_config.h"
|
||||||
#include "drv_flash.h"
|
#include "drv_flash.h"
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_FAL)
|
#if defined(RT_USING_FAL)
|
||||||
#include "fal.h"
|
#include "fal.h"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_RT_USING_NANO=y
|
|
@ -15,7 +15,21 @@ config PKGS_DIR
|
||||||
option env="PKGS_ROOT"
|
option env="PKGS_ROOT"
|
||||||
default "packages"
|
default "packages"
|
||||||
|
|
||||||
|
config SOC_STM32F407ZG
|
||||||
|
bool
|
||||||
|
select SOC_SERIES_STM32F4
|
||||||
|
select RT_USING_COMPONENTS_INIT
|
||||||
|
select RT_USING_USER_MAIN
|
||||||
|
default y
|
||||||
|
|
||||||
|
config BOARD_STM32F407_SPARK
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
source "$RTT_DIR/Kconfig"
|
source "$RTT_DIR/Kconfig"
|
||||||
source "../libraries/Kconfig"
|
|
||||||
source "board/Kconfig"
|
|
||||||
source "$PKGS_DIR/Kconfig"
|
source "$PKGS_DIR/Kconfig"
|
||||||
|
source "../libraries/Kconfig"
|
||||||
|
|
||||||
|
if !RT_USING_NANO
|
||||||
|
source "board/Kconfig"
|
||||||
|
endif
|
||||||
|
|
|
@ -6,12 +6,15 @@
|
||||||
* Change Logs:
|
* Change Logs:
|
||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
* 2023-07-06 Supperthomas first version
|
* 2023-07-06 Supperthomas first version
|
||||||
|
* 2023-12-03 Meco Man support nano version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <rtthread.h>
|
|
||||||
#include <rtdevice.h>
|
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
#include <rtthread.h>
|
||||||
|
#include <drv_gpio.h>
|
||||||
|
#ifndef RT_USING_NANO
|
||||||
|
#include <rtdevice.h>
|
||||||
|
#endif /* RT_USING_NANO */
|
||||||
|
|
||||||
#define GPIO_LED_B GET_PIN(F, 11)
|
#define GPIO_LED_B GET_PIN(F, 11)
|
||||||
#define GPIO_LED_R GET_PIN(F, 12)
|
#define GPIO_LED_R GET_PIN(F, 12)
|
||||||
|
|
|
@ -1,16 +1,5 @@
|
||||||
menu "Hardware Drivers Config"
|
menu "Hardware Drivers Config"
|
||||||
|
|
||||||
config SOC_STM32F407ZG
|
|
||||||
bool
|
|
||||||
select SOC_SERIES_STM32F4
|
|
||||||
select RT_USING_COMPONENTS_INIT
|
|
||||||
select RT_USING_USER_MAIN
|
|
||||||
default y
|
|
||||||
|
|
||||||
config BOARD_STM32F407_SPARK
|
|
||||||
bool
|
|
||||||
default y
|
|
||||||
|
|
||||||
menu "Onboard Peripheral Drivers"
|
menu "Onboard Peripheral Drivers"
|
||||||
|
|
||||||
config BSP_USING_USB_TO_USART
|
config BSP_USING_USB_TO_USART
|
||||||
|
@ -369,23 +358,6 @@ menu "On-chip Peripheral Drivers"
|
||||||
default n
|
default n
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig BSP_USING_ONCHIP_RTC
|
|
||||||
bool "Enable RTC"
|
|
||||||
select RT_USING_RTC
|
|
||||||
default n
|
|
||||||
if BSP_USING_ONCHIP_RTC
|
|
||||||
choice
|
|
||||||
prompt "Select clock source"
|
|
||||||
default BSP_RTC_USING_LSE
|
|
||||||
|
|
||||||
config BSP_RTC_USING_LSE
|
|
||||||
bool "RTC USING LSE"
|
|
||||||
|
|
||||||
config BSP_RTC_USING_LSI
|
|
||||||
bool "RTC USING LSI"
|
|
||||||
endchoice
|
|
||||||
endif
|
|
||||||
|
|
||||||
menuconfig BSP_USING_PWM
|
menuconfig BSP_USING_PWM
|
||||||
bool "Enable PWM"
|
bool "Enable PWM"
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include <drv_common.h>
|
||||||
|
|
||||||
void SystemClock_Config(void)
|
void SystemClock_Config(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,10 +12,7 @@
|
||||||
#ifndef __BOARD_H__
|
#ifndef __BOARD_H__
|
||||||
#define __BOARD_H__
|
#define __BOARD_H__
|
||||||
|
|
||||||
#include <rtthread.h>
|
|
||||||
#include <stm32f4xx.h>
|
#include <stm32f4xx.h>
|
||||||
#include "drv_common.h"
|
|
||||||
#include "drv_gpio.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
* 2018-08-27 ZYLX the first version
|
* 2018-08-27 ZYLX the first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drivers/pin.h>
|
#include <rtdevice.h>
|
||||||
#include <enc28j60.h>
|
#include <enc28j60.h>
|
||||||
#include "drv_spi.h"
|
#include <drv_spi.h>
|
||||||
#include "board.h"
|
#include <drv_gpio.h>
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
#define PIN_NRF_IRQ GET_PIN(E,2)
|
#define PIN_NRF_IRQ GET_PIN(E,2)
|
||||||
#define PIN_SPI_CS GET_PIN(A,4)
|
#define PIN_SPI_CS GET_PIN(A,4)
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
#ifndef _FAL_CFG_H_
|
#ifndef _FAL_CFG_H_
|
||||||
#define _FAL_CFG_H_
|
#define _FAL_CFG_H_
|
||||||
|
|
||||||
#include <rtthread.h>
|
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
#include <fal_def.h>
|
||||||
|
|
||||||
#define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
|
#define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
|
||||||
#define FLASH_SIZE_GRANULARITY_64K (8 * 64 * 1024)
|
#define FLASH_SIZE_GRANULARITY_64K (8 * 64 * 1024)
|
||||||
#define FLASH_SIZE_GRANULARITY_128K (8 * 128 * 1024)
|
#define FLASH_SIZE_GRANULARITY_128K (8 * 128 * 1024)
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
|
|
||||||
#include <rtdevice.h>
|
#include <rtdevice.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#include "string.h"
|
#include <string.h>
|
||||||
|
#include <drv_gpio.h>
|
||||||
#include "drv_lcd.h"
|
#include "drv_lcd.h"
|
||||||
#include "drv_lcd_font.h"
|
#include "drv_lcd_font.h"
|
||||||
|
|
||||||
|
|
|
@ -21,19 +21,21 @@
|
||||||
* - logic 1 is: 900ns(H) + 400ns(L)
|
* - logic 1 is: 900ns(H) + 400ns(L)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <rtdevice.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#include <drv_matrix_led.h>
|
#include <drv_matrix_led.h>
|
||||||
|
#include <drv_common.h>
|
||||||
|
#include <drv_gpio.h>
|
||||||
|
|
||||||
#ifndef LED_NUM
|
#ifndef LED_NUM
|
||||||
#define LED_NUM 19 // LED灯珠个数
|
#define LED_NUM 19 // LED灯珠个数
|
||||||
#endif
|
#endif
|
||||||
#define LED_MATRIX_EN_PIN GET_PIN(F, 2)
|
#define LED_MATRIX_EN_PIN GET_PIN(F, 2)
|
||||||
|
|
||||||
TIM_HandleTypeDef htim3;
|
TIM_HandleTypeDef htim3;
|
||||||
DMA_HandleTypeDef hdma_tim3_ch2;
|
DMA_HandleTypeDef hdma_tim3_ch2;
|
||||||
|
|
||||||
rt_align(4)
|
rt_align(RT_ALIGN_SIZE) uint8_t led_buffer[LED_NUM * 24 * 2];
|
||||||
uint8_t led_buffer[LED_NUM * 24 * 2];
|
|
||||||
|
|
||||||
extern void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
extern void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
* 2023-05-05 yuanjie add test method
|
* 2023-05-05 yuanjie add test method
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <rtdevice.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
#include <drv_gpio.h>
|
||||||
#include "drv_rs485.h"
|
#include "drv_rs485.h"
|
||||||
|
|
||||||
#ifdef BSP_USING_RS485
|
#ifdef BSP_USING_RS485
|
||||||
|
@ -134,4 +136,4 @@ void rs485_test(int argc, void **argv)
|
||||||
}
|
}
|
||||||
MSH_CMD_EXPORT(rs485_test, test rs485 transmission);
|
MSH_CMD_EXPORT(rs485_test, test rs485 transmission);
|
||||||
|
|
||||||
#endif /* bsp_using_RS485 */
|
#endif /* BSP_USING_RS485 */
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include "spi_flash.h"
|
#include "spi_flash.h"
|
||||||
#include "spi_flash_sfud.h"
|
#include "spi_flash_sfud.h"
|
||||||
#include "drv_spi.h"
|
#include <drv_spi.h>
|
||||||
#include "drv_soft_spi.h"
|
#include <drv_soft_spi.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_SOFT_SPI_FLASH
|
#ifdef BSP_USING_SOFT_SPI_FLASH
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include "spi_flash.h"
|
#include "spi_flash.h"
|
||||||
#include "spi_flash_sfud.h"
|
#include "spi_flash_sfud.h"
|
||||||
#include "drv_spi.h"
|
#include <drv_spi.h>
|
||||||
|
#include <drv_gpio.h>
|
||||||
|
|
||||||
#if defined(BSP_USING_SPI_FLASH)
|
#if defined(BSP_USING_SPI_FLASH)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue