欢迎光临散文网 会员登陆 & 注册

转Github_Wiki_Using CalEPD in a C project

2023-03-12 22:09 作者:高刷墨水屏电子纸金桑  | 我要投稿

via D1sconnected(https://github.com/D1sconnected), he asked this in a CalEPD issue(https://github.com/martinberlin/CalEPD/issues/9) and found a nice way to do it. 

Since the Issue is closed, in order to make the solution available to everyone, I decided to add it here in the WiKi. 

Background info: You are working in a C project but you want to use a C++ component like CalEPD. What is the right step? Should I update all my code to C++?


In D1sconnected own words here is his explanation on how to do it.

Steps to integrate it

  1. I left my entire code-base in C language with no changes

  2. Create additional cpp wrapper component, where placed CalEPD functions and left all cpp-related includes in cpp file

  3. Include wrapper header in main.c, function declaration has extern C directive

This works just fine. ESP32 Cmake pretty "smart" and there is no need to add any additional build steps.

main.c

eink_interface.h

eink_interface.cpp

CMakeLists.txt

欢迎各位尝试移植,CALE-IDF中COMPONENT里的CALEPD现在已经由我提供样品支持,目前GOOD DISPLAY系列很多SPI屏幕都可以成功使用!!!

转Github_Wiki_Using CalEPD in a C project的评论 (共 条)

分享到微博请遵守国家法律