Specifications
u_char on[] = { 0x53, 0xEF, 0x6E, 56 };
u_char off[] = { 0x45, 0x78, 0x69, 0x74 };
on[3] += (fsin & 7) * 9;
for(i = 0; i < sizeof(on); i++)
VsSend(on[i]);
for(i = 0; i < 8; i++)
VsSend(0);
NutDelay(ms);
for(i = 0; i < sizeof(off); i++)
VsSend(off[i]);
for(i = 0; i < 8; i++)
VsSend(0);
}
/*
* Initialize the VS1001 hardware interface.
*/
void VsInit(u_char wDelay)
{
writeDelay = wDelay;
/*
* Toggle MP3 hardware reset output.
*/
cbi(VS_RESET_PORT, VS_RESET_BIT);
sbi(VS_RESET_DDR, VS_RESET_BIT);
NutDelay(3);
sbi(VS_RESET_PORT, VS_RESET_BIT);
/*
* Set BSYNC output low.
*/
cbi(VS_BSYNC_PORT, VS_BSYNC_BIT);
sbi(VS_BSYNC_DDR, VS_BSYNC_BIT);
/*
* Set MP3 chip select output low.
*/
sbi(VS_XCS_PORT, VS_XCS_BIT);
sbi(VS_XCS_DDR, VS_XCS_BIT);
/*
* Set DREQ input with pullup.
*/
cbi(VS_DREQ_DDR, VS_DREQ_BIT);
sbi(VS_DREQ_PORT, VS_DREQ_BIT);
// setup serial data interface :
// clock = f/4
// select clock phase positive going in middle of data
// master mode
// enable SPI
// setup serial data I/O pins
/*
* Set MOSI output.
* FIXME: hi/lo?
99










