annotate target-utils/pirexplore/lcd.c @ 74:8138a6380ae3

pirexplore: attempt to play with SPCA552E
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 27 Jul 2013 07:30:08 +0000
parents
children 07b686248ab7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
74
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 #include <sys/types.h>
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 #include "types.h"
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 void
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 cmd_spca(argbulk)
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 char *argbulk;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 {
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 char *argv[3];
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 u_long addr, data;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 if (parse_args(argbulk, 2, 2, argv, 0) < 0)
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 return;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 if (parse_hexarg(argv[0], 4, &addr) < 0) {
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 printf("ERROR: arg1 must be a valid 16-bit hex value\n");
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 return;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 }
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 if (parse_hexarg(argv[1], 4, &data) < 0) {
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 printf("ERROR: arg2 must be a valid 16-bit hex value\n");
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 return;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 }
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 *(volatile u16 *)0x02800000 = addr;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 *(volatile u16 *)0x02800002 = data;
8138a6380ae3 pirexplore: attempt to play with SPCA552E
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 }