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

VS1001K device driver.
[Sound device drivers.]

MP3 decoder driver. More...

Functions

int VsPlayerInit (void)
 Initialize the VS1001 hardware interface.

int VsPlayerReset (u_short mode)
 Software reset the decoder.

int VsPlayerSetMode (u_short mode)
 Set mode register of the decoder.

int VsPlayerKick (void)
 Start playback.

int VsPlayerStop (void)
 Stops the playback.

int VsPlayerFlush (void)
 Sets up decoder internal buffer flushing.

u_char VsPlayerInterrupts (u_char enable)
 Enable or disable player interrupts.

u_short VsPlayTime (void)
 Returns play time since last reset.

u_char VsGetStatus (void)
 Returns status of the player.

u_short VsMemoryTest (void)
 Initialize decoder memory test and return result.

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

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


Detailed Description

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 VsGetStatus void   
 

Returns status of the player.

Returns:
Any of the following value:
  • VS_STATUS_STOPPED Player is ready to be started by VsPlayerKick().
  • VS_STATUS_RUNNING Player is running.
  • VS_STATUS_EOF Player has reached the end of a stream after VsPlayerFlush() has been called.
  • VS_STATUS_EMPTY Player runs out of data. VsPlayerKick() will restart it.
Examples:
playmp3/playmp3.c.

u_short VsMemoryTest void   
 

Initialize decoder memory test and return result.

Returns:
Memory test result.
  • Bit 0: Good X ROM
  • Bit 1: Good Y ROM (high)
  • Bit 2: Good Y ROM (low)
  • Bit 3: Good Y RAM
  • Bit 4: Good X RAM
  • Bit 5: Good Instruction RAM (high)
  • Bit 6: Good Instruction RAM (low)

int VsPlayerFlush void   
 

Sets up decoder internal buffer flushing.

This routine will set up internal VS buffer flushing, unless the buffer is already empty and starts the playback if necessary. The internal VS buffer is flushed in VsPlayerFeed() at the end of the stream.

Decoder interrupts will be enabled.

Returns:
0 on success, -1 otherwise.
Examples:
playmp3/playmp3.c.

int VsPlayerInit void   
 

Initialize the VS1001 hardware interface.

Returns:
0 on success, -1 otherwise.
Examples:
playmp3/playmp3.c.

u_char VsPlayerInterrupts u_char    enable
 

Enable or disable player interrupts.

This routine is typically used by applications when dealing with unprotected buffers.

Parameters:
enable Disables interrupts when zero. Otherwise interrupts are enabled.
Returns:
Zero if interrupts were disabled before this call.
Examples:
playmp3/playmp3.c.

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 before calling this routine.

Decoder interrupts will be enabled.

Returns:
0 on success, -1 otherwise.
Examples:
playmp3/playmp3.c.

int VsPlayerReset u_short    mode
 

Software reset the decoder.

This function is typically called after VsPlayerInit() and at the end of each track.

Parameters:
mode Any of the following flags may be or'ed
  • VS_SM_DIFF Left channel inverted.
  • VS_SM_FFWD Fast forward.
  • VS_SM_RESET Force hardware reset.
  • VS_SM_PDOWN Switch to power down mode.
  • VS_SM_BASS Bass/treble enhancer.
Returns:
0 on success, -1 otherwise.
Examples:
playmp3/playmp3.c.

int VsPlayerSetMode u_short    mode
 

Set mode register of the decoder.

Parameters:
mode Any of the following flags may be or'ed
  • VS_SM_DIFF Left channel inverted.
  • VS_SM_FFWD Fast forward.
  • VS_SM_RESET Software reset.
  • VS_SM_PDOWN Switch to power down mode.
  • VS_SM_BASS Bass/treble enhancer.
Returns:
0 on success, -1 otherwise.

int VsPlayerStop void   
 

Stops the playback.

This routine will stops the MP3 playback, VsPlayerKick() may be used to resume the playback.

Returns:
0 on success, -1 otherwise.

u_short VsPlayTime void   
 

Returns play time since last reset.

Returns:
Play time since reset in seconds

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.
Examples:
playmp3/playmp3.c.


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