summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer_v1.0/include
diff options
context:
space:
mode:
Diffstat (limited to 'Graphic_Equalizer_v1.0/include')
-rw-r--r--Graphic_Equalizer_v1.0/include/audio.hch114
-rw-r--r--Graphic_Equalizer_v1.0/include/configuration.hch53
-rw-r--r--Graphic_Equalizer_v1.0/include/display.hch62
-rw-r--r--Graphic_Equalizer_v1.0/include/display_shared.hch98
-rw-r--r--Graphic_Equalizer_v1.0/include/eventhandler.hch39
-rw-r--r--Graphic_Equalizer_v1.0/include/eventhandler_shared.hch90
-rw-r--r--Graphic_Equalizer_v1.0/include/events.hch44
-rw-r--r--Graphic_Equalizer_v1.0/include/fft.hch35
-rw-r--r--Graphic_Equalizer_v1.0/include/mouse.hch41
-rw-r--r--Graphic_Equalizer_v1.0/include/mouse_shared.hch57
-rw-r--r--Graphic_Equalizer_v1.0/include/runfft.hch1
-rw-r--r--Graphic_Equalizer_v1.0/include/smartmedia.hch91
-rw-r--r--Graphic_Equalizer_v1.0/include/smartmedia_shared.hch121
-rw-r--r--Graphic_Equalizer_v1.0/include/weights_256.hch264
14 files changed, 1110 insertions, 0 deletions
diff --git a/Graphic_Equalizer_v1.0/include/audio.hch b/Graphic_Equalizer_v1.0/include/audio.hch
new file mode 100644
index 0000000..051e8fb
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/audio.hch
@@ -0,0 +1,114 @@
+/*! \file audio.hch
+ *
+ * \section generic Graphic Equalizer API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041021
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041021: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _AUDIO_HCH
+#define _AUDIO_HCH 1
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ mpram {
+ ram unsigned 7 write[256];
+ rom unsigned 7 read[256];
+ } fft_info with { block = "BlockRAM"};
+ mpram {
+ ram unsigned 6 write[256];
+ rom unsigned 6 read[256];
+ } ifft_info with { block = "BlockRAM"};
+ unsigned 4 *equalizer_levels_ptr;
+ unsigned 1 display_log;
+ unsigned 1 saturated;
+ unsigned 1 play;
+} audiodata_t;
+
+
+
+
+/*
+ * States used to indicate wether audio data is sampled.
+ */
+#define AUDIO_NOT_READY 0
+#define AUDIO_READY 1
+
+
+
+/*
+ * Line in or Mic in aliases for audio_init.
+ */
+#define LINE_IN RC200AudioInLineIn
+#define MIC_IN RC200AudioInMicrophone
+
+
+
+/*
+ * Sample Rate Aliases for audio_init.
+ */
+#define SR_8000 RC200AudioSampleRate8000
+#define SR_11025 RC200AudioSampleRate11025
+#define SR_16000 RC200AudioSampleRate16000
+#define SR_22050 RC200AudioSampleRate22050
+#define SR_44100 RC200AudioSampleRate44100
+#define SR_48000 RC200AudioSampleRate48000
+
+
+
+/*
+ * Convert microseconds to something our code understands.
+ */
+#define AUDIOINITDELAY ((PAL_ACTUAL_CLOCK_RATE *AUDIOINIT_MICROSECONDS) /1000000)
+
+
+
+/*
+ * Initialize the Audio sub-system. Input_source chooses between line in or mic
+ * in. The sample_rate is set to supplied rate. Defines for these are mentioned
+ * above.
+ */
+macro proc audio_init(input_source, sample_rate, AUDIOIN, AUDIOOUT);
+
+
+
+/*
+ * Main audiodriver loop. This procedure never returns! It handles audio io and
+ * updates the shared memory. It needs Audio I/O handlers passed.
+ */
+macro proc audio_main(audiodata, AUDIOIN, AUDIOOUT);
+
+/*
+ * FFT loop, waits until 64 samples are read from the audio input
+ * before switching the pointers needed for double and quadruple buffering, after that
+ * sequentially calling the perform_fft, equalize_audio and perform_ifft functions.
+ */
+macro proc run_fft(audiodata);
+
+/*
+ * Sampling loop, fills the audio input and output arrays and uses FFT_Sync
+ * to notify the FFT when 64 samples are read from the audio input.
+ */
+macro proc sample_audio(audiodata, AUDIOOIN);
+
+/*
+ * Audio output loop, writes the modified audio samples to the audio output.
+ */
+macro proc output_audio(AUDIOOUT);
+
+#else
+#error "ERROR file audio.hch multiple times included"
+#endif /* --- _AUDIO_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/configuration.hch b/Graphic_Equalizer_v1.0/include/configuration.hch
new file mode 100644
index 0000000..c9e5c23
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/configuration.hch
@@ -0,0 +1,53 @@
+/*! \file configuration.hch
+ *
+ * \section generic Configuration for the entire application
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041101
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041101: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _CONFIGURATION_HCH
+#define _CONFIGURATION_HCH 1
+
+
+
+/*
+ * We need to wait this long for our audio component to be booted successfully
+ * up.
+ */
+#define AUDIOINIT_MICROSECONDS 1000000
+
+/*
+ * Bit width of the actual delay. We need this because we can not determin bit
+ * width pre-compile time.
+ */
+#define AUDIOINITWIDTH 32
+
+
+
+/*
+ * FFT specific. TODO: Clean Up!
+ */
+#define USE_RUNFFT 1
+#define HARDWARE_MULTIPLY 1
+#define PERFORM_FFT_CALCULATION 1
+#define USE_UNSIGNED_AUDIO 0
+
+
+
+#else
+#error "ERROR file configuration.hch multiple times included"
+
+#endif /* --- _CONFIGURATION_HCH --- */
+
+
diff --git a/Graphic_Equalizer_v1.0/include/display.hch b/Graphic_Equalizer_v1.0/include/display.hch
new file mode 100644
index 0000000..ee994eb
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/display.hch
@@ -0,0 +1,62 @@
+/*! \file display.hch
+ *
+ * \section generic Display API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: \n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _DISPLAY_HCH
+#define _DISPLAY_HCH 1
+
+
+
+/*
+ * Set the color for various items that will be drawn on screen.
+ */
+#define DISABLED (0x808080)
+#define MASK (pixeldata[31:24])
+#define PIXEL (pixeldata <- 24)
+#define PIXEL_VOLUME (0x2d74b5)
+#define PIXEL_INPUTGAIN_NORM (0x2d74b5)
+#define PIXEL_INPUTGAIN_SAT (0xc7541f)
+#define PIXEL_EQUALIZER (0xc7541f)
+#define PIXEL_SPECTRUM ((((skindata->spectrum.bottom -(SCANY <- 11)) <<1) <- 8) @ 0x00 @ (((skindata->spectrum.bottom -(SCANY <- 11)) <<1) <- 8))
+#define PIXEL_WAVEFORM (0x2d74b5)
+
+
+
+#define MASK_AREA_BACKGROUND 0x00
+#define MASK_AREA_ABOUT_TOP 0x01
+#define MASK_AREA_ABOUT_BOTTOM 0x02
+
+
+
+/*
+ * Main display loop. This function never returns! It handles display output.
+ * It needs to respond to certain events set by the events pointer. Also it
+ * informs events what the current mask is. To optain the current mask we need
+ * the X and Y coordinates from our mousedata pointer.
+ */
+inline void display_main(skindata_t *skindata, audiodata_t *audiodata, events_t *events, mousedata_t *mousedata);
+
+
+
+/*
+ * reload equalizer bars into the display memory.
+ */
+void reload_equalizer(events_t *events, unsigned 4 *equalizer_levels_ptr);
+
+#else
+#error "ERROR file display.hch multiple times included"
+#endif /* --- _DISPLAY_HCH --- */
diff --git a/Graphic_Equalizer_v1.0/include/display_shared.hch b/Graphic_Equalizer_v1.0/include/display_shared.hch
new file mode 100644
index 0000000..b9bf0d8
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/display_shared.hch
@@ -0,0 +1,98 @@
+/*! \file display_shared.hch
+ *
+ * \brief Datastructures and defines for usage when interacting with the
+ * display library.
+ *
+ * \section project Project information.
+ * Graphic Equalizer 2\n
+ * \author
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: \n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _DISPLAY_SHARED_HCH
+#define _DISPLAY_SHARED_HCH 1
+
+
+
+/*! \struct skin_info_t
+ * \brief Structure containing the four boundry limits of an area and
+ * maximal two colors per area.
+ */
+typedef struct {
+ unsigned 11 left; /*!< leftmost point registerd in the area */
+ unsigned 11 right; /*!< rightmost point registerd in the area */
+ unsigned 11 bottom; /*!< lowest point registerd in the area */
+ unsigned 11 top; /*!< highest point registerd in the area */
+ unsigned 24 color_primary; /*!< primary color for this area */
+ unsigned 24 color_secondary; /*!< optionally an area can have a second color */
+} skininfo_t;
+
+/*! \struct skindata_t
+ * \brief This struct contains all area- dimensions and color information
+ * for the skin.
+ */
+typedef struct {
+ skininfo_t waveform; /*!< We store all information about the waveform area here. */
+ skininfo_t spectrum; /*!< We store all information about the spectrum analyzer area here. */
+ skininfo_t volume; /*!< We store all information about the volume control area here. */
+ skininfo_t inputgain; /*!< We store all information about the inputgain area here. */
+ skininfo_t equalizer; /*!< We store all information about the equalizerbars here. */
+} skindata_t;
+
+
+
+#define AREA_WAVEFORM 0x01 /*!< Waveform area. */
+#define AREA_VOLUME_YAXIS 0x02 /*!< Volume control on the Y plane. */
+#define AREA_SPECTRUM_ANALYZER 0x03 /*!< Spectrum Analyzer area. */
+
+#define BUTTON_LOG 0x04 /*!< Logarithmic display button. */
+#define BUTTON_DEMO 0x05 /*!< Demo preset button. */
+#define BUTTON_RESET 0x06 /*!< Reset presets button. */
+
+#define BUTTON_PRESET_1 0x07 /*!< Button for switching to preset 1 */
+#define BUTTON_PRESET_2 0x08 /*!< Button for switching to preset 2 */
+#define BUTTON_PRESET_3 0x09 /*!< Button for switching to preset 3 */
+#define BUTTON_PRESET_4 0x0a /*!< Button for switching to preset 4 */
+#define BUTTON_PRESET_5 0x0b /*!< Button for switching to preset 5 */
+#define BUTTON_PRESET_6 0x0c /*!< Button for switching to preset 6 */
+
+#define BUTTON_PRECISE 0x0d /*!< | 'Precise' selection Button */
+#define BUTTON_CONVEX_HALF 0x0f /*!< /\ 'Convex' mode Button */
+#define BUTTON_CONVEX_FULL 0x11 /*!< / - \ 'Convex' mode Button*/
+
+#define BUTTON_HELP 0x12 /*!< Button to display help screen. */
+#define BUTTON_MODE 0x13 /*!< Button to switch to graphical mode. */
+#define BUTTON_OPTION 0x14 /*!< Button to display options screen. */
+#define BUTTON_ABOUT 0x15 /*!< Button to change about screen. */
+
+#define AREA_ABOUT_BOTTOM 0x16 /*!< Bottom half of about area */
+#define AREA_ABOUT_TOP 0x17 /*!< Top half of about area */
+
+#define BUTTON_URL_FONTYS 0x18 /*!< Url for Fontys in about screen */
+#define BUTTON_URL_TASS 0x19 /*!< Url for TASS in about screen */
+#define BUTTON_URL_TRANSFER 0x1a /*!< Url for Transfer in about screen */
+#define BUTTON_URL_CELOXICA 0x1b /*!< Url for Celoxica in about screen */
+#define BUTTON_URL_DETAILS 0x1c /*!< Url for Details in about screen */
+
+#define BUTTON_EXIT_TO_SKIN 0x1d /*!< Button that exits the current screen and returns to the normal 'skin' screen */
+
+#define AREA_INPUTGAIN_YAXIS 0x1e /*!< Input Gain control on the Y plane. */
+#define BUTTON_PLAY 0x1f /*!< Button to play built in audio. */
+
+#define AREA_MASK_END 0x7e /*!< Area in mask determining the end of the area beeing drawn */
+
+#define AREA_EQUALIZER_MIN 0x80 /*!< First bar of the Equalizer Area. */
+#define AREA_EQUALIZER_MAX 0xff /*!< Last bar of the Equalizer Area. */
+
+#else
+#error "ERROR file display_shared.hch multiple times included"
+#endif /* --- _DISPLAY_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/eventhandler.hch b/Graphic_Equalizer_v1.0/include/eventhandler.hch
new file mode 100644
index 0000000..bb48f9f
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/eventhandler.hch
@@ -0,0 +1,39 @@
+/*! \file eventhandler.hch
+ *
+ * \section generic SmartMedia API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _EVENTHANDLER_HCH
+#define _EVENTHANDLER_HCH 1
+
+
+
+#define LOAD_PRESET_RESET 0x000
+#define LOAD_PRESET_DEMO 0x180
+
+
+
+/*
+ * This is the main eventhandler loop. We require pointers to the event struct
+ * to store actions to be performed and a mousedata pointer so that we know on
+ * what mousestate to respond. We never returns!
+ */
+inline void eventhandler_main(audiodata_t *audiodata, events_t *events, mousedata_t *mousedata, skindata_t *skindata);
+
+#else
+#error "ERROR file eventhandler.hch multiple times included"
+#endif /* --- _EVENTHANDLER_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/eventhandler_shared.hch b/Graphic_Equalizer_v1.0/include/eventhandler_shared.hch
new file mode 100644
index 0000000..98c2eea
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/eventhandler_shared.hch
@@ -0,0 +1,90 @@
+/*! \file eventhandler_shared.hch
+ *
+ * \section generic Shared definitions etc. for eveents.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ *****************************************************************************/
+
+#ifndef _EVENTHANDLER_SHARED_HCH
+#define _EVENTHANDLER_SHARED_HCH 1
+
+
+
+/*** Data Types **********************/
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ ram unsigned 11 equalizer_display[128];
+
+ unsigned 11 volume_position;
+ unsigned 11 inputgain_position;
+ unsigned 10 active_preset;
+ unsigned 8 mask;
+ unsigned 5 image, image_about;
+ unsigned 4 mode;
+ unsigned 4 equalizer_mode;
+ unsigned 1 button_demo_state;
+ unsigned 1 button_reset_state;
+ unsigned 1 locked_gain;
+ unsigned 1 locked_display;
+ unsigned 1 saturated;
+} events_t;
+
+
+
+#define IMAGE_ABOUT_TOP_FONTYS 0x00
+#define IMAGE_ABOUT_TOP_TASS 0x01
+#define IMAGE_ABOUT_TOP_TRANSFER 0x02
+#define IMAGE_ABOUT_TOP_CELOXICA 0x03
+#define IMAGE_ABOUT_TOP_DETAILS 0x04
+#define IMAGE_ABOUT_BOTTOM 0x05
+#define IMAGE_SKIN 0x06
+#define IMAGE_HELP 0x07
+#define IMAGE_ABOUT 0x08
+#define IMAGE_GRAPH 0x09
+
+
+#define EQUALIZERMODE_FULL 0x05
+#define EQUALIZERMODE_HALF 0x03
+#define EQUALIZERMODE_PRECISE 0x00
+
+
+
+/*
+ * Volume Control lookuptable.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+extern unsigned 5 volumecontrol_table[46];
+extern unsigned 11 volumecontrol_table_inv[32];
+
+extern unsigned 4 inputgain_table[46];
+extern unsigned 11 inputgain_table_inv[16];
+
+/*
+ * Equalizer lookup tables.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+extern unsigned 4 equalizer_table[640];
+extern unsigned 11 equalizer_table_inv[16];
+
+
+
+#else
+#error "ERROR file eventhandler_shared.hch multiple times included"
+#endif /* --- _EVENTHANDLER_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/events.hch b/Graphic_Equalizer_v1.0/include/events.hch
new file mode 100644
index 0000000..084bf1c
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/events.hch
@@ -0,0 +1,44 @@
+/*! \file events.hch
+ *
+ * \section generic This module contains the various actions and events
+ * that need to be performed.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041710
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041710: O.M. Schinagl\n Initial version
+ *
+ ******************************************************************************/
+
+#ifndef _EVENTS_HCH
+#define _EVENTS_HCH 1
+
+
+
+/*
+ */
+inline unsigned 5 change_volume_from_coordinate(unsigned 11 coordinate, events_t *events, skindata_t *skindata);
+
+
+/*
+ */
+inline unsigned 4 change_inputgain_from_coordinate(unsigned 11 coordinate, events_t *events, skindata_t *skindata);
+
+
+
+/*
+ * This function loads 768 4bits presets into the equalizer_levels array
+ * pointed to by equalizer_levels.
+ */
+void load_preset(unsigned 10 preset, unsigned 4 *equalizer_levels_ptr);
+
+#else
+#error "ERROR file events.hch multiple times included"
+#endif /* --- _EVENTS_HCH --- */
diff --git a/Graphic_Equalizer_v1.0/include/fft.hch b/Graphic_Equalizer_v1.0/include/fft.hch
new file mode 100644
index 0000000..1c5d1cf
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/fft.hch
@@ -0,0 +1,35 @@
+#define NUMBER_OF_COLUMNS 8
+#define NUMBER_OF_POINTS (1<<NUMBER_OF_COLUMNS)
+#define NUMBER_OF_FREQUENCIES (NUMBER_OF_POINTS>>1)
+#define WINDOW_SIZE (NUMBER_OF_POINTS>>2)
+
+#if HARDWARE_MULTIPLY
+/*
+ * This routine obtains the audio data from the audio I/O component and copies this
+ * data to local arrays for calculating purposes, and calls the FFT algorithm.
+*/
+void perform_fft(signed 18 *pcm_audio);
+
+/* This routine calls the ifft algorithm and after completing that it obtains the
+ * modified audio data and copies that to the output arrays of the audio I/O component.
+ * Besides that it also fills the array used by the display routine for displaying the waveform.
+*/
+void perform_ifft(signed 18 *modified_audio ,unsigned 6 *ifft_info);
+#else
+/*
+ * This routine obtains the audio data from the audio I/O component and copies this
+ * data to local arrays for calculating purposes, and calls the FFT algorithm.
+*/
+void perform_fft(signed 16 *pcm_audio);
+
+/* This routine calls the ifft algorithm and after completing that it obtains the
+ * modified audio data and copies that to the output arrays of the audio I/O component.
+ * Besides that it also fills the array used by the display routine for displaying the waveform.
+*/
+void perform_ifft(signed 16 *modified_audio ,unsigned 6 *ifft_info);
+#endif
+
+/* This routine equalizes the frequencies derived by the FFT calculation,
+ * according to the settings of the equalizer bars.
+*/
+void equalize_audio(audiodata_t *audiodata);
diff --git a/Graphic_Equalizer_v1.0/include/mouse.hch b/Graphic_Equalizer_v1.0/include/mouse.hch
new file mode 100644
index 0000000..341c11a
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/mouse.hch
@@ -0,0 +1,41 @@
+/*! \file mouse.hch
+ *
+ * \section generic Mousedriver API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _MOUSEDRIVER_HCH
+#define _MOUSEDRIVER_HCH 1
+
+
+
+/*
+ * Create a define to keep API generic
+ */
+#define MouseRun(ClockRate) RC200TouchScreenRun(ClockRate)
+
+
+
+/*
+ * Main mousedriver loop. This procedure never returns! It handles mouse input,
+ * updates the shared memory and notifies listeners. It requires a pointer to
+ * a mousedata_t struct to store mouse information.
+ */
+inline void mouse_main(mousedata_t *mousedata);
+
+#else
+#error "ERROR file mousedriver.hch multiple times included"
+#endif /* --- _MOUSEDRIVER_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/mouse_shared.hch b/Graphic_Equalizer_v1.0/include/mouse_shared.hch
new file mode 100644
index 0000000..58d22a7
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/mouse_shared.hch
@@ -0,0 +1,57 @@
+/*! \file mouse_shared.hch
+ *
+ * \section generic Shared definitions etc.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: O.M. Schinagl\n Initial version
+ *
+ *****************************************************************************/
+
+#ifndef _MOUSEDRIVER_SHARED_HCH
+#define _MOUSEDRIVER_SHARED_HCH 1
+
+/*** Data Types **********************/
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ unsigned 11 x;
+ unsigned 11 y;
+ unsigned 3 state;
+ unsigned 1 status;
+} mousedata_t;
+
+
+
+/*
+ * States used to identify wether mouse data is updated
+ */
+#define MOUSE_NOT_UPDATED 0
+#define MOUSE_UPDATED 1
+
+
+
+/*
+ * Set of Mouse States defines
+ */
+#define MOUSE_STATE_UP 0
+#define MOUSE_STATE_ON_PRESS 1
+#define MOUSE_STATE_DOWN 2
+#define MOUSE_STATE_ON_RELEASE 3
+
+
+
+#else
+#error "ERROR file mousedriver_shared.hch multiple times included"
+#endif /* --- _MOUSEDRIVER_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/runfft.hch b/Graphic_Equalizer_v1.0/include/runfft.hch
new file mode 100644
index 0000000..d6f6ce0
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/runfft.hch
@@ -0,0 +1 @@
+extern macro proc RunFFT (AudioIn, AudioOut);
diff --git a/Graphic_Equalizer_v1.0/include/smartmedia.hch b/Graphic_Equalizer_v1.0/include/smartmedia.hch
new file mode 100644
index 0000000..d05c6d7
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/smartmedia.hch
@@ -0,0 +1,91 @@
+/*! \file smartmedia.hch
+ *
+ * \section generic SmartMedia API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _SMARTMEDIA_HCH
+#define _SMARTMEDIA_HCH 1
+
+
+
+/*
+ * SmartMedia functioncalls a bit to be set to either Read or Write. This
+ * define should make life easier identifying which one is what.
+ */
+#define READ 0
+#define WRITE 1
+
+
+
+/*
+ * The different stages the smart media loaders knows.
+ */
+#define STAGE_LOAD_DEMO_PRESET 0x00
+#define STAGE_LOAD_RESET_PRESET 0x01
+#define STAGE_LOAD_SKIN 0x02
+#define STAGE_LOAD_HELP 0x03
+#define STAGE_LOAD_GRAPH 0x04
+#define STAGE_LOAD_TOP_FONTYS 0x05
+#define STAGE_LOAD_TOP_TASS 0x06
+#define STAGE_LOAD_TOP_TRANSFER 0x07
+#define STAGE_LOAD_TOP_CELOXICA 0x08
+#define STAGE_LOAD_TOP_DETAILS 0x09
+#define STAGE_LOAD_ABOUT_BOTTOM 0x0a
+
+
+
+/*
+ * Create a define to keep API generic
+ * FIXME: replace with PAL calls when avaiable.
+ */
+#define CPLDRun(ClockRate) RC200CPLDRun(ClockRate)
+#define SmartMediaRun(ClockRate) RC200SmartMediaRun(ClockRate)
+
+
+
+/*
+ * Initializes the smartmedia device.
+ */
+
+inline unsigned 1 smartmedia_init(void);
+
+
+
+/*
+ * This function loads the memory with data from the smartmedia card.
+ */
+unsigned 1 smartmedia_loaddata(skindata_t *skindata);
+
+/*
+ * This function loads samplecount samples from the smartmedia.
+ */
+void load_audio_samples(signed 18 *samples, unsigned 27 blockoffset, unsigned 7 sample_count);
+
+/*
+ * Generic funtion to read at most 255 at a time bytes from the SmartMedia card.
+ * The data is returned as an array in the data pointer.
+ */
+void smartmedia_read_bytes(unsigned 8 *data, unsigned 8 bytecount);
+
+/*
+ * Generic funtion to set the read address at the SmartMedia card
+ */
+void smartmedia_set_read_address(unsigned 20 address);
+
+#else
+#error "ERROR file smartmedia.hch multiple times included"
+#endif /* --- _SMARTMEDIA_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/smartmedia_shared.hch b/Graphic_Equalizer_v1.0/include/smartmedia_shared.hch
new file mode 100644
index 0000000..c4100a8
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/smartmedia_shared.hch
@@ -0,0 +1,121 @@
+/*! \file smartmedia_shared.hch
+ *
+ * \section generic SmartMedia Shared
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041202
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041202: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _SMARTMEDIA_SHARED_HCH
+#define _SMARTMEDIA_SHARED_HCH 1
+
+
+
+/*
+ * Here we set the various sizes of the data in use. Do not round this values
+ * in anyway! For example, 640 pixels times 480 pixels is 307200 (4b000) pixels
+ * total.
+ */
+#define SIZE_SKIN 0x004afff /* Number of pixels */
+
+#define SIZE_HELP 0x004afff /* Number of pixels */
+
+#define SIZE_GRAPH 0x004afff /* Number of pixels */
+
+#define SIZE_ABOUT_TOP 0x000e989 /* Number of pixels */
+
+#define SIZE_ABOUT_BOTTOM 0x000890b /* Number of pixels */
+
+#define SIZE_AUDIO 0x108D500 /* Number of bytes */
+
+#define SIZE_PRESET 384 /* Number of elements */
+
+
+
+/*
+ * Here we setup the start and end address for the various components.
+ */
+
+#define SMARTMEDIA_ADDRESS_OFFSET 0x3a4000 /* Block: 233 */
+
+#define SMARTMEDIA_ADDRESS_CONFIGURATION (SMARTMEDIA_ADDRESS_OFFSET +0x000000) /* Block: 133 */
+#define SMARTMEDIA_ADDRESS_PRESET_DEMO_START (SMARTMEDIA_ADDRESS_OFFSET +0x004000) /* Block: 134 */
+#define SMARTMEDIA_ADDRESS_PRESET_RESET_START (SMARTMEDIA_ADDRESS_OFFSET +0x008000) /* Block: 135 */
+
+#define SMARTMEDIA_ADDRESS_SKIN_START (SMARTMEDIA_ADDRESS_OFFSET +0x00c000) /* Block: 136 */
+#define SMARTMEDIA_ADDRESS_HELP_START (SMARTMEDIA_ADDRESS_OFFSET +0x13c000) /* Block: 212 */
+#define SMARTMEDIA_ADDRESS_GRAPH_START (SMARTMEDIA_ADDRESS_OFFSET +0x26c000) /* Block: 288 */
+
+#define SMARTMEDIA_ADDRESS_TOP_FONTYS_START (SMARTMEDIA_ADDRESS_OFFSET +0x2b8000) /* Block: 307 */
+#define SMARTMEDIA_ADDRESS_TOP_TASS_START (SMARTMEDIA_ADDRESS_OFFSET +0x2f8000) /* Block: 323 */
+#define SMARTMEDIA_ADDRESS_TOP_TRANSFER_START (SMARTMEDIA_ADDRESS_OFFSET +0x338000) /* Block: 339 */
+#define SMARTMEDIA_ADDRESS_TOP_CELOXICA_START (SMARTMEDIA_ADDRESS_OFFSET +0x378000) /* Block: 355 */
+#define SMARTMEDIA_ADDRESS_TOP_DETAILS_START (SMARTMEDIA_ADDRESS_OFFSET +0x3b8000) /* Block: 371 */
+
+#define SMARTMEDIA_ADDRESS_BOTTOM_START (SMARTMEDIA_ADDRESS_OFFSET +0x3f8000) /* Block: 387 */
+
+#define SMARTMEDIA_ADDRESS_AUDIO_START (SMARTMEDIA_ADDRESS_OFFSET +0x41C000) /* Block: 396 */
+
+
+#define SMARTMEDIA_ADDRESS_PRESET_DEMO_END (SMARTMEDIA_ADDRESS_PRESET_DEMO_START +(SIZE_PRESET))
+#define SMARTMEDIA_ADDRESS_PRESET_RESET_END (SMARTMEDIA_ADDRESS_PRESET_RESET_START +(SIZE_PRESET))
+
+#define SMARTMEDIA_ADDRESS_SKIN_END (SMARTMEDIA_ADDRESS_SKIN_START +(SIZE_SKIN << 2))
+#define SMARTMEDIA_ADDRESS_HELP_END (SMARTMEDIA_ADDRESS_HELP_START +(SIZE_HELP << 2))
+#define SMARTMEDIA_ADDRESS_GRAPH_END (SMARTMEDIA_ADDRESS_GRAPHMASK_START +SIZE_GRAPH)
+
+#define SMARTMEDIA_ADDRESS_TOP_FONTYS_END (SMARTMEDIA_ADDRESS_TOP_FONTYS_START +(SIZE_ABOUT_TOP << 2))
+#define SMARTMEDIA_ADDRESS_TOP_TASS__END (SMARTMEDIA_ADDRESS_TOP_TASS_START +(SIZE_ABOUT_TOP <<2))
+#define SMARTMEDIA_ADDRESS_TOP_TRANSFER_END (SMARTMEDIA_ADDRESS_TOP_TRANSFER_START +(SIZE_ABOUT_TOP <<2))
+#define SMARTMEDIA_ADDRESS_TOP_CELOXICA_END (SMARTMEDIA_ADDRESS_TOP_CELOXICA_START +(SIZE_ABOUT_TOP <<2))
+#define SMARTMEDIA_ADDRESS_TOP_DETAILS_END (SMARTMEDIA_ADDRESS_TOP_DETAILS_START +(SIZE_ABOUT_TOP <<2))
+
+#define SMARTMEDIA_ADDRESS_BOTTOM_END (SMARTMEDIA_ADDRESS_BOTTOM_START +(SIZE_ABOUT_BOTTOM <<2))
+
+#define SMARTMEDIA_ADDRESS_AUDIO_END (SMARTMEDIA_ADDRESS_AUDIO_START +SIZE_AUDIO)
+
+#define INDEX_PRESET_DEMO_START 0
+#define INDEX_PRESET_DEMO_END (INDEX_PRESET_DEMO_START +SIZE_PRESET)
+
+#define INDEX_PRESET_RESET_START 384
+#define INDEX_PRESET_RESET_END (INDEX_PRESET_RESET_START +SIZE_PRESET)
+
+#define ADDRESS_SKIN_START 0x000000
+#define ADDRESS_SKIN_END (ADDRESS_SKIN_START +SIZE_SKIN)
+
+#define ADDRESS_HELP_START 0x04b000
+#define ADDRESS_HELP_END (ADDRESS_HELP_START +SIZE_HELP)
+
+#define ADDRESS_GRAPH_START 0x096000
+#define ADDRESS_GRAPH_END (ADDRESS_GRAPH_START +(SIZE_GRAPH >>2))
+
+#define ADDRESS_ABOUT_TOP_FONTYS_START 0x0a8c00
+#define ADDRESS_ABOUT_TOP_FONTYS_END (ADDRESS_ABOUT_TOP_FONTYS_START +SIZE_ABOUT_TOP)
+#define ADDRESS_ABOUT_TOP_TASS_START 0x0b758a
+#define ADDRESS_ABOUT_TOP_TASS_END (ADDRESS_ABOUT_TOP_TASS_START +SIZE_ABOUT_TOP)
+#define ADDRESS_ABOUT_TOP_TRANSFER_START 0x0c5f14
+#define ADDRESS_ABOUT_TOP_TRANSFER_END (ADDRESS_ABOUT_TOP_TRANSFER_START +SIZE_ABOUT_TOP)
+#define ADDRESS_ABOUT_TOP_CELOXICA_START 0x0d489e
+#define ADDRESS_ABOUT_TOP_CELOXICA_END (ADDRESS_ABOUT_TOP_CELOXICA_START +SIZE_ABOUT_TOP)
+#define ADDRESS_ABOUT_TOP_DETAILS_START 0x0e3228
+#define ADDRESS_ABOUT_TOP_DETAILS_END (ADDRESS_ABOUT_TOP_DETAILS_START +SIZE_ABOUT_TOP)
+
+//#define ADDRESS_ABOUT_BOTTOM_START 0x0e3228
+#define ADDRESS_ABOUT_BOTTOM_START 0x0f5000
+#define ADDRESS_ABOUT_BOTTOM_END (ADDRESS_ABOUT_BOTTOM_START +SIZE_ABOUT_BOTTOM)
+
+
+#else
+#error "ERROR file smartmedia_shared.hch multiple times included"
+#endif /* --- _SMARTMEDIA_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_v1.0/include/weights_256.hch b/Graphic_Equalizer_v1.0/include/weights_256.hch
new file mode 100644
index 0000000..f2f71ff
--- /dev/null
+++ b/Graphic_Equalizer_v1.0/include/weights_256.hch
@@ -0,0 +1,264 @@
+#define INTBITS 1
+#define FRACBITS 14
+
+rom signed 16 weight_re[128] = {
+ 16384,
+ 16379,
+ 16364,
+ 16340,
+ 16305,
+ 16261,
+ 16207,
+ 16143,
+ 16069,
+ 15986,
+ 15893,
+ 15791,
+ 15679,
+ 15557,
+ 15426,
+ 15286,
+ 15137,
+ 14978,
+ 14811,
+ 14635,
+ 14449,
+ 14256,
+ 14053,
+ 13842,
+ 13623,
+ 13395,
+ 13160,
+ 12916,
+ 12665,
+ 12406,
+ 12140,
+ 11866,
+ 11585,
+ 11297,
+ 11003,
+ 10702,
+ 10394,
+ 10080,
+ 9760,
+ 9434,
+ 9102,
+ 8765,
+ 8423,
+ 8076,
+ 7723,
+ 7366,
+ 7005,
+ 6639,
+ 6270,
+ 5897,
+ 5520,
+ 5139,
+ 4756,
+ 4370,
+ 3981,
+ 3590,
+ 3196,
+ 2801,
+ 2404,
+ 2006,
+ 1606,
+ 1205,
+ 804,
+ 402,
+ 0,
+ -402,
+ -804,
+ -1205,
+ -1606,
+ -2006,
+ -2404,
+ -2801,
+ -3196,
+ -3590,
+ -3981,
+ -4370,
+ -4756,
+ -5139,
+ -5520,
+ -5897,
+ -6270,
+ -6639,
+ -7005,
+ -7366,
+ -7723,
+ -8076,
+ -8423,
+ -8765,
+ -9102,
+ -9434,
+ -9760,
+ -10080,
+ -10394,
+ -10702,
+ -11003,
+ -11297,
+ -11585,
+ -11866,
+ -12140,
+ -12406,
+ -12665,
+ -12916,
+ -13160,
+ -13395,
+ -13623,
+ -13842,
+ -14053,
+ -14256,
+ -14449,
+ -14635,
+ -14811,
+ -14978,
+ -15137,
+ -15286,
+ -15426,
+ -15557,
+ -15679,
+ -15791,
+ -15893,
+ -15986,
+ -16069,
+ -16143,
+ -16207,
+ -16261,
+ -16305,
+ -16340,
+ -16364,
+ -16379
+} with {block = "BlockRAM"};
+
+rom signed 16 weight_im[128] = {
+ 0,
+ -402,
+ -804,
+ -1205,
+ -1606,
+ -2006,
+ -2404,
+ -2801,
+ -3196,
+ -3590,
+ -3981,
+ -4370,
+ -4756,
+ -5139,
+ -5520,
+ -5897,
+ -6270,
+ -6639,
+ -7005,
+ -7366,
+ -7723,
+ -8076,
+ -8423,
+ -8765,
+ -9102,
+ -9434,
+ -9760,
+ -10080,
+ -10394,
+ -10702,
+ -11003,
+ -11297,
+ -11585,
+ -11866,
+ -12140,
+ -12406,
+ -12665,
+ -12916,
+ -13160,
+ -13395,
+ -13623,
+ -13842,
+ -14053,
+ -14256,
+ -14449,
+ -14635,
+ -14811,
+ -14978,
+ -15137,
+ -15286,
+ -15426,
+ -15557,
+ -15679,
+ -15791,
+ -15893,
+ -15986,
+ -16069,
+ -16143,
+ -16207,
+ -16261,
+ -16305,
+ -16340,
+ -16364,
+ -16379,
+ -16384,
+ -16379,
+ -16364,
+ -16340,
+ -16305,
+ -16261,
+ -16207,
+ -16143,
+ -16069,
+ -15986,
+ -15893,
+ -15791,
+ -15679,
+ -15557,
+ -15426,
+ -15286,
+ -15137,
+ -14978,
+ -14811,
+ -14635,
+ -14449,
+ -14256,
+ -14053,
+ -13842,
+ -13623,
+ -13395,
+ -13160,
+ -12916,
+ -12665,
+ -12406,
+ -12140,
+ -11866,
+ -11585,
+ -11297,
+ -11003,
+ -10702,
+ -10394,
+ -10080,
+ -9760,
+ -9434,
+ -9102,
+ -8765,
+ -8423,
+ -8076,
+ -7723,
+ -7366,
+ -7005,
+ -6639,
+ -6270,
+ -5897,
+ -5520,
+ -5139,
+ -4756,
+ -4370,
+ -3981,
+ -3590,
+ -3196,
+ -2801,
+ -2404,
+ -2006,
+ -1606,
+ -1205,
+ -804,
+ -402,
+} with {block = "BlockRAM"};