FreeCalypso > hg > freecalypso-tools
annotate target-utils/lunadrv/regcmd.c @ 1014:961efadd530a default tip
fc-shell TCH DL handler: add support for CSD modes
TCH DL capture mechanism in FC Tourmaline firmware has been extended
to support CSD modes in addition to speech - add the necessary support
on the host tools side.
It needs to be noted that this mechanism in its present state does NOT
provide the debug utility value that was sought: as we learned only
after the code was implemented, TI's DSP has a misfeature in that the
buffer we are reading (a_dd_0[]) is zeroed out when the IDS block
is enabled, i.e., we are reading all zeros and not the real DL bits
we were after. But since the code has already been written, we are
keeping it - perhaps we can do some tests with IDS disabled.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 26 Nov 2024 06:27:43 +0000 |
parents | 36e6a1ff9608 |
children |
rev | line source |
---|---|
702
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Handy commands for reading and writing LCD controller registers. |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include "types.h" |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include "luna.h" |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 void |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 cmd_rd(argbulk) |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 char *argbulk; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 char *argv[2]; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 u_long regno; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 if (parse_args(argbulk, 1, 1, argv, 0) < 0) |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 return; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 if (parse_hexarg(argv[0], 4, ®no) < 0) { |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 printf("ERROR: regno argument must be a valid 16-bit hex word\n"); |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 return; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 } |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 LCD_IR = regno; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 printf("%04X\n", LCD_DR); |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 } |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 void |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 cmd_wr(argbulk) |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 char *argbulk; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 { |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 char *argv[3]; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 u_long regno, value; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 if (parse_args(argbulk, 2, 2, argv, 0) < 0) |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 return; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 if (parse_hexarg(argv[0], 4, ®no) < 0) { |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 printf("ERROR: regno argument must be a valid 16-bit hex word\n"); |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 return; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 } |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 if (parse_hexarg(argv[1], 4, &value) < 0) { |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 printf("ERROR: value argument must be a valid 16-bit hex word\n"); |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 return; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 } |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 LCD_IR = regno; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 LCD_DR = value; |
36e6a1ff9608
lunadrv: rd and wr commands added
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 } |