diff options
author | Joel Bodenmann <joel@seriouslyembedded.com> | 2015-11-27 20:39:28 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@seriouslyembedded.com> | 2015-11-27 20:39:28 +0100 |
commit | 5a99092b794373966e444296c57991631e712c70 (patch) | |
tree | 3e2853ab9730ece7398f508238ac2707e485b346 /boards/base | |
parent | eaf0b19fb8428b9e2e47798294d6ba83a56d186e (diff) | |
parent | f16ee702727a811288749a0722ddb138dd559fa8 (diff) | |
download | uGFX-5a99092b794373966e444296c57991631e712c70.tar.gz uGFX-5a99092b794373966e444296c57991631e712c70.tar.bz2 uGFX-5a99092b794373966e444296c57991631e712c70.zip |
Merge branch 'master' of https://bitbucket.org/Tectu/ugfx
Diffstat (limited to 'boards/base')
18 files changed, 251 insertions, 80 deletions
diff --git a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/Makefile b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/Makefile index f163dad2..344e3bf4 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/Makefile +++ b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/Makefile @@ -16,10 +16,12 @@ GFXLIB = ../uGFX GFXBOARD = Mikromedia-Plus-STM32-M4 GFXDEMO = modules/gdisp/basics + GFXSINGLEMAKE = no # ChibiOS settings ifeq ($(OPT_OS),chibios) # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables + CHIBIOS_VERSION = 2 CHIBIOS = ../ChibiOS CHIBIOS_BOARD = CHIBIOS_PLATFORM = STM32F4xx @@ -34,7 +36,7 @@ endif # ARCH = arm-none-eabi- -SRCFLAGS = -ggdb -O0 +SRCFLAGS = -ggdb -O1 CFLAGS = CXXFLAGS = -fno-rtti ASFLAGS = diff --git a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/openocd.cfg b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/openocd.cfg index f8b6a6f5..b4395b52 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/openocd.cfg +++ b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_2.x/openocd.cfg @@ -1,4 +1,4 @@ -# This is a script file for OpenOCD 0.7.0 +# This is a script file for OpenOCD ?.?.? # # It is set up for the Mikromedia-STM32M4 board using the ST-Link JTAG adaptor. # @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/Makefile b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/Makefile index 7f274b95..03ed9e2b 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/Makefile +++ b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/Makefile @@ -6,7 +6,7 @@ # Compiler options here. ifeq ($(USE_OPT),) # Replace -O0 with -O2 for a production build. -O2 just messes with the debugger. - USE_OPT = -O0 -g -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O1 -g -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). diff --git a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/openocd.cfg b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/openocd.cfg index f8b6a6f5..b4395b52 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/openocd.cfg +++ b/boards/base/Mikromedia-Plus-STM32-M4/example_chibios_3.x/openocd.cfg @@ -1,4 +1,4 @@ -# This is a script file for OpenOCD 0.7.0 +# This is a script file for OpenOCD ?.?.? # # It is set up for the Mikromedia-STM32M4 board using the ST-Link JTAG adaptor. # @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/Makefile b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/Makefile index 7eb8eb3e..387656f6 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/Makefile +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/Makefile @@ -20,6 +20,7 @@ # ChibiOS settings ifeq ($(OPT_OS),chibios) # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables + CHIBIOS_VERSION = 2 CHIBIOS = ../ChibiOS CHIBIOS_BOARD = CHIBIOS_PLATFORM = STM32F4xx @@ -34,7 +35,7 @@ endif # ARCH = arm-none-eabi- -SRCFLAGS = -ggdb -O0 +SRCFLAGS = -ggdb -O1 CFLAGS = CXXFLAGS = -fno-rtti ASFLAGS = diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/openocd.cfg b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/openocd.cfg index f8b6a6f5..83395e5a 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/openocd.cfg +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_2.x/openocd.cfg @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/Makefile b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/Makefile index a68e06e4..da6e199e 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/Makefile +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/Makefile @@ -36,7 +36,7 @@ endif # ARCH = arm-none-eabi- -SRCFLAGS = -ggdb -O0 +SRCFLAGS = -ggdb -O1 CFLAGS = CXXFLAGS = -fno-rtti ASFLAGS = diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/openocd.cfg b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/openocd.cfg index f8b6a6f5..83395e5a 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/openocd.cfg +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/example_chibios_3.x/openocd.cfg @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/Olimex-SAM7EX256-GE8/example/Makefile b/boards/base/Olimex-SAM7EX256-GE8/example/Makefile index 652d43dd..60a46752 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/example/Makefile +++ b/boards/base/Olimex-SAM7EX256-GE8/example/Makefile @@ -16,6 +16,7 @@ GFXLIB = ../uGFX GFXBOARD = Olimex-SAM7EX256-GE8 GFXDEMO = modules/gdisp/basics + GFXSINGLEMAKE = no # ChibiOS settings ifeq ($(OPT_OS),chibios) diff --git a/boards/base/STM32F429i-Discovery/board.mk b/boards/base/STM32F429i-Discovery/board.mk index 09116393..cbf08097 100644 --- a/boards/base/STM32F429i-Discovery/board.mk +++ b/boards/base/STM32F429i-Discovery/board.mk @@ -3,5 +3,5 @@ GFXSRC += $(GFXLIB)/boards/base/STM32F429i-Discovery/stm32f429i_discovery_sdram $(GFXLIB)/boards/base/STM32F429i-Discovery/stm32f4xx_fmc.c GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE -include $(GFXLIB)/drivers/gdisp/STM32F429iDiscovery/driver.mk +include $(GFXLIB)/drivers/gdisp/STM32LTDC/driver.mk include $(GFXLIB)/drivers/ginput/touch/STMPE811/driver.mk diff --git a/boards/base/STM32F429i-Discovery/board_STM32F429iDiscovery.h b/boards/base/STM32F429i-Discovery/board_STM32LTDC.h index cdea4b54..8cd3048d 100644 --- a/boards/base/STM32F429i-Discovery/board_STM32F429iDiscovery.h +++ b/boards/base/STM32F429i-Discovery/board_STM32LTDC.h @@ -48,7 +48,104 @@ static const ltdcConfig driverCfg = { LTDC_UNUSED_LAYER_CONFIG }; -static GFXINLINE void init_board(GDisplay *g) { +#include "ili9341.h" + +static void acquire_bus(GDisplay *g) { + (void) g; + + spiSelect(SPI_PORT); +} + +static void release_bus(GDisplay *g) { + (void) g; + + spiUnselect(SPI_PORT); +} + +static void write_index(GDisplay *g, uint8_t index) { + static uint8_t sindex; + (void) g; + + palClearPad(DC_PORT, DC_PIN); + sindex = index; + spiSend(SPI_PORT, 1, &sindex); +} + +static void write_data(GDisplay *g, uint8_t data) { + static uint8_t sdata; + (void) g; + + palSetPad(DC_PORT, DC_PIN); + sdata = data; + spiSend(SPI_PORT, 1, &sdata); +} + +static void Init9341(GDisplay *g) { + #define REG_TYPEMASK 0xFF00 + #define REG_DATAMASK 0x00FF + + #define REG_DATA 0x0000 + #define REG_COMMAND 0x0100 + #define REG_DELAY 0x0200 + + static const uint16_t initdata[] = { + REG_COMMAND | ILI9341_CMD_RESET, + REG_DELAY | 5, + REG_COMMAND | ILI9341_CMD_DISPLAY_OFF, + REG_COMMAND | ILI9341_SET_FRAME_CTL_NORMAL, 0x00, 0x1B, + REG_COMMAND | ILI9341_SET_FUNCTION_CTL, 0x0A, 0xA2, + REG_COMMAND | ILI9341_SET_POWER_CTL_1, 0x10, + REG_COMMAND | ILI9341_SET_POWER_CTL_2, 0x10, + #if 1 + REG_COMMAND | ILI9341_SET_VCOM_CTL_1, 0x45, 0x15, + REG_COMMAND | ILI9341_SET_VCOM_CTL_2, 0x90, + #else + REG_COMMAND | ILI9341_SET_VCOM_CTL_1, 0x35, 0x3E, + REG_COMMAND | ILI9341_SET_VCOM_CTL_2, 0xBE, + #endif + REG_COMMAND | ILI9341_SET_MEM_ACS_CTL, 0xC8, + REG_COMMAND | ILI9341_SET_RGB_IF_SIG_CTL, 0xC2, + REG_COMMAND | ILI9341_SET_FUNCTION_CTL, 0x0A, 0xA7, 0x27, 0x04, + REG_COMMAND | ILI9341_SET_COL_ADDR, 0x00, 0x00, 0x00, 0xEF, + REG_COMMAND | ILI9341_SET_PAGE_ADDR, 0x00, 0x00, 0x01, 0x3F, + REG_COMMAND | ILI9341_SET_IF_CTL, 0x01, 0x00, 0x06, + REG_COMMAND | ILI9341_SET_GAMMA, 0x01, + REG_COMMAND | ILI9341_SET_PGAMMA, + #if 1 + 0x0F, 0x29, 0x24, 0x0C, 0x0E, 0x09, 0x4E, 0x78, + 0x3C, 0x09, 0x13, 0x05, 0x17, 0x11, 0x00, + #else + 0x1F, 0x1a, 0x18, 0x0a, 0x0f, 0x06, 0x45, 0x87, + 0x32, 0x0a, 0x07, 0x02, 0x07, 0x05, 0x00, + #endif + REG_COMMAND | ILI9341_SET_NGAMMA, + #if 1 + 0x00, 0x16, 0x1B, 0x04, 0x11, 0x07, 0x31, 0x33, + 0x42, 0x05, 0x0C, 0x0A, 0x28, 0x2F, 0x0F, + #else + 0x00, 0x25, 0x27, 0x05, 0x10, 0x09, 0x3a, 0x78, + 0x4d, 0x05, 0x18, 0x0d, 0x38, 0x3a, 0x1f, + #endif + REG_COMMAND | ILI9341_CMD_SLEEP_OFF, + REG_DELAY | 10, + REG_COMMAND | ILI9341_CMD_DISPLAY_ON, + REG_COMMAND | ILI9341_SET_MEM + }; + + const uint16_t *p; + + acquire_bus(g); + for(p = initdata; p < &initdata[sizeof(initdata)/sizeof(initdata[0])]; p++) { + switch(*p & REG_TYPEMASK) { + case REG_DATA: write_data(g, *p); break; + case REG_COMMAND: write_index(g, *p); break; + case REG_DELAY: gfxSleepMilliseconds(*p & 0xFF); break; + } + } + release_bus(g); +} + +static void init_board(GDisplay *g) { // As we are not using multiple displays we set g->board to NULL as we don't use it. g->board = 0; @@ -84,6 +181,8 @@ static GFXINLINE void init_board(GDisplay *g) { memset((void *)SDRAM_BANK_ADDR, 0, 0x400000); spiStart(SPI_PORT, &spi_cfg); + + Init9341(g); break; } } @@ -97,34 +196,4 @@ static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { (void) percent; } -static GFXINLINE void acquire_bus(GDisplay *g) { - (void) g; - - spiSelect(SPI_PORT); -} - -static GFXINLINE void release_bus(GDisplay *g) { - (void) g; - - spiUnselect(SPI_PORT); -} - -static GFXINLINE void write_index(GDisplay *g, uint8_t index) { - static uint8_t sindex; - (void) g; - - palClearPad(DC_PORT, DC_PIN); - sindex = index; - spiSend(SPI_PORT, 1, &sindex); -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { - static uint8_t sdata; - (void) g; - - palSetPad(DC_PORT, DC_PIN); - sdata = data; - spiSend(SPI_PORT, 1, &sdata); -} - #endif /* _GDISP_LLD_BOARD_H */ diff --git a/boards/base/STM32F429i-Discovery/example_chibios_2.x/Makefile b/boards/base/STM32F429i-Discovery/example_chibios_2.x/Makefile index 6c1bb94c..f5a1b2c2 100644 --- a/boards/base/STM32F429i-Discovery/example_chibios_2.x/Makefile +++ b/boards/base/STM32F429i-Discovery/example_chibios_2.x/Makefile @@ -16,6 +16,7 @@ GFXLIB = ../uGFX GFXBOARD = STM32F429i-Discovery GFXDEMO = modules/gdisp/basics + GFXSINGLEMAKE = no # ChibiOS settings ifeq ($(OPT_OS),chibios) @@ -33,7 +34,7 @@ endif # ARCH = arm-none-eabi- -SRCFLAGS = -ggdb -O0 +SRCFLAGS = -ggdb -O1 CFLAGS = CXXFLAGS = -fno-rtti ASFLAGS = diff --git a/boards/base/STM32F429i-Discovery/example_chibios_2.x/openocd.cfg b/boards/base/STM32F429i-Discovery/example_chibios_2.x/openocd.cfg index f8b6a6f5..b4395b52 100644 --- a/boards/base/STM32F429i-Discovery/example_chibios_2.x/openocd.cfg +++ b/boards/base/STM32F429i-Discovery/example_chibios_2.x/openocd.cfg @@ -1,4 +1,4 @@ -# This is a script file for OpenOCD 0.7.0 +# This is a script file for OpenOCD ?.?.? # # It is set up for the Mikromedia-STM32M4 board using the ST-Link JTAG adaptor. # @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/STM32F429i-Discovery/example_chibios_3.x/Makefile b/boards/base/STM32F429i-Discovery/example_chibios_3.x/Makefile index d7ee1d20..87eb6e61 100644 --- a/boards/base/STM32F429i-Discovery/example_chibios_3.x/Makefile +++ b/boards/base/STM32F429i-Discovery/example_chibios_3.x/Makefile @@ -16,6 +16,7 @@ GFXLIB = ../path/to/ugfx GFXBOARD = STM32F429i-Discovery GFXDEMO = modules/gdisp/basics + GFXSINGLEMAKE = no # ChibiOS settings ifeq ($(OPT_OS),chibios) @@ -36,7 +37,7 @@ endif # ARCH = arm-none-eabi- -SRCFLAGS = -ggdb -O0 +SRCFLAGS = -ggdb -O1 CFLAGS = CXXFLAGS = -fno-rtti ASFLAGS = diff --git a/boards/base/STM32F429i-Discovery/example_chibios_3.x/openocd.cfg b/boards/base/STM32F429i-Discovery/example_chibios_3.x/openocd.cfg index f8b6a6f5..b4395b52 100644 --- a/boards/base/STM32F429i-Discovery/example_chibios_3.x/openocd.cfg +++ b/boards/base/STM32F429i-Discovery/example_chibios_3.x/openocd.cfg @@ -1,4 +1,4 @@ -# This is a script file for OpenOCD 0.7.0 +# This is a script file for OpenOCD ?.?.? # # It is set up for the Mikromedia-STM32M4 board using the ST-Link JTAG adaptor. # @@ -32,11 +32,11 @@ source [find interface/stlink-v2.cfg] echo "" echo "##### Loading CPU..." -source [find target/stm32f4x_stlink.cfg] +source [find target/stm32f4x.cfg] echo "" echo "##### Configuring..." -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate #cortex_m maskisr (auto|on|off) #cortex_m vector_catch [all|none|list] #cortex_m reset_config (srst|sysresetreq|vectreset) @@ -58,10 +58,10 @@ proc Burn {file} { # If this happens to you - use the ST-Link utility to set the option byte back to normal. # If you are using a different debugger eg a FT2232 based adapter you can uncomment the line below. #stm32f2x unlock 0 - flash protect 0 0 last off - reset init - flash write_image erase $file 0x08000000 - verify_image $file 0x0 + #flash protect 0 0 last off + reset halt + flash write_image erase $file 0 elf + verify_image $file 0x0 elf #flash protect 0 0 last on reset echo "Burning Complete!" diff --git a/boards/base/STM32F429i-Discovery/ili9341.h b/boards/base/STM32F429i-Discovery/ili9341.h new file mode 100644 index 00000000..ae1620c0 --- /dev/null +++ b/boards/base/STM32F429i-Discovery/ili9341.h @@ -0,0 +1,97 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef ILI9341_H +#define ILI9341_H + +// ILI9341 commands +#define ILI9341_CMD_NOP 0x00 /**< No operation.*/ +#define ILI9341_CMD_RESET 0x01 /**< Software reset.*/ +#define ILI9341_GET_ID_INFO 0x04 /**< Get ID information.*/ +#define ILI9341_GET_STATUS 0x09 /**< Get status.*/ +#define ILI9341_GET_PWR_MODE 0x0A /**< Get power mode.*/ +#define ILI9341_GET_MADCTL 0x0B /**< Get MADCTL.*/ +#define ILI9341_GET_PIX_FMT 0x0C /**< Get pixel format.*/ +#define ILI9341_GET_IMG_FMT 0x0D /**< Get image format.*/ +#define ILI9341_GET_SIG_MODE 0x0E /**< Get signal mode.*/ +#define ILI9341_GET_SELF_DIAG 0x0F /**< Get self-diagnostics.*/ +#define ILI9341_CMD_SLEEP_ON 0x10 /**< Enter sleep mode.*/ +#define ILI9341_CMD_SLEEP_OFF 0x11 /**< Exist sleep mode.*/ +#define ILI9341_CMD_PARTIAL_ON 0x12 /**< Enter partial mode.*/ +#define ILI9341_CMD_PARTIAL_OFF 0x13 /**< Exit partial mode.*/ +#define ILI9341_CMD_INVERT_ON 0x20 /**< Enter inverted mode.*/ +#define ILI9341_CMD_INVERT_OFF 0x21 /**< Exit inverted mode.*/ +#define ILI9341_SET_GAMMA 0x26 /**< Set gamma params.*/ +#define ILI9341_CMD_DISPLAY_OFF 0x28 /**< Disable display.*/ +#define ILI9341_CMD_DISPLAY_ON 0x29 /**< Enable display.*/ +#define ILI9341_SET_COL_ADDR 0x2A /**< Set column address.*/ +#define ILI9341_SET_PAGE_ADDR 0x2B /**< Set page address.*/ +#define ILI9341_SET_MEM 0x2C /**< Set memory.*/ +#define ILI9341_SET_COLOR 0x2D /**< Set color.*/ +#define ILI9341_GET_MEM 0x2E /**< Get memory.*/ +#define ILI9341_SET_PARTIAL_AREA 0x30 /**< Set partial area.*/ +#define ILI9341_SET_VSCROLL 0x33 /**< Set vertical scroll def.*/ +#define ILI9341_CMD_TEARING_ON 0x34 /**< Tearing line enabled.*/ +#define ILI9341_CMD_TEARING_OFF 0x35 /**< Tearing line disabled.*/ +#define ILI9341_SET_MEM_ACS_CTL 0x36 /**< Set mem access ctl.*/ +#define ILI9341_SET_VSCROLL_ADDR 0x37 /**< Set vscroll start addr.*/ +#define ILI9341_CMD_IDLE_OFF 0x38 /**< Exit idle mode.*/ +#define ILI9341_CMD_IDLE_ON 0x39 /**< Enter idle mode.*/ +#define ILI9341_SET_PIX_FMT 0x3A /**< Set pixel format.*/ +#define ILI9341_SET_MEM_CONT 0x3C /**< Set memory continue.*/ +#define ILI9341_GET_MEM_CONT 0x3E /**< Get memory continue.*/ +#define ILI9341_SET_TEAR_SCANLINE 0x44 /**< Set tearing scanline.*/ +#define ILI9341_GET_TEAR_SCANLINE 0x45 /**< Get tearing scanline.*/ +#define ILI9341_SET_BRIGHTNESS 0x51 /**< Set brightness.*/ +#define ILI9341_GET_BRIGHTNESS 0x52 /**< Get brightness.*/ +#define ILI9341_SET_DISPLAY_CTL 0x53 /**< Set display ctl.*/ +#define ILI9341_GET_DISPLAY_CTL 0x54 /**< Get display ctl.*/ +#define ILI9341_SET_CABC 0x55 /**< Set CABC.*/ +#define ILI9341_GET_CABC 0x56 /**< Get CABC.*/ +#define ILI9341_SET_CABC_MIN 0x5E /**< Set CABC min.*/ +#define ILI9341_GET_CABC_MIN 0x5F /**< Set CABC max.*/ +#define ILI9341_GET_ID1 0xDA /**< Get ID1.*/ +#define ILI9341_GET_ID2 0xDB /**< Get ID2.*/ +#define ILI9341_GET_ID3 0xDC /**< Get ID3.*/ + +// ILI9341 extended commands +#define ILI9341_SET_RGB_IF_SIG_CTL 0xB0 /**< RGB IF signal ctl.*/ +#define ILI9341_SET_FRAME_CTL_NORMAL 0xB1 /**< Set frame ctl (normal).*/ +#define ILI9341_SET_FRAME_CTL_IDLE 0xB2 /**< Set frame ctl (idle).*/ +#define ILI9341_SET_FRAME_CTL_PARTIAL 0xB3 /**< Set frame ctl (partial).*/ +#define ILI9341_SET_INVERSION_CTL 0xB4 /**< Set inversion ctl.*/ +#define ILI9341_SET_BLANKING_PORCH_CTL 0xB5 /**< Set blanking porch ctl.*/ +#define ILI9341_SET_FUNCTION_CTL 0xB6 /**< Set function ctl.*/ +#define ILI9341_SET_ENTRY_MODE 0xB7 /**< Set entry mode.*/ +#define ILI9341_SET_LIGHT_CTL_1 0xB8 /**< Set backlight ctl 1.*/ +#define ILI9341_SET_LIGHT_CTL_2 0xB9 /**< Set backlight ctl 2.*/ +#define ILI9341_SET_LIGHT_CTL_3 0xBA /**< Set backlight ctl 3.*/ +#define ILI9341_SET_LIGHT_CTL_4 0xBB /**< Set backlight ctl 4.*/ +#define ILI9341_SET_LIGHT_CTL_5 0xBC /**< Set backlight ctl 5.*/ +#define ILI9341_SET_LIGHT_CTL_7 0xBE /**< Set backlight ctl 7.*/ +#define ILI9341_SET_LIGHT_CTL_8 0xBF /**< Set backlight ctl 8.*/ +#define ILI9341_SET_POWER_CTL_1 0xC0 /**< Set power ctl 1.*/ +#define ILI9341_SET_POWER_CTL_2 0xC1 /**< Set power ctl 2.*/ +#define ILI9341_SET_VCOM_CTL_1 0xC5 /**< Set VCOM ctl 1.*/ +#define ILI9341_SET_VCOM_CTL_2 0xC6 /**< Set VCOM ctl 2.*/ +#define ILI9341_SET_NVMEM 0xD0 /**< Set NVMEM data.*/ +#define ILI9341_GET_NVMEM_KEY 0xD1 /**< Get NVMEM protect key.*/ +#define ILI9341_GET_NVMEM_STATUS 0xD2 /**< Get NVMEM status.*/ +#define ILI9341_GET_ID4 0xD3 /**< Get ID4.*/ +#define ILI9341_SET_PGAMMA 0xE0 /**< Set positive gamma.*/ +#define ILI9341_SET_NGAMMA 0xE1 /**< Set negative gamma.*/ +#define ILI9341_SET_DGAMMA_CTL_1 0xE2 /**< Set digital gamma ctl 1.*/ +#define ILI9341_SET_DGAMMA_CTL_2 0xE3 /**< Set digital gamma ctl 2.*/ +#define ILI9341_SET_IF_CTL 0xF6 /**< Set interface control.*/ + +// ILI9341 interface modes +#define ILI9341_IM_3LSI_1 0x5 /**< 3-line serial, mode 1.*/ +#define ILI9341_IM_3LSI_2 0xD /**< 3-line serial, mode 2.*/ +#define ILI9341_IM_4LSI_1 0x6 /**< 4-line serial, mode 1.*/ +#define ILI9341_IM_4LSI_2 0xE /**< 4-line serial, mode 2.*/ + +#endif /* ILI9341_H */ diff --git a/boards/base/STM32F746-Discovery/board.mk b/boards/base/STM32F746-Discovery/board.mk index a8ad0f1a..87bfcde3 100644 --- a/boards/base/STM32F746-Discovery/board.mk +++ b/boards/base/STM32F746-Discovery/board.mk @@ -15,7 +15,7 @@ ifeq ($(OPT_OS),raw32) $(GFXLIB)/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c \ $(GFXLIB)/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c \ $(GFXLIB)/boards/base/STM32F746-Discovery/stm32f746g_raw32_interrupts.c - GFXDEFS += GFX_OS_EXTRA_INIT_FUNCTION=Raw32OSInit GFX_OS_INIT_NO_WARNING=TRUE + GFXDEFS += GFX_OS_PRE_INIT_FUNCTION=Raw32OSInit GFX_OS_INIT_NO_WARNING=TRUE GFXINC += $(CMSIS)/Device/ST/STM32F7xx/Include \ $(CMSIS)/Include \ $(STMHAL)/Inc diff --git a/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c b/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c index aaf3c391..2f6af0dd 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c @@ -16,7 +16,6 @@ #endif static void SystemClock_Config(void); -static void CPU_CACHE_Enable(void); void Raw32OSInit(void) { /* Enable the CPU Cache's */ |