Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate LCD library #3

Open
archerindigo opened this issue Dec 6, 2021 · 13 comments
Open

Evaluate LCD library #3

archerindigo opened this issue Dec 6, 2021 · 13 comments
Assignees
Milestone

Comments

@archerindigo
Copy link
Contributor

Evaluate LCD library to see how to control image displays.

May break this issue into smaller issues.

@archerindigo archerindigo added this to the HoloCubic milestone Dec 6, 2021
@archerindigo
Copy link
Contributor Author

@wjb321 May you set some smaller goals regarding the development of the HoloCube software and update the progress from time-to-time?

@archerindigo archerindigo added the Hardware Evalution Evalution of components that to be used label Dec 17, 2021
@wjb321
Copy link
Contributor

wjb321 commented Dec 17, 2021

I will set several subgoals and put them below.

@archerindigo
Copy link
Contributor Author

You should create new issues when you set your sub-goals. Better fit a week of workload for each task.

@wjb321 wjb321 pinned this issue Dec 18, 2021
@wjb321 wjb321 unpinned this issue Dec 18, 2021
@wjb321 wjb321 pinned this issue Dec 18, 2021
@wjb321 wjb321 unpinned this issue Dec 18, 2021
@wjb321
Copy link
Contributor

wjb321 commented Dec 18, 2021

there are some basic tasks that I did in local disk about LCD(lvgl) and recently I will upload the local notes and update the tasks below:

  1. [ ]vscode environment and esp-idf environment setup
  2. [ ]esp32 examples tests and peripheral test
  3. [ ]lvgl display interface and GUI library porting
  4. [ ]lvgl animation test and coding
  5. [ ]2048 game + BLE control(partition table error: more than1mb error 102% problem)

@wjb321
Copy link
Contributor

wjb321 commented Dec 18, 2021

  1. vscode environment and esp-idf environment
    a, first time i tried on mac by using vscode_mac, but can not upload to board, it may be caused by driver problems or Type-c port problem. I can build but can not upload
    b, vscode environment here is my reference vscode_win this works fine.
    c, esp-idf, there were many problems. by checking the manual, i stalled the esp-idf tools installer(esp-idf power shell, cmd and eclipse) and then all the configurations for changing the layout and size should configure by some commands, somehow not so convenient for me. as an alternative, i found the the support plug-ins in the vscode, then i searched them and installed. then the problems happened with the environment variables conflicts, vscode esp-idf can not find some paths and files even i added in the path josn. but finally worked when reinstall the plugs-ins and make a fixed environment variables(can not share with original variables)
    d, tested some given examples in the Soc

@wjb321
Copy link
Contributor

wjb321 commented Dec 19, 2021

e, sometimes building a esp-idf project in vscode, the menuconfig will stop in initial values state forever :(, for solving this issue, it took quite a long time to solve, the final solutions were either make sure the repository esp-idf is the same root directory in the file or need configure the environment path.
f, the project opened in vscode can not be second level dir, it will make build file in the same level with the project, then the menuconfig will stop at loading initial variables forever again.
g, when esp-idf is in the same file, the example sub-file can be deleted, somehow can make the building time shorter
捕获

h, esp-idf building steps esp-idf-soc

@wjb321
Copy link
Contributor

wjb321 commented Dec 19, 2021

  1. lvgl display interface, codeblocks simulator testing and GUI library porting

@wjb321
Copy link
Contributor

wjb321 commented Dec 20, 2021

after configuring the esp-idf , there are main three files can get from lvgl githublvgl_components where the tft/touch, example, lvgl located. also the alternative way is get plug-in in vscode, which is same like getting esp-idf in vscode or the github directly.
components

@wjb321
Copy link
Contributor

wjb321 commented Dec 20, 2021

A, after clone all the files mentioned above then start the journey. in driver file(show above), there are mainly 2 parts, one is the tft driver, another one is touch driver. here I use st7989 ips lcd and no touch function, so I remove the touch driver.
B, Code porting, there are main three files need to be modified in order to drive different LCD.these files according different requirements need to be modified. Reference sorry for Chinese GUI guide

+ User_Setup_Select.h
-  Copy lv_conf_template.h  and rename it as lv_conf.h     
+ user_setup.h

C, Now come to GUI design, according to different components, build different labels and animations. here are the simulators that I used Visual Studio and Code Blocks , and after testing working fine, then I porting to LVGL projects and run it. here are:animand labels for lvgl.

@wjb321
Copy link
Contributor

wjb321 commented Dec 23, 2021

  1. here add one more thing: pictures loading

@wjb321
Copy link
Contributor

wjb321 commented Jan 3, 2022

for picture loading there are mainly 2 options:

  1. convert the pic into c online and put into flash(files)and read the c array of the given pictures
  2. convert the pic into binary format and put them into SD card and read the pic from sd card. for reading from sd card:
    • configure the sd driver: sd_card.cpp: where contains basic functions: init(), listDir, readFileLines, readBinFromSd, writeBintoSd.....
    • configure SPI(here sd card use spi mode), there are 3 different spi buses: FSPI, HSPI and VSPI, and due to my test board is already fixed module, so I redefine the pins to: ss: 0, clk:21, miso:22, mosi:19
    • configure FATFS of lvgl, the driver file named: lv_port_fatfs.h/c are the basic for lvgl get some files(png, gif, bin and txt) from sd card.

@wjb321
Copy link
Contributor

wjb321 commented Jan 3, 2022

now can load the pic from flash and read txt file from sd card, but for reading some gifs from sd card or flash still can not work.

  • animate the image as the start UI
  • add hint for next puzzle
  • mpu combine and test

@wjb321
Copy link
Contributor

wjb321 commented Jan 23, 2022

done with the drivers of gif files, it mainly has these configurations:
gif drivers needed:

lv_gif.h/c same like img with these
lv_gif_create()
lv_gif_set_src()
lv_gif_restart()

gifdec.c/h decode the gif(open gif data or file name and render frame)

TFT_eSPI drivers needed:

User_Setup.h : uncomment the needed ips drives #define and relative ips pins
User_Setup_Select.h: uncomment the needed ips setups

c struct reformat

change the format of the c.array

I tried get some online gif and cropped gif into needed size and convert gif online into raw and .c array(flash read), but it is not working(only blinking) I think it can be the online cropping tool has some influence. and tried another converted gif, it works fine.
I would like to change the interface of the game into gif

but the lvgl for gif is based on v8.1.0 the project for 2048 is v7, so code porting is more troublesome, requiring many library file driver changes and adaptation adjustments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants