1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/stm32f723e-disco: enable FMC support for LCD

This commit is contained in:
Gunar Schorcht 2023-09-22 17:08:37 +02:00
parent 94fdead641
commit 71a97c2ee9
3 changed files with 46 additions and 0 deletions

View File

@ -39,6 +39,7 @@ config BOARD_STM32F723E_DISCO
select HAVE_FT5X06
select HAVE_ST7789
select HAVE_LCD_PARALLEL_16BIT if MODULE_ST7789
select HAVE_LCD_PARALLEL_LL_MCU if MODULE_ST7789
select MODULE_PERIPH_UART_HW_FC if HAS_PERIPH_UART_HW_FC && MODULE_PERIPH_UART
# Workaround due to stdout only working with stdin enabled

View File

@ -25,6 +25,8 @@ endif
ifneq (,$(filter st7789,$(USEMODULE)))
USEMODULE += lcd_parallel_16bit
USEMODULE += lcd_parallel_ll_mcu
FEATURES_REQUIRED += periph_fmc_nor_sram
endif
# TODO: remove the stdin dependency

View File

@ -42,6 +42,7 @@
#else
#include "cfg_usb_otg_fs.h"
#endif
#include "lcd_fmc.h"
#ifdef __cplusplus
extern "C" {
@ -325,6 +326,29 @@ static const fmc_bank_conf_t fmc_bank_config[] = {
.bus_turnaround = 3, }, /* 3 HCLKs a 4.63 ns */
},
},
/* bank 1, subbank 2 is used for LCD with asynchronuous
* access in Mode 1, i.e. write timings are not used */
{
.bank = FMC_BANK_1,
.mem_type = FMC_SRAM,
.data_width = FMC_BUS_WIDTH_16BIT,
.address = 0x64000000, /* Bank 1, subbank 2 is mapped to 0x64000000 */
.size = 4, /* 1 word for command @ 0x64000000 and
1 word for data @ 0x64000001 */
.nor_sram = {
.sub_bank = 2,
.ext_mode = false, /* Mode 1 used, no separate w_timing */
/* timing requirements for ST7789H2:
- t_AST min 0 ns (Address setup time)
- t_DST min 10 ns (Data setup time)
- t_WRL min 15 ns (WE LOW time)
- t_WRH min 15 ns (WE HIGH time)
- t_WRC min 66 ns (WE cycle time) */
.r_timing = { .addr_setup = 2, /* t_AST = 10 ns (2 HCLKs a 4.63 ns) */
.data_setup = 8, /* t_DST = 37 ns (8 HCLKs a 4.63 ns) */
.bus_turnaround = 5, }, /* t_WRH = 23 ns (5 HCLKs a 4.63 ns) */
},
},
};
/**
@ -333,6 +357,25 @@ static const fmc_bank_conf_t fmc_bank_config[] = {
#define FMC_BANK_NUMOF ARRAY_SIZE(fmc_bank_config)
/** @} */
/**
* @brief Descriptors of FMC banks used for LCDs
*/
static const lcd_fmc_desc_t lcd_fmc_desc[] = {
{
.bank = FMC_BANK_CONFIG(1), /* second bank (fmc_bank_config[1]) is used */
.cmd_offset = 0x0, /* address 0x64000000 (offset 0x0) used for commands */
.data_offset = 0x2, /* address 0x64000002 (offset 0x2) used for commands */
}
};
/**
* @brief Number of LCDs using FMC banks
*
* Because it is used by the preprocessor it has to be a number.
* The @ref ARRAY_SIZE can't be used here.
*/
#define LCD_FMC_NUMOF 1
#ifdef __cplusplus
}
#endif