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

Can I use cale-idf in Arduino #37

Closed
cultur98 opened this issue Mar 14, 2021 · 7 comments
Closed

Can I use cale-idf in Arduino #37

cultur98 opened this issue Mar 14, 2021 · 7 comments
Assignees

Comments

@cultur98
Copy link

Hi Martin,
very nice work!
It might be a stupid question but I don't
have issues making a fool of myself. .-)
Can I use the library in Arduino?

@martinberlin martinberlin self-assigned this Mar 14, 2021
@martinberlin
Copy link
Owner

martinberlin commented Mar 14, 2021

Short answer: I've used specific ESP-IDF things regarding SPI Communication (Check for ex: epdspi.cpp )
So of course it could be ported. But is not me who is going to take this task. Primarily since I use arduino-esp32 only to test quick things but most thing this days I build with ESP-IDF.

Why don't you use GxEPD or GxEPD2 that work good and they where made for the arduino framework?
Or is that you want to use Cale-idf for some particular reason?
SPI works faster in this component. But is only because I'm sending full X lines in each transaction. Other than that you could do the same, except of the touch support, in the GxEPD* libraries

@cultur98
Copy link
Author

Hi Martin, thanks for you quick response.
I am using the EPD47 from LilyGo.
And cale-idf seems to be the only library to
provide screen rotation for it.

@martinberlin
Copy link
Owner

martinberlin commented Mar 14, 2021

Oh I understand that’s a pity. What you can do is fork Lilygo EPD47 repository and add rotation based on my class here:
https://github.com/martinberlin/cale-idf/tree/master/components/CalEPD/models/parallel

Basically add a wrapper before write pixel that will add software rotation before drawing it. It’s a pity Lilygo did not add them themselves...
But is not that complicated. From the top of my head:
Rotation can be a global : uint8 rotation = 0;

then a function setRotation can update this value from 0 to max 3.
And then the function drawPixel will take this in account and basically recalculate X,Y based on the rotation integer. So instead of calling:

epd_draw_pixel(x, y, color, framebuffer);

you will call your own drawPixel that will take in account rotation just like I’m doing in Ed047TC1::drawPixel(int16_t x, int16_t y, uint16_t color)

that’s mostly it. And then if you get it working just make a pull request and we make rotation work also for those using arduino-ESP32 in this epaper.
If you do it locally and it works you can also copy here the update and I will do the rest.

@martinberlin
Copy link
Owner

@cultur98 tell me what are your plans and if I can help somehow. This will remain open till Friday 19.03 waiting for your feedback

@cultur98
Copy link
Author

@martinberlin
You can close the case. The device uses a framebuffer. It should be easy to rotate the pixels on demand.
However I use it in "landscape" mode right now. When I am ready for pixel work I will make an approach
and keep you updated!

@martinberlin
Copy link
Owner

Alright perfect. Otherwise just suggest in the rotate issue from Lilygo repository (Maybe just copy my proposal)
And when I find the time will just fork it and add it, so other people can use it too, but it would be nice it Lilygo does it.
I don't mind but I really prefer that they implement it since maybe they want to do it differently. Anyways if they say yes, do it, since they have no pland to implement it I can step in. Keep healthy!
And try ESP-IDF, you won't regret, it's a very nice Framework to work with.

@martinberlin
Copy link
Owner

Hi @cultur98 please check my update in Lilygo repository for the EPD47 parallel epaper
Xinyuan-LilyGO/LilyGo-EPD47#9 (comment)

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

No branches or pull requests

2 participants