VS1053  1.03.00
Arduino Library for VS10xx shield
Macros
vs1053_SdFat_config.h File Reference
#include <pins_arduino.h>
Include dependency graph for vs1053_SdFat_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SEEEDUINO   0
 A macro to configure use on a Seeeduino MP3 player shield. More...
 
#define GRAVITECH   0
 A macro to configure use on a Gravitech's MP3-4NANO shield. More...
 
#define TEENSY2   0
 Macro to configure pins for connecting the Sparkfun shield to a Teensy 2. More...
 
#define BARETOUCH   0
 A macro to explicitly configure use with the Bare Conductive Touch Board. More...
 
#define PERF_MON_PIN   -1
 A macro to configure a Pin to analyze performance. More...
 
#define MP3_XCS   6
 A macro to configure the XCS pin. More...
 
#define MP3_XDCS   7
 A macro to configure the XDCS pin. More...
 
#define MP3_DREQ   2
 A macro to configure the DREQ pin. More...
 
#define MP3_DREQINT   0
 A macro to configure the DREQINT pin. More...
 
#define MP3_RESET   8
 A macro to configure the RESET pin. More...
 
#define SD_SEL   9
 A macro to configure the SdCard Chip Select for vs1053 library. More...
 
#define USE_MP3_REFILL_MEANS   USE_MP3_INTx
 The selection of DREQ'ss refilling method. More...
 
#define USE_MP3_INTx   0
 defacto Interrupt on INTx, from DREQ More...
 
#define USE_MP3_Polled   1
 A macro of the enumerated value used to select Software polling as the means to refill the VS10xx. More...
 
#define USE_MP3_Timer1   2
 A macro of the enumerated value used to select Timer1's interrupt as the means to refill the VS10xx. More...
 
#define USE_MP3_SimpleTimer   3
 A macro of the enumerated value used to select Soft SimpleTimer period as the means to refill the VS10xx. More...
 
#define MIDI_CHANNEL   9
 A macro used to specify the MIDI channel. More...
 
#define MIDI_NOTE_NUMBER   56
 A macro used to specify the MIDI note. More...
 
#define MIDI_NOTE_DURATION   100
 A macro used to specify the duration of the MIDI note. More...
 
#define MIDI_INTENSITY   127
 A macro used to specify the intensity of the MIDI note. More...
 

Macro Definition Documentation

◆ BARETOUCH

#define BARETOUCH   0

A macro to explicitly configure use with the Bare Conductive Touch Board.

Bare Conductive's Touch Board is supported. However, its pin mapping is significantly different to the SparkFun MP3 player shield.

If you are using Arduino 1.5.0+ then automatic pin remapping can be enabled as follows:

  1. Download the Bare Conductive board definitions file (boards.txt) from their Github (https://github.com/bareconductive).
  2. Extract the Bare Conductive folder into your Documents/Arduino/Hardware folder... My Documents\Arduino\Hardware on Windows. If the folder does not already exist, create it.
  3. Restart Arduino if it is currently running.
  4. In the Arduino menu, select Tools -> Board -> Bare Conductive Touch Board

This will automatically set up this library when the board is selected, and revert back to the setting for the Sparkfun MP3 shield when it is not. If you would like to override this, set the BARETOUCH value below: 0 to use the Sparkfun MP3 shield, 1 to use the Bare Conductive Touch Board.

If you are using an earlier version of Arduino, you will have to manage the pin remapping manually. Setting BARETOUCH below to 0 will leave the pin map as normal - i.e. for the Sparkfun MP3 shield. Setting it to 1 will map the pins correctly for the Bare Conductive Touch Board. If you decide to then use a different board, you'll have to remember to come back here and adjust the settings accordingly.

Definition at line 134 of file vs1053_SdFat_config.h.

◆ GRAVITECH

#define GRAVITECH   0

A macro to configure use on a Gravitech's MP3-4NANO shield.

Gravitech's MP3-4NANO shield is supported. However, its chip select of the SdCard connected to D4. This can be configured, simply by setting the below define of GRAVITECH to 1.

Set GRAVITECH to 0 to use on a Gravitech's MP3-4NANO shield

Set GRAVITECH to 1 to use on a Gravitech's MP3-4NANO

Definition at line 87 of file vs1053_SdFat_config.h.

◆ MIDI_CHANNEL

#define MIDI_CHANNEL   9

A macro used to specify the MIDI channel.

Where used in the SingleMIDInoteFile array for sending quick beeps with function vs1053::SendSingleMIDInote()

Note
Where Ch9 is reserved for Percussion Instruments with single note

Definition at line 382 of file vs1053_SdFat_config.h.

◆ MIDI_INTENSITY

#define MIDI_INTENSITY   127

A macro used to specify the intensity of the MIDI note.

Value ranges from 0 to 127(full scale). Where used in the SingleMIDInoteFile array for sending both the ON and off of the quick beep with function vs1053::SendSingleMIDInote()

Definition at line 411 of file vs1053_SdFat_config.h.

◆ MIDI_NOTE_DURATION

#define MIDI_NOTE_DURATION   100

A macro used to specify the duration of the MIDI note.

Where used in the SingleMIDInoteFile array for sending quick beeps with function vs1053::SendSingleMIDInote()

Warning
format is variable length, must keep it small. As not to break hardcoded header format

Definition at line 402 of file vs1053_SdFat_config.h.

◆ MIDI_NOTE_NUMBER

#define MIDI_NOTE_NUMBER   56

A macro used to specify the MIDI note.

Where used in the SingleMIDInoteFile array for sending quick beeps with function vs1053::SendSingleMIDInote()

Note
So for Ch9's the note is GM Bank Percussion Instrument, not actual note. e.g 56 is cowbell. This removes the necassasity to send other commands.

Definition at line 392 of file vs1053_SdFat_config.h.

◆ MP3_DREQ

#define MP3_DREQ   2

A macro to configure the DREQ pin.

VS10xx's DREQ pin that indicates when it is clear to send more data. aka Data REQuest. as seen by the the Arduino

Definition at line 247 of file vs1053_SdFat_config.h.

◆ MP3_DREQINT

#define MP3_DREQINT   0

A macro to configure the DREQINT pin.

The associated INT(X) pin name for the associated pin of DREQ, if used. as seen by the the Arduino

This may not be needed when USE_MP3_REFILL_MEANS is not equal to USE_MP3_REFILL_MEANS

See also
USE_MP3_REFILL_MEANS

Definition at line 251 of file vs1053_SdFat_config.h.

◆ MP3_RESET

#define MP3_RESET   8

A macro to configure the RESET pin.

VS10xx's RESET Pin as seen by the the Arduino

Definition at line 253 of file vs1053_SdFat_config.h.

◆ MP3_XCS

#define MP3_XCS   6

A macro to configure the XCS pin.

VS10xx's Control Chip Select Pin (for accessing SPI Control/Status registers) as seen by the the Arduino

Definition at line 245 of file vs1053_SdFat_config.h.

◆ MP3_XDCS

#define MP3_XDCS   7

A macro to configure the XDCS pin.

VS10xx's Data Chip Select Pin (for streaming data back and forth) as seen by the the Arduino

Definition at line 246 of file vs1053_SdFat_config.h.

◆ PERF_MON_PIN

#define PERF_MON_PIN   -1

A macro to configure a Pin to analyze performance.

The output of this pin will be low, during the refill of the VSdsp, allowing measurement of the CPU utilization, required to sustain playing.

Set value to any available digital output, including A0-5...

Set value to negative to disable.

Definition at line 206 of file vs1053_SdFat_config.h.

◆ SD_SEL

#define SD_SEL   9

A macro to configure the SdCard Chip Select for vs1053 library.

This is the pin of the Arduino that is connected to the SdCards Chip select pin. This pin should be the same pin assigned in SdFat Library. as seen by the the Arduino

Definition at line 257 of file vs1053_SdFat_config.h.

◆ SEEEDUINO

#define SEEEDUINO   0

A macro to configure use on a Seeeduino MP3 player shield.

Seeduino MP3 Players is supported. However, its DREQ is not connected to a hard INT(x) pin, hence it MUST be polled. This can be configured, using USE_MP3_SimpleTimer. When using a Seeeduino MP3 Player shield set the below define of SEEEDUINO to 1. As so the correct IO pins are configured MP3_XCS, MP3_XDCS and MP3_DREQ

Along with USE_MP3_REFILL_MEANS should not be USE_MP3_INTx, unless extra jumper wires are used.

Set SEEEDUINO to 0 to use on a SparkFun MP3 player shield

Set SEEEDUINO to 1 to use on a Seeeduino MP3 player shield

Definition at line 73 of file vs1053_SdFat_config.h.

◆ TEENSY2

#define TEENSY2   0

Macro to configure pins for connecting the Sparkfun shield to a Teensy 2.

You can connect the Sparkfun Mp3 shield to a Teensy 2 with jumper cables on a breadboard. Teensy SDI pins are CS=0, SCK=1, MOSI=2, MISO=3. If you are using a Teensy 2 then set TEENSY2 to 1 below and scroll down for pin assignments.

Set TEENSY2 to 0 to use on a Gravitech's MP3-4NANO shield

Set TEENSY2 to 1 to use on a Gravitech's MP3-4NANO

Definition at line 101 of file vs1053_SdFat_config.h.

◆ USE_MP3_INTx

#define USE_MP3_INTx   0

defacto Interrupt on INTx, from DREQ

A macro of the enumerated value used to select hard interrupt INTx as the means to refill the VS10xx

Where the Interrupt Service Routine attached to INTx as per attachInterrupt(MP3_DREQINT, refill, RISING) causes execution of vs1053::refill() as per the VS10xx need per DREQ.

Note
MP3_DREQINT corresponds the interrupt vector associated with the pin assigned to MP3_DREQ. As defined in WIterrupts.c
INT(x) may be relocated or not be available on some base systems depending upon design. Such as with the Lenoardo, which have pins D2/D3 and there corresponding INT0/INT1 swapped, versus the UNO. See attachInterrupt() Where SFE MP3 Player can use USE_MP3_INTx as DREQ is connected to D2 aka INT0. Noting that MP3_DREQINT vector is defined above, in pin assignments.

Definition at line 306 of file vs1053_SdFat_config.h.

◆ USE_MP3_Polled

#define USE_MP3_Polled   1

A macro of the enumerated value used to select Software polling as the means to refill the VS10xx.

Where Main loop uses vs1053::available() to check if DREQ needs refilling on a periodic basis.

Note
In this means vs1053::available() is simply vs1053::refill() and MP3_REFILL_PERIOD is NOT used with this means.

Definition at line 316 of file vs1053_SdFat_config.h.

◆ USE_MP3_REFILL_MEANS

#define USE_MP3_REFILL_MEANS   USE_MP3_INTx

The selection of DREQ'ss refilling method.

The value is that of an enumerated list of possible methods, aka means.

The VS10xx's DREQ requests more data from the host micro (the Arduino) Where it can either be an input to an interrupt and corresponding ISR or be polled by software.

To enable MP3 Player to use OTHER than default INT0 on D2 for refilling uncomment or change the define of USE_MP3_REFILL_MEANS and set to desired method,

The default when left commented implements INT0 on D2.

Note
ALL base Arduino's should support timers and soft polled means of either
USE_MP3_Polled, USE_MP3_Timer1 or USE_MP3_SimpleTimer means.
Assuming resources are not committed else where.
Warning
Remember to restart Arduino IDE for new Libraries to be available. Coping the file is not enough.

Definition at line 284 of file vs1053_SdFat_config.h.

◆ USE_MP3_SimpleTimer

#define USE_MP3_SimpleTimer   3

A macro of the enumerated value used to select Soft SimpleTimer period as the means to refill the VS10xx.

Where Main loop uses vs1053::available() to check if DREQ needs refilling on a periodic basis.

Note
In this means vs1053::available() is gating the excecution of vs1053::refill() based on MP3_REFILL_PERIOD. Where MP3_REFILL_PERIOD is required when using this means.
The associated <SimpleTimer.h> library is required and utilizes 170 more bytes.
See also
The use of USE_MP3_SimpleTimer interrupt requires the TimerOne.h library can be downloaded from http://www.arduino.cc/playground/Code/SimpleTimer#GetTheCode for library.

Definition at line 344 of file vs1053_SdFat_config.h.

◆ USE_MP3_Timer1

#define USE_MP3_Timer1   2

A macro of the enumerated value used to select Timer1's interrupt as the means to refill the VS10xx.

Where the Interrupt Service Route attached to Timer1 cause periodic execution of vs1053::refill()

Note
MP3_REFILL_PERIOD is required when using this means.
See also
The use of USE_MP3_Timer1 interrupt requires the TimerOne.h library can be downloaded from http://code.google.com/p/arduino-timerone/ for library.

Definition at line 328 of file vs1053_SdFat_config.h.