summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/doc/html/events_8hcc-source.html
blob: 2b40607254e292324e683d1b1cafeaf4355536fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Graphic Equalizer: C:/Project  Marcel &amp; Oliver/Graphic_Equalizer/src/events.hcc Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="globals.html">Globals</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">C:</a>&nbsp;/&nbsp;<a class="el" href="dir_000001.html">Project  Marcel &amp; Oliver</a>&nbsp;/&nbsp;<a class="el" href="dir_000002.html">Graphic_Equalizer</a>&nbsp;/&nbsp;<a class="el" href="dir_000004.html">src</a></div>
<h1>events.hcc</h1><a href="events_8hcc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 
00022 <span class="comment">/******** System Includes *************/</span>
00023 <span class="preprocessor">#include &lt;stdlib.hch&gt;</span>
00024 
00025 <span class="preprocessor">#include "pal_master.hch"</span>
00026 
00027 <span class="comment">/******** Application Includes ********/</span>
00028 <span class="preprocessor">#include "<a class="code" href="configuration_8hch.html">configuration.hch</a>"</span>
00029 <span class="preprocessor">#include "<a class="code" href="eventhandler__shared_8hch.html">eventhandler_shared.hch</a>"</span>
00030 <span class="preprocessor">#include "<a class="code" href="events_8hch.html">events.hch</a>"</span>
00031 
00032 <span class="preprocessor">#if HAVE_DEBUG</span>
00033 <span class="preprocessor"></span><span class="preprocessor">        #include "debug.hch"</span>
00034 <span class="preprocessor">#endif</span>
00035 <span class="preprocessor"></span>
00036 
<a name="l00049"></a><a class="code" href="events_8hcc.html#a2">00049</a> <span class="keywordtype">void</span> <a class="code" href="events_8hcc.html#a2">load_preset</a>(<span class="keywordtype">unsigned</span> 20 preset_address, <span class="keywordtype">unsigned</span> 4 *equalizer_levels) {
00050         macro expr RAM_BANK0 = PalPL2RAMCT(0);
00051         macro expr AW = PalPL2RAMGetMaxAddressWidthCT();
00052         macro expr DW = PalPL2RAMGetMaxDataWidthCT();
00053 
00054         <span class="keywordtype">unsigned</span> DW data;
00055         <span class="keywordtype">unsigned</span> AW address;
00056         <span class="keywordtype">unsigned</span> 10 equalizer_index;
00057 
00058         address = preset_address;
00059         <span class="comment">/*</span>
00060 <span class="comment">         * PL2Ram needs a clockclycle between the set of an address and read.</span>
00061 <span class="comment">         * Therefore we set it once here.</span>
00062 <span class="comment">         */</span>
00063         PalPL2RAMSetReadAddress(RAM_BANK0, address);
00064 
00065         <span class="comment">/*</span>
00066 <span class="comment">         *</span>
00067 <span class="comment">         */</span>
00068         <span class="keywordflow">for</span> (equalizer_index = 0; equalizer_index != 768; equalizer_index += 2) {
00069                 <span class="comment">/*</span>
00070 <span class="comment">                 * We've allready set the address hence we can allready</span>
00071 <span class="comment">                 * increase it for next use.</span>
00072 <span class="comment">                 */</span>
00073                 address++;
00074 
00075                 PalPL2RAMRead(RAM_BANK0, &amp;data);
00076 <span class="preprocessor">#if HAVE_DEBUG</span>
00077 <span class="preprocessor"></span>                print_hex_value(0 @ data[3:0]);print_string(<span class="stringliteral">" "</span>);print_hex_value(0 @ data[7:4]);print_eol();
00078 <span class="preprocessor">#endif</span>
00079 <span class="preprocessor"></span>                equalizer_levels[equalizer_index] = data[3:0];
00080                 equalizer_levels[equalizer_index +1] = data[7:4];
00081         }
00082 } <span class="comment">/* --- load_preset() --- */</span>
00083 
00084 
00085 
00086 <span class="comment">/*</span>
00087 <span class="comment"> * Equalizer lookuptabes.</span>
00088 <span class="comment"> * TODO: This table is now hardcoded. To ensure full skinability this table</span>
00089 <span class="comment"> * should be dynamically loaded.</span>
00090 <span class="comment"> */</span>
00091 ram <span class="keywordtype">unsigned</span> 4 equalizer_table[640] = {15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0};
00092 ram <span class="keywordtype">unsigned</span> 10 equalizer_table_inv[16] = {446, 444, 440, 436, 432, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 384};
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Nov 29 12:04:47 2004 for Graphic Equalizer by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>