annotate target-utils/c139explore/lcd.c @ 1030:194967e11b2b

fc-shell: tch record and tch play reworked for libgsm-compatible file format
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 31 May 2016 18:39:06 +0000
parents 9e1be763b626
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
950
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 #include <sys/types.h>
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 #include "types.h"
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 static void
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 send_cmd_data(cmdbyte, databyte)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 send_via_uwire(cmdbyte);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 send_via_uwire(databyte | 0x100);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 void
951
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
12 cmd_lcdcmd(argbulk)
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
13 char *argbulk;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
14 {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
15 char *argv[3];
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
16 u_long cmd, data;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
17
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
18 if (parse_args(argbulk, 2, 2, argv, 0) < 0)
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
19 return;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
20 if (parse_hexarg(argv[0], 2, &cmd) < 0) {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
21 printf("ERROR: arg1 must be a valid 8-bit hex value\n");
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
22 return;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
23 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
24 if (parse_hexarg(argv[1], 2, &data) < 0) {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
25 printf("ERROR: arg2 must be a valid 8-bit hex value\n");
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
26 return;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
27 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
28 send_cmd_data(cmd, data);
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
29 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
30
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
31 static void
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
32 send_pixel_value(pix)
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
33 {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
34 send_via_uwire((pix >> 8) | 0x100);
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
35 send_via_uwire((pix & 0xFF) | 0x100);
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
36 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
37
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
38 void
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
39 cmd_lcdpix(argbulk)
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
40 char *argbulk;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
41 {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
42 char *argv[2];
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
43 u_long pixval;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
44
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
45 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
46 return;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
47 if (parse_hexarg(argv[0], 4, &pixval) < 0) {
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
48 printf("ERROR: arg1 must be a valid 16-bit hex value\n");
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
49 return;
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
50 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
51 send_pixel_value(pixval);
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
52 }
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
53
eb27543ce18e c139explore: elementary operation commands lcdcmd and lcdpix added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 950
diff changeset
54 void
950
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 cmd_lcdinit()
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 /* from OsmocomBB */
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 send_cmd_data(0x3F, 0x01);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 send_cmd_data(0x20, 0x03);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 send_cmd_data(0x31, 0x03);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 static void
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 set_lcd_addr_region(xstart, xend, ystart, yend)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 send_cmd_data(0x10, xstart);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 send_cmd_data(0x11, ystart);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 send_cmd_data(0x12, xend);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 send_cmd_data(0x13, yend);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 send_cmd_data(0x14, xstart);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 send_cmd_data(0x15, ystart);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 void
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 cmd_lcdfill(argbulk)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 char *argbulk;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 int argc;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 char *argv[6];
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 u_long pixval;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 int xstart, xend, ystart, yend;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 int npix;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 if (parse_args(argbulk, 1, 5, argv, &argc) < 0)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 return;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 if (parse_hexarg(argv[0], 4, &pixval) < 0) {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 printf("ERROR: arg1 must be a valid 16-bit hex value\n");
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 return;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 switch (argc) {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 case 1:
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 xstart = ystart = 0;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 xend = 95;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 yend = 63;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 break;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 case 5:
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 xstart = atoi(argv[1]);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 if (xstart < 0 || xstart > 95) {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 range_err: printf("ERROR: coordinate arg out of range\n");
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 return;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 xend = atoi(argv[2]);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103 if (xend < 0 || xend > 95)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 goto range_err;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 ystart = atoi(argv[3]);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 if (ystart < 0 || ystart > 63)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 goto range_err;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 yend = atoi(argv[4]);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 if (yend < 0 || yend > 63)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 goto range_err;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 if (xend < xstart || yend < ystart) {
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 printf("ERROR: negative range\n");
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 return;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 break;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 default:
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 printf("ERROR: wrong number of arguments\n");
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 return;
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 }
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 set_lcd_addr_region(xstart, xend, ystart, yend);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 npix = (xend + 1 - xstart) * (yend + 1 - ystart);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 while (npix--)
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 send_pixel_value(pixval);
cd34e0d534b9 c139explore: LCD output implemented, does not work
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 }
953
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
125
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
126 void
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
127 cmd_hbars()
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
128 {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
129 int i, j, k, p;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
130
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
131 /*
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
132 * The result of this command should be 8 horizontal bars
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
133 * in the natural RGB order.
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
134 */
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
135 set_lcd_addr_region(16, 79, 0, 63);
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
136 for (i = 0; i < 8; i++) {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
137 for (j = 0; j < 8; j++) {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
138 p = 0;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
139 if (i & 4)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
140 p |= 0xF800;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
141 if (i & 2)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
142 p |= 0x07E0;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
143 if (i & 1)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
144 p |= 0x001F;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
145 for (k = 0; k < 64; k++)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
146 send_pixel_value(p);
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
147 }
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
148 }
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
149 }
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
150
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
151 void
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
152 cmd_vbars()
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
153 {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
154 int i, j, k, p;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
155
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
156 /*
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
157 * The result of this command should be 8 vertical bars
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
158 * in the natural RGB order.
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
159 */
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
160 set_lcd_addr_region(16, 79, 0, 63);
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
161 for (i = 0; i < 64; i++) {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
162 for (j = 0; j < 8; j++) {
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
163 p = 0;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
164 if (j & 4)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
165 p |= 0xF800;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
166 if (j & 2)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
167 p |= 0x07E0;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
168 if (j & 1)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
169 p |= 0x001F;
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
170 for (k = 0; k < 8; k++)
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
171 send_pixel_value(p);
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
172 }
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
173 }
9e1be763b626 c139explore: hbars and vbars tests implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 951
diff changeset
174 }