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

VS1001K device driver.
[Sound device drivers.]

Experimental MP3 decoder driver. More...

Defines

#define VS_SCK_PORT   PORTB
#define VS_SCK_DDR   DDRB
#define VS_SCK_BIT   0
#define VS_SS_PORT   PORTB
#define VS_SS_DDR   DDRB
#define VS_SS_BIT   1
#define VS_SI_PORT   PORTB
#define VS_SI_DDR   DDRB
#define VS_SI_BIT   2
#define VS_SO_DDR   DDRB
#define VS_SO_BIT   3
#define VS_XCS_PORT   PORTB
#define VS_XCS_DDR   DDRB
#define VS_XCS_BIT   4
#define VS_BSYNC_PORT   PORTB
#define VS_BSYNC_DDR   DDRB
#define VS_BSYNC_BIT   5
#define VS_RESET_PORT   PORTB
#define VS_RESET_DDR   DDRB
#define VS_RESET_BIT   7
#define VS_DREQ_PORT   PORTE
#define VS_DREQ_PIN   PINE
#define VS_DREQ_DDR   DDRE
#define VS_DREQ_BIT   6
#define VS_OPCODE_READ   3
#define VS_OPCODE_WRITE   2
#define VS_MODE_REG   0
#define VS_STATUS_REG   1
#define VS_CLOCKF_REG   3
#define VS_DECODE_TIME_REG   4
#define VS_AUDATA_REG   5
#define VS_WRAM_REG   6
#define VS_WRAMADDR_REG   7
#define VS_HDAT0_REG   8
#define VS_HDAT1_REG   9
#define VS_A1ADDR_REG   10
#define VS_VOL_REG   11
#define VS_A1CTRL_REG   13
#define VS_SM_DIFF   0x0001
#define VS_SM_FFWD   0x0002
#define VS_SM_RESET   0x0004
#define VS_SM_MP12   0x0008
#define VS_SM_PDOWN   0x0010
#define VS_SM_DAC   0x0020
#define VS_SM_DACMONO   0x0040
#define VS_SM_BASS   0x0080
#define VS_SM_DACT   0x0100
#define VS_SM_BYTEORD   0x0200
#define VS_SM_IBMODE   0x0400
#define VS_SM_IBCLK   0x0800
#define VS_CF_DOUBLER   0x8000

Functions

int VsPlayerInit (void)
 Initialize the VS1001 hardware interface.

int VsPlayerReset (u_short mode)
 Software reset the decoder.

int VsPlayerKick (void)
 Start playback.

u_charVsBufferInit (u_short size)
 Initialize the MP3 data buffer.

u_charVsBufferReset (void)
 Reset all MP3 data buffer pointers.

u_charVsBufferRequest (u_short *sizep)
 Request MP3 data buffer space.

u_charVsBufferAcknowledge (u_short nbytes)
 Acknowledge filled buffer space.

int VsSetVolume (u_char left, u_char right)
 Set volume.

int VsBeep (u_char fsin, u_char ms)
 Sine wave beep.


Detailed Description

Experimental MP3 decoder driver.


Function Documentation

int VsBeep u_char    fsin,
u_char    ms
 

Sine wave beep.

Parameters:
fsin  Frequency.
ms  Duration.
Returns:
0 on success, -1 otherwise.

u_char* VsBufferAcknowledge u_short    nbytes
 

Acknowledge filled buffer space.

Returns:
Pointer to the next write position.

u_char* VsBufferInit u_short    size
 

Initialize the MP3 data buffer.

Parameters:
size  Number of bytes to allocate for the data buffer. Should be at least 4k. If this parameter is 0, all available memory minus 8k are allocated.
Returns:
Pointer to the data buffer or null on failures.

u_char* VsBufferRequest u_short   sizep
 

Request MP3 data buffer space.

Returns:
Pointer to the next write position.

u_char* VsBufferReset void   
 

Reset all MP3 data buffer pointers.

Returns:
Pointer to the data buffer.

int VsPlayerInit void   
 

Initialize the VS1001 hardware interface.

Returns:
0 on success, -1 otherwise.

int VsPlayerKick void   
 

Start playback.

This routine will send the first MP3 data bytes to the decoder, until it is completely filled. The data buffer should have been filled with at least about 6k of data before calling this routine.

If called for the first time, the routine will register the interrupt handler.

If the decoder is activated, 1024 nulls are sent first.

Returns:
0 on success, -1 otherwise.

int VsPlayerReset u_short    mode
 

Software reset the decoder.

This function is typically called after VsPlayerInit().

Parameters:
mode  Any of the following flags may be or'ed
  • VS_SM_DIFF
  • VS_SM_FFWD
  • VS_SM_RESET
  • VS_SM_MP12
  • VS_SM_PDOWN
  • VS_SM_DAC
  • VS_SM_DACMONO
  • VS_SM_BASS
  • VS_SM_DACT
  • VS_SM_BYTEORD
  • VS_SM_IBMODE
  • VS_SM_IBCLK
Returns:
0 on success, -1 otherwise.

int VsSetVolume u_char    left,
u_char    right
 

Set volume.

Parameters:
left  Left channel volume.
right  Right channel volume.
Returns:
0 on success, -1 otherwise.


© 2000-2002 by egnite Software GmbH - visit http://www.ethernut.de/