Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

vs1001k.h

Go to the documentation of this file.
00001 #ifndef _VS1001K_H_
00002 #define _VS1001K_H_
00003 /*
00004  * Copyright (C) 2001-2002 by egnite Software GmbH. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. All advertising materials mentioning features or use of this
00016  *    software must display the following acknowledgement:
00017  *
00018  *    This product includes software developed by egnite Software GmbH
00019  *    and its contributors.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00022  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00025  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00028  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00029  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00031  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  * For additional information see http://www.ethernut.de/
00035  *
00036  * -
00037  * Portions Copyright (C) 2001 Jesper Hansen <jesperh@telia.com>.
00038  * 
00039  * This file is part of the yampp system.
00040  * 
00041  * This program is free software; you can redistribute it and/or
00042  * modify it under the terms of the GNU General Public License
00043  * as published by the Free Software Foundation; either version 2
00044  * of the License, or (at your option) any later version.
00045  * 
00046  * This program is distributed in the hope that it will be useful,
00047  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00048  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00049  * GNU General Public License for more details.
00050  *
00051  * You should have received a copy of the GNU General Public License
00052  * along with this program; if not, write to the Free Software Foundation,
00053  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00054  */
00055 
00056 /*
00057  * $Log: vs1001k.h,v $
00058  * Revision 1.2  2003/01/24 12:01:09  przemko
00059  * Obciecie dosowych znakow konca lini
00060  *
00061  * Revision 1.1.1.1  2002/12/07 07:16:52  marwi
00062  *
00063  *
00064  * Revision 1.4  2002/10/29 15:40:49  harald
00065  * *** empty log message ***
00066  *
00067  * Revision 1.3  2002/08/16 17:51:19  harald
00068  * First public release
00069  *
00070  * Revision 1.2  2002/06/26 17:29:15  harald
00071  * First pre-release with 2.4 stack
00072  *
00073  */
00074 
00075 #include <sys/types.h>
00076 
00086 
00087 
00088 /*
00089  * Serial control interface clock input. The first rising clock 
00090  * edge after XCS has gone low marks the first bit to be written
00091  * to the decoder.
00092  */
00093 #define VS_SCK_PORT     PORTB
00094 #define VS_SCK_DDR      DDRB
00095 #define VS_SCK_BIT      0
00096 
00097 #define VS_SS_PORT      PORTB
00098 #define VS_SS_DDR       DDRB
00099 #define VS_SS_BIT       1
00100 
00101 /*
00102  * Serial control interface data input. The decoder samples this 
00103  * input on the rising edge of SCK if XCS is low.
00104  */
00105 #define VS_SI_PORT      PORTB
00106 #define VS_SI_DDR       DDRB
00107 #define VS_SI_BIT       2
00108 
00109 /*
00110  * Serial control interface data output. If data is transfered
00111  * to the decoder, bits are shifted out on the falling SCK edge.
00112  * If data is transfered from the decoder, SO is at a high 
00113  * impedance state.
00114  */
00115 #define VS_SO_DDR       DDRB
00116 #define VS_SO_BIT       3
00117 
00118 /*
00119  * Active low chip select input. A high level forces the serial 
00120  * interface into standby mode, ending the current operation. 
00121  * A high level also forces serial output (SO) to high impedance 
00122  * state.
00123  */
00124 #define VS_XCS_PORT     PORTB
00125 #define VS_XCS_DDR      DDRB
00126 #define VS_XCS_BIT      4
00127 
00128 /*
00129  * Serial data interface bit sync. The first DCLK sampling edge, 
00130  * during which BSYNC is high, marks the first bit of a data byte.
00131  */
00132 #define VS_BSYNC_PORT   PORTB
00133 #define VS_BSYNC_DDR    DDRB
00134 #define VS_BSYNC_BIT    5
00135 
00136 #define VS_RESET_PORT   PORTB
00137 #define VS_RESET_DDR    DDRB
00138 #define VS_RESET_BIT    7
00139 
00140 /*
00141  * Data request.
00142  */
00143 #define VS_DREQ_PORT    PORTE
00144 #define VS_DREQ_PIN     PINE
00145 #define VS_DREQ_DDR     DDRE
00146 #define VS_DREQ_BIT     6
00147 
00148 /*
00149  * Instruction opcodes.
00150  */
00151 #define VS_OPCODE_READ  3
00152 #define VS_OPCODE_WRITE 2
00153 
00154 /*
00155  * Decoder registers.
00156  */
00157 #define VS_MODE_REG         0
00158 #define VS_STATUS_REG       1
00159 #define VS_CLOCKF_REG       3
00160 #define VS_DECODE_TIME_REG  4
00161 #define VS_AUDATA_REG       5
00162 #define VS_WRAM_REG         6
00163 #define VS_WRAMADDR_REG     7
00164 #define VS_HDAT0_REG        8
00165 #define VS_HDAT1_REG        9
00166 #define VS_A1ADDR_REG      10
00167 #define VS_VOL_REG         11
00168 #define VS_A1CTRL_REG      13
00169 
00170 
00171 /*
00172  * Mode register bits.
00173  */
00174 #define VS_SM_DIFF      0x0001
00175 #define VS_SM_FFWD      0x0002
00176 #define VS_SM_RESET     0x0004
00177 #define VS_SM_MP12      0x0008
00178 #define VS_SM_PDOWN     0x0010
00179 #define VS_SM_DAC       0x0020
00180 #define VS_SM_DACMONO   0x0040
00181 #define VS_SM_BASS      0x0080
00182 #define VS_SM_DACT      0x0100
00183 #define VS_SM_BYTEORD   0x0200
00184 #define VS_SM_IBMODE    0x0400
00185 #define VS_SM_IBCLK     0x0800
00186 
00187 
00188 /*
00189  * Clock register bits.
00190  */
00191 #define VS_CF_DOUBLER   0x8000
00192 
00193 
00194 extern int VsPlayerInit(void);
00195 extern int VsPlayerReset(u_short mode);
00196 extern int VsPlayerKick(void);
00197 
00198 extern u_char *VsBufferInit(u_short size);
00199 extern u_char *VsBufferReset(void);
00200 extern u_char *VsBufferRequest(u_short *sizep);
00201 extern u_char *VsBufferAcknowledge(u_short nbytes);
00202 
00203 extern int VsSetVolume(u_char left, u_char right);
00204 extern int VsBeep(u_char fsin, u_char ms);
00205 
00206 
00210 #endif

Generated on Thu Jan 30 22:30:53 2003 for EduNet by doxygen1.2.18