#ifndef VS1001_H
#define VS1001_H

#define SDI_DMACHANNEL 0
#define SDI_DATAREG    0x130

#define SCI_XCSPIO    10
#define SCI_SCLKPIO   11
#define SCI_SIPIO     12
#define SCI_SOPIO      9

#define SCI_MODE       0
#define SCI_STATUS     1
#define SCI_CLOCKF     3
#define SCI_DECTIME    4
#define SCI_AUDATA     5
#define SCI_WRAM       6
#define SCI_WRAMADR    7
#define SCI_HDAT0      8
#define SCI_HDAT1      9
#define SCI_A1ADDR    10
#define SCI_VOL       11
#define SCI_A1CTRL0   12
#define SCI_A1CTRL1   13
#define SCI_A1CTRL2   14

#define SM_DIFF        1
#define SM_FFWD        2
#define SM_RESET       4
#define SM_MP12        8
#define SM_PDOWN      16
#define SM_DAC        32
#define SM_DACMONO    64
#define SM_BASS      128
#define SM_DACT      256
#define SM_BYTEORD   512
#define SM_IBMODE   1024
#define SM_IBCLK    2048

#define VS_OK          0
#define VS_TIMEOUT     1

// length of internal fifo in bytes
// (see VS1001 data sheet)
//
#define VS_FIFOSIZE   2048

// Default clock frequency for VS_Reset()
//
//#define VS_CLOCK    24576000L
#define VS_CLOCK      12288000L

extern void  VS_Init();
extern void  VS_Done();
extern void  VS_Reset();

extern void  VS_SCITest();
extern void  VS_SDITest();

extern void  VS_SetClockFreq(long frequency);
extern void  VS_SetVolume   (int left, int right);
extern void  VS_SetBassBoost(bool onoff);
extern int   VS_PlayMpegSync(char *data, unsigned len);
extern void  VS_PlayMpegAsync(char *data, unsigned len,
                              void (*function)(void*),
                              void *param);
extern void  VS_Stop();
extern bool  VS_IsPlaying();

extern void  VS_GetMPEGHeader(unsigned long *header);


#endif


