00001 00007 #ifndef VS10XX_H 00008 #define VS10XX_H 00009 00010 #include "board.h" 00011 00013 #define VS_WRITE_COMMAND 0x02 00014 00016 #define VS_READ_COMMAND 0x03 00017 00018 00019 #define SPI_MODE 0x0 00020 #define SPI_STATUS 0x1 00021 #define SPI_BASS 0x2 00022 #define SPI_CLOCKF 0x3 00023 #define SPI_DECODE_TIME 0x4 00024 #define SPI_AUDATA 0x5 00025 #define SPI_WRAM 0x6 00026 #define SPI_WRAMADDR 0x7 00027 #define SPI_HDAT0 0x8 00028 #define SPI_HDAT1 0x9 00029 #define SPI_AIADDR 0xa 00030 #define SPI_VOL 0xb 00031 #define SPI_AICTRL0 0xc 00032 #define SPI_AICTRL1 0xd 00033 #define SPI_AICTRL2 0xe 00034 #define SPI_AICTRL3 0xf 00036 #define SM_DIFF 0x01 00037 #define SM_JUMP 0x02 00038 #define SM_RESET 0x04 00039 #define SM_OUTOFWAV 0x08 00040 #define SM_PDOWN 0x10 00041 #define SM_TESTS 0x20 00042 #define SM_STREAM 0x40 00043 #define SM_PLUSV 0x80 00044 #define SM_DACT 0x100 00045 #define SM_SDIORD 0x200 00046 #define SM_SDISHARE 0x400 00047 #define SM_SDINEW 0x800 00048 #define SM_ADPCM 0x1000 00049 #define SM_ADPCM_HP 0x2000 00053 extern xdata unsigned char playingState; 00054 00055 00056 00058 void VsSineTest(); 00059 00060 void Mp3Reset(); 00061 00063 void Mp3SoftReset(); 00064 00065 00066 00068 #define Mp3WriteRegister(addressbyte,highbyte,lowbyte){ \ 00069 Mp3SelectControl(); \ 00070 SPIPutCharWithoutWaiting(VS_WRITE_COMMAND); \ 00071 SPIPutChar((addressbyte)); \ 00072 SPIPutChar((highbyte)); \ 00073 SPIPutChar((lowbyte)); \ 00074 SPIWait(); \ 00075 Mp3DeselectControl();} 00076 00078 #define Mp3SetVolume(leftchannel,rightchannel){\ 00079 Mp3WriteRegister(11,(leftchannel),(rightchannel));} 00080 00082 unsigned int Mp3ReadRegister (unsigned char addressbyte); 00083 00085 void SendZerosToVS10xx(); 00086 00088 unsigned char PlayDiskSectors (unsigned int nSectorsToPlay); 00089 00090 00092 void AvailableProcessorTime(); 00093 00094 00095 00096 #endif