Nut/OS  4.10.3
API Reference
VLSI VS1001K

MP3 Decoder. More...

Collaboration diagram for VLSI VS1001K:

Data Structures

struct  VS_HEADERINFO

Defines

#define VS_OPCODE_READ   3
#define VS_OPCODE_WRITE   2
#define VS_MODE_REG   0
#define VS_STATUS_REG   1
#define VS_INT_FCTLH_REG   2
#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
#define VS_FLUSH_BYTES   2048
#define VS_STATUS_STOPPED   0
#define VS_STATUS_RUNNING   1
#define VS_STATUS_EOF   2
#define VS_STATUS_EMPTY   4
#define VS_SCK_BIT   0
 VS1001 serial control interface clock input bit.
#define VS_SCK_PORT   PORTB
#define VS_SCK_DDR   DDRB
#define VS_SS_BIT   1
 VS1001 serial data interface clock input bit.
#define VS_SS_PORT   PORTB
#define VS_SS_DDR   DDRB
#define VS_SI_BIT   2
 VS1001 serial control interface data input.
#define VS_SI_PORT   PORTB
#define VS_SI_DDR   DDRB
#define VS_SO_BIT   3
 VS1001 serial control interface data output.
#define VS_SO_PIN   PINB
#define VS_SO_DDR   DDRB
#define VS_XCS_BIT   4
 VS1001 active low chip select input.
#define VS_XCS_PORT   PORTB
#define VS_XCS_DDR   DDRB
#define VS_BSYNC_BIT   5
 VS1001 serial data interface bit sync.
#define VS_BSYNC_PORT   PORTB
#define VS_BSYNC_DDR   DDRB
#define VS_RESET_BIT   7
 VS1001 hardware reset input.
#define VS_RESET_PORT   PORTB
#define VS_RESET_DDR   DDRB
#define VS_SIGNAL   sig_INTERRUPT6
 VS1001 data request interrupt.
#define VS_DREQ_BIT   6
#define VS_DREQ_PORT   PORTE
#define VS_DREQ_PIN   PINE
#define VS_DREQ_DDR   DDRE

Functions

uint8_t VsPlayerInterrupts (uint8_t enable)
 Enable or disable player interrupts.
uint8_tVsBufferInit (uint16_t size)
uint8_tVsBufferReset (void)
uint8_tVsBufferRequest (uint16_t *sizep)
uint8_tVsBufferAcknowledge (uint16_t nbytes)
uint16_t VsBufferAvailable (void)
int VsSetVolume (uint8_t left, uint8_t right)
 Set volume.

Detailed Description

MP3 Decoder.


Define Documentation

#define VS_OPCODE_READ   3

Definition at line 117 of file vs1001k.h.

Referenced by FeederThread(), and VsCodecMode().

#define VS_OPCODE_WRITE   2

Definition at line 118 of file vs1001k.h.

Referenced by FeederThread(), VsCodecMode(), VsDecoderSetBass(), and VsDecoderSetVolume().

#define VS_MODE_REG   0

Definition at line 123 of file vs1001k.h.

Referenced by VsCodecMode(), VsPlayerReset(), and VsPlayerSetMode().

#define VS_STATUS_REG   1

Definition at line 124 of file vs1001k.h.

#define VS_INT_FCTLH_REG   2

Definition at line 125 of file vs1001k.h.

Referenced by VsPlayerInit(), and VsPlayerReset().

#define VS_CLOCKF_REG   3

Definition at line 126 of file vs1001k.h.

Referenced by VsPlayerInit(), and VsPlayerReset().

#define VS_DECODE_TIME_REG   4

Definition at line 127 of file vs1001k.h.

Referenced by VsPlayTime().

#define VS_AUDATA_REG   5

Definition at line 128 of file vs1001k.h.

#define VS_WRAM_REG   6

Definition at line 129 of file vs1001k.h.

#define VS_WRAMADDR_REG   7

Definition at line 130 of file vs1001k.h.

#define VS_HDAT0_REG   8

Definition at line 131 of file vs1001k.h.

Referenced by FeederThread(), VsGetHeaderInfo(), and VsMemoryTest().

#define VS_HDAT1_REG   9

Definition at line 132 of file vs1001k.h.

Referenced by FeederThread(), and VsGetHeaderInfo().

#define VS_A1ADDR_REG   10

Definition at line 133 of file vs1001k.h.

#define VS_VOL_REG   11

Definition at line 134 of file vs1001k.h.

Referenced by FeederThread(), VsDecoderSetVolume(), and VsSetVolume().

#define VS_A1CTRL_REG   13

Definition at line 135 of file vs1001k.h.

#define VS_SM_DIFF   0x0001

Definition at line 141 of file vs1001k.h.

#define VS_SM_FFWD   0x0002

Definition at line 142 of file vs1001k.h.

#define VS_SM_RESET   0x0004

Definition at line 143 of file vs1001k.h.

Referenced by VsCodecBeep(), VsCodecMode(), VsCodecOpen(), and VsPlayerReset().

#define VS_SM_MP12   0x0008

Definition at line 144 of file vs1001k.h.

#define VS_SM_PDOWN   0x0010

Definition at line 145 of file vs1001k.h.

#define VS_SM_DAC   0x0020

Definition at line 146 of file vs1001k.h.

#define VS_SM_DACMONO   0x0040

Definition at line 147 of file vs1001k.h.

#define VS_SM_BASS   0x0080

Definition at line 148 of file vs1001k.h.

#define VS_SM_DACT   0x0100

Definition at line 149 of file vs1001k.h.

#define VS_SM_BYTEORD   0x0200

Definition at line 150 of file vs1001k.h.

#define VS_SM_IBMODE   0x0400

Definition at line 151 of file vs1001k.h.

#define VS_SM_IBCLK   0x0800

Definition at line 152 of file vs1001k.h.

#define VS_CF_DOUBLER   0x8000

Definition at line 158 of file vs1001k.h.

#define VS_FLUSH_BYTES   2048

Definition at line 164 of file vs1001k.h.

#define VS_STATUS_STOPPED   0

Definition at line 170 of file vs1001k.h.

Referenced by VsPlayerReset(), and VsPlayerStop().

#define VS_STATUS_RUNNING   1

Definition at line 171 of file vs1001k.h.

Referenced by VsPlayerFlush(), VsPlayerKick(), and VsPlayerStop().

#define VS_STATUS_EOF   2

Definition at line 172 of file vs1001k.h.

#define VS_STATUS_EMPTY   4

Definition at line 173 of file vs1001k.h.

Referenced by VsPlayerFlush().

#define VS_SCK_BIT   0

VS1001 serial control interface clock input bit.

The first rising clock edge after XCS has gone low marks the first bit to be written to the decoder.

Definition at line 158 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SCK_PORT   PORTB

Port register of VS_SCK_BIT.

Definition at line 162 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SCK_DDR   DDRB

Data direction register of VS_SCK_BIT.

Definition at line 163 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SS_BIT   1

VS1001 serial data interface clock input bit.

Definition at line 181 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SS_PORT   PORTB

Port output register of VS_SS_BIT.

Definition at line 185 of file vs1001k.c.

#define VS_SS_DDR   DDRB

Data direction register of VS_SS_BIT.

Definition at line 186 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SI_BIT   2

VS1001 serial control interface data input.

The decoder samples this input on the rising edge of SCK if XCS is low.

Definition at line 206 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SI_PORT   PORTB

Port output register of VS_SI_BIT.

Definition at line 210 of file vs1001k.c.

#define VS_SI_DDR   DDRB

Data direction register of VS_SI_BIT.

Definition at line 211 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SO_BIT   3

VS1001 serial control interface data output.

If data is transfered from the decoder, bits are shifted out on the falling SCK edge. If data is transfered to the decoder, SO is at a high impedance state.

Definition at line 233 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SO_PIN   PINB

Port input register of VS_SO_BIT.

Definition at line 237 of file vs1001k.c.

#define VS_SO_DDR   DDRB

Data direction register of VS_SO_BIT.

Definition at line 238 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_XCS_BIT   4

VS1001 active low chip select input.

A high level forces the serial interface into standby mode, ending the current operation. A high level also forces serial output (SO) to high impedance state.

Definition at line 260 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_XCS_PORT   PORTB

Port output register of VS_XCS_BIT.

Definition at line 264 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_XCS_DDR   DDRB

Data direction register of VS_XCS_BIT.

Definition at line 265 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_BSYNC_BIT   5

VS1001 serial data interface bit sync.

The first DCLK sampling edge, during which BSYNC is high, marks the first bit of a data byte.

Definition at line 286 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_BSYNC_PORT   PORTB

Port output register of VS_BSYNC_BIT.

Definition at line 290 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_BSYNC_DDR   DDRB

Data direction register of VS_BSYNC_BIT.

Definition at line 291 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_RESET_BIT   7

VS1001 hardware reset input.

Definition at line 309 of file vs1001k.c.

Referenced by VsPlayerInit(), and VsPlayerReset().

#define VS_RESET_PORT   PORTB

Port output register of VS_RESET_BIT.

Definition at line 313 of file vs1001k.c.

Referenced by VsPlayerInit(), and VsPlayerReset().

#define VS_RESET_DDR   DDRB

Data direction register of VS_RESET_BIT.

Definition at line 314 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_SIGNAL   sig_INTERRUPT6

VS1001 data request interrupt.

Definition at line 332 of file vs1001k.c.

Referenced by VsPlayerInit(), and VsPlayerInterrupts().

#define VS_DREQ_BIT   6

Definition at line 333 of file vs1001k.c.

Referenced by VsPlayerInit(), and VsPlayerReset().

#define VS_DREQ_PORT   PORTE

Port output register of VS_DREQ_BIT.

Definition at line 334 of file vs1001k.c.

Referenced by VsPlayerInit().

#define VS_DREQ_PIN   PINE

Port input register of VS_DREQ_BIT.

Definition at line 335 of file vs1001k.c.

Referenced by VsPlayerReset().

#define VS_DREQ_DDR   DDRE

Data direction register of VS_DREQ_BIT.

Definition at line 336 of file vs1001k.c.

Referenced by VsPlayerInit().


Function Documentation

uint8_t VsPlayerInterrupts ( uint8_t  enable)

Enable or disable player interrupts.

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

Parameters:
enableDisables interrupts when zero. Otherwise interrupts are enabled.
Returns:
Zero if interrupts were disabled before this call.

Definition at line 598 of file vs1001k.c.

References NutIrqDisable(), NutIrqEnable(), and VS_SIGNAL.

Referenced by VsBeep(), VsGetHeaderInfo(), VsMemoryTest(), VsPlayerFlush(), VsPlayerInit(), VsPlayerKick(), VsPlayerReset(), VsPlayerSetMode(), VsPlayerStop(), VsPlayTime(), and VsSetVolume().

Here is the call graph for this function:

uint8_t* VsBufferInit ( uint16_t  size)
uint8_t* VsBufferReset ( void  )
uint8_t* VsBufferRequest ( uint16_t sizep)
uint8_t* VsBufferAcknowledge ( uint16_t  nbytes)
uint16_t VsBufferAvailable ( void  )
int VsSetVolume ( uint8_t  left,
uint8_t  right 
)

Set volume.

Parameters:
leftLeft channel volume.
rightRight channel volume.
Returns:
0 on success, -1 otherwise.

Definition at line 1016 of file vs1001k.c.

References VS_VOL_REG, and VsPlayerInterrupts().

Here is the call graph for this function: