From 94cb87223e338fcd820e695214b687bd5a9caa4f Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Fri, 19 Aug 2016 17:25:59 +0800 Subject: [PATCH] [bsp][stm32f429-disco] Add stm32f42x GPIO index --- bsp/stm32f429-disco/SConstruct | 2 +- bsp/stm32f429-disco/drivers/gpio.c | 33 ++++++++++++++++++++++++++++++ bsp/stm32f429-disco/rtconfig.py | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/bsp/stm32f429-disco/SConstruct b/bsp/stm32f429-disco/SConstruct index 99c2876aab..47749abd0a 100644 --- a/bsp/stm32f429-disco/SConstruct +++ b/bsp/stm32f429-disco/SConstruct @@ -15,7 +15,7 @@ except: print RTT_ROOT exit(-1) -TARGET = 'rtthread-stm32f4xx.' + rtconfig.TARGET_EXT +TARGET = 'rtthread-stm32f42x.' + rtconfig.TARGET_EXT env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, diff --git a/bsp/stm32f429-disco/drivers/gpio.c b/bsp/stm32f429-disco/drivers/gpio.c index 88819f73b5..7650aba447 100644 --- a/bsp/stm32f429-disco/drivers/gpio.c +++ b/bsp/stm32f429-disco/drivers/gpio.c @@ -86,6 +86,39 @@ static const struct pin_index pins[] = {51, RCC_AHB1Periph_GPIOA, GPIOA, GPIO_Pin_7}, {52, RCC_AHB1Periph_GPIOB, GPIOB, GPIO_Pin_3}, {53, RCC_AHB1Periph_GPIOA, GPIOA, GPIO_Pin_4}, + + {54, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_0}, + {55, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_1}, + {56, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_2}, + {57, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_3}, + {58, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_4}, + {59, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_5}, + {60, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_6}, + {61, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_7}, + {62, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_8}, + {63, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_9}, + {64, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_10}, + {65, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_11}, + {66, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_12}, + {67, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_13}, + {68, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_14}, + {69, RCC_AHB1Periph_GPIOF, GPIOF, GPIO_Pin_15}, + {70, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_0}, + {71, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_1}, + {72, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_2}, + {73, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_3}, + {74, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_4}, + {75, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_5}, + {76, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_6}, + {77, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_7}, + {78, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_8}, + {79, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_9}, + {80, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_10}, + {81, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_11}, + {82, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_12}, + {83, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_13}, + {84, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_14}, + {85, RCC_AHB1Periph_GPIOG, GPIOG, GPIO_Pin_15} }; #define ITEM_NUM(items) sizeof(items)/sizeof(items[0]) diff --git a/bsp/stm32f429-disco/rtconfig.py b/bsp/stm32f429-disco/rtconfig.py index 9bc94499fd..81c8572ab9 100644 --- a/bsp/stm32f429-disco/rtconfig.py +++ b/bsp/stm32f429-disco/rtconfig.py @@ -41,7 +41,7 @@ if PLATFORM == 'gcc': OBJCPY = PREFIX + 'objcopy' DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' - CFLAGS = DEVICE + ' -g -Wall -DSTM32F407ZG -DSTM32F4XX -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -D__FPU_USED' + CFLAGS = DEVICE + ' -g -Wall -DSTM32F429ZI -DSTM32F4XX -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -D__FPU_USED' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld' -- GitLab