FreeCalypso > hg > fc-tourmaline
annotate src/g23m-aci/aci/ati_fcmisc.c @ 304:58c7961bd0b0 default tip
TCH tap: extend DL sniffing feature to support CSD modes
Our debug feature for TCH DL sniffing reads the content of the DSP's
a_dd_0 buffer (or a_dd_1 for TCH/H subchannel 1) at appropriate times
and forwards captured bits to the host. This feature was originally
implemented for TCH/FS, TCH/EFS and TCH/HS - now extend it to cover
TCH/F data modes too.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 25 Nov 2024 23:33:27 +0000 |
parents | d32ac4edb634 |
children |
rev | line source |
---|---|
1
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module implements miscellaneous FreeCalypso-added AT commands. |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #ifndef ATI_FCMISC_C |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #define ATI_FCMISC_C |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include "aci_all.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <ctype.h> |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <string.h> |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include "aci_cmh.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "ati_cmd.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "aci_cmd.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "aci_io.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "aci_cmd.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "l4_tim.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "line_edit.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "aci_lst.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #include "pcm.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "audio.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "aci.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "rx.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "pwr.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #include "l4_tim.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #ifdef GPRS |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #ifdef DTI |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "dti.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "dti_conn_mng.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "dti_cntrl_mng.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #endif /* DTI */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #include "gaci.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #include "gaci_cmh.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "gaci_cmd.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #endif /* GPRS */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include "aci_mem.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #include "aci_prs.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include "ati_int.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #ifndef _SIMULATION_ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #include "ffs/ffs.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #endif |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #ifdef FF_ATI_BAT |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #include "typedefs.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #include "gdd.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #include "bat.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #include "ati_bat.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #endif /*FF_ATI_BAT*/ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 |
301
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
59 #include "cl_user_spver.h" |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
60 |
296
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
61 #include "rv/rv_defined_swe.h" /* for RVM_BUZM_SWE and RVM_VIBR_SWE */ |
1
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #include "main/sys_types.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #include "fc-target.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #include "armio.h" |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 |
299
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
66 #ifdef RVM_BUZM_SWE |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
67 #include "buzm/buzm_api.h" |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
68 #endif |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
69 |
296
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
70 #ifdef RVM_VIBR_SWE |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
71 #include "vibr/vibr_api.h" |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
72 #endif |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
73 |
1
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 extern SYS_UWORD8 SIM_allow_speed_enhancement; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 /* AT@SPENH - enable or disable SIM speed enhancement */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId ) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 int state, nonvol = 0; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 TRACE_FUNCTION("atAtSPENH()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 cl = parse(cl, "Dd", &state, &nonvol); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 if (!cl) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 if (state != 0 && state != 1) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 SIM_allow_speed_enhancement = state; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 if (!nonvol) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 ffs_mkdir("/etc"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 if (ffs_file_write("/etc/SIM_spenh", &SIM_allow_speed_enhancement, 1, |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 FFS_O_CREATE | FFS_O_TRUNC) == EFFS_OK) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 else |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 GLOBAL T_ATI_RSLT queatAtSPENH (char *cl, UBYTE srcId) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 char *me="@SPENH: "; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 TRACE_FUNCTION("queatAtSPENH()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 sprintf(g_sa, "%s%u", me, SIM_allow_speed_enhancement); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 |
302
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
110 /* AT%MSCAP - tinker with /pcm/MSCAP settings */ |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
111 GLOBAL T_ATI_RSLT atPercentMSCAP (char *cl, UBYTE srcId) |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
112 { |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
113 EF_MSCAP mscap; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
114 |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
115 TRACE_FUNCTION("atPercentMSCAP()"); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
116 |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
117 mscap.featLst1 = 0; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
118 mscap.featLst2 = 0; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
119 mscap.featLst3 = 0; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
120 cl = parse(cl, "XXXxxx", &mscap.chnMode, &mscap.datCap1, &mscap.datCap2, |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
121 &mscap.featLst1, &mscap.featLst2, &mscap.featLst3); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
122 if (!cl) |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
123 return (ATI_FAIL); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
124 pcm_WriteFile((UBYTE *) EF_MSCAP_ID, SIZE_EF_MSCAP, (UBYTE *) &mscap); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
125 return (ATI_CMPL); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
126 } |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
127 |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
128 GLOBAL T_ATI_RSLT queatPercentMSCAP (char *cl, UBYTE srcId) |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
129 { |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
130 EF_MSCAP mscap; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
131 UBYTE version; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
132 char *me="%MSCAP: "; |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
133 |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
134 pcm_ReadFile((UBYTE *) EF_MSCAP_ID, SIZE_EF_MSCAP, (UBYTE *) &mscap, |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
135 &version); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
136 sprintf(g_sa, "%s%02X,%02X,%02X,%02X,%02X,%02X", me, mscap.chnMode, |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
137 mscap.datCap1, mscap.datCap2, mscap.featLst1, mscap.featLst2, |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
138 mscap.featLst3); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
139 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
140 return (ATI_CMPL); |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
141 } |
d32ac4edb634
aci: add AT%MSCAP command for tinkering with /pcm/MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
301
diff
changeset
|
142 |
301
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
143 /* AT%SPVER - set custom speech version list */ |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
144 GLOBAL T_ATI_RSLT atPercentSPVER (char *cl, UBYTE srcId) |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
145 { |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
146 UBYTE spver_set; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
147 UBYTE spver_list[5] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
148 UBYTE spver_rc; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
149 |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
150 TRACE_FUNCTION("atPercentSPVER()"); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
151 |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
152 cl = parse(cl, "Xxxxxx", &spver_set, &spver_list[0], &spver_list[1], |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
153 &spver_list[2], &spver_list[3], &spver_list[4]); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
154 if (!cl) |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
155 return (ATI_FAIL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
156 switch (spver_set) { |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
157 case CL_USER_SPVER_IS_NOT_SET: |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
158 cl_user_spver_reset(); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
159 return (ATI_CMPL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
160 case CL_USER_SPVER_IS_SET: |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
161 spver_rc = cl_user_spver_set(spver_list); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
162 if (spver_rc == CL_USER_SPVER_SET_OK) |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
163 return (ATI_CMPL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
164 else |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
165 return (ATI_FAIL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
166 default: |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
167 return (ATI_FAIL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
168 } |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
169 } |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
170 |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
171 GLOBAL T_ATI_RSLT queatPercentSPVER (char *cl, UBYTE srcId) |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
172 { |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
173 UBYTE spver_set, rad_chan_req; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
174 UBYTE spver_list[5], n, sv; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
175 char *me="%SPVER: "; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
176 char add[5]; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
177 |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
178 spver_set = cl_user_spver_get(spver_list, &rad_chan_req); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
179 sprintf(g_sa, "%s%u", me, spver_set); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
180 if (spver_set == CL_USER_SPVER_IS_SET) { |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
181 for (n = 0; n < 5; n++) { |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
182 sv = spver_list[n]; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
183 if (sv == NOT_PRESENT_8BIT) |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
184 break; |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
185 sprintf(add, ",%u", sv); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
186 strcat(g_sa, add); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
187 } |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
188 } |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
189 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
190 return (ATI_CMPL); |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
191 } |
4bb5772a05a3
AT%SPVER: new command for setting custom speech version lists
Mychaela Falconia <falcon@freecalypso.org>
parents:
299
diff
changeset
|
192 |
1
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 #ifdef TARGET_HAS_LPG |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 /* AT@LPG - program LPG output */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 GLOBAL T_ATI_RSLT atAtLPG ( char *cl, UBYTE srcId ) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 unsigned glob, period = 0, ontime = 0; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 TRACE_FUNCTION("atAtLPG()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 cl = parse(cl, "Ddd", &glob, &period, &ontime); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 if (!cl) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 if (glob > 3 || period > 7 || ontime > 7) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 *(volatile SYS_UWORD8 *)0xFFFE7801 = 0x01; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 *(volatile SYS_UWORD8 *)0xFFFE7800 = |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 (glob << 6) | (ontime << 3) | period; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 GLOBAL T_ATI_RSLT queatAtLPG (char *cl, UBYTE srcId) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 char *me="@LPG: "; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 SYS_UWORD8 regval; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 unsigned glob, period, ontime; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 TRACE_FUNCTION("queatAtLPG()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 regval = *(volatile SYS_UWORD8 *)0xFFFE7800; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 glob = (regval >> 6) & 3; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 ontime = (regval >> 3) & 7; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 period = regval & 7; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 sprintf(g_sa, "%s%u,%u,%u", me, glob, period, ontime); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 #endif /* TARGET_HAS_LPG */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 #ifdef TARGET_HAS_PWL |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 /* AT@PWL - program PWL output */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 GLOBAL T_ATI_RSLT atAtPWL ( char *cl, UBYTE srcId ) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 unsigned level; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 TRACE_FUNCTION("atAtPWL()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 cl = parse(cl, "D", &level); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 if (!cl) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 if (level > 255) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 *(volatile SYS_UWORD8 *)0xFFFE8000 = level; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 *(volatile SYS_UWORD8 *)0xFFFE8001 = 0x01; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 GLOBAL T_ATI_RSLT queatAtPWL (char *cl, UBYTE srcId) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 char *me="@PWL: "; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 SYS_UWORD8 regval; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 TRACE_FUNCTION("queatAtPWL()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 regval = *(volatile SYS_UWORD8 *)0xFFFE8000; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 sprintf(g_sa, "%s%u", me, regval); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 #endif /* TARGET_HAS_PWL */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 /* AT+IOR - read GPIO pin */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 GLOBAL T_ATI_RSLT atPlusIOR (char *cl, UBYTE srcId) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 char *me="+IOR: "; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 unsigned ionum; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 int state; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 TRACE_FUNCTION("atPlusIOR()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 cl = parse(cl, "D", &ionum); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 if (!cl) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 if (ionum > 13) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 state = AI_ReadBit(ionum); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 sprintf(g_sa, "%s%u,%d", me, ionum, state); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 /* AT+IOW - set GPIO pin */ |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 GLOBAL T_ATI_RSLT atPlusIOW (char *cl, UBYTE srcId) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 { |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 unsigned ionum; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 int state; |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 TRACE_FUNCTION("atPlusIOW()"); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 cl = parse(cl, "DD", &ionum, &state); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 if (!cl) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 if (ionum > 13) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 return (ATI_FAIL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 if (state) |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 AI_SetBit(ionum); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 else |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 AI_ResetBit(ionum); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 return (ATI_CMPL); |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 } |
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 |
299
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
302 #ifdef RVM_BUZM_SWE |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
303 /* AT@BUZ - play a buzzer melody */ |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
304 GLOBAL T_ATI_RSLT atAtBUZ ( char *cl, UBYTE srcId ) |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
305 { |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
306 char melody_name[20]; |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
307 int play_volume = BUZM_VOLUME_MAX; |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
308 int loopback = 0; |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
309 |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
310 cl = parse(cl, "Sdd", (LONG)(sizeof(melody_name)), melody_name, |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
311 &play_volume, &loopback); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
312 if (!cl || !melody_name[0]) |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
313 return (ATI_FAIL); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
314 if (buzm_play_melody(melody_name, play_volume, loopback) == RV_OK) |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
315 return (ATI_CMPL); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
316 else |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
317 return (ATI_FAIL); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
318 } |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
319 |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
320 /* AT@BZSTOP - stop melody started with AT@BUZ */ |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
321 GLOBAL T_ATI_RSLT atAtBZSTOP ( char *cl, UBYTE srcId ) |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
322 { |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
323 if (buzm_stop_melody() == RV_OK) |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
324 return (ATI_CMPL); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
325 else |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
326 return (ATI_FAIL); |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
327 } |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
328 #endif |
91e61d00a6b5
add AT@BUZ and AT@BZSTOP commands for testing BUZM SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
296
diff
changeset
|
329 |
296
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
330 #ifdef RVM_VIBR_SWE |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
331 /* AT@VIBR - run the vibrator by way of VIBR SWE */ |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
332 GLOBAL T_ATI_RSLT atAtVIBR ( char *cl, UBYTE srcId ) |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
333 { |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
334 int num_pulses = VIBR_INFINITE; |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
335 int vibr_level = VIBR_LEVEL_MAX; |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
336 |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
337 cl = parse(cl, "dd", &num_pulses, &vibr_level); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
338 if (!cl) |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
339 return (ATI_FAIL); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
340 if (vibr_pulse_train_start(num_pulses, vibr_level) == RV_OK) |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
341 return (ATI_CMPL); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
342 else |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
343 return (ATI_FAIL); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
344 } |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
345 |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
346 /* AT@VIBS - stop vibration that was started with AT@VIBR */ |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
347 GLOBAL T_ATI_RSLT atAtVIBS ( char *cl, UBYTE srcId ) |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
348 { |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
349 if (vibr_pulse_train_stop() == RV_OK) |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
350 return (ATI_CMPL); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
351 else |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
352 return (ATI_FAIL); |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
353 } |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
354 #endif |
a927f030a4e0
add AT@VIBR and AT@VIBS commands for testing VIBR SWE
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
355 |
1
fa8dc04885d8
src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 #endif /* ATI_FCMISC_C */ |