XgVsCodec

Collaboration diagram for XgVsCodec:


Data Structures

struct  VS_HEADERINFO

Mode Control Register

#define VS_MODE_REG   0
 Register index.
#define VS_SM_DIFF   0x0001
 Left channel inverted.
#define VS_SM_LAYER12   0x0002
 Allow MPEG Layers I & II.
#define VS_SM_FFWD   0x0002
 VS1001K fast forward.
#define VS_SM_RESET   0x0004
 Soft reset.
#define VS_SM_MP12   0x0008
 VS1001 MPEG Layers I & II enable.
#define VS_SM_OUTOFWAV   0x0008
 Jump out of wave decoding.
#define VS_SM_PDOWN   0x0010
 Power down.
#define VS_SM_DAC   0x0020
 VS1001K unknown function.
#define VS_SM_TESTS   0x0020
 Allow SDI tests.
#define VS_SM_DACMONO   0x0040
 VS1001K unknown function.
#define VS_SM_STREAM   0x0040
 Stream mode.
#define VS_SM_BASS   0x0080
 VS1001K bass/treble enhancer.
#define VS_SM_DACT   0x0100
 Active edge of the data clock.
#define VS_SM_BYTEORD   0x0200
 
#define VS_SM_SDIORD   0x0200
 SDI most significant bit last.
#define VS_SM_IBMODE   0x0400
 VS1001K master mode.
#define VS_SM_SDISHARE   0x0400
 Share SPI chip select.
#define VS_SM_IBCLK   0x0800
 VS1001K master mode clock speed.
#define VS_SM_SDINEW   0x0800
 VS1002 native SDI mode.
#define VS_SM_ADPCM   0x1000
 ADPCM recording.
#define VS_SM_ADPCM_HP   0x2000
 ADPCM high pass filter.
#define VS_SM_LINE_IN   0x4000
 ADPCM recording selector.
#define VS_SM_CLK_RANGE   0x8000
 Input clock range.

Status Register

#define VS_STATUS_REG   1
 Register index.
#define VS_SS_AVOL   0x0003
 Internal analog volume control mask.
#define VS_SS_AVOL_LSB   0
 Internal analog volume control LSB.
#define VS_SS_APDOWM1   0x0004
 Internal analog power down.
#define VS_SS_APDOWN2   0x0008
 Analog driver power down.
#define VS_SS_VER   0x0070
 Version mask.
#define VS_SS_VER_LSB   4
 Version LSB.

VS1001 internal frequency control register.

#define VS_INT_FCTLH_REG   2
 Register index.

Bass/Treble Enhancer Register

#define VS_BASS_REG   2
 Register index.
#define VS_SB_FREQLIMIT   0x000F
 Bass enhancer lower limit frequency mask.
#define VS_SB_FREQLIMIT_LSB   0
 Lower limit frequency LSB.
#define VS_SB_AMPLITUDE   0x00F0
 Bass enhancement mask.
#define VS_SB_AMPLITUDE_LSB   4
 Bass enhancement LSB.
#define VS_ST_FREQLIMIT   0x000F
 Treble control lower limit frequency mask.
#define VS_ST_FREQLIMIT_LSB   0
 Lower limit frequency LSB.
#define VS_ST_AMPLITUDE   0x00F0
 Treble control mask.
#define VS_ST_AMPLITUDE_LSB   4
 Bass enhancement LSB.

Clock Frequency and Multiplier Register

#define VS_CLOCKF_REG   3
 Register index.
#define VS_SC_FREQ   0x7FFF
 Clock frequency mask.
#define VS_SC_X3FREQ   0x07FF
 VS1003/VS1033 clock frequency mask.
#define VS_SC_FREQ_LSB   0
 Clock frequency LSB.
#define VS_SC_ADD   0x1800
 Allowed multiplier addition.
#define VS_SC_MULT   0xE000
 Clock multiplier.
#define VS_CF_DOUBLER   0x8000
 Clock doubler enable.

Decode Time Register

#define VS_DECODE_TIME_REG   4
 Register index.

Miscellaneous Audio Data Register

#define VS_AUDATA_REG   5
 Register index.
#define VS_AD_STEREO   0x0001
 Stereo flag.
#define VS_AD_SRATE   0xFFFE
 Current sampling rate mask.
#define VS_AD_SRATE_LSB   1
 Crystal clock LSB.

RAM Read/Write Register

#define VS_WRAM_REG   6
 Register index.

RAM Read/Write Base Address Register

#define VS_WRAMADDR_REG   7
 Register index.

Stream Header Data Register 0

#define VS_HDAT0_REG   8
 Register index.

VS1103 Input Register 0

#define VS_IN0_REG   8
 Register index.

Stream Header Data Register 1

#define VS_HDAT1_REG   9
 Register index.

VS1103 Input Register 1

#define VS_IN1_REG   9
 Register index.

Application Start Address Register

Used to activate previously uploaded application programs.

#define VS_AIADDR_REG   10
 Register index.

Volume Control Register

#define VS_VOL_REG   11
 Register index.
#define VS_VOL_RIGHT   0x00FF
 Right channel volume mask.
#define VS_VOL_RIGHT_LSB   0
 Right channel volume LSB.
#define VS_VOL_LEFT   0xFF00
 Right channel volume mask.
#define VS_VOL_LEFT_LSB   8
 Right channel volume LSB.

VS1103 Mixer Volume Register

#define VS_MIXERVOL_REG   12
 Register index.
#define VS_SMV_GAIN1   0x001F
#define VS_SMV_GAIN2   0x03E0
#define VS_SMV_GAIN3   0x7C00
#define VS_SMV_ACTIVE   0x8000

VS1103 IMA ADPCM Record Control Register

#define VS_ADPCMRECCTL_REG   13
 Register index.
#define VS_SARC_GAIN4   0x003F
#define VS_SARC_MANUALGAIN   0x0040
#define VS_SARC_OUTOFADPCM   0x0080

Application Control Registers

#define VS_AICTRL0_REG   12
 Application register 0 index.
#define VS_AICTRL_REG   13
 VS1001K application register 0 index.
#define VS_AICTRL1_REG   13
 Application register 1 index.
#define VS_AICTRL2_REG   14
 Application register 2 index.
#define VS_AICTRL3_REG   15
 Application register 3 index.

Defines

#define AUDIO_DAC_MIN_GAIN   -127
#define AUDIO_DAC_MAX_GAIN   0
#define AUDIO_PLAY   0x3001
 Immediately start playing.
#define AUDIO_CANCEL   0x3002
 Immediately stop playing and discard buffer.
#define AUDIO_GET_STATUS   0x3003
#define AUDIO_GET_PLAYGAIN   0x3004
#define AUDIO_SET_PLAYGAIN   0x3005
#define AUDIO_GET_PBSIZE   0x3006
#define AUDIO_SET_PBSIZE   0x3007
#define AUDIO_GET_PBLEVEL   0x3008
#define AUDIO_GET_PBWLOW   0x3009
#define AUDIO_SET_PBWLOW   0x300A
#define AUDIO_GET_PBWHIGH   0x300B
#define AUDIO_SET_PBWHIGH   0x300C
#define AUDIO_BEEP   0x300F
#define AUDIO_GET_DECINFO   0x3010
 Retrieve decoder information.
#define AUDIO_GET_DECCAPS   0x3011
 Retrieve decoder capabilities.
#define AUDIO_GET_DECFMTS   0x3012
 Retrieve decoder formats.
#define AUDIO_SET_DECFMTS   0x3013
 Enable or disable specific decoder formats.
#define AUDIO_GET_CODINFO   0x3014
 Retrieve encoder information.
#define AUDIO_GET_CODCAPS   0x3015
 Retrieve encoder capabilities.
#define AUDIO_GET_CODFMTS   0x3016
 Retrieve encoder formats.
#define AUDIO_SET_CODFMTS   0x3017
 Enable or disable specific encoder formats.
#define AUDIO_GET_MIDINFO   0x3018
 Retrieve midi information.
#define AUDIO_GET_MIDCAPS   0x3019
 Retrieve midi capabilities.
#define VS_OPCODE_READ   3
#define VS_OPCODE_WRITE   2
#define VS_FLUSH_BYTES   2048
#define CODEC_STATUS_IDLE   0
#define CODEC_STATUS_PLAYING   1
#define AUDIO_VS1001K
#define VS10XX_FREQ   12288000UL
 Decoder crystal frequency.
#define VS10XX_HWRST_DURATION   1
 Minimum time in milliseconds to held hardware reset low.
#define VS10XX_HWRST_RECOVER   4
 Milliseconds to wait after hardware reset.
#define VS10XX_SWRST_RECOVER   2
 Milliseconds to wait after software reset.
#define VS10XX_SCI_MODE   0
#define VS10XX_SCI_RATE   (VS10XX_FREQ / 6)
#define VS10XX_SDI_MODE   0
#define VS10XX_SDI_RATE   (VS10XX_FREQ / 6)
#define VSREQ_PLAY   0x00000001
#define VSREQ_CANCEL   0x00000002
#define VSREQ_BEEP   0x00000004

Functions

void FeederThread (void *arg)

Variables

NUTDEVICE devVsCodec
 VS10XX device information structure.
NUTDEVICE devVsCodec
 VS10XX device information structure.


Define Documentation

#define AUDIO_DAC_MIN_GAIN   -127

Definition at line 54 of file vscodec.h.

#define AUDIO_DAC_MAX_GAIN   0

Definition at line 57 of file vscodec.h.

#define AUDIO_PLAY   0x3001

Immediately start playing.

Definition at line 64 of file vscodec.h.

#define AUDIO_CANCEL   0x3002

Immediately stop playing and discard buffer.

Definition at line 66 of file vscodec.h.

#define AUDIO_GET_STATUS   0x3003

Definition at line 67 of file vscodec.h.

#define AUDIO_GET_PLAYGAIN   0x3004

Definition at line 68 of file vscodec.h.

#define AUDIO_SET_PLAYGAIN   0x3005

Definition at line 69 of file vscodec.h.

#define AUDIO_GET_PBSIZE   0x3006

Definition at line 70 of file vscodec.h.

#define AUDIO_SET_PBSIZE   0x3007

Definition at line 71 of file vscodec.h.

#define AUDIO_GET_PBLEVEL   0x3008

Definition at line 72 of file vscodec.h.

#define AUDIO_GET_PBWLOW   0x3009

Definition at line 73 of file vscodec.h.

#define AUDIO_SET_PBWLOW   0x300A

Definition at line 74 of file vscodec.h.

#define AUDIO_GET_PBWHIGH   0x300B

Definition at line 75 of file vscodec.h.

#define AUDIO_SET_PBWHIGH   0x300C

Definition at line 76 of file vscodec.h.

#define AUDIO_BEEP   0x300F

Definition at line 77 of file vscodec.h.

#define AUDIO_GET_DECINFO   0x3010

Retrieve decoder information.

Definition at line 79 of file vscodec.h.

#define AUDIO_GET_DECCAPS   0x3011

Retrieve decoder capabilities.

Definition at line 81 of file vscodec.h.

#define AUDIO_GET_DECFMTS   0x3012

Retrieve decoder formats.

Definition at line 83 of file vscodec.h.

#define AUDIO_SET_DECFMTS   0x3013

Enable or disable specific decoder formats.

Definition at line 85 of file vscodec.h.

#define AUDIO_GET_CODINFO   0x3014

Retrieve encoder information.

Definition at line 87 of file vscodec.h.

#define AUDIO_GET_CODCAPS   0x3015

Retrieve encoder capabilities.

Definition at line 89 of file vscodec.h.

#define AUDIO_GET_CODFMTS   0x3016

Retrieve encoder formats.

Definition at line 91 of file vscodec.h.

#define AUDIO_SET_CODFMTS   0x3017

Enable or disable specific encoder formats.

Definition at line 93 of file vscodec.h.

#define AUDIO_GET_MIDINFO   0x3018

Retrieve midi information.

Definition at line 95 of file vscodec.h.

#define AUDIO_GET_MIDCAPS   0x3019

Retrieve midi capabilities.

Definition at line 97 of file vscodec.h.

#define VS_OPCODE_READ   3

Definition at line 103 of file vscodec.h.

#define VS_OPCODE_WRITE   2

Definition at line 104 of file vscodec.h.

#define VS_MODE_REG   0

Register index.

Definition at line 113 of file vscodec.h.

#define VS_SM_DIFF   0x0001

Left channel inverted.

Definition at line 115 of file vscodec.h.

#define VS_SM_LAYER12   0x0002

Allow MPEG Layers I & II.

Determines whether it is allowed to decode MPEG 1 and 2 Layers I and II in addition to Layer III. If you enable Layer I and Layer II decoding, you are liable for any patent issues that may arise. Joint licensing of MPEG 1.0 / 2.0 Layer III does not cover all patents pertaining to Layers I and II.

Definition at line 124 of file vscodec.h.

#define VS_SM_FFWD   0x0002

VS1001K fast forward.

By setting this bit, the player starts to accept data at a high speed, and just decodes the audio headers silently without playing any audio data. This can be used to fast-forward data with safe landing. Register VS_DECODE_TIME_REG is updated during a fast-forward just as normal.

Note, that this bit is available on the VS1001K only and is used as MPEG Layer I & II enable on other members of the VS10xx family.

Definition at line 136 of file vscodec.h.

#define VS_SM_RESET   0x0004

Soft reset.

Bit is cleared automatically.

Definition at line 141 of file vscodec.h.

#define VS_SM_MP12   0x0008

VS1001 MPEG Layers I & II enable.

May not work reliable due to firmware problems.

If you enable Layer I and Layer II decoding, you are liable for any patent issues that may arise.

Definition at line 149 of file vscodec.h.

#define VS_SM_OUTOFWAV   0x0008

Jump out of wave decoding.

Set this bit to stop WAV, WMA and MIDI file playing before the end of the file has been reached. Continue sending zeros for WAV and more data for MIDI and WMA until this bit is cleared again.

Not available on the VS1001K.

Definition at line 158 of file vscodec.h.

#define VS_SM_PDOWN   0x0010

Power down.

During powerdown, no audio is played and no SDI operations are performed. It is recommended to set VS_VOL_REG to 0xFFFF before setting this bit.

For best power down efficiency, activate hardware reset.

Not available on the VS1011. Although defined, this is not implemented in the VS1001K firmware.

Definition at line 170 of file vscodec.h.

#define VS_SM_DAC   0x0020

VS1001K unknown function.

Definition at line 172 of file vscodec.h.

#define VS_SM_TESTS   0x0020

Allow SDI tests.

Not required for the VS1001K, where tests are enabled by default.

Definition at line 177 of file vscodec.h.

#define VS_SM_DACMONO   0x0040

VS1001K unknown function.

Definition at line 179 of file vscodec.h.

#define VS_SM_STREAM   0x0040

Stream mode.

When stream mode is activated, data should be sent with as even intervals as possible (and preferable with data blocks of less than 512 bytes). The decoder makes every attempt to keep its input buffer half full by changing its playback speed upto 5%. For best quality sound, the average speed error should be within 0.5%, the bitrate should not exceed 160 kbit/s and VBR should not be used.

Not available on the VS1001K.

Definition at line 191 of file vscodec.h.

#define VS_SM_BASS   0x0080

VS1001K bass/treble enhancer.

Definition at line 193 of file vscodec.h.

#define VS_SM_DACT   0x0100

Active edge of the data clock.

If clear data is read at the rising edge, and if set data is read at the falling edge.

Definition at line 199 of file vscodec.h.

#define VS_SM_BYTEORD   0x0200

Definition at line 201 of file vscodec.h.

#define VS_SM_SDIORD   0x0200

SDI most significant bit last.

Bytes are, however, still sent in default order.

Definition at line 206 of file vscodec.h.

#define VS_SM_IBMODE   0x0400

VS1001K master mode.

Untested and not recommended.

Definition at line 211 of file vscodec.h.

#define VS_SM_SDISHARE   0x0400

Share SPI chip select.

Definition at line 213 of file vscodec.h.

#define VS_SM_IBCLK   0x0800

VS1001K master mode clock speed.

Untested and not recommended.

Definition at line 218 of file vscodec.h.

#define VS_SM_SDINEW   0x0800

VS1002 native SDI mode.

Default is 0 on the VS1011E and 1 on the VS1002.

Not available on the VS1001K.

Definition at line 225 of file vscodec.h.

#define VS_SM_ADPCM   0x1000

ADPCM recording.

Available on VS1033.

Definition at line 230 of file vscodec.h.

#define VS_SM_ADPCM_HP   0x2000

ADPCM high pass filter.

If set at the same time as VS_SM_ADPCM and VS_SM_RESET, ADPCM mode will start with a high-pass filter. This may help intelligibility of speech when there is lots of background noise.

Available on VS1033.

Definition at line 239 of file vscodec.h.

#define VS_SM_LINE_IN   0x4000

ADPCM recording selector.

Used to select the input for ADPCM recording. If cleared, microphone input is used. If set to 1, LINEIN is used instead.

Available on VS1033.

Definition at line 247 of file vscodec.h.

#define VS_SM_CLK_RANGE   0x8000

Input clock range.

Activates a clock divider at the XTAL input. Should be set as soon as possible after a chip reset.

Available on VS1033.

Definition at line 255 of file vscodec.h.

#define VS_STATUS_REG   1

Register index.

Definition at line 264 of file vscodec.h.

#define VS_SS_AVOL   0x0003

Internal analog volume control mask.

These bits is meant to be used by the internal firmware only.

Definition at line 273 of file vscodec.h.

#define VS_SS_AVOL_LSB   0

Internal analog volume control LSB.

Definition at line 275 of file vscodec.h.

#define VS_SS_APDOWM1   0x0004

Internal analog power down.

This bit is meant to be used by the internal firmware only.

Definition at line 280 of file vscodec.h.

#define VS_SS_APDOWN2   0x0008

Analog driver power down.

This bit is typically controlled by the internal firmware. However, if the application wants to power down the decoder with a minimum power-off transient, this bit should be set to 1 a few milliseconds before activating reset.

Definition at line 288 of file vscodec.h.

#define VS_SS_VER   0x0070

Version mask.

Definition at line 299 of file vscodec.h.

#define VS_SS_VER_LSB   4

Version LSB.

Definition at line 301 of file vscodec.h.

#define VS_INT_FCTLH_REG   2

Register index.

Use only on older chip revisions?

Definition at line 313 of file vscodec.h.

#define VS_BASS_REG   2

Register index.

For the VS1001K see VS_SM_BASS.

Definition at line 325 of file vscodec.h.

#define VS_SB_FREQLIMIT   0x000F

Bass enhancer lower limit frequency mask.

Specified in 10 Hz steps.

Definition at line 330 of file vscodec.h.

#define VS_SB_FREQLIMIT_LSB   0

Lower limit frequency LSB.

Definition at line 332 of file vscodec.h.

#define VS_SB_AMPLITUDE   0x00F0

Bass enhancement mask.

Bass enhancement in 1 dB steps, or disabled when zero.

Definition at line 337 of file vscodec.h.

#define VS_SB_AMPLITUDE_LSB   4

Bass enhancement LSB.

Definition at line 339 of file vscodec.h.

#define VS_ST_FREQLIMIT   0x000F

Treble control lower limit frequency mask.

Specified in 1 kHz steps.

Definition at line 344 of file vscodec.h.

#define VS_ST_FREQLIMIT_LSB   0

Lower limit frequency LSB.

Definition at line 346 of file vscodec.h.

#define VS_ST_AMPLITUDE   0x00F0

Treble control mask.

Treble control in 1.5 dB steps, or disabled when zero.

Definition at line 351 of file vscodec.h.

#define VS_ST_AMPLITUDE_LSB   4

Bass enhancement LSB.

Definition at line 353 of file vscodec.h.

#define VS_CLOCKF_REG   3

Register index.

Definition at line 362 of file vscodec.h.

#define VS_SC_FREQ   0x7FFF

Clock frequency mask.

Should be set to crystal clock divided by 2000, if the clock is not 24.576 MHz.

Used for the VS1001, VS1011 and VS1002.

Definition at line 370 of file vscodec.h.

#define VS_SC_X3FREQ   0x07FF

VS1003/VS1033 clock frequency mask.

Should be set to crystal clock divided by 4000, if the clock is not 12.288 MHz.

Used for the VS1003 and VS1033.

Definition at line 378 of file vscodec.h.

#define VS_SC_FREQ_LSB   0

Clock frequency LSB.

Definition at line 380 of file vscodec.h.

#define VS_SC_ADD   0x1800

Allowed multiplier addition.

Used for WMA decoding with the VS1003 and VS1033.

Definition at line 385 of file vscodec.h.

#define VS_SC_MULT   0xE000

Clock multiplier.

Used for the VS1003 and VS1033.

Definition at line 390 of file vscodec.h.

#define VS_CF_DOUBLER   0x8000

Clock doubler enable.

Used for the VS1001, VS1011 and VS1002.

Definition at line 395 of file vscodec.h.

#define VS_DECODE_TIME_REG   4

Register index.

This read-only register contains the decode time in full seconds or zero after resetting the decoder.

Definition at line 408 of file vscodec.h.

#define VS_AUDATA_REG   5

Register index.

Usage on the VS1001K differs.

Definition at line 420 of file vscodec.h.

#define VS_AD_STEREO   0x0001

Stereo flag.

Set to 1 for stereo and 0 for mono. Read-only.

Definition at line 425 of file vscodec.h.

#define VS_AD_SRATE   0xFFFE

Current sampling rate mask.

Value is sample rate divided by 2. Writing to this register will change the sample rate on the run.

Definition at line 431 of file vscodec.h.

#define VS_AD_SRATE_LSB   1

Crystal clock LSB.

Definition at line 433 of file vscodec.h.

#define VS_WRAM_REG   6

Register index.

Used to upload application programs and data to instruction and data RAM.

Definition at line 445 of file vscodec.h.

#define VS_WRAMADDR_REG   7

Register index.

Used to upload application programs and data to instruction and data RAM.

Definition at line 457 of file vscodec.h.

#define VS_HDAT0_REG   8

Register index.

Not available in the VS1103.

Definition at line 469 of file vscodec.h.

#define VS_IN0_REG   8

Register index.

Definition at line 478 of file vscodec.h.

#define VS_HDAT1_REG   9

Register index.

Not available in the VS1103.

Definition at line 490 of file vscodec.h.

#define VS_IN1_REG   9

Register index.

Definition at line 499 of file vscodec.h.

#define VS_AIADDR_REG   10

Register index.

Definition at line 510 of file vscodec.h.

#define VS_VOL_REG   11

Register index.

Definition at line 519 of file vscodec.h.

#define VS_VOL_RIGHT   0x00FF

Right channel volume mask.

Attenuation is given in 0.5 dB steps or 255 for mute.

Definition at line 524 of file vscodec.h.

#define VS_VOL_RIGHT_LSB   0

Right channel volume LSB.

Definition at line 526 of file vscodec.h.

#define VS_VOL_LEFT   0xFF00

Right channel volume mask.

Attenuation is given in 0.5 dB steps or 255 for mute.

Definition at line 531 of file vscodec.h.

#define VS_VOL_LEFT_LSB   8

Right channel volume LSB.

Definition at line 533 of file vscodec.h.

#define VS_MIXERVOL_REG   12

Register index.

Definition at line 544 of file vscodec.h.

#define VS_SMV_GAIN1   0x001F

Definition at line 545 of file vscodec.h.

#define VS_SMV_GAIN2   0x03E0

Definition at line 546 of file vscodec.h.

#define VS_SMV_GAIN3   0x7C00

Definition at line 547 of file vscodec.h.

#define VS_SMV_ACTIVE   0x8000

Definition at line 548 of file vscodec.h.

#define VS_ADPCMRECCTL_REG   13

Register index.

Definition at line 559 of file vscodec.h.

#define VS_SARC_GAIN4   0x003F

Definition at line 560 of file vscodec.h.

#define VS_SARC_MANUALGAIN   0x0040

Definition at line 561 of file vscodec.h.

#define VS_SARC_OUTOFADPCM   0x0080

Definition at line 562 of file vscodec.h.

#define VS_AICTRL0_REG   12

Application register 0 index.

Do not use with VS1001. Also used for mixer volume on the VS1103.

Definition at line 574 of file vscodec.h.

#define VS_AICTRL_REG   13

VS1001K application register 0 index.

A second register is available at VS_AICTRL0_REG + 1.

Definition at line 579 of file vscodec.h.

#define VS_AICTRL1_REG   13

Application register 1 index.

Register 0 on the VS1001. Also used for IMA ADPCM record control in the VS1103.

Definition at line 585 of file vscodec.h.

#define VS_AICTRL2_REG   14

Application register 2 index.

Register 1 on the VS1001.

Definition at line 590 of file vscodec.h.

#define VS_AICTRL3_REG   15

Application register 3 index.

Do not use with VS1001.

Definition at line 595 of file vscodec.h.

#define VS_FLUSH_BYTES   2048

Definition at line 602 of file vscodec.h.

#define CODEC_STATUS_IDLE   0

Definition at line 607 of file vscodec.h.

#define CODEC_STATUS_PLAYING   1

Definition at line 608 of file vscodec.h.

#define AUDIO_VS1001K

Definition at line 80 of file vscodec.c.

#define VS10XX_FREQ   12288000UL

Decoder crystal frequency.

Definition at line 85 of file vscodec.c.

#define VS10XX_HWRST_DURATION   1

Minimum time in milliseconds to held hardware reset low.

Definition at line 90 of file vscodec.c.

#define VS10XX_HWRST_RECOVER   4

Milliseconds to wait after hardware reset.

Definition at line 95 of file vscodec.c.

#define VS10XX_SWRST_RECOVER   2

Milliseconds to wait after software reset.

Definition at line 100 of file vscodec.c.

#define VS10XX_SCI_MODE   0

Definition at line 104 of file vscodec.c.

#define VS10XX_SCI_RATE   (VS10XX_FREQ / 6)

Definition at line 108 of file vscodec.c.

#define VS10XX_SDI_MODE   0

Definition at line 112 of file vscodec.c.

#define VS10XX_SDI_RATE   (VS10XX_FREQ / 6)

Definition at line 116 of file vscodec.c.

#define VSREQ_PLAY   0x00000001

Definition at line 250 of file vscodec.c.

Referenced by FeederThread().

#define VSREQ_CANCEL   0x00000002

Definition at line 251 of file vscodec.c.

Referenced by FeederThread().

#define VSREQ_BEEP   0x00000004

Definition at line 252 of file vscodec.c.

Referenced by FeederThread().


Function Documentation

void FeederThread ( void *  arg  ) 

Definition at line 428 of file vscodec.c.

References _BV, CODEC_STATUS_IDLE, CODEC_STATUS_PLAYING, NUT_IRQMODE_RISINGEDGE, NutEventWait(), NutIrqEnable(), NutIrqSetMode(), NutRegisterIrqHandler(), NutSegBufReadLast(), NutSegBufReadRequest(), NutSegBufReset(), NutSegBufUsed(), NutSleep(), outr, SPI_MODFDIS, SPI_MSTR, SPI_NCPHA, SPI_SCBR_LSB, VS_VOL_LEFT_LSB, VS_VOL_REG, VS_VOL_RIGHT_LSB, VsBeep(), VSREQ_BEEP, VSREQ_CANCEL, and VSREQ_PLAY.


Variable Documentation

NUTDEVICE devVsCodec

VS10XX device information structure.

An application must pass a pointer to this structure to NutRegisterDevice() before using this driver.

The device is named audio0.

Definition at line 852 of file vscodec.c.

NUTDEVICE devVsCodec

Initial value:

 {
    0,              
    {'a', 'u', 'd', 'i', 'o', '0', 0, 0, 0},    
    IFTYP_CHAR,     
    0,              
    0,              
    0,              
    &dcb,           
    VsInit,         
    VsIOCtl,        
    NULL,           
    VsWrite,        

    VsWrite_P,      

    VsOpen,         
    VsClose,        
    NULL            
}
VS10XX device information structure.

An application must pass a pointer to this structure to NutRegisterDevice() before using this driver.

The device is named audio0.

Definition at line 852 of file vscodec.c.


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