VS1053  1.03.00
Arduino Library for VS10xx shield
Classes | Macros | Enumerations | Functions
vs1053_SdFat.h File Reference
#include "vs1053_SdFat_config.h"
#include "SPI.h"
#include "WProgram.h"
#include <SdFat.h>
Include dependency graph for vs1053_SdFat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vs1053
 Interface Driver to the VS10xx chip on the SPI. More...
 
union  vs1053::sci_bass_m
 A handler for accessing nibbles of the SCI_BASS word. More...
 
union  twobyte
 A handler for accessing bytes of a word. More...
 

Macros

#define TRUE   1
 
#define FALSE   0
 
SCI_Register_Group

VS10xx Serial Control Interface (aka SCI) Registers /

#define SCI_MODE   0x00
 A macro of the SCI MODE register's address (R/W) More...
 
#define SCI_STATUS   0x01
 A macro of the SCI STATUS register's address (R/W) More...
 
#define SCI_BASS   0x02
 A macro of the SCI BASS register's address (R/W) More...
 
#define SCI_CLOCKF   0x03
 A macro of the SCI CLOCKF register's address (R/W) More...
 
#define SCI_DECODE_TIME   0x04
 A macro of the SCI Decode Time register's address (R/W) More...
 
#define SCI_AUDATA   0x05
 A macro of the SCI AUDATA register's address (R/W) More...
 
#define SCI_WRAM   0x06
 A macro of the SCI WRAM register's address (R/W) More...
 
#define SCI_WRAMADDR   0x07
 A macro of the SCI WRAMADDR register (W) More...
 
#define SCI_HDAT0   0x08
 A macro of the SCI HDAT0 register's address (R/W) More...
 
#define SCI_HDAT1   0x09
 A macro of the SCI HDAT1 register's address (R/W) More...
 
#define SCI_AIADDR   0x0A
 A macro of the SCI AIADDR register's address (R/W) More...
 
#define SCI_VOL   0x0B
 A macro of the SCI VOL register's address (R/W) More...
 
#define SCI_AICTRL0   0x0C
 A macro of the SCI AICTRL[x] register's address (R/W) More...
 
#define SCI_AICTRL1   0x0D
 A macro of the SCI AICTRL[x] register's address (R/W) More...
 
#define SCI_AICTRL2   0x0E
 A macro of the SCI AICTRL[x] register's address (R/W) More...
 
#define SCI_AICTRL3   0x0F
 A macro of the SCI AICTRL[x] register (R/W) More...
 
SCI_MODE_Bit_Definitions_Group

VS10xx SCI_MODE bitmasks /

#define SM_DIFF   0x0001
 A macro of the SM_DIFF bit mask of the SCI_MODE register. More...
 
#define SM_LAYER12   0x0002
 A macro of the SM_LAYER12 bit mask of the SCI_MODE register. More...
 
#define SM_RESET   0x0004
 A macro of the SM_DIFF bit mask of the SM_RESET register. More...
 
#define SM_CANCEL   0x0008
 A macro of the SM_DIFF bit mask of the SCI_MODE register. More...
 
#define SM_EARSPEAKER_LO   0x0010
 A macro of the SM_EARSPEAKER_LO bit mask of the SCI_MODE register. More...
 
#define SM_TESTS   0x0020
 A macro of the SM_TESTS bit mask of the SCI_MODE register. More...
 
#define SM_STREAM   0x0040
 A macro of the SM_STREAM bit mask of the SCI_MODE register. More...
 
#define SM_EARSPEAKER_HI   0x0080
 A macro of the SM_EARSPEAKER_HI bit mask of the SCI_MODE register. More...
 
#define SM_DACT   0x0100
 A macro of the SM_DACT bit mask of the SCI_MODE register. More...
 
#define SM_SDIORD   0x0200
 A macro of the SM_SDIORD bit mask of the SCI_MODE register. More...
 
#define SM_SDISHARE   0x0400
 A macro of the SM_SDISHARE bit mask of the SCI_MODE register. More...
 
#define SM_SDINEW   0x0800
 A macro of the SM_SDINEW bit mask of the SCI_MODE register. More...
 
#define SM_ADPCM   0x1000
 A macro of the SM_ADPCM bit mask of the SCI_MODE register. More...
 
#define SM_PAUSE   0x2000
 A macro of the SM_PAUSE bit mask of the SCI_MODE register. More...
 
#define SM_LINE1   0x4000
 A macro of the SM_LINE1 bit mask of the SCI_MODE register. More...
 
#define SM_CLK_RANGE   0x8000
 A macro of the SM_CLK_RANGE bit mask of the SCI_MODE register. More...
 
#define VS_LINE1_MODE
 A macro of the VS_LINE1_MODE to configure either Line level or microphone input. More...
 
SCI_STATUS_Bit_Definitions_Group

VS10xx SCI_STATUS bitmasks /

#define SS_VU_ENABLE   0x0200
 A macro of the SS_VU_ENABLE bit mask of the SCI_STATUS register. More...
 
Extra_Parameter_Group

Extra Parameter in X memory (refer to p.58 of the datasheet) /

#define para_chipID_0   0x1E00
 A macro of the WRAM para_chipID_0 register's address (R/W) More...
 
#define para_chipID_1   0x1E01
 A macro of the WRAM para_chipID_1 register's address (R/W) More...
 
#define para_version   0x1E02
 A macro of the WRAM para_version register's address (R/W) More...
 
#define para_config1   0x1E03
 A macro of the WRAM para_config1 register's address (R/W) More...
 
#define para_playSpeed   0x1E04
 A macro of the WRAM para_playSpeed register's address (R/W) More...
 
#define para_byteRate   0x1E05
 A macro of the WRAM para_byteRate register's address (R/W) More...
 
#define para_endFillByte   0x1E06
 A macro of the WRAM para_endFillByte register's address (R/W) More...
 
#define para_MonoOutput   0x1E09
 A macro of the WRAM para_MonoOutput register's address (R/W) More...
 
#define para_positionMsec_0   0x1E27
 A macro of the WRAM para_positionMsec_0 register's address (R/W) More...
 
#define para_positionMsec_1   0x1E28
 A macro of the WRAM para_positionMsec_1 register's address (R/W) More...
 
#define para_resync   0x1E29
 A macro of the WRAM para_resync register's address (R/W) More...
 
ID3_Tag_Group

ID3 Tag location offsets /

#define TRACK_TITLE   3
 A macro of the offset for the track's Title. More...
 
#define TRACK_ARTIST   33
 A macro of the offset for the track's Artist. More...
 
#define TRACK_ALBUM   63
 A macro of the offset for the track's Album. More...
 

Enumerations

enum  state_m {
  uninitialized, initialized, deactivated, loading,
  ready, playback, playMIDIbeep, paused_playback,
  testing_memory, testing_sinewave
}
 State of the vs1053 device. More...
 
enum  flush_m { post, pre, both, none }
 How to flush the VSdsp's buffer. More...
 

Functions

char * strip_nonalpha_inplace (char *s)
 chomp non printable characters out of string. More...
 
bool isFnMusic (char *)
 is the filename music More...
 

Variables

External_Variable_Group

External Variables accessed by other files. /

SdFat sd
 SdFat sd;. More...
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Definition at line 621 of file vs1053_SdFat.h.

◆ para_byteRate

#define para_byteRate   0x1E05

A macro of the WRAM para_byteRate register's address (R/W)

para_byteRate is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

playSpeed makes it possible to fast forward songs. Decoding of the bitstream is performed, but only each playSpeed frames are played. For example by writing 4 to playSpeed will play the song four times as fast as normal, if you are able to feed the data with that speed. Write 0 or 1 to return to normal speed. SCI_DECODE_TIME will also count faster. All current codecs support the playSpeed configuration.

Definition at line 546 of file vs1053_SdFat.h.

◆ para_chipID_0

#define para_chipID_0   0x1E00

A macro of the WRAM para_chipID_0 register's address (R/W)

para_chipID_0 is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

The fuse-programmed ID is read at startup and copied into the chipID field. If not available the value will be all zeros.

Definition at line 489 of file vs1053_SdFat.h.

◆ para_chipID_1

#define para_chipID_1   0x1E01

A macro of the WRAM para_chipID_1 register's address (R/W)

para_chipID_1 is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

The fuse-programmed ID is read at startup and copied into the chipID field. If not available the value will be all zeros.

Definition at line 500 of file vs1053_SdFat.h.

◆ para_config1

#define para_config1   0x1E03

A macro of the WRAM para_config1 register's address (R/W)

para_config1 is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

The version field can be used to determine the layout of the rest of the structure. The version number is changed when the structure is changed. For VS1053b the structure version is 3.

Definition at line 522 of file vs1053_SdFat.h.

◆ para_endFillByte

#define para_endFillByte   0x1E06

A macro of the WRAM para_endFillByte register's address (R/W)

para_endFillByte is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

The endFillByte indicates what byte value to send as to properly flush the streams playback buffer, before SM_CANCEL is set, as to gracefully end the current stream.

Warning
Omitting the endFillByte requirement may prevent subsequent streams from properly resyncing.

Definition at line 561 of file vs1053_SdFat.h.

◆ para_MonoOutput

#define para_MonoOutput   0x1E09

A macro of the WRAM para_MonoOutput register's address (R/W)

para_MonoOutput is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

Analog output of the VS10XX may be configuured to be either either Stereo(default) or Mono. When correspondingly set to 0 or 1.

Warning
This feature is only available when composite patch 1.7 or higher is loaded into the VSdsp.

Definition at line 575 of file vs1053_SdFat.h.

◆ para_playSpeed

#define para_playSpeed   0x1E04

A macro of the WRAM para_playSpeed register's address (R/W)

para_playSpeed is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

config1 controls MIDI Reverb and AAC’s SBR and PS settings.

Definition at line 532 of file vs1053_SdFat.h.

◆ para_positionMsec_0

#define para_positionMsec_0   0x1E27

A macro of the WRAM para_positionMsec_0 register's address (R/W)

para_positionMsec_0 is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM. Corresponding to the high 16 bit value of positionMsec

positionMsec is a field that gives the current play position in a file in milliseconds, regardless of rewind and fast forward operations. The value is only available in codecs that can determine the play position from the stream itself. Currently WMA and Ogg Vorbis provide this information. If the position is unknown, this field contains -1.

Definition at line 589 of file vs1053_SdFat.h.

◆ para_positionMsec_1

#define para_positionMsec_1   0x1E28

A macro of the WRAM para_positionMsec_1 register's address (R/W)

para_positionMsec_1 is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM. Corresponding to the high 16 bit value of positionMsec

positionMsec is a field that gives the current play position in a file in milliseconds, regardless of rewind and fast forward operations. The value is only available in codecs that can determine the play position from the stream itself. Currently WMA and Ogg Vorbis provide this information. If the position is unknown, this field contains -1.

Definition at line 602 of file vs1053_SdFat.h.

◆ para_resync

#define para_resync   0x1E29

A macro of the WRAM para_resync register's address (R/W)

para_resync is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

The resync field is set to 32767 after a reset to make resynchronization the default action, but it can be cleared after reset to restore the old action. When resync is set, every file decode should always end as described in Chapter 9.5.1.

Definition at line 614 of file vs1053_SdFat.h.

◆ para_version

#define para_version   0x1E02

A macro of the WRAM para_version register's address (R/W)

para_version is a Read/Write Extra Parameter in X memory, accessed indirectly with the SCI_WRAMADDR and SCI_WRAM.

Definition at line 510 of file vs1053_SdFat.h.

◆ SCI_AIADDR

#define SCI_AIADDR   0x0A

A macro of the SCI AIADDR register's address (R/W)

SCI_AIADDR is a Read/Write register indicates the start address of the application code written earlier with SCI_WRAMADDR and SCI_WRAM registers. If no application code is used, this register should not be initialized,or it should be initialized to zero. For more details,

See also
Application Notes for VS10XX.
Note
Reading AIADDR is not recommended. It can cause samplerate to be set to a very low value.

Definition at line 223 of file vs1053_SdFat.h.

◆ SCI_AICTRL0

#define SCI_AICTRL0   0x0C

A macro of the SCI AICTRL[x] register's address (R/W)

SCI_AICTRL[x] registers ( x=[0 .. 3] ) are Read/Write that can be used to access the user's application program. The AICTRL registers are also used with PCM/ADPCM encoding mode.

Definition at line 245 of file vs1053_SdFat.h.

◆ SCI_AICTRL1

#define SCI_AICTRL1   0x0D

A macro of the SCI AICTRL[x] register's address (R/W)

SCI_AICTRL[x] registers ( x=[0 .. 3] ) are Read/Write that can be used to access the user's application program. The AICTRL registers are also used with PCM/ADPCM encoding mode.

Definition at line 253 of file vs1053_SdFat.h.

◆ SCI_AICTRL2

#define SCI_AICTRL2   0x0E

A macro of the SCI AICTRL[x] register's address (R/W)

SCI_AICTRL[x] registers ( x=[0 .. 3] ) are Read/Write that can be used to access the user's application program. The AICTRL registers are also used with PCM/ADPCM encoding mode.

Definition at line 261 of file vs1053_SdFat.h.

◆ SCI_AICTRL3

#define SCI_AICTRL3   0x0F

A macro of the SCI AICTRL[x] register (R/W)

SCI_AICTRL[x] registers ( x=[0 .. 3] ) are Read/Write that can be used to access the user's application program. The AICTRL registers are also used with PCM/ADPCM encoding mode.

Definition at line 269 of file vs1053_SdFat.h.

◆ SCI_AUDATA

#define SCI_AUDATA   0x05

A macro of the SCI AUDATA register's address (R/W)

SCI_AUDATA is a Read/Write register containing information when decoding correct data, the current samplerate and number of channels can be found in bits 15:1 and 0 of SCI_AUDATA, respectively. Bits 15:1 contain the samplerate divided by two, and bit 0 is 0 for mono data and 1 for stereo. Writing to SCI_AUDATA will change the samplerate directly.

Definition at line 166 of file vs1053_SdFat.h.

◆ SCI_BASS

#define SCI_BASS   0x02

A macro of the SCI BASS register's address (R/W)

SCI_BASS is a Read/Write register used to control VSBE. The Bass Enhancer VSBE is a powerful bass boosting DSP algorithm, which tries to take the most out of the users earphones without causing clipping.

Definition at line 134 of file vs1053_SdFat.h.

◆ SCI_CLOCKF

#define SCI_CLOCKF   0x03

A macro of the SCI CLOCKF register's address (R/W)

SCI_CLOCKF is a Read/Write register used to control Clock Multipler.

Definition at line 141 of file vs1053_SdFat.h.

◆ SCI_DECODE_TIME

#define SCI_DECODE_TIME   0x04

A macro of the SCI Decode Time register's address (R/W)

SCI_DECODE_TIME is a Read/Write register containing information when decoding correct data, current decoded time is shown in this register in full seconds. The user may change the value of this register. In that case the new value should be written twice to make absolutely certain that the change is not overwritten by the firmware. A write to SCI_DECODE_TIME also resets the byteRate calculation. SCI_DECODE_TIME is reset at every hardware and software reset. It is no longer cleared when decoding of a file ends to allow the decode time to proceed automatically with looped files and with seamless playback of multiple files.

Definition at line 155 of file vs1053_SdFat.h.

◆ SCI_HDAT0

#define SCI_HDAT0   0x08

A macro of the SCI HDAT0 register's address (R/W)

SCI_HDAT0 register is a Read/Write register which contains header information that is extracted from MP3 stream currently being decoded. After reset both registers are cleared, indicating no data has been found yet.

The register is used in conjuction with HDAT1 to provide various information about the current operating mode of the VSdsp. Where its value may represent different information based on the value of HDAT1. Typically, HDAT0's value indicates something about the various speed or rate.

See also
VS1053 Datasheet.

Definition at line 199 of file vs1053_SdFat.h.

◆ SCI_HDAT1

#define SCI_HDAT1   0x09

A macro of the SCI HDAT1 register's address (R/W)

SCI_HDAT1 register is a Read/Write register which contains header information that is extracted from MP3 stream currently being decoded. After reset both registers are cleared, indicating no data has been found yet.

The register is used in conjuction with HDAT0 to provide various information about the current operating mode of the VSdsp. Where its value typically indicates the encoding format of the current stream of playback.

See also
VS1053 Datasheet.

Definition at line 211 of file vs1053_SdFat.h.

◆ SCI_MODE

#define SCI_MODE   0x00

A macro of the SCI MODE register's address (R/W)

SCI_MODE is a Read/Write register used to control the operation of VS1053b and defaults to 0x0800 (SM_SDINEW set).

See also
SCI_MODE_Bit_Definitions_Group

Definition at line 117 of file vs1053_SdFat.h.

◆ SCI_STATUS

#define SCI_STATUS   0x01

A macro of the SCI STATUS register's address (R/W)

SCI_STATUS is a Read/Write register containing information on the current status of VS1053b. It also controls some low-level things that the user does not usually have to care about.

Definition at line 125 of file vs1053_SdFat.h.

◆ SCI_VOL

#define SCI_VOL   0x0B

A macro of the SCI VOL register's address (R/W)

SCI_VOL is a Read/Write register to control master volume for the player hardware. The most significant byte of the volume register controls the left channel volume, the low part controls the right channel volume. The channel volume sets the attenuation from the maximum volume level in 0.5 dB steps. Thus, maximum volume is 0x0000 and total silence is 0xFEFE.

Note
After hardware reset the volume is set to full volume. Resetting the software does not reset the volume setting.

Setting SCI_VOL to 0xFFFF will activate analog powerdown mode.

Definition at line 237 of file vs1053_SdFat.h.

◆ SCI_WRAM

#define SCI_WRAM   0x06

A macro of the SCI WRAM register's address (R/W)

SCI_AUDATA is a Read/Write register used to upload application programs and data to instruction and data RAMs. The start address must be initialized by writing to SCI_WRAMADDR prior to the first write/read of SCI_WRAM. As 16 bits of data can be transferred with one SCI_WRAM write/read, and the instruction word is 32 bits long, two consecutive writes/reads are needed for each instruction word. The byte order is big-endian (i.e. most significant words first). After each full-word write/read, the internal pointer is autoincremented.

Definition at line 178 of file vs1053_SdFat.h.

◆ SCI_WRAMADDR

#define SCI_WRAMADDR   0x07

A macro of the SCI WRAMADDR register (W)

SCI_WRAMADDR is a Write only register used to set the program address for following SCI_WRAM writes/reads. Use an address offset from the following table to access X, Y, I or peripheral memory.

Definition at line 186 of file vs1053_SdFat.h.

◆ SM_ADPCM

#define SM_ADPCM   0x1000

A macro of the SM_ADPCM bit mask of the SCI_MODE register.

By activating SM_ADPCM and SM_RESET at the same time, the user will activate IMA ADPCM recording mode (see section 9.8).

Definition at line 401 of file vs1053_SdFat.h.

◆ SM_CANCEL

#define SM_CANCEL   0x0008

A macro of the SM_DIFF bit mask of the SCI_MODE register.

If you want to stop decoding a in the middle, set SM_CANCEL, and continue sending data honouring DREQ. When SM_CANCEL is detected by a codec, it will stop decoding and return to the main loop. The stream buffer content is discarded and the SM_CANCEL bit cleared. SCI_HDAT1 will also be cleared. See Chapter 9.5.2 for details.

Definition at line 313 of file vs1053_SdFat.h.

◆ SM_CLK_RANGE

#define SM_CLK_RANGE   0x8000

A macro of the SM_CLK_RANGE bit mask of the SCI_MODE register.

SM_CLK_RANGE activates a clock divider in the XTAL input. When SM_CLK_RANGE is set, the clock is divided by 2 at the input. From the chip's point of view e.g. 24 MHz becomes 12 MHz. SM_CLK_RANGE should be set as soon as possible after a chip reset.

Definition at line 432 of file vs1053_SdFat.h.

◆ SM_DACT

#define SM_DACT   0x0100

A macro of the SM_DACT bit mask of the SCI_MODE register.

SM_DACT defines the active edge of data clock for SDI. When '0', data is read at the rising edge, when '1', data is read at the falling edge.

Definition at line 362 of file vs1053_SdFat.h.

◆ SM_DIFF

#define SM_DIFF   0x0001

A macro of the SM_DIFF bit mask of the SCI_MODE register.

When SM_DIFF is set, the player inverts the left channel output. For a stereo input this creates virtual surround, and for a mono input this creates a differential left/right signal.

Definition at line 287 of file vs1053_SdFat.h.

◆ SM_EARSPEAKER_HI

#define SM_EARSPEAKER_HI   0x0080

A macro of the SM_EARSPEAKER_HI bit mask of the SCI_MODE register.

SM_STREAM activates VS1053b's stream mode. In this mode, data should be sent with as even intervals as possible and preferable in blocks of less than 512 bytes, and VS1053b 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. For details, see Application Notes for VS10XX. This mode only works with MP3 and WAV files.

Definition at line 354 of file vs1053_SdFat.h.

◆ SM_EARSPEAKER_LO

#define SM_EARSPEAKER_LO   0x0010

A macro of the SM_EARSPEAKER_LO bit mask of the SCI_MODE register.

Bits SM_EARSPEAKER_LO and SM_EARSPEAKER_HI control the EarSpeaker spatial processing. If both are 0, the processing is not active. Other combinations activate the processing and select 3 different effect levels: LO = 1, HI = 0 selects minimal, LO = 0, HI = 1 selects normal, and LO = 1, HI = 1 selects extreme. EarSpeaker takes approximately 12 MIPS at 44.1 kHz samplerate.

Definition at line 324 of file vs1053_SdFat.h.

◆ SM_LAYER12

#define SM_LAYER12   0x0002

A macro of the SM_LAYER12 bit mask of the SCI_MODE register.

SM_LAYER12 enables MPEG 1.0 and 2.0 layer I and II decoding 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 296 of file vs1053_SdFat.h.

◆ SM_LINE1

#define SM_LINE1   0x4000

A macro of the SM_LINE1 bit mask of the SCI_MODE register.

SM_LINE_IN is used to select the left-channel input for ADPCM recording. If '0', differential microphone input pins MICP and MICN are used; if '1', line-level MICP/LINEIN1 pin is used.

See also
VS_LINE1_MODE

Definition at line 423 of file vs1053_SdFat.h.

◆ SM_PAUSE

#define SM_PAUSE   0x2000

A macro of the SM_PAUSE bit mask of the SCI_MODE register.

Play pause is traditionally implemented by stopping sending data to VS10xx. With lowbitrate songs, especially MIDI, decoding will continue for a long time because stream buffer is filled with data. This patch implements pause by stopping audio generation if bit 13 in SCI_MODE is set.

Note
This is only available with patch loaded. Typically done with vs1053::vs_init()

Definition at line 413 of file vs1053_SdFat.h.

◆ SM_RESET

#define SM_RESET   0x0004

A macro of the SM_DIFF bit mask of the SM_RESET register.

Software reset is initiated by setting SM_RESET to 1. This bit is cleared automatically.

Definition at line 303 of file vs1053_SdFat.h.

◆ SM_SDINEW

#define SM_SDINEW   0x0800

A macro of the SM_SDINEW bit mask of the SCI_MODE register.

Setting SM_SDINEW will activate VS1002 native serial modes as described in Chapters 7.2.1 and 7.4.2. This bit is set as a default when VS1053b is started up.

Note
This value is set correctly and should not be changed for use with AVR's Arduiino ATmega SPI operation.r.

Definition at line 393 of file vs1053_SdFat.h.

◆ SM_SDIORD

#define SM_SDIORD   0x0200

A macro of the SM_SDIORD bit mask of the SCI_MODE register.

When SM_SDIORD is clear, bytes on SDI are sent MSb first. By setting SM_SDIORD, the user may reverse the bit order for SDI, i.e. bit 0 is received first and bit 7 last. Bytes are, however, still sent in the default order. This register bit has no effect on the SCI bus.

Note
This value is set correctly and should not be changed for use with AVR's Arduiino ATmega SPI operation.r.

Definition at line 373 of file vs1053_SdFat.h.

◆ SM_SDISHARE

#define SM_SDISHARE   0x0400

A macro of the SM_SDISHARE bit mask of the SCI_MODE register.

Setting SM_SDISHARE makes SCI and SDI share the same chip select, as explained in Chapter 7.2, if also SM_SDINEW is set.

Note
This value is set correctly and should not be changed for use with AVR's Arduiino ATmega SPI operation.r.

Definition at line 383 of file vs1053_SdFat.h.

◆ SM_STREAM

#define SM_STREAM   0x0040

A macro of the SM_STREAM bit mask of the SCI_MODE register.

If SM_TESTS is set, SDI tests are allowed. For more details on SDI tests, look at Chapter 9.12.

Definition at line 342 of file vs1053_SdFat.h.

◆ SM_TESTS

#define SM_TESTS   0x0020

A macro of the SM_TESTS bit mask of the SCI_MODE register.

Bits SM_EARSPEAKER_LO and SM_EARSPEAKER_HI control the EarSpeaker spatial processing. If both are 0, the processing is not active. Other combinations activate the processing and select 3 different effect levels: LO = 1, HI = 0 selects minimal, LO = 0, HI = 1 selects normal, and LO = 1, HI = 1 selects extreme. EarSpeaker takes approximately 12 MIPS at 44.1 kHz samplerate.

Definition at line 335 of file vs1053_SdFat.h.

◆ SS_VU_ENABLE

#define SS_VU_ENABLE   0x0200

A macro of the SS_VU_ENABLE bit mask of the SCI_STATUS register.

When SS_VU_ENABLE is set and patch 1.2 or greater is loaded the player the VU meter is enabled. See data patches data sheet VU meter for details.

See also
setVUmeter and getVUlevel

Definition at line 468 of file vs1053_SdFat.h.

◆ TRACK_ALBUM

#define TRACK_ALBUM   63

A macro of the offset for the track's Album.

The offset from the begining of the ID3 tag for the location containing the track's Artist of the mp3 file being read from the SdCard.

Warning
This may not be available on all source music files.

Definition at line 655 of file vs1053_SdFat.h.

◆ TRACK_ARTIST

#define TRACK_ARTIST   33

A macro of the offset for the track's Artist.

The offset from the begining of the ID3 tag for the location containing the track's Artist of the mp3 file being read from the SdCard.

Warning
This may not be available on all source music files.

Definition at line 646 of file vs1053_SdFat.h.

◆ TRACK_TITLE

#define TRACK_TITLE   3

A macro of the offset for the track's Title.

The offset from the begining of the ID3 tag for the location containing the track's Title of the mp3 file being read from the SdCard.

Warning
This may not be available on all source music files.

Definition at line 637 of file vs1053_SdFat.h.

◆ TRUE

#define TRUE   1

Definition at line 620 of file vs1053_SdFat.h.

◆ VS_LINE1_MODE

#define VS_LINE1_MODE

A macro of the VS_LINE1_MODE to configure either Line level or microphone input.

Used by vs1053::ADMixerLoad to determine if the SM_LINE1 of SCI_MODE being set as to use both MICP and LINEIN1 pins as stereo input, at line levels. Commenting it out, will result MICP and MICN used as differential input with resulting mono signal on the left channel.

See also
SM_LINE1

Definition at line 446 of file vs1053_SdFat.h.

Enumeration Type Documentation

◆ flush_m

enum flush_m

How to flush the VSdsp's buffer.

For use with vs1053::flush_cancel(flush_m) as to how to flush the VSdsp's buffer.

See Data sheet 9.5.2

Enumerator
post 

Flush After.

This will cause vs1053::flush_cancel(flush_m) to flush with endfillbyte after issuing the cancel

pre 

Flush First.

This will cause vs1053::flush_cancel(flush_m) to flush with endfillbyte before issuing the cancel

both 

Flush both First and After.

This will cause vs1053::flush_cancel(flush_m) to flush with endfillbyte before and after issuing the cancel

none 

Don't Flush.

This will cause vs1053::flush_cancel(flush_m) NOT to flush with endfillbyte when issuing the cancel

Definition at line 53 of file vs1053_SdFat.h.

◆ state_m

enum state_m

State of the vs1053 device.

Value of vs1053::playing_state detailing the current state of the VSdsp. Noting that test, pause, play and idle states are not directly the same.

Enumerator
uninitialized 
initialized 
deactivated 
loading 
ready 
playback 
playMIDIbeep 
paused_playback 
testing_memory 
testing_sinewave 

Definition at line 33 of file vs1053_SdFat.h.

Function Documentation

◆ isFnMusic()

bool isFnMusic ( char *  filename)

is the filename music

Parameters
[in]filenameinspects the end of the filename to be of the extension types that VS10xx can decode.
Returns
boolean true indicating that it is music

Definition at line 2291 of file vs1053_SdFat.cpp.

◆ strip_nonalpha_inplace()

char* strip_nonalpha_inplace ( char *  s)

chomp non printable characters out of string.

Parameters
[out]spointer of a char array (aka string)
Returns
char array (aka string) with out whitespaces

Definition at line 2269 of file vs1053_SdFat.cpp.

Variable Documentation

◆ sd

SdFat sd

SdFat sd;.

An external reference used by vs1053 Class for individual files of the SdCard.

Note
this is an extern and needs to correspond to the same in the calling INO file. of vs1053 and accessed by static functions.