diff --git a/configs/Kconfig b/configs/Kconfig index 4ad0b46697..679e52450c 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -258,6 +258,16 @@ config ARCH_BOARD_FREEDOM_KL26Z This is the configuration for the NXP/FreeScale Freedom KL26Z board. This board has the K26Z128VLH4 chip with a built-in SDA debugger. +config ARCH_BOARD_HYMINI_STM32V + bool "HY-Mini STM32v board" + depends on ARCH_CHIP_STM32F103VC + select ARCH_HAVE_LEDS + select ARCH_HAVE_BUTTONS + select ARCH_HAVE_IRQBUTTONS + ---help--- + A configuration for the HY-Mini STM32v board. This board is based on the + STM32F103VCT6 chip. + config ARCH_BOARD_IMXRT1050_EVK bool "NXP i.MX RT 1050 EVK" depends on ARCH_CHIP_MIMXRT1052DVL6A diff --git a/configs/hymini-stm32v/include/board.h b/configs/hymini-stm32v/include/board.h index 4c711bce41..86572fb63b 100644 --- a/configs/hymini-stm32v/include/board.h +++ b/configs/hymini-stm32v/include/board.h @@ -40,20 +40,14 @@ * ************************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __CONFIGS_HYMINI_STM32V_INCLUDE_BOARD_H +#define __CONFIGS_HYMINI_STM32V_INCLUDE_BOARD_H /************************************************************************************ * Included Files ************************************************************************************/ #include -#ifndef __ASSEMBLY__ -# include -#endif -#include "stm32_rcc.h" -#include "stm32_sdio.h" -#include "stm32.h" /************************************************************************************ * Pre-processor Definitions @@ -181,4 +175,4 @@ #define BUTTON_KEYA_BIT (1 << BUTTON_KEYA) #define BUTTON_KEYB_BIT (1 << BUTTON_KEYB) -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __CONFIGS_HYMINI_STM32V_INCLUDE_BOARD_H */ diff --git a/configs/hymini-stm32v/src/stm32_boot.c b/configs/hymini-stm32v/src/stm32_boot.c index 4692aae53b..76208bbb29 100644 --- a/configs/hymini-stm32v/src/stm32_boot.c +++ b/configs/hymini-stm32v/src/stm32_boot.c @@ -43,18 +43,11 @@ #include #include -#include #include "up_arch.h" #include "hymini-stm32v.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ +#include /* Should always be included last due to dependencies */ /************************************************************************************ * Public Functions diff --git a/configs/hymini-stm32v/src/stm32_buttons.c b/configs/hymini-stm32v/src/stm32_buttons.c index 4dac6fc8f4..107cf7a097 100644 --- a/configs/hymini-stm32v/src/stm32_buttons.c +++ b/configs/hymini-stm32v/src/stm32_buttons.c @@ -44,15 +44,13 @@ #include #include -#include +#include "stm32_gpio.h" #include "hymini-stm32v.h" #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ +#include /* Should always be included last due to dependencies */ /**************************************************************************** * Public Functions diff --git a/configs/hymini-stm32v/src/stm32_leds.c b/configs/hymini-stm32v/src/stm32_leds.c index 22f724ef1f..8f66304b2c 100644 --- a/configs/hymini-stm32v/src/stm32_leds.c +++ b/configs/hymini-stm32v/src/stm32_leds.c @@ -45,7 +45,6 @@ #include #include -#include #include "chip.h" #include "up_arch.h" @@ -53,6 +52,8 @@ #include "stm32.h" #include "hymini-stm32v.h" +#include /* Should always be included last due to dependencies */ + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -138,29 +139,31 @@ ****************************************************************************/ static const uint16_t g_ledbits[8] = -{ (LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS | LED_STARTED_OFF_SETBITS - | LED_STARTED_OFF_CLRBITS), +{ + (LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS | LED_STARTED_OFF_SETBITS + | LED_STARTED_OFF_CLRBITS), -(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS - | LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS), + (LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS + | LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS), -(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS - | LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS), + (LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS + | LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS), -(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS - | LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS), + (LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS + | LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS), -(LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS | LED_INIRQ_OFF_SETBITS - | LED_INIRQ_OFF_CLRBITS), + (LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS | LED_INIRQ_OFF_SETBITS + | LED_INIRQ_OFF_CLRBITS), -(LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS | LED_SIGNAL_OFF_SETBITS - | LED_SIGNAL_OFF_CLRBITS), + (LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS | LED_SIGNAL_OFF_SETBITS + | LED_SIGNAL_OFF_CLRBITS), -(LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS | LED_ASSERTION_OFF_SETBITS - | LED_ASSERTION_OFF_CLRBITS), + (LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS | LED_ASSERTION_OFF_SETBITS + | LED_ASSERTION_OFF_CLRBITS), -(LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS | LED_PANIC_OFF_SETBITS - | LED_PANIC_OFF_CLRBITS) }; + (LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS | LED_PANIC_OFF_SETBITS + | LED_PANIC_OFF_CLRBITS) +}; /**************************************************************************** * Private Functions diff --git a/configs/hymini-stm32v/src/stm32_r61505u.c b/configs/hymini-stm32v/src/stm32_r61505u.c index cb787eae4a..1aeab883e2 100644 --- a/configs/hymini-stm32v/src/stm32_r61505u.c +++ b/configs/hymini-stm32v/src/stm32_r61505u.c @@ -54,12 +54,12 @@ #include #include -#include - #include "up_arch.h" #include "stm32.h" #include "hymini-stm32v.h" +#include /* Should always be included last due to dependencies */ + /************************************************************************************** * Pre-processor Definitions **************************************************************************************/ @@ -344,10 +344,10 @@ static void stm32_selectlcd(void) /* Bank1 NOR/SRAM timing register configuration */ - putreg32( - FSMC_BTR_ADDSET(2)|FSMC_BTR_ADDHLD(0)|FSMC_BTR_DATAST(2)|FSMC_BTR_BUSTURN(0)| - FSMC_BTR_CLKDIV(0)|FSMC_BTR_DATLAT(0)|FSMC_BTR_ACCMODA, - STM32_FSMC_BTR1); + putreg32(FSMC_BTR_ADDSET(2) | FSMC_BTR_ADDHLD(0) |FSMC_BTR_DATAST(2) | + FSMC_BTR_BUSTURN(0) | FSMC_BTR_CLKDIV(0) | FSMC_BTR_DATLAT(0) | + FSMC_BTR_ACCMODA, + STM32_FSMC_BTR1); /* As ext mode is not active the write timing is ignored!! */ @@ -367,7 +367,6 @@ static void stm32_selectlcd(void) * ************************************************************************************/ -// FIXME: Check this code !! static void stm32_deselectlcd(void) { /* Restore registers to their power up settings */ diff --git a/configs/hymini-stm32v/src/stm32_spi.c b/configs/hymini-stm32v/src/stm32_spi.c index 568cdb2494..a345d850a6 100644 --- a/configs/hymini-stm32v/src/stm32_spi.c +++ b/configs/hymini-stm32v/src/stm32_spi.c @@ -45,13 +45,14 @@ #include #include -#include #include "up_arch.h" #include "chip.h" #include "stm32.h" #include "hymini-stm32v.h" +#include /* Should always be included last due to dependencies */ + #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) /************************************************************************************ diff --git a/configs/hymini-stm32v/src/stm32_ssd1289.c b/configs/hymini-stm32v/src/stm32_ssd1289.c index d55964bb12..d09d884f96 100644 --- a/configs/hymini-stm32v/src/stm32_ssd1289.c +++ b/configs/hymini-stm32v/src/stm32_ssd1289.c @@ -48,17 +48,18 @@ #include #include -#include - #include "up_arch.h" #include "stm32.h" #include "hymini-stm32v.h" +#include /* Should always be included last due to dependencies */ + #ifdef CONFIG_LCD_SSD1289 /************************************************************************************** * Pre-processor Definitions **************************************************************************************/ + /* Configuration **********************************************************************/ #ifndef CONFIG_STM32_FSMC @@ -379,9 +380,10 @@ static void stm32_selectlcd(void) /* Bank1 NOR/SRAM timing register configuration */ - putreg32( - FSMC_BTR_ADDSET(1)|FSMC_BTR_ADDHLD(0)|FSMC_BTR_DATAST(2)|FSMC_BTR_BUSTURN(0)| FSMC_BTR_CLKDIV(0)|FSMC_BTR_DATLAT(0)|FSMC_BTR_ACCMODA, - STM32_FSMC_BTR1); + putreg32(FSMC_BTR_ADDSET(1) | FSMC_BTR_ADDHLD(0) | FSMC_BTR_DATAST(2) | + FSMC_BTR_BUSTURN(0) | FSMC_BTR_CLKDIV(0) | FSMC_BTR_DATLAT(0) | + FSMC_BTR_ACCMODA, + STM32_FSMC_BTR1); /* As ext mode is not active the write timing is ignored!! */ @@ -390,7 +392,7 @@ static void stm32_selectlcd(void) /* Enable the bank by setting the MBKEN bit */ putreg32(FSMC_BCR_MBKEN | FSMC_BCR_SRAM | FSMC_BCR_MWID16 | FSMC_BCR_WREN, - STM32_FSMC_BCR1); + STM32_FSMC_BCR1); } /************************************************************************************ @@ -500,7 +502,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) * Name: board_lcd_uninitialize * * Description: - * Unitialize the LCD support + * Uninitialize the LCD support * **************************************************************************************/