|
RetroArch
|
#include <stdlib.h>#include "asm.h"#include "processor.h"#include "irq.h"#include "audio.h"#include "lwp_watchdog.h"Macros | |
| #define | STACKSIZE 16384 |
| #define | DSPCR_DSPRESET 0x0800 |
| #define | DSPCR_DSPDMA 0x0200 |
| #define | DSPCR_DSPINTMSK 0x0100 |
| #define | DSPCR_DSPINT 0x0080 |
| #define | DSPCR_ARINTMSK 0x0040 |
| #define | DSPCR_ARINT 0x0020 |
| #define | DSPCR_AIINTMSK 0x0010 |
| #define | DSPCR_AIINT 0x0008 |
| #define | DSPCR_HALT 0x0004 |
| #define | DSPCR_PIINT 0x0002 |
| #define | DSPCR_RES 0x0001 |
| #define | AI_CONTROL 0 |
| #define | AI_STREAM_VOL 1 |
| #define | AI_SAMPLE_COUNT 2 |
| #define | AI_INT_TIMING 3 |
| #define | AI_PSTAT 0x01 |
| #define | AI_AISFR 0x02 |
| #define | AI_AIINTMSK 0x04 |
| #define | AI_AIINT 0x08 |
| #define | AI_AIINTVLD 0x10 |
| #define | AI_SCRESET 0x20 |
| #define | AI_DMAFR 0x40 |
| #define | _SHIFTL(v, s, w) ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s))) |
| #define | _SHIFTR(v, s, w) ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1))) |
Functions | |
| static u8 *__CallbackStack | __attribute__ ((used)) |
| static void | __AICallbackStackSwitch (AIDCallback handler) |
| static void | __AIDHandler (u32 nIrq, void *pCtx) |
| static void | __AISRCINIT () |
| void | AUDIO_Init (u8 *stack) |
| Initialize the AUDIO subsystem. More... | |
| AIDCallback | AUDIO_RegisterDMACallback (AIDCallback callback) |
| Register a user callback function for the audio DMA interface. More... | |
| void | AUDIO_InitDMA (u32 startaddr, u32 len) |
| Initialize an audio DMA transfer. More... | |
| u16 | AUDIO_GetDMAEnableFlag () |
| Get the audio DMA flag. More... | |
| void | AUDIO_StartDMA () |
| Start the audio DMA operation. More... | |
| void | AUDIO_StopDMA () |
| Stop the previously started audio DMA operation. More... | |
| u32 | AUDIO_GetDMABytesLeft () |
| Get the count of bytes, left to play, from the audio DMA interface. More... | |
| u32 | AUDIO_GetDMAStartAddr () |
| Get the main memory address for the DMA operation. More... | |
| u32 | AUDIO_GetDMALength () |
| Get the DMA transfer length configured in the audio DMA interface. More... | |
| void | AUDIO_SetDSPSampleRate (u8 rate) |
| Set the sampling rate for the DSP interface. More... | |
| u32 | AUDIO_GetDSPSampleRate () |
| Get the sampling rate for the DSP interface. More... | |
Variables | |
| static vu16 *const | _dspReg = (u16*)0xCC005000 |
| static u32 | __AIInitFlag = 0 |
| static u32 | __AIActive = 0 |
| static u64 | bound_32KHz |
| static u64 | bound_48KHz |
| static u64 | min_wait |
| static u64 | max_wait |
| static u64 | buffer |
| static AIDCallback | __AID_Callback |
| #define AI_AIINT 0x08 |
| #define AI_AIINTMSK 0x04 |
| #define AI_AIINTVLD 0x10 |
| #define AI_AISFR 0x02 |
| #define AI_CONTROL 0 |
| #define AI_DMAFR 0x40 |
| #define AI_INT_TIMING 3 |
| #define AI_PSTAT 0x01 |
| #define AI_SAMPLE_COUNT 2 |
| #define AI_SCRESET 0x20 |
| #define AI_STREAM_VOL 1 |
| #define DSPCR_AIINT 0x0008 |
| #define DSPCR_AIINTMSK 0x0010 |
| #define DSPCR_ARINT 0x0020 |
| #define DSPCR_ARINTMSK 0x0040 |
| #define DSPCR_DSPDMA 0x0200 |
| #define DSPCR_DSPINT 0x0080 |
| #define DSPCR_DSPINTMSK 0x0100 |
| #define DSPCR_DSPRESET 0x0800 |
| #define DSPCR_HALT 0x0004 |
| #define DSPCR_PIINT 0x0002 |
| #define DSPCR_RES 0x0001 |
| #define STACKSIZE 16384 |
|
static |
|
static |
|
static |
| u32 AUDIO_GetDMABytesLeft | ( | ) |
Get the count of bytes, left to play, from the audio DMA interface.
| u16 AUDIO_GetDMAEnableFlag | ( | ) |
Get the audio DMA flag.
| u32 AUDIO_GetDMALength | ( | ) |
Get the DMA transfer length configured in the audio DMA interface.
| u32 AUDIO_GetDMAStartAddr | ( | ) |
Get the main memory address for the DMA operation.
| u32 AUDIO_GetDSPSampleRate | ( | ) |
Get the sampling rate for the DSP interface.
Initialize the AUDIO subsystem.
| [in] | stack | pointer to a memory area to work as stack when calling the callbacks. May be NULL |
Initialize an audio DMA transfer.
| [in] | startaddr | start address of the memory region to load into the audio DMA. NOTE: Has to be aligned on a 32byte boundery! |
| [in] | len | lenght of data to load into the audio DMA. NOTE: Should be a multiple of 32 |
| AIDCallback AUDIO_RegisterDMACallback | ( | AIDCallback | callback | ) |
Register a user callback function for the audio DMA interface.
This callback will be called whenever the audio DMA requests new data.<br> Internally the DMA buffers are double buffered.
| [in] | callback | pointer to the function which to call when AID interrupt has triggered. |
Set the sampling rate for the DSP interface.
| [in] | rate | sampling rate to set for the DSP (AI_SAMPLERATE_32KHZ,AI_SAMPLERATE_48KHZ) |
| void AUDIO_StartDMA | ( | ) |
Start the audio DMA operation.
Starts to transfer the data from main memory to the audio interface thru DMA.<br> This call should follow the call to AUDIO_InitDMA() which is used to initialize DMA transfers.
| void AUDIO_StopDMA | ( | ) |
Stop the previously started audio DMA operation.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
1.8.15