diff options
author | root <root@no.no.james.local> | 2015-12-28 11:26:32 +0000 |
---|---|---|
committer | root <root@no.no.james.local> | 2015-12-28 11:26:32 +0000 |
commit | c7cb971cd394ac9c66174a3c07e50bfc4fcd6e7a (patch) | |
tree | e3ebaf749e5b8cf87ee625b0e89e1279532a4446 /eink_full_monochrome.c | |
download | kobo-tools-c7cb971cd394ac9c66174a3c07e50bfc4fcd6e7a.tar.gz kobo-tools-c7cb971cd394ac9c66174a3c07e50bfc4fcd6e7a.tar.bz2 kobo-tools-c7cb971cd394ac9c66174a3c07e50bfc4fcd6e7a.zip |
original framebuffer-utils for kobo-mini from marek
Diffstat (limited to 'eink_full_monochrome.c')
-rw-r--r-- | eink_full_monochrome.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/eink_full_monochrome.c b/eink_full_monochrome.c new file mode 100644 index 0000000..da4ecaa --- /dev/null +++ b/eink_full_monochrome.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include "mxcfb.h" +#include <linux/fb.h> + + +int main(int argc, char *argv[]) +{ + struct mxcfb_update_data update_data = { + 0, 0, 800, 600, + WAVEFORM_MODE_AUTO, + }; + update_data.update_mode = UPDATE_MODE_PARTIAL; + update_data.flags = EPDC_FLAG_FORCE_MONOCHROME; + + + int framebuffer = open("/dev/fb0", O_RDWR); /* 0_RDONLY */ + if (framebuffer != -1) + { + ioctl(framebuffer, MXCFB_SET_UPDATE_SCHEME, UPDATE_SCHEME_QUEUE); + ioctl(framebuffer, MXCFB_SEND_UPDATE, &update_data); + close(framebuffer); + + printf("E-ink display fully updated (monochrome).\n"); + } + return 0; +} |