summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-11-16 20:44:03 +0100
committerWolfgang Denk <wd@denx.de>2011-11-16 20:44:03 +0100
commit9dfa8da709a1589d177d99c597d9b18d8c9a145d (patch)
treee5f42ab6c6bcfffd17eb60306ffad2c0567dac6f /examples
parent0c2dd9a05bdcf3b2b4880509ec690116873fe158 (diff)
parenta2a5729fc1247bb45d794e9d731c0b03bf58096f (diff)
downloadu-boot-imx-9dfa8da709a1589d177d99c597d9b18d8c9a145d.zip
u-boot-imx-9dfa8da709a1589d177d99c597d9b18d8c9a145d.tar.gz
u-boot-imx-9dfa8da709a1589d177d99c597d9b18d8c9a145d.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-video
* 'master' of git://git.denx.de/u-boot-video: api: export LCD device to external apps font: split font data from video_font.h tools: logo: split bmp arrays from bmp_logo.h lcd: add clear and draw bitmap declaration VIDEO: mx3fb: GCC4.6 fix build warnings Powerpc/DIU: Fixed the 800x600 and 1024x768 resolution bug
Diffstat (limited to 'examples')
-rw-r--r--examples/api/demo.c31
-rw-r--r--examples/api/glue.c31
-rw-r--r--examples/api/glue.h5
3 files changed, 67 insertions, 0 deletions
diff --git a/examples/api/demo.c b/examples/api/demo.c
index 65e7491..19d38f6 100644
--- a/examples/api/demo.c
+++ b/examples/api/demo.c
@@ -48,6 +48,7 @@ int main(int argc, char * const argv[])
ulong start, now;
struct device_info *di;
lbasize_t rlen;
+ struct display_info disinfo;
if (!api_search_sig(&sig))
return -1;
@@ -176,6 +177,36 @@ int main(int argc, char * const argv[])
while ((env = ub_env_enum(env)) != NULL)
printf("%s = %s\n", env, ub_env_get(env));
+ printf("\n*** Display ***\n");
+
+ if (ub_display_get_info(DISPLAY_TYPE_LCD, &disinfo)) {
+ printf("LCD info: failed\n");
+ } else {
+ printf("LCD info:\n");
+ printf(" pixel width: %d\n", disinfo.pixel_width);
+ printf(" pixel height: %d\n", disinfo.pixel_height);
+ printf(" screen rows: %d\n", disinfo.screen_rows);
+ printf(" screen cols: %d\n", disinfo.screen_cols);
+ }
+ if (ub_display_get_info(DISPLAY_TYPE_VIDEO, &disinfo)) {
+ printf("video info: failed\n");
+ } else {
+ printf("video info:\n");
+ printf(" pixel width: %d\n", disinfo.pixel_width);
+ printf(" pixel height: %d\n", disinfo.pixel_height);
+ printf(" screen rows: %d\n", disinfo.screen_rows);
+ printf(" screen cols: %d\n", disinfo.screen_cols);
+ }
+
+ printf("*** Press any key to continue ***\n");
+ printf("got char 0x%x\n", ub_getc());
+
+ /*
+ * This only clears messages on screen, not on serial port. It is
+ * equivalent to a no-op if no display is available.
+ */
+ ub_display_clear();
+
/* reset */
printf("\n*** Resetting board ***\n");
ub_reset();
diff --git a/examples/api/glue.c b/examples/api/glue.c
index eff6a7e..d907e3f 100644
--- a/examples/api/glue.c
+++ b/examples/api/glue.c
@@ -402,3 +402,34 @@ const char * ub_env_enum(const char *last)
return env_name;
}
+
+/****************************************
+ *
+ * display
+ *
+ ****************************************/
+
+int ub_display_get_info(int type, struct display_info *di)
+{
+ int err = 0;
+
+ if (!syscall(API_DISPLAY_GET_INFO, &err, (uint32_t)type, (uint32_t)di))
+ return API_ESYSC;
+
+ return err;
+}
+
+int ub_display_draw_bitmap(ulong bitmap, int x, int y)
+{
+ int err = 0;
+
+ if (!syscall(API_DISPLAY_DRAW_BITMAP, &err, bitmap, x, y))
+ return API_ESYSC;
+
+ return err;
+}
+
+void ub_display_clear(void)
+{
+ syscall(API_DISPLAY_CLEAR, NULL);
+}
diff --git a/examples/api/glue.h b/examples/api/glue.h
index 6bf47d0..e43f7d9 100644
--- a/examples/api/glue.h
+++ b/examples/api/glue.h
@@ -77,4 +77,9 @@ int ub_dev_send(int handle, void *buf, int len);
int ub_dev_recv(int handle, void *buf, int len, int *rlen);
struct device_info * ub_dev_get(int);
+/* display */
+int ub_display_get_info(int type, struct display_info *di);
+int ub_display_draw_bitmap(ulong bitmap, int x, int y);
+void ub_display_clear(void);
+
#endif /* _API_GLUE_H_ */