As a quick pre-XMAS hack I implemented the basic LCD support for STM32F429i-Discovery of STM (Branch simple_lcdctrl_support as in the link):
https://github.com/tobbad/micropython/t ... rl_support
To support the LCD controller you have to call make with MICROPY_PY_LCDCTRL=1 command line options (Is this OK?). Ic checked it on STM32F429, but not on STM32F7.
Following are the requirements:
- - There is a need for SDRAM support: The code is copy paste from the STMs STM32F429-Discovery BSP. placed in stmhal/sdram/src or stmhal/sdram/inc.
- Support for the ili9341 and the LTDC (LCD_TFT Controller) in the stmhal/lcdctrl/src/inc. The code is copy/modified/paste from the STMs STM32F429-Discovery BSP/components/utilities placed and renamed in/to stmhal/lcdctrl/src or stmhal/lcdctrl/inc
(Is this OK?). pyb_lcd_ctrl is copy modified paste of lcd.c. I am not positive about the naming of the files, yet. Maybe I will change the filenames. There is a little script (main.py) in the lcdctrl folder which you can copy to the board.
- hal_dma2d.c/h
hal_ltdc.c/h
hal_sdram.c/h
ll_fmc.c/h
This code still needs some rework and is not yet PR (push request) ready.
During this there came up some questions:
- - Shall micropython include a generic LCD library (eg. https://code.google.com/p/u8glib/) which handles all the drawing and several LCDs device drivers out of the box? Or shall this all be done in python (No support for HW acceleration as for example DMA for box filling)?
- What is the best way to configure the sdram (which will pushed to micropython in an own PR). Inject a configuration struct to the init or just keep it like in this hack hard coded? Maye add a possibility to get the configuration struct and modifiy the values before setting them?