-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg: u8glib: add initial support for graphics library #5126
Conversation
nice! |
cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch | ||
|
||
$(PKG_DIR)/.git/config: | ||
test -d "$(PKG_DIR)" || git clone "$(PKG_URL)" "$(PKG_DIR)"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this Makefile to use "git cache" from #5112, please?
990caf3
to
4de6cb6
Compare
Added git-cache support and fixed some gcc errors (I normally use clang). |
Thanks for the PR ! That was something I was also thinking about. #define SPI_INTERFACE SPI_1
#define SS_PIN GPIO_PIN(PB,03)
#define A0_PIN GPIO_PIN(PA,13)
#define RS_PIN GPIO_PIN(PA,23)
int main(void)
{
uint32_t screen = 0;
u8g_t u8g;
u8g_spi_t dev;
if (u8g_init_spi(&dev, SPI_INTERFACE, SS_PIN, A0_PIN, RS_PIN, &u8g, &u8g_dev_ssd1306_128x32_hw_spi)) {
puts("Failed to initialize U8glib to SPI device.");
return -1;
}
/* draw text */
... Unfortunately, nothing is displayed. I plan to test with another board asap (arduino-due for instance). |
Hmm, not sure what is wrong. You can try to swap SS/A0/RS pins and see if that makes a difference. This is because my cheap OLED display uses vague names, so I basically guessed and tried until it worked :-) You can also try to set breakpoints in the Does the native/stdout backend work for you? |
I tested the native/stdout and it worked for me. Don't have any other hardware to test right now. |
4de6cb6
to
7099981
Compare
Adapted to new pkg structure and rebased. |
7099981
to
65c49fd
Compare
6ad41d8
to
cd31852
Compare
26c77ed
to
d6f88ad
Compare
Fixed couple of things to make Murdock happy:
Now Murdock is happy. |
@@ -0,0 +1,123 @@ | |||
/* | |||
* Copyright (C) 2015 Freie Universität Berlin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the copyright you want to add? It's 2016. ;)
Please address copyright if needed, then squash. Very nice, I wish I had such a display! |
d6f88ad
to
c6278cf
Compare
Changed the copyright and squashed into two separate commits. |
c6278cf
to
206c3c9
Compare
After #5435, this PR should build again. |
206c3c9
to
5bc855a
Compare
Don't merge this PR yet. I'm improving the interface to RIOT-OS, which depends on a PR I have submitted to U8glib. I hope that gets merged, otherwise I will point it to my own branch. In the mean time, enjoy this picture of this PR running on a low-power memory display :-) |
I will close this PR as I am working on porting the successor of U8glib to RIOT-OS. The successor is (IMHO) much easier to use, includes the fixes I originally PR'd for U8glib and is less coupled to Arduino. It also need less patches. I'll open a new PR once it is ready. |
It would have been perfectly fine to just rework this PR, but no problem. Looking forward for the new PR :-). |
This PR adds initial support for U8glib graphics library as an external package. While targeted for Arduino MCUs, it works fine on 32-bit MCUs. The license should be compatible (new-style BSD).
I've tested this with a cheap SSD1306 OLED display via SPI, but it also has a stdout (for native) and I2C backend (untested). The included test application cycles through three pages, each second. Several other displays are also supported.
The code size for the test application only (EFM32, STK3600, SPI) is approximately 4.0 kb.