Nut/OS  4.10.3
API Reference
vs10xx.h File Reference

Network interface controller definitions. More...

#include <cfg/audio.h>
#include <sys/types.h>
#include <stdint.h>
Include dependency graph for vs10xx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VS_HEADERINFO

Defines

#define VS_OPCODE_READ   3
#define VS_OPCODE_WRITE   2
#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

Functions

int VsPlayerInit (void)
 Initialize the VS10XX hardware interface.
int VsPlayerReset (uint16_t mode)
 Software reset the decoder.
int VsPlayerSetMode (uint16_t 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.
ureg_t VsPlayerInterrupts (ureg_t enable)
 Enable or disable player interrupts.
ureg_t VsPlayerThrottle (ureg_t on)
 Throttle decoder activity.
uint16_t VsPlayTime (void)
 Returns play time since last reset.
unsigned int VsGetStatus (void)
 Returns status of the player.
int VsGetHeaderInfo (VS_HEADERINFO *vshi)
 Query MP3 stream header information.
uint16_t VsMemoryTest (void)
 Initialize decoder memory test and return result.
int VsSetVolume (ureg_t left, ureg_t right)
 Set volume.
int VsBeep (uint8_t fsin, uint8_t ms)
 Sine wave beep.

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.

Detailed Description

Network interface controller definitions.

Definition in file vs10xx.h.