annotate libpwon/duart28c.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 7d1df6d831e4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
736
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include <sys/types.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include <sys/ioctl.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include <stdio.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 #include <stdlib.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <string.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <strings.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <unistd.h>
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 extern int target_fd;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 int bootctrl_duart28c_mode;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 static int mctl_arg;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 bootctrl_check_duart28c(bc_name)
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 char *bc_name;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 {
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 if (!strcmp(bc_name, "dtr")) {
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 bootctrl_duart28c_mode = 1;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 mctl_arg = TIOCM_DTR;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 return 1;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 }
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 if (!strcmp(bc_name, "rts")) {
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 bootctrl_duart28c_mode = 1;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 mctl_arg = TIOCM_RTS;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 return 1;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 }
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 return 0;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 }
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 void
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 fork_duart28c_pulse()
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 {
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 int i;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 i = fork();
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 if (i < 0) {
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 perror("fork");
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 exit(1);
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 }
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 if (i)
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 return;
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 ioctl(target_fd, TIOCMBIS, &mctl_arg);
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 usleep(50000);
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 ioctl(target_fd, TIOCMBIC, &mctl_arg);
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 exit(0);
7d1df6d831e4 libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 }