Void dumpRegs(void) - Prints the contents of the MODE, STATUS, CLOCKF and VOLUME registers. Void setVolume(uint8_t left, uint8_t right) - Set the output volume for the chip. Uint16_t decodeTime(void) - Reads the DECODETIME register from the chip. Uint8_t spiread(void) - Low-level SPI read operation. Void spiwrite(uint8_t d) - Low-level SPI write operation. Void sineTest(uint8_t n, uint16_t ms) - Generate a sine-wave test signal. Void sciWrite(uint8_t addr, uint16_t data) - Writes to the specified register on the chip. Uint16_t sciRead(uint8_t addr) - Reads from the specified register on the chip. Void softReset(void) - Attempts a soft reset of the chip. Void reset(void) - Performs a hard reset of the chip. Uint8_t begin(void) - Initialize SPI communication and (hard) reset the chip. Public Methods: Adafruit_VS1053(uint8_t mosi, uint8_t miso, uint8_t clk, uint8_t rst, uint8_t cs, uint8_t dcs, uint8_t dreq) - Software SPI constructor - must specify all pins.Īdafruit_VS1053(uint8_t rst, uint8_t cs, uint8_t dcs, uint8_t dreq) - Hardware SPI constructor - assumes hardware SPI pins. We suggest sticking to the FilePlayer class (previous section) which abstracts a lot of this out for you. Its a little more powerful but it's also harder to use. For more detail on the operation of the VS1053 chip, please refer to the documentation on the Downloads page (see the link to the left). The Adafruit_VS1053 class implements an interface to the basic VS1053 functionality. This function will not return until the playback is complete. This allows your program to perform other tasks as the file is playing.īoolean playFullFile(char *trackname) - Play the complete file. Valid arguments are:īoolean startPlayingFile(char *trackname) - Begin playing the specified file from the SD card using interrupt-driven playback. Returns true if a VS1053 is foundīoolean useInterrupt(uint8_t type) - Specifies the interrupt to use for interrupt-driven playback. This is what you'll likely use if you're using the shield.īoolean begin(void) - Initialize communication and reset the chip. Uses Hardware SPI and assumes the default SPI pins. Uses Software SPI, so you must specify all SPI pins.Īdafruit_VS1053_FilePlayer (int8_t rst, int8_t cs, int8_t dcs, int8_t dreq, int8_t cardCS) - Hardware SPI constructor. We dont use it.Īdafruit_VS1053_FilePlayer (int8_t mosi, int8_t miso, int8_t clk, int8_t rst, int8_t cs, int8_t dcs, int8_t dreq, int8_t cardCS) - Software SPI constructor. Use a pullup on a digital pin to detect when a SD card is inserted. CD - this is the card detect pin, it is tied to ground when a card is inserted. ![]()
0 Comments
Leave a Reply. |