-
Notifications
You must be signed in to change notification settings - Fork 203
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
160 remove board defines #168
Conversation
Tested with Lilygo EPD47, just pulled Micke's repository and switched to branch 160-board_hal
|
Sorry, my mistake. Please try again now. |
Thanks Micke, now is complaining about this: /src/epd_driver/board/epd_board_v5.c:5:10: fatal error: display_ops.h: No such file or directory Tomorrow when I find some time I will go through your code and try to get more awareness of what you modified. Now if you go into the referenced files, for example in my board epd_board_lilygo_t5_47.c and I change the includes to reference this folder: #include "../display_ops.h"
#include "../i2s_data_bus.h"
#include "../rmt_pulse.h" Then it compiles and by flashing I get this error: assertion "epd_board != NULL" failed: file "/home/martin/esp/projects/pull-requests/epdiy-micke/src/epd_driver/render.c", line 249, function: epd_init This needs an extra correction: #if defined(CONFIG_EPD_BOARD_REVISION_LILYGO_T5_472) // --> it's without the 2:
// CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47
epd_set_board(&epd_board_lilygo_t5_47);
#endif After this it refreshes and works as expected. When @mcer12 board comes I will test it also with his. |
Fixed these as well. Thanks. |
But did you push the changes? Or it’s me that I don’t find the commits. Now I see it’s in #include "epd_board_common.h" |
I did push, yes. But there is no new commits. |
I ask because I don't see the changes pulling from origin, same error as before is reported: Sorry but changes are not pushed, last commit in the log: |
You have the change. The path did not contain ".." before. Why you still get compile error I need to check though. The last commit has not been changed so the date is correct. |
No problem. But I must say I really don't get how is updated. Because usually if you review something, comes a new commit + push and you can check it before building it.
Actually that would be a better way to organize this. Header files should be in the include path and then you don't need to use this ugly relative "../" style paths. Actually I'm not sure that will compile in Arduino framework. More feedback: Refresh and update correct. Only at the end getting this:
@mickeprag an additional request if you find some time: Can you prepare also an example and add it to the current ones, that shows how it should be done to declare the board dynamically? (Withouth using menuconfig) Just declaring the Board directly in the main.c code maybe just add a comment in the the top that says that Board definition in menuconfig is not being used. That would be a nice one to test and experiment more what you did. |
Started to play around with this so I can use it for the next revision of my S2 board so you can check it out. I might have forgotten something. Apart of that, in order to use this MCU, this are the things that need to be updated and I've on my list:
|
Thank you for going forward with this and sorry for the late reply. I like the direction this is going :) |
Thank you @vroland. I have some ideas regarding the VCOM voltage. But previously I had no way to test it since I don't have a v6 board. I just got my own version running so I should try to get some solution up on Github shortly. |
Sounds good :) |
Since I'm currently travelling I can't test this right now, so I'll have to rely on the judgement of the other contributors to try this out.. |
I will be also kind of busy at least until end of April, beginning of Mai since I'm reallocating to Barcelona and have a big mess in front of me.
Let's keep it active and test it good before doing any merge. Also IMHO this should get a v1.0 tagged release and after this update it should have a different release version, so people using Platformio can relate to this using the: #v1.0 tag at the end of the github URL to avoid breaking any existing build. Maybe it's not needed but I will take some precautions provided that this is kind of a big update and touches core files. |
Instead of using defines to set the board hardware definitions each board get its own file with the routines to access the hardware functions. This way also third party boards can be implemented without being required to modify the epdiy source. So far only logic from display_ops.c has been ported. Work still also exists to optimize duplicated code. Care has been taken to not break existing code bases. If a board is defined in menuconfig this will still be used.
The goal is to get rid of the config_reg_v*.h files
This should not be done for individual boards.
Boards specific code should be marked as such.
Move signals oe, mode and stv to this Implement start_frame using the ctrl interface
96cd9fa
to
9ee422d
Compare
I just rebased this branch on top of master and fixed the following:
I feel I am pretty much done with this PR and is ready to merge. |
Awesome Micke, I will take some time to test it on the following days, and we can merge it. Question: Do you think we should make a new release in case the Platformio users can still use the old way just fixing it to a release tag? (Like #6.2 ) By the way tests are failing because of this: /app/src/epd_driver/board/epd_board_common.c:1:10: fatal error: ../epd_board.h: No such file or directory That epd_board.h is in the include path. So I think is save to add it without the / backslash. Can you please change it? |
This makes vcom voltage available at runtime and not at compile time
Done |
This reverts commit f1e266c.
* 160 remove board defines (#168) * Add board HAL (Hardware abstraction layer) Instead of using defines to set the board hardware definitions each board get its own file with the routines to access the hardware functions. This way also third party boards can be implemented without being required to modify the epdiy source. So far only logic from display_ops.c has been ported. Work still also exists to optimize duplicated code. Care has been taken to not break existing code bases. If a board is defined in menuconfig this will still be used. * Move content of config_reg_v4.h into epd_board_v5.c The goal is to get rid of the config_reg_v*.h files * Move content of config_reg_v4.h into epd_board_v4.c * Move content of config_reg_v6.h into epd_board_v6.c * Move content of config_reg_v2.h into epd_board_v2_v3.c * Move content of config_reg_v2.h into epd_board_lilygo_t5_47.c * Remove board specific defines from display_ops.h * Free the i2s clock pin in i2s code This should not be done for individual boards. * Deprecate v6 board specific functions as generic function. Boards specific code should be marked as such. * Move temperature readings into board code * Implement a control interface for gpios Move signals oe, mode and stv to this Implement start_frame using the ctrl interface * Move logic of end_frame() from board to display_opts * Remove uneccesary function latch_row() * Move logic for latch_row from board to display_opts * Remove warning about v6_wait_for_interrupt() is unused * Optimize set_ctrl by supplying a mask with the changed signals * Share the temperature readings between boards v2 to v5 * Deprecate epd_powerdown() and make it to a board specific function instead * Read vcom voltage from epd_board_vcom_v6() This makes vcom voltage available at runtime and not at compile time * enable CI runs on latest ESP-IDF version Revert "disable CI runs on latest ESP-IDF for now" This reverts commit 0e2bd15. * replace deprecated portTICK_RATE_MS macro The drop-in replacement is portTICK_PERIOD_MS. See espressif/esp-idf#51. * add missing headers Some symbols and macros were not longer implicitly imported. * update clock usage Co-authored-by: jdoubleu <[email protected]> * update GPIO usage Co-authored-by: jdoubleu <[email protected]> * add missing libsodium component as dependency Disable the component manager in ESP-IDF <5. See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/removed-components.html#components-moved-to-idf-component-registry * fix minor errors in examples For a thorough exaplanation of the st.c changes see https://stackoverflow.com/a/60696378/7201. * migrate TCP/IP adapter API in mpd_status See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/tcpip-adapter.html * update component registration in weather example Use the recommended flow. * disable CI job to build arduino-esp32 with ESP-IDF v5 arduino-esp32 does not support ESP-IDF v5, yet (see https://github.com/espressif/arduino-esp32/blob/master/CMakeLists.txt#L8-L9). * Use gpio port correctly instead of pin when getting LL device * Fix log print format specifer in www-image example * Add 'rules' to idf_component yaml file in mpd_status example to correctly pull in libsodium between eps-idf 4.X and 5.X * Fix pointer arg to error handling function * Switch between format specifiers based on esp-idf version in www-image example * remove IRAM_ATTR macros from header declarations * fix warnings about type incompatibilities * replace deprecated header See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/peripherals.html#peripheral-clock-gating * Empty commit to kick CI to see if new esp-idf releave_v4.3 container pushed 2 days ago fixes libsodium build error * Update cmakelists to support v5.0-beta1 driver and adc component changes. Compilation failing still, esp_adc_cal functionality neesd to be ported to new adc_cali.h and driver/esp_adc functionality * Fix CMakeLists to support correct component lists for both idf 4.X and 5.X * Switch 'latest' esp-idf container tag to 'v5.0-beta1' * Explicitly add missing components to mpd_status and www-image examples cmakelists that were just inferred in 4.X * Bump to newly release esp-idf 5.0 docker container for CI * fix log statements after uint32_t alias changed Co-authored-by: Micke Prag <[email protected]> Co-authored-by: dot4qu <[email protected]>
This is my take on #160 to remove defines for board definitions.
The goal has been to not break backwards compatibility. All current project should still work without modifications. Configuring the board to use is still possible through
menuconfig
, but is not required. For projects not using this library as an esp-idf component there is a new option (and default if nothing is defined) calledEPD_BOARD_CUSTOM
that can be used by PlatformIO projects or Arduino.These project must call the new function
epd_set_board()
beforeepd_init()
to tell which board to use.The different code for each board is now separated into own source files to keep maintenance as clean and easy as possible. For third party boards these can also be used as a templates since it will be possible to support new boards without modify epdiy source.
Since this branch touches quite many files I have tried my best to create isolated atomic commits for easier review.
This is currently only tested on v5 boards.