|
vs1053_avr_renesas_uno 0.1.0
Arduino Library for VS1053 shield
|
Interface Driver to the VS10xx chip on the SPI. More...
#include <vs1053_avr_renesas_uno.h>
Classes | |
| union | sci_bass_m |
| A handler for accessing nibbles of the SCI_BASS word. More... | |
Public Member Functions | |
| uint8_t | begin () |
| Initialize the MP3 Player shield. | |
| void | end () |
| Disables the MP3 Player shield. | |
| uint8_t | vs_init () |
| Initialize the VS10xx Audio Decoder Chip. | |
| void | setVolume (uint8_t, uint8_t) |
| Store and Push member volume to VS10xx chip. | |
| void | setVolume (uint16_t) |
| Overload function of vs1053::setVolume(leftchannel, rightchannel) | |
| void | setVolume (uint8_t) |
| Overload function of vs1053::setVolume(leftchannel, rightchannel) | |
| uint16_t | getTrebleFrequency () |
| Get the current Treble Frequency limit from the VS10xx chip. | |
| int8_t | getTrebleAmplitude () |
| Get the current Treble Amplitude from the VS10xx chip. | |
| uint16_t | getBassFrequency () |
| Get the current Bass Frequency limit from the VS10xx chip. | |
| int8_t | getBassAmplitude () |
| Get the current Bass boost amplitude from the VS10xx chip. | |
| void | setTrebleFrequency (uint16_t) |
| Set the current treble frequency limit in VS10xx chip. | |
| void | setTrebleAmplitude (int8_t) |
| Set the current Treble Amplitude in VS10xx chip. | |
| void | setBassFrequency (uint16_t) |
| Set the current Bass Boost Frequency limit cutoff in VS10xx chip. | |
| void | setBassAmplitude (uint8_t) |
| Set the current Bass Boost amplitude in VS10xx chip. | |
| void | setPlaySpeed (uint16_t) |
| Set the current playSpeed of the VS10xx chip. | |
| uint16_t | getPlaySpeed () |
| Get the current playSpeed from the VS10xx chip. | |
| uint16_t | getVolume () |
| Get the current volume from the VS10xx chip. | |
| uint8_t | getEarSpeaker () |
| Get the current Spatial EarSpeaker setting from the VS10xx chip. | |
| state_m | getState () |
| Get the current state of the device. | |
| void | setEarSpeaker (uint16_t) |
| Set the current Spatial EarSpeaker setting of the VS10xx chip. | |
| uint16_t | getMonoMode () |
| Get the current Stereo/Mono setting of the VS10xx output. | |
| void | setMonoMode (uint16_t) |
| Set the current Stereo/Mono setting of the VS10xx output. | |
| void | setDifferentialOutput (uint16_t) |
| Set the current SM_DIFF setting of the VS10xx chip. | |
| uint8_t | getDifferentialOutput () |
| Get the current SM_DIFF setting from the VS10xx chip. | |
| uint8_t | playTrack (uint8_t) |
| Begin playing a mp3 file, just with a number. | |
| uint8_t | playMP3 (char *, uint32_t timecode=0) |
| Begin playing a mp3 file by its filename. | |
| void | trackTitle (char *) |
| Get Track's Title. | |
| void | trackArtist (char *) |
| Get Track's Artist. | |
| void | trackAlbum (char *) |
| Get Track's Album. | |
| void | stopTrack () |
| Gracefully close track and cancel refill. | |
| uint8_t | isPlaying () |
| Inidicate if a song is playing? | |
| uint8_t | skip (int32_t) |
| Skips to a duration in the track. | |
| uint8_t | skipTo (uint32_t) |
| Skips to a certain point in the track. | |
| uint32_t | currentPosition () |
| Current timecode in ms. | |
| void | setBitRate (uint16_t) |
| Force bit rate. | |
| void | pauseDataStream () |
| Pause streaming data to the VSdsp. | |
| void | resumeDataStream () |
| Unpause streaming data to the VSdsp. | |
| void | pauseMusic () |
| Pause music. | |
| bool | resumeMusic () |
| Resume music from where it was paused. | |
| uint8_t | resumeMusic (uint32_t) |
| Resume music from pause at new location. | |
| void | getAudioInfo () |
| Display various Audio information from the VSdsp. | |
| uint8_t | enableTestSineWave (uint8_t) |
| Generate Test Sine wave. | |
| uint8_t | disableTestSineWave () |
| Disable Test Sine wave. | |
| uint16_t | memoryTest () |
| Perform Memory Test. | |
| uint8_t | ADMixerLoad (char *) |
| Initially load ADMixer patch and configure line/mic mode. | |
| void | ADMixerVol (int8_t) |
| Set ADMixer's attenuation of input to between -3 and -31 dB otherwise disable. | |
| int8_t | getVUmeter () |
| get the status of the VSdsp VU Meter | |
| int8_t | setVUmeter (int8_t) |
| enable VSdsp VU Meter | |
| int16_t | getVUlevel () |
| get current measured VU Meter | |
| void | SendSingleMIDInote () |
| Play hardcoded MIDI file. | |
Static Public Member Functions | |
| static void | available () |
| Public interface of refill. | |
Private Member Functions | |
| void | getTrackInfo (uint8_t, char *) |
| Fetch ID3 Tag information. | |
| void | getBitRateFromMP3File (char *) |
| Read the Bit-Rate from the current track's filehandle. | |
| uint8_t | VSLoadUserCode (char *) |
| load VS1xxx with patch or plugin from file on SDcard. | |
Static Private Member Functions | |
| static void | refill () |
| Refill the VS10xx buffer with new data. | |
| static void | flush_cancel (flush_m) |
| flush the VSdsp buffer and cancel | |
| static void | spiInit () |
| Initialize the SPI for VS10xx use. | |
| static void | cs_low () |
| Select Control Channel. | |
| static void | cs_high () |
| Deselect Control Channel. | |
| static void | dcs_low () |
| Select Data Channel. | |
| static void | dcs_high () |
| Deselect Data Channel. | |
| static void | Mp3WriteRegister (uint8_t, uint8_t, uint8_t) |
| Write a value a VSDsp's register. | |
| static void | Mp3WriteRegister (uint8_t, uint16_t) |
| uint16_t Overload of vs1053::Mp3WriteRegister | |
| static uint16_t | Mp3ReadRegister (uint8_t) |
| Read a VS10xx register. | |
| static uint16_t | Mp3ReadWRAM (uint16_t) |
| Read a VS10xx WRAM Location. | |
| static void | Mp3WriteWRAM (uint16_t, uint16_t) |
| Write a VS10xx WRAM Location. | |
| static void | enableRefill () |
| Enable the Interrupts for refill. | |
| static void | disableRefill () |
| Disable the Interrupts for refill. | |
Private Attributes | |
| uint8_t | bitrate |
| contains a local value of the beleived current bit-rate. | |
| uint32_t | start_of_music |
| contains a filehandles offset to the begining of the current file. | |
| uint8_t | VolL |
| contains a local value of the VSdsp's master volume left channels | |
| uint8_t | VolR |
| contains a local value of the VSdsp's master volume Right channels | |
Static Private Attributes | |
| static SdFile | track |
| Initializer for the instance of the SdCard's static member. | |
| static state_m | playing_state |
| Boolean flag indicating if filehandle is streaming. | |
| static uint32_t | spi_Max_Rate |
| Rate of the SPI to be used with communicating to the VSdsp. | |
| static uint8_t | mp3DataBuffer [32] |
| Buffer for moving data between Filehandle and VSdsp. | |
Interface Driver to the VS10xx chip on the SPI.
Definition at line 675 of file vs1053_avr_renesas_uno.h.
| uint8_t vs1053::ADMixerLoad | ( | char * | fileName | ) |
Initially load ADMixer patch and configure line/mic mode.
| [out] | fileName | pointer of a char array (aka string), contianing the filename |
Loads a patch file of Analog to Digital Mixer. Current available options are as follows:
And subsequently returns the following result codes.
Definition at line 2206 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::ADMixerVol | ( | int8_t | ADM_volume | ) |
Set ADMixer's attenuation of input to between -3 and -31 dB otherwise disable.
| [in] | ADM_volume | -3 through -31 dB of attentuation. |
Will range check the requested value and for values out of range the VSdsp's ADMixer will be disabled. While valid ranges will write to VSdsp's current operating volume and enable the the ADMixer.
Definition at line 2243 of file vs1053_avr_renesas_uno.cpp.
|
static |
Public interface of refill.
Serves as a helper as to correspondingly run either the timer service or run the refill() direclty, depending upon the configured means for refilling.
Definition at line 1956 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::begin | ( | ) |
Initialize the MP3 Player shield.
Execute this function before anything else, typically during setup(). It will bring the VS10xx out of reset, initialize the connected pins and then ready the VSdsp for playback, with vs_init().
SdFat::begin() function is required to be executed prior, as to define the volume for the tracks (aka files) to be operated on. Definition at line 139 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Deselect Control Channel.
Primative function to Deselect the VS10xx's Control Chip Select as per defined by MP3_XCS.
Definition at line 1759 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Select Control Channel.
Primative function to configure the SPI's Mode and rate control to that of the current VX10xx. Then select the VS10xx's Control Chip Select as per defined by MP3_XCS.
Definition at line 1747 of file vs1053_avr_renesas_uno.cpp.
| uint32_t vs1053::currentPosition | ( | ) |
Current timecode in ms.
Reads the currenty position from the VSdsp's decode time and converts the value to milliseconds.
Definition at line 1396 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Deselect Data Channel.
Primative function to Deselect the VS10xx's Control Data Select as per defined by MP3_XDCS.
Definition at line 1785 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Select Data Channel.
Primative function to configure the SPI's Mode and rate control to that of the current VX10xx. Then select the VS10xx's Data Chip Select as per defined by MP3_XDCS.
Definition at line 1773 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Disable the Interrupts for refill.
Depending upon the means selected to request refill of the VSdsp's data stream buffer, this routine will disable the corresponding service.
Definition at line 2107 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::disableTestSineWave | ( | ) |
Disable Test Sine wave.
Disable and report the generation of Test Sine Wave as per specified. As specified by Data Sheet Section 9.12.1
Definition at line 446 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Enable the Interrupts for refill.
Depending upon the means selected to request refill of the VSdsp's data stream buffer, this routine will enable the corresponding service.
Definition at line 2087 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::enableTestSineWave | ( | uint8_t | freq | ) |
Generate Test Sine wave.
| [in] | freq | specifies the output frequency sine wave. |
Enable and/or report the generation of Test Sine Wave as per specified. As specified by Data Sheet Section 9.12.1
Definition at line 394 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::end | ( | ) |
Disables the MP3 Player shield.
Places the VS10xx into low power hard reset, after polity closing files after releasing interrupts and or timers.
Definition at line 194 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
flush the VSdsp buffer and cancel
| [in] | mode | is an enumerated value of flush_m |
Typically called after a filehandlers' stream has been stopped, as to gracefully flush any buffer contents still playing. Along with issueing a SM_CANCEL to the VSdsp's SCI_MODE register.
Definition at line 2134 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::getAudioInfo | ( | ) |
Display various Audio information from the VSdsp.
Read numerous attributes from the VSdsp's registers about either the currently or prior played stream and display in a column format for easy reviewing.
This may be called while playing a current stream.
Definition at line 1508 of file vs1053_avr_renesas_uno.cpp.
| int8_t vs1053::getBassAmplitude | ( | ) |
Get the current Bass boost amplitude from the VS10xx chip.
Definition at line 691 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::getBassFrequency | ( | ) |
Get the current Bass Frequency limit from the VS10xx chip.
Definition at line 673 of file vs1053_avr_renesas_uno.cpp.
|
private |
Read the Bit-Rate from the current track's filehandle.
| [out] | fileName | pointer of a char array (aka string), contianing the filename |
locate the MP3 header in the current file and from there determine the Bit-Rate, using bitrate_table located in flash. And return the position to the prior location.
Definition at line 1592 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::getDifferentialOutput | ( | ) |
Get the current SM_DIFF setting from the VS10xx chip.
Read the VS10xx SCI_MODE register bits SM_DIFF for current SM_DIFF and return its results as a composite integer. To indicate if the Left Channel is either normal or differential output. As specified by Data Sheet Section 8.7.1
Definition at line 935 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::getEarSpeaker | ( | ) |
Get the current Spatial EarSpeaker setting from the VS10xx chip.
Read the VS10xx SCI_MODE register bits SM_EARSPEAKER_LO and SM_EARSPEAKER_HIGH for current EarSpeaker and return its results as a composite integer. As specified by Data Sheet Section 8.7.1 and 8.4
Definition at line 871 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::getMonoMode | ( | ) |
Get the current Stereo/Mono setting of the VS10xx output.
Read the VS10xx WRAMADDR bit 0 of para_MonoOutput] for the current Stereo/Mono and return its results as a byte. As specified by VS1053B PATCHES AND FLAC DECODER Data Sheet Section 1.2 Mono output mode.
Definition at line 989 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::getPlaySpeed | ( | ) |
Get the current playSpeed from the VS10xx chip.
Read the VS10xx extra parameter memory for playSpeed register and return its results. As specified by Data Sheet Section 9.11.1
Definition at line 831 of file vs1053_avr_renesas_uno.cpp.
| state_m vs1053::getState | ( | ) |
Get the current state of the device.
Reports the current operational status of the device from the list of possible states enumerated by state_m
Definition at line 1167 of file vs1053_avr_renesas_uno.cpp.
|
private |
Fetch ID3 Tag information.
| [in] | offset | for the desired information desired. |
| [out] | infobuffer | pointer char array of filename to be read. |
Read current filehandles offset of track ID3 tag information. Then strip all non readible (ascii) characters.
Definition at line 1469 of file vs1053_avr_renesas_uno.cpp.
| int8_t vs1053::getTrebleAmplitude | ( | ) |
Get the current Treble Amplitude from the VS10xx chip.
Definition at line 660 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::getTrebleFrequency | ( | ) |
Get the current Treble Frequency limit from the VS10xx chip.
Definition at line 646 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::getVolume | ( | ) |
Get the current volume from the VS10xx chip.
Read the VS10xx SC_VOL register and return its results As specified by Data Sheet Section 8.7.11
Definition at line 628 of file vs1053_avr_renesas_uno.cpp.
| int16_t vs1053::getVUlevel | ( | ) |
get current measured VU Meter
Returns the calculated peak sample values from both channels in 3 dB increaments through. Where the high byte represent the left channel, and the low bytes the right channel.
Values from 0 to 31 are valid for both channels.
Definition at line 1701 of file vs1053_avr_renesas_uno.cpp.
| int8_t vs1053::getVUmeter | ( | ) |
get the status of the VSdsp VU Meter
See data patches data sheet VU meter for details.
Definition at line 1658 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::isPlaying | ( | ) |
Inidicate if a song is playing?
Public method for determining if a file is streaming to the VSdsp.
Definition at line 1144 of file vs1053_avr_renesas_uno.cpp.
| uint16_t vs1053::memoryTest | ( | ) |
Perform Memory Test.
Perform the internal memory test of the VSdsp core processor and resources. As specified by Data Sheet Section 9.12.4
Definition at line 502 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Read a VS10xx register.
| [in] | addressbyte | of the VSdsp's register to be read |
Primative function to suspend playing and directly communicate over the SPI to the VSdsp's registers.
Definition at line 1860 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Read a VS10xx WRAM Location.
| [in] | addressbyte | of the VSdsp's WRAM to be read |
Function to communicate to the VSdsp's registers, indirectly accessing the WRAM. As per data sheet the result is read back twice to verify. As it is not buffered.
Definition at line 1908 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
uint16_t Overload of vs1053::Mp3WriteRegister
| [in] | addressbyte | of the VSdsp's register to be written |
| [in] | data | to writen to the register |
Forces the input value into the Big Endian Corresponding positions of Mp3WriteRegister as to be written to the addressed VSdsp's registers.
Definition at line 1799 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Write a value a VSDsp's register.
| [in] | addressbyte | of the VSdsp's register to be written |
| [in] | highbyte | to writen to the register |
| [in] | lowbyte | to writen to the register |
Primative function to suspend playing and directly communicate over the SPI to the VSdsp's registers. Where the value write is Big Endian (MSB first).
Definition at line 1816 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Write a VS10xx WRAM Location.
| [in] | addressbyte | of the VSdsp's WRAM to be read |
| [in] | data | written to the VSdsp's WRAM |
Function to communicate to the VSdsp's registers, indirectly accessing the WRAM.
Definition at line 1943 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::pauseDataStream | ( | ) |
Pause streaming data to the VSdsp.
Public method for disabling the refill with disableRefill().
Definition at line 1177 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::pauseMusic | ( | ) |
Pause music.
Public method for pausing the play of music.
Definition at line 1215 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::playMP3 | ( | char * | fileName, |
| uint32_t | timecode = 0 ) |
Begin playing a mp3 file by its filename.
| [out] | fileName | pointer of a char array (aka string), contianing the filename |
| [in] | timecode | (optional) milliseconds from the begining of the file. Only works with mp3 files, otherwise do nothing. |
Skip, if already playing. Otherwise initialize the SdCard track to desired filehandle. Reset the ByteRate and Play position and set playing to indicate such. If the filename extension is MP3, then pre-read the byterate from the file. And initially fill the VSDsp's buffer, then enable refilling.
SdFat::chvol() command prior, to select desired SdCard volume, if multiple cards are used. Definition at line 1074 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::playTrack | ( | uint8_t | trackNo | ) |
Begin playing a mp3 file, just with a number.
| [in] | trackNo | integer value between 0 and 9, corresponding to the track to play. |
Formats the input number into a corresponding filename, from track001.mp3 through track009.mp3. Then executes the track by calling vs1053::playMP3(char* fileName)
Definition at line 1032 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Refill the VS10xx buffer with new data.
This the primative function to refilling the VSdsp's buffers. And is typically called as an interrupt to the rising edge of the VS10xx's DREQ. Where if the DREQ is indicating not full, it will read 32 bytes from the filehandle's track and send them via SPI to the VSdsp's data stream buffer. Repeating until the DREQ indicates it is full.
When the filehandle's track indicates it is at the end of file. The track is closed, the playing indicator is set to false, interrupts for refilling are disabled and the VSdsp's data stream buffer is flushed appropiately.
Definition at line 1978 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::resumeDataStream | ( | ) |
Unpause streaming data to the VSdsp.
Public method for re-enabling the refill with enableRefill(). Where skipped if not currently playing.
Definition at line 1194 of file vs1053_avr_renesas_uno.cpp.
| bool vs1053::resumeMusic | ( | ) |
Resume music from where it was paused.
Public method for resuming the play of music from a specific file location.
Definition at line 1260 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::resumeMusic | ( | uint32_t | timecode | ) |
Resume music from pause at new location.
| [in] | timecode | (optional) milliseconds from the begining of the file. |
Public method for resuming the play of music from a specific file location.
Definition at line 1235 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::SendSingleMIDInote | ( | ) |
Play hardcoded MIDI file.
This the primative function to fill the VSdsp's buffers quicly. The intention is to send a quick MIDI file of a single note on and off. This can be used responses to buttons and such. Where the MIDI file is short enough to be stored into an array that can be delivered via SPI to the VSdsp's data stream buffer. Waiting for DREQ every 32 bytes.
Definition at line 2040 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setBassAmplitude | ( | uint8_t | amplitude | ) |
Set the current Bass Boost amplitude in VS10xx chip.
| [in] | amplitude | to Bass Boost amplitude in dB (0dB to 15dB). |
Definition at line 791 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setBassFrequency | ( | uint16_t | frequency | ) |
Set the current Bass Boost Frequency limit cutoff in VS10xx chip.
| [in] | frequency | of Bass Boost frequency cutoff limit in Hertz (20Hz to 150Hz). |
Definition at line 759 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setBitRate | ( | uint16_t | bitr | ) |
Force bit rate.
| [in] | bitr | new bit-rate |
Public method for forcing the percieved bit-rate to a desired value. Useful if auto-detect failed
Definition at line 1717 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setDifferentialOutput | ( | uint16_t | DiffMode | ) |
Set the current SM_DIFF setting of the VS10xx chip.
| [in] | DiffMode | integer value between 0 and 1. |
The input value is mapped onto the SM_DIFF of the SCI_MODE register, preserving the remainder of SCI_MODE. For stereo playback streams this creates a virtual sound, and for mono streams this creates a differential left/right output with a maximum output of 3V.
As specified by Data Sheet Section 8.7.1
Definition at line 959 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setEarSpeaker | ( | uint16_t | EarSpeaker | ) |
Set the current Spatial EarSpeaker setting of the VS10xx chip.
| [in] | EarSpeaker | integer value between 0 and 3. Where 0 is OFF and 3 is maximum. |
The input value is mapped onto SM_EARSPEAKER_LO and SM_EARSPEAKER_HIGH bits and written the VS10xx SCI_MODE register, preserving the remainder of SCI_MODE. As specified by Data Sheet Section 8.7.1 and 8.4
Definition at line 895 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setMonoMode | ( | uint16_t | StereoMode | ) |
Set the current Stereo/Mono setting of the VS10xx output.
Write the VS10xx WRAMADDR para_MonoOutput bit 0 to configure the current Stereo/Mono. As specified by VS1053B PATCHES AND FLAC DECODER Data Sheet Section 1.2 Mono output mode. While preserving the other bits.
Definition at line 1005 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setPlaySpeed | ( | uint16_t | data | ) |
Set the current playSpeed of the VS10xx chip.
Write the VS10xx extra parameter memory for playSpeed register with the desired multipler.
Where 0 and/or 1 are normal 1x speed. e.g. 4 to playSpeed will play the song four times as fast as normal, if you are able to feed the data with that speed. As specified by Data Sheet Section 9.11.1
Definition at line 851 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setTrebleAmplitude | ( | int8_t | amplitude | ) |
Set the current Treble Amplitude in VS10xx chip.
| [in] | amplitude | Treble in dB from -8 to 7. |
Definition at line 733 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setTrebleFrequency | ( | uint16_t | frequency | ) |
Set the current treble frequency limit in VS10xx chip.
| [in] | frequency | Treble cutoff limit in Hertz. |
Definition at line 705 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setVolume | ( | uint16_t | data | ) |
Overload function of vs1053::setVolume(leftchannel, rightchannel)
| [in] | data | packed with left and right master volume |
calls vs1053::setVolume expecting the left channel in the upper byte and right channel in the lower byte.
As specified by Data Sheet Section 8.7.11
Definition at line 572 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setVolume | ( | uint8_t | data | ) |
Overload function of vs1053::setVolume(leftchannel, rightchannel)
| [in] | data | byte to be placed into both Left and Right |
calls vs1053::setVolume placing the input into both the left channel and right channels.
As specified by Data Sheet Section 8.7.11
Definition at line 589 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::setVolume | ( | uint8_t | leftchannel, |
| uint8_t | rightchannel ) |
Store and Push member volume to VS10xx chip.
| [in] | leftchannel | writes the left channel master volume |
| [in] | rightchannel | writes the right channel master volume |
Updates the VS10xx SCI_VOL register's left and right master volume level in -0.5 dB Steps. Where maximum volume is 0x0000 and total silence is 0xFEFE. As specified by Data Sheet Section 8.7.11
Definition at line 606 of file vs1053_avr_renesas_uno.cpp.
| int8_t vs1053::setVUmeter | ( | int8_t | enable | ) |
enable VSdsp VU Meter
| [in] | enable | when set will enable the VU meter |
Writes the SS_VU_ENABLE bit of the SCI_STATUS register to enable VU meter on board to the VSdsp.
See data patches data sheet VU meter for details.
Definition at line 1678 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::skip | ( | int32_t | timecode | ) |
Skips to a duration in the track.
| [in] | timecode | offset milliseconds from the current location of the file. |
Repositions the filehandles track location to the requested offset. As calculated by the bitrate multiplied by the desired ms offset.
Definition at line 1284 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::skipTo | ( | uint32_t | timecode | ) |
Skips to a certain point in the track.
| [in] | timecode | offset milliseconds from the begining of the file. |
Repositions the filehandles track location to the requested offset. As calculated by the bitrate multiplied by the desired ms offset.
Definition at line 1340 of file vs1053_avr_renesas_uno.cpp.
|
staticprivate |
Initialize the SPI for VS10xx use.
Primative function to configure the SPI's BitOrder, DataMode and ClockDivider to that of the current VX10xx.
Definition at line 1732 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::stopTrack | ( | ) |
Gracefully close track and cancel refill.
Skip if already not playing. Otherwise Disable the refill means, then set playing to false, close the filehandle track instance. And finally flush the VSdsp's stream buffer.
Definition at line 1116 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::trackAlbum | ( | char * | infobuffer | ) |
Get Track's Album.
| [out] | infobuffer | pointer char array to be updated with result |
Extract the Album from the current filehandles track ID3 tag information.
Definition at line 1452 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::trackArtist | ( | char * | infobuffer | ) |
Get Track's Artist.
| [out] | infobuffer | pointer char array to be updated with result |
Extract the Artist from the current filehandles track ID3 tag information.
Definition at line 1420 of file vs1053_avr_renesas_uno.cpp.
| void vs1053::trackTitle | ( | char * | infobuffer | ) |
Get Track's Title.
| [out] | infobuffer | pointer char array to be updated with result |
Extract the Title from the current filehandles track ID3 tag information.
Definition at line 1436 of file vs1053_avr_renesas_uno.cpp.
| uint8_t vs1053::vs_init | ( | ) |
Initialize the VS10xx Audio Decoder Chip.
Reset and initialize the VS10xx chip's internal registers such as clock for normal operation with the vs1053 class's members. Along with uploading corresponding accumilative patch file, if present.
Definition at line 227 of file vs1053_avr_renesas_uno.cpp.
|
private |
load VS1xxx with patch or plugin from file on SDcard.
| [out] | fileName | pointer of a char array (aka string), contianing the filename |
Loads the VX10xx with filename of the specified patch, if present. This can be used to load various VSdsp apps, patches and plug-in's. Providing many new features and updates not present on the default firmware.
The file format of the plugin is raw binary, in VLSI's interleaved and RLE compressed format, as extracted from the source plugin file (.plg). A perl script vs_plg_to_bin.pl is provided to convert the .plg file in to the binary filename.053. Where the extension of .053 is a convention to indicate the VSdsp chip version.
Definition at line 332 of file vs1053_avr_renesas_uno.cpp.
|
private |
contains a local value of the beleived current bit-rate.
Definition at line 761 of file vs1053_avr_renesas_uno.h.
|
staticprivate |
Buffer for moving data between Filehandle and VSdsp.
Definition at line 758 of file vs1053_avr_renesas_uno.h.
|
staticprivate |
Boolean flag indicating if filehandle is streaming.
Initializer for the instance of the SdCard's static member.
Definition at line 752 of file vs1053_avr_renesas_uno.h.
|
staticprivate |
Rate of the SPI to be used with communicating to the VSdsp.
Initializer for the instance of the SdCard's static member.
Definition at line 755 of file vs1053_avr_renesas_uno.h.
|
private |
contains a filehandles offset to the begining of the current file.
Definition at line 764 of file vs1053_avr_renesas_uno.h.
|
staticprivate |
Initializer for the instance of the SdCard's static member.
Definition at line 730 of file vs1053_avr_renesas_uno.h.
|
private |
contains a local value of the VSdsp's master volume left channels
Definition at line 767 of file vs1053_avr_renesas_uno.h.
|
private |
contains a local value of the VSdsp's master volume Right channels
Definition at line 770 of file vs1053_avr_renesas_uno.h.