summaryrefslogtreecommitdiffstats
path: root/eink_full_monochrome.c
diff options
context:
space:
mode:
Diffstat (limited to 'eink_full_monochrome.c')
-rw-r--r--eink_full_monochrome.c28
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;
+}