summaryrefslogtreecommitdiff
path: root/examples/api/demo.c
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-10-20 23:04:22 +0000
committerAnatolij Gustschin <agust@denx.de>2011-11-15 23:58:27 +0100
commita2a5729fc1247bb45d794e9d731c0b03bf58096f (patch)
treea89f1b03ebc2e3987b8068aefe0f0a30c1c357c4 /examples/api/demo.c
parentd3983ee85325d2be730830ebcf82585ee7cd2ecb (diff)
downloadu-boot-imx-a2a5729fc1247bb45d794e9d731c0b03bf58096f.zip
u-boot-imx-a2a5729fc1247bb45d794e9d731c0b03bf58096f.tar.gz
u-boot-imx-a2a5729fc1247bb45d794e9d731c0b03bf58096f.tar.bz2
api: export LCD device to external apps
This patch exports LCD info-query and bitmap-rendering functions to external apps. This patch is tested on a Seaboard. Because the LCD driver is not yet upstreamed, the test was done in a local downstream repo. Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'examples/api/demo.c')
-rw-r--r--examples/api/demo.c31
1 files changed, 31 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();