#include <stdlib.h>
#include <stdio.h>
#include "amd186.h"
#include "clib/hwapi.h"
#include "clib/rtos.h"
#include "misc.h"
#include "vs1001.h"
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | SCI_Write (unsigned data) |
unsigned | SCI_Read () |
unsigned | SCI_ReadReg (int address) |
void | SCI_WriteReg (int address, unsigned data) |
void interrupt | DmaHandler (...) |
Interrupt handler for DMA channel terminal count. | |
bool | VS_IsPlaying () |
Check asynchronous playback status. | |
void | VS_PlayMpegAsync (char *data, unsigned len, void(*function)(void *), void *param) |
Asynchronously play a block of MPEG data. | |
int | VS_PlayMpegSync (char *data, unsigned len) |
Play a block of MPEG Data, and wait for completion. | |
void | SDI_WriteZeros (unsigned length) |
Send a stream of zeros to the VS1001. | |
void | VS_Stop () |
Stop playback of current stream. | |
void | VS_SetVolume (int left, int right) |
Set the output volume for both channels. | |
void | VS_GetMPEGHeader (unsigned long *header) |
Get MPEG Header information. | |
void | VS_SetClockFreq (long frequency) |
Set Clock frequency. | |
void | VS_SetBassBoost (bool onoff) |
Enable bass and treble enhancement (VS1001k only). | |
void | VS_SDITest () |
Test SDI Interface - generate short beeps. | |
void | VS_SCITest () |
Test SCI Interface - generate snapping sounds. | |
void | VS_Dump () |
Dump all SCI register contents. | |
void | VS_Reset () |
Initiate a software reset. | |
void | VS_Init () |
Set up hardware resources for the VS1001 interface. | |
void | VS_Done () |
Free all resources used by the VS1001 interface. | |
Variables | |
int | lastVolLeft |
int | lastVolRight |
long | lastFrequency |
bool | lastBassBoost |
void interrupt(* | oldDmaHandler )(...) |
void(* | callbackFunction )(void *) |
void * | callbackParam |
|
Interrupt handler for DMA channel terminal count. This handler will call the user specified callback function, after the playback of a data block has finished. Definition at line 109 of file vs1001.cpp. References callbackFunction, callbackParam, and oldDmaHandler. Referenced by VS_Init(). |
|
Definition at line 63 of file vs1001.cpp. References AMD_GetPio(), AMD_PioHigh(), AMD_PioLow(), SCI_SCLKPIO, and SCI_SOPIO. Referenced by SCI_ReadReg(). |
|
Definition at line 76 of file vs1001.cpp. References AMD_EnableDrq(), AMD_PioHigh(), AMD_PioLow(), SCI_Read(), SCI_SCLKPIO, SCI_Write(), SCI_XCSPIO, SDI_DMACHANNEL, and usleep(). Referenced by VS_Dump(), VS_GetMPEGHeader(), VS_Reset(), and VS_SetBassBoost(). |
|
Definition at line 50 of file vs1001.cpp. References AMD_PioHigh(), AMD_PioLow(), SCI_SCLKPIO, and SCI_SIPIO. Referenced by SCI_ReadReg(), and SCI_WriteReg(). |
|
Definition at line 90 of file vs1001.cpp. References AMD_EnableDrq(), AMD_PioHigh(), AMD_PioLow(), SCI_SCLKPIO, SCI_Write(), SCI_XCSPIO, SDI_DMACHANNEL, and usleep(). Referenced by VS_Reset(), VS_SetBassBoost(), VS_SetClockFreq(), and VS_SetVolume(). |
|
Send a stream of zeros to the VS1001. This function can be used to flush the internal bitstream buffer of the 1001.
Definition at line 200 of file vs1001.cpp. References VS_PlayMpegSync(). Referenced by VS_Reset(). |
|
Free all resources used by the VS1001 interface.
Definition at line 417 of file vs1001.cpp. References oldDmaHandler, and VS_Stop(). Referenced by main(). |
|
Dump all SCI register contents.
Definition at line 338 of file vs1001.cpp. References SCI_A1ADDR, SCI_A1CTRL0, SCI_A1CTRL1, SCI_A1CTRL2, SCI_AUDATA, SCI_CLOCKF, SCI_DECTIME, SCI_HDAT0, SCI_HDAT1, SCI_MODE, SCI_ReadReg(), SCI_STATUS, and SCI_VOL. |
|
Get MPEG Header information. Returns the current header for the stream being decoded. Right after reset, 0 will be returned, indicating that no data has been found yet.
Definition at line 250 of file vs1001.cpp. References SCI_HDAT0, SCI_HDAT1, and SCI_ReadReg(). |
|
Set up hardware resources for the VS1001 interface.
Definition at line 384 of file vs1001.cpp. References DmaHandler(), lastBassBoost, lastFrequency, lastVolLeft, lastVolRight, oldDmaHandler, pfe_enable_bus(), pfe_enable_pcs(), pfe_enable_pio(), PIO_IPU, PIO_O0, PIO_O1, SCI_SCLKPIO, SCI_SIPIO, SCI_SOPIO, SCI_XCSPIO, SDI_DATAREG, VS_CLOCK, and VS_Reset(). Referenced by main(). |
|
Check asynchronous playback status.
Definition at line 122 of file vs1001.cpp. References AMD_GetDmaInfo(), DmaInfo::control, DCON_ST, and SDI_DMACHANNEL. Referenced by BUF_Play(), http_get(), and VS_PlayMpegSync(). |
|
Asynchronously play a block of MPEG data. You can either specify a callback function, or poll the transfer status using VS_IsPlaying()
Definition at line 149 of file vs1001.cpp. References AMD_EnableDrq(), AMD_StartDma(), callbackFunction, callbackParam, DmaInfo::control, DCON_DSYNC, DCON_INT, DCON_SINC, DCON_SMIO, DCON_TC, DmaInfo::dstPort, DmaInfo::length, SDI_DATAREG, SDI_DMACHANNEL, and DmaInfo::srcMem. Referenced by BUF_Play(), http_get(), and VS_PlayMpegSync(). |
|
Play a block of MPEG Data, and wait for completion.
Definition at line 184 of file vs1001.cpp. References VS_IsPlaying(), VS_OK, and VS_PlayMpegAsync(). Referenced by SDI_WriteZeros(), and VS_SDITest(). |
|
Initiate a software reset. All previous VS1001 settings are automatically restored by this function. Definition at line 362 of file vs1001.cpp. References AMD_EnableDrq(), lastBassBoost, lastFrequency, lastVolLeft, lastVolRight, SCI_MODE, SCI_ReadReg(), SCI_WriteReg(), SDI_DMACHANNEL, SDI_WriteZeros(), SM_RESET, usleep(), VS_SetBassBoost(), VS_SetClockFreq(), and VS_SetVolume(). |
|
Test SCI Interface - generate snapping sounds.
Definition at line 320 of file vs1001.cpp. References RTX_Sleep_Time(), and VS_SetVolume(). |
|
Test SDI Interface - generate short beeps.
Definition at line 299 of file vs1001.cpp. References RTX_Sleep_Time(), and VS_PlayMpegSync(). |
|
Enable bass and treble enhancement (VS1001k only).
Definition at line 284 of file vs1001.cpp. References lastBassBoost, SCI_MODE, SCI_ReadReg(), SCI_WriteReg(), and SM_BASS. Referenced by VS_Reset(). |
|
Set Clock frequency. This function needs to be called if the chip is running at something else than 24.576MHz. The Clock frequency may be between 0 .. 65.534 MHz, although hardware limits the highest possible speed.
Definition at line 269 of file vs1001.cpp. References lastFrequency, SCI_CLOCKF, and SCI_WriteReg(). Referenced by VS_Reset(). |
|
Set the output volume for both channels. 255 is the maximum volume, 0 the minimum. Note that a volume setting of 0 will enter the analog powersave mode, and causes a slight snapping sound. If you want to avoid this, set the volume to 1 instead of 0.
Definition at line 234 of file vs1001.cpp. References lastVolLeft, lastVolRight, SCI_VOL, and SCI_WriteReg(). Referenced by VS_Reset(), and VS_SCITest(). |
|
Stop playback of current stream.
Definition at line 217 of file vs1001.cpp. References AMD_StopDma(), and SDI_DMACHANNEL. Referenced by VS_Done(). |
|
Definition at line 46 of file vs1001.cpp. Referenced by DmaHandler(), and VS_PlayMpegAsync(). |
|
Definition at line 47 of file vs1001.cpp. Referenced by DmaHandler(), and VS_PlayMpegAsync(). |
|
Definition at line 38 of file vs1001.cpp. Referenced by VS_Init(), VS_Reset(), and VS_SetBassBoost(). |
|
Definition at line 37 of file vs1001.cpp. Referenced by VS_Init(), VS_Reset(), and VS_SetClockFreq(). |
|
Definition at line 36 of file vs1001.cpp. Referenced by VS_Init(), VS_Reset(), and VS_SetVolume(). |
|
Definition at line 36 of file vs1001.cpp. Referenced by VS_Init(), VS_Reset(), and VS_SetVolume(). |
|
Definition at line 42 of file vs1001.cpp. Referenced by DmaHandler(), VS_Done(), and VS_Init(). |