vs1053_avr_renesas_uno 0.1.0
Arduino Library for VS1053 shield
Loading...
Searching...
No Matches
vs1053_avr_renesas_uno_config.h File Reference
#include <pins_arduino.h>

Go to the source code of this file.

Macros

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

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 135 of file vs1053_avr_renesas_uno_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 88 of file vs1053_avr_renesas_uno_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 349 of file vs1053_avr_renesas_uno_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 377 of file vs1053_avr_renesas_uno_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 369 of file vs1053_avr_renesas_uno_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 359 of file vs1053_avr_renesas_uno_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 238 of file vs1053_avr_renesas_uno_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 239 of file vs1053_avr_renesas_uno_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 236 of file vs1053_avr_renesas_uno_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 237 of file vs1053_avr_renesas_uno_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 195 of file vs1053_avr_renesas_uno_config.h.

◆ SD_SEL

#define SD_SEL   9

A macro to configure the SdCard Chip Select for vs1053_avr_renesas_uno 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 245 of file vs1053_avr_renesas_uno_config.h.

◆ SEEEDUINO

#define SEEEDUINO   0

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

Seeduino MP3 Player is supported. However, its DREQ pin is not connected to an IRQ-capable 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 irq, 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 74 of file vs1053_avr_renesas_uno_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 102 of file vs1053_avr_renesas_uno_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 284 of file vs1053_avr_renesas_uno_config.h.

◆ USE_MP3_REFILL_MEANS

#define USE_MP3_REFILL_MEANS   irq

Selection of the DREQ refill method.

Defines the mechanism for handling the VS10xx's request for new data. DREQ can be managed via an interrupt or software polling.

The default method assigns USE_MP3_REFILL_MEANS to the variable irq, which stores the interrupt identifier corresponding to the MP3_DREQ pin. This ensures compatibility with architectures where any pin can serve as an interrupt source.

To use a different refill method, uncomment or modify the definition of USE_MP3_REFILL_MEANS and set it to the desired option.

Note
All Arduino base boards should support polling and timer-based methods such as:
USE_MP3_Polled, USE_MP3_Timer1, or USE_MP3_SimpleTimer, provided resources are not allocated elsewhere.
Warning
Remember to restart the Arduino IDE for the library changes to take effect. Simply copying the file is not enough.

Definition at line 268 of file vs1053_avr_renesas_uno_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 312 of file vs1053_avr_renesas_uno_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 296 of file vs1053_avr_renesas_uno_config.h.