VS1053  1.03.00
Arduino Library for VS10xx shield
vs1053_SdFat_config.h
Go to the documentation of this file.
1 
51 #ifndef vs1053Config_h
52 #define vs1053Config_h
53 
54 //------------------------------------------------------------------------------
55 
73 #define SEEEDUINO 0 // set to 1 if using the Seeeduino Music Shield
74 
87 #define GRAVITECH 0 // set to 1 if using the Gravitech's MP3-4NANO shield
88 
101 #define TEENSY2 0 // set to 1 if using the Sparkfun Mp3 shield with Teensy 2
102 
134 #define BARETOUCH 0 // set to 1 to force Bare Conductive Touch Board settings on
135 
136 //------------------------------------------------------------------------------
137 /*
138  * MP3 Player Shield pin mapping. See the appropiate schematic
139  */
140 
206 #define PERF_MON_PIN -1 // example of A5
207 
208 #include <pins_arduino.h>
209 
210 #if defined(__BIOFEEDBACK_MEGA__)
211  #define MP3_XCS 67 //PK5 Output, Active Low, Control Chip Select Pin (for accessing SPI Control/Status registers)
212  #define MP3_XDCS 68 //PK6 Output, Active Low, Data Chip Select / BSYNC Pin
213  #define MP3_DREQ 66 //PK4 Input , Active High, Data Request Pin: Player asks for more data
214  #define MP3_RESET 65 //PK3 Output, Active Low, Reset is active low
215  #define SD_SEL 76 //PJ6 Output, Active Low
216  #define MP3_DREQINT 5 //Corresponding INTx for DREQ pin
217 #elif ( SEEEDUINO == 1 ) // if SEEDUINO use the following pin outs
218  #define MP3_XCS A3 //Control Chip Select Pin (for accessing SPI Control/Status registers)
219  #define MP3_XDCS A2 //Data Chip Select / BSYNC Pin
220  #define MP3_DREQ A1 //Data Request Pin: Player asks for more data
221  //#define MP3_DREQINT 0 // There is no IRQ used on Seeduino
222  #define MP3_RESET A0 //Reset is active low
223  #define SD_SEL 10 //select pin for SD card
224 #elif ( TEENSY2 == 1 )
225  #define MP3_XCS 7
226  #define MP3_XDCS 8
227  #define MP3_DREQ 4
228  #define MP3_DREQINT 1
229  #define MP3_RESET 9
230  #define SD_SEL 0 // Teensy SDI CS on pin 0
231  // Connect SDI pins as follows:
232  // Sparkfun shield 11 -> Teensy 2 (mosi)
233  // Sparkfun shield 12 -> Teensy 3 (miso)
234  // Sparkfun shield 13 -> Teensy 1 (sck)
235 // if BARETOUCH or ARDUINO_AVR_BARETOUCH use the following pin map
236 #elif (( BARETOUCH == 1 ) || ( ARDUINO_AVR_BARETOUCH == 1 ))
237  #define MP3_XCS 9 //Control Chip Select Pin (for accessing SPI Control/Status registers)
238  #define MP3_XDCS 6 //Data Chip Select / BSYNC Pin
239  #define MP3_DREQ 7 //Data Request Pin: Player asks for more data
240  #define MP3_DREQINT 4 //Corresponding INTx for DREQ pin
241  #define MP3_RESET 8 //Reset is active low
242  #define SD_SEL 5 //select pin for SD card
243 // otherwise use pinout of typical Sparkfun MP3 Player Shield.
244 #else // otherwise use pinout of typical Sparkfun MP3 Player Shield.
245  #define MP3_XCS 6 //Control Chip Select Pin (for accessing SPI Control/Status registers)
246  #define MP3_XDCS 7 //Data Chip Select / BSYNC Pin
247  #define MP3_DREQ 2 //Data Request Pin: Player asks for more data
248  #if defined(__AVR_ATmega32U4__)
249  #define MP3_DREQINT 1 //Corresponding INTx for DREQ pin
250  #else // swapped between Uno and Leonardo.
251  #define MP3_DREQINT 0 //Corresponding INTx for DREQ pin
252  #endif
253  #define MP3_RESET 8 //Reset is active low
254  #if ( GRAVITECH == 1 )
255  #define SD_SEL 4 //select pin for SD card
256  #else
257  #define SD_SEL 9 //select pin for SD card
258  #endif // GRAVITECH
259 #endif // none SEEEDUINO
260 
261 //------------------------------------------------------------------------------
284 #define USE_MP3_REFILL_MEANS USE_MP3_INTx
285 
286 /*
287  * Configure the implemented means of Refilling the VS10xx chip
288  */
289 #if defined(USE_MP3_REFILL_MEANS)
290 
306 #define USE_MP3_INTx 0
307 
316 #define USE_MP3_Polled 1
317 
328 #define USE_MP3_Timer1 2
329 
344 #define USE_MP3_SimpleTimer 3
345 
346 #endif
347 
348 //------------------------------------------------------------------------------
349 /*
350  * When means other than Polled and INTx are used the following Libraries need to be loaded.
351  */
352 #if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
353  #include <TimerOne.h>
354 // strange if TimerOne.h is present but not selected it still consums 6 bytes, something to do with Arduino's pre-compiler and Linker.
355 #elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer
356  #include <SimpleTimer.h>
357 #endif
358 
359 
360 //------------------------------------------------------------------------------
361 /*
362  When means are time based, need to define the period of update.
363  100ms is recommened for 192K sample rate MP3. other rates may vary.
364  */
365 #if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS > USE_MP3_Polled // not needed if INTx is used or polled in loop.
366 
370 #define MP3_REFILL_PERIOD 100
371 #endif
372 
373 //------------------------------------------------------------------------------
382 #define MIDI_CHANNEL 9
383 
392 #define MIDI_NOTE_NUMBER 56
393 
402 #define MIDI_NOTE_DURATION 100
403 
404 
411 #define MIDI_INTENSITY 127 // Full scale.
412 
413 
414 
415 
416 #endif // vs1053Config_h