1 /******************************************************************************
2 * Copyright (c) 2012-16 Texas Instruments Incorporated - http://www.ti.com
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *****************************************************************************
33 *
34 * Filename: file_io.gel
35 * Description: GEL file to load microphone files
36 * EVM. This GEL has functions that handle the Main PLL
37 * initialization.
38 *
39 * More functions may be added as needed at a later date.
40 *
41 * Author: Nitin Sakhuja
42 * Revision History:
43 *
44 * Rev 1.0 - 02/06/2012
45 * - Initial file creation
46 ---------------------------------------------------------------------------*/
48 #define MIC1PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_1.pcm"
49 #define MIC2PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_2.pcm"
50 #define MIC3PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_3.pcm"
51 #define MIC4PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_4.pcm"
52 #define MIC5PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_5.pcm"
53 #define MIC6PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_6.pcm"
54 #define MIC7PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_7.pcm"
55 #define MIC8PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_8.pcm"
57 #define OUTPUTPATH "$(GEL_file_dir)/../../common/t8/fileOutput8.bin"
59 BFLoadMic(buffer,micpath)
60 {
61 GEL_MemoryLoad(buffer,0,160,micpath,32);
62 }
64 BFSaveMic(buffer,num, micpath)
65 {
66 GEL_MemorySave(buffer,0,num,micpath,8,0,32);
67 }
69 menuitem "Microphone Load Functions";
71 dialog BFLoadOneMic(buffer "Buffer Address",micpath "Microphone File Path")
72 {
73 GEL_TextOut("Loading %s\n","",,,,micpath);
74 BFLoadMic(buffer,micpath);
75 }
77 hotmenu BFLoadMic1()
78 {
79 GEL_TextOut("Loading %s\n","",,,,MIC1PATH);
80 BFLoadMic(filBuf0,MIC1PATH);
81 }
83 hotmenu BFLoadMic2()
84 {
85 GEL_TextOut("Loading %s\n","",,,,MIC2PATH);
86 BFLoadMic(filBuf1,MIC2PATH);
87 }
89 hotmenu BFLoadMic3()
90 {
91 GEL_TextOut("Loading %s\n","",,,,MIC3PATH);
92 BFLoadMic(filBuf2,MIC3PATH);
93 }
95 hotmenu BFLoadMic4()
96 {
97 GEL_TextOut("Loading %s\n","",,,,MIC4PATH);
98 BFLoadMic(filBuf3,MIC4PATH);
99 }
101 hotmenu BFLoadMic5()
102 {
103 GEL_TextOut("Loading %s\n","",,,,MIC5PATH);
104 BFLoadMic(filBuf4,MIC5PATH);
105 }
107 hotmenu BFLoadMic6()
108 {
109 GEL_TextOut("Loading %s\n","",,,,MIC6PATH);
110 BFLoadMic(filBuf5,MIC6PATH);
111 }
113 hotmenu BFLoadMic7()
114 {
115 GEL_TextOut("Loading %s\n","",,,,MIC7PATH);
116 BFLoadMic(filBuf6,MIC7PATH);
117 }
119 hotmenu BFLoadMic8()
120 {
121 GEL_TextOut("Loading %s\n","",,,,MIC8PATH);
122 BFLoadMic(filBuf7,MIC8PATH);
123 }
125 hotmenu BFLoadMicAll()
126 {
127 BFLoadMic1();
128 BFLoadMic2();
129 BFLoadMic3();
130 BFLoadMic4();
131 BFLoadMic5();
132 BFLoadMic6();
133 BFLoadMic7();
134 BFLoadMic8();
135 GEL_TextOut("Done Loading Microphones\n");
136 }
138 menuitem "Microphone Save Functions";
140 hotmenu BFSaveOutput()
141 {
142 GEL_TextOut("Saving %s\n","",,,,OUTPUTPATH);
143 BFSaveMic(filOutBuf0,filConfig.outlen/2,OUTPUTPATH);
144 }