etrax should not select foxboard-utils by default as the package is now in the packag...
[15.05/openwrt.git] / package / fonera-mp3 / src / lib / mp3_common.h
1 /*
2 * FOXMP3 
3 * Copyright (c) 2006 acmesystems.it - john@acmesystems.it
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
18 *
19 * Feedback, Bugs...  info@acmesystems.it
20 *
21 */ 
22
23 #define MP3_CHUNK_SIZE                  4096    
24 #define MP3_BUFFERING                   0
25 #define MP3_PLAYING                     1
26 #define MP3_BUFFER_FINISHED             2
27 #define MP3_PLAY_FINISHED               3
28
29 typedef struct _MP3_DATA{
30         unsigned char mp3[MP3_CHUNK_SIZE];
31         unsigned char state;
32 } MP3_DATA;
33
34
35 #define IOCTL_MP3_INIT                  0x01
36 #define IOCTL_MP3_RESET                 0x02
37 #define IOCTL_MP3_SETVOLUME             0x03
38 #define IOCTL_MP3_GETVOLUME             0x04
39 typedef struct _AUDIO_DATA{
40         unsigned int bitrate;
41         unsigned int sample_rate;
42         unsigned char is_stereo;
43 }AUDIO_DATA;
44 #define IOCTL_MP3_GETAUDIODATA          0x05
45
46 #define IOCTL_MP3_CLEARBUFFER           0x06
47 #define IOCTL_MP3_PLAY                  0x07
48 typedef struct _MP3_BEEP{
49         unsigned char   freq;
50         unsigned int    ms;
51 } MP3_BEEP;
52 #define IOCTL_MP3_BEEP                  0x08                    
53 #define IOCTL_MP3_END_REACHED           0x09
54
55 #define IOCTL_MP3_BASS                  0x10
56
57 #define CRYSTAL12288                    0x9800
58 #define CRYSTAL24576                    0x0
59
60 #define MP3_OK                          0
61 #define MP3_ERROR                       1
62 #define MP3_END                         2
63
64 void mp3_reset(void);
65 unsigned char mp3_send_data_to_buffer(MP3_DATA mp3_data);
66 unsigned char mp3_buffer_finished(void);
67 unsigned char mp3_play(void);
68 void mp3_stop(void);
69 int mp3_init(void);
70 void mp3_bass(unsigned char t_freq, unsigned char t_amp, 
71                 unsigned char b_freq, unsigned char b_amp);
72 void mp3_set_volume(unsigned char left, unsigned char right);