Skip to content

CalEPD in C?

Martin F edited this page May 21, 2023 · 4 revisions

Some time ago I had an issue in the epaper component CalEPD referring to this. And it's a good question. How I can use this C++ component if I want to use only C?

My best answer would be here: CalEPD Issue #2 I've found a nice C graphical GFX library.

That you can also use to send your framebuffer to an epaper display. Because if you want to use C++ then use it also in your main file and take profit from all the added functionality (Classes, inheritance, etc. etc) Otherwise just use C. But then of course use also C components. It's not a drawback, many libraries, including all ESP-IDF components use mostly C. And you can do everything with it. Also Linus Torvalds that dislikes C++ with all his heart will be proud of you!

  epd_fb_init();

  epd_fill_rect(1,1,50,50, NEGRO);

  epd_fill_rect(1,110,EPD_WIDTH,30, NEGRO);

  epd_font(EZD_FONT_TYPE_MEDIUM, "FASANI CORPORATION", 10, 80, NEGRO);

  epd_font(EZD_FONT_TYPE_MEDIUM, "D A I T E C", 10, 120, BLANCO);

  epd_circle(200, 200, 50, NEGRO);

  epd_fill_circle(300, 200, 20, NEGRO);
  epd_update();

C rendered framebuffer Framebuffer of this epaper was sent using a C firmware by an STM32 Microchip

Clone this wiki locally