As before, I have a bare ugfx library. The only difference to the original git clone is an additional "ugfx.h" file. It's probably not even necessary, but might help arduino find and pick the correct folder.
Another library is created for the display driver and ugfx config, the library folder looks like this:
~/Arduino/libraries/myproject-ugfx-extdriver ├── board_SSD1331.cpp ├── board_SSD1331.h ├── driver_SSD1331.c ├── gdisp_lld_config.h ├── gfx.c ├── gfxconf.h ├── myproject-ugfx-extdriver.h └── SSD1331.hThe important details: some of the files need to include headers or source files in ugfx's directory structure. As arduino adds an include path (.../ugfx), we can dive into ugfx like so (in driver_SSD1331.c):
#include "src/gdisp/gdisp_driver.h"
The second important detail is that we include ugfx's single-file-source in gfx.c:#include "src/gfx_mk.c"
(this is actually the whole content of that file!).I probably just messed up some files or include directive in my previous attempt. The next step is to make the driver code more reusable, probably with another extra library. Then we'd have these libs:
- ugfx (git clone)
- ugfx-<display>-<board> (ugfx driver for a specific board, but without pin definitions) This would be reusable and could be included in the ugfx repo if done well enough. Example: ugfx-ssd1331-teensy32
- myproject-ugfx (ugfx and driver config for a specific project)
The current state has the latter two merged, making it harder to reuse the driver code.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.