RetroArch
|
AUDIO subsystem. More...
#include <gctypes.h>
Go to the source code of this file.
Macros | |
#define | AI_STREAM_STOP 0x00000000 |
#define | AI_STREAM_START 0x00000001 |
#define | AI_SAMPLERATE_32KHZ 0x00000000 |
#define | AI_SAMPLERATE_48KHZ 0x00000001 |
Typedefs | |
typedef void(* | AIDCallback) (void) |
function pointer typedef for the user's Audio DMA interrupt callback More... | |
typedef void(* | AISCallback) (u32 smp_cnt) |
function pointer typedef for the user's Audio Streaming interrupt callback More... | |
Functions | |
AISCallback | AUDIO_RegisterStreamCallback (AISCallback callback) |
Register a user callback function for the AUDIO streaming interface. More... | |
void | AUDIO_Init (u8 *stack) |
Initialize the AUDIO subsystem. More... | |
void | AUDIO_SetStreamVolLeft (u8 vol) |
Set streaming volume on the left channel. More... | |
u8 | AUDIO_GetStreamVolLeft () |
Get streaming volume of the left channel. More... | |
void | AUDIO_SetStreamVolRight (u8 vol) |
set streaming volume of the right channel. More... | |
u8 | AUDIO_GetStreamVolRight () |
Get streaming volume of the right channel. More... | |
void | AUDIO_SetStreamSampleRate (u32 rate) |
Set streaming sample rate. More... | |
u32 | AUDIO_GetStreamSampleRate () |
Get streaming sample rate. 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_GetDMALength () |
Get the DMA transfer length configured in the audio DMA interface. More... | |
u32 | AUDIO_GetDMAStartAddr () |
Get the main memory address for the DMA operation. More... | |
void | AUDIO_SetStreamTrigger (u32 cnt) |
Set the sample count for the stream trigger. More... | |
void | AUDIO_ResetStreamSampleCnt () |
Reset the stream sample count register. 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... | |
void | AUDIO_SetStreamPlayState (u32 state) |
Set the play state for the streaming audio interface. More... | |
u32 | AUDIO_GetStreamPlayState () |
Get the play state from the streaming audio interface. More... | |
AUDIO subsystem.
function pointer typedef for the user's Audio DMA interrupt callback
none |
function pointer typedef for the user's Audio Streaming interrupt callback
smp_cnt | AI sample count |
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.
u32 AUDIO_GetStreamPlayState | ( | ) |
Get the play state from the streaming audio interface.
u32 AUDIO_GetStreamSampleRate | ( | ) |
Get streaming sample rate.
u8 AUDIO_GetStreamVolLeft | ( | ) |
Get streaming volume of the left channel.
u8 AUDIO_GetStreamVolRight | ( | ) |
Get streaming volume of the right channel.
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. |
AISCallback AUDIO_RegisterStreamCallback | ( | AISCallback | callback | ) |
Register a user callback function for the AUDIO streaming interface.
[in] | callback | pointer to the function which to call when AIS interrupt has triggered. |
void AUDIO_ResetStreamSampleCnt | ( | ) |
Reset the stream sample count register.
Set the sampling rate for the DSP interface.
[in] | rate | sampling rate to set for the DSP (AI_SAMPLERATE_32KHZ,AI_SAMPLERATE_48KHZ) |
Set the play state for the streaming audio interface.
[in] | state | playstate of the streaming audio interface (AI_STREAM_STOP,AI_STREAM_START) |
Set the sample count for the stream trigger.
[in] | cnt | count of samples when to trigger the audio stream. |
Set streaming volume on the left channel.
[in] | vol | level of volume 0<= vol <=255 |
set streaming volume of the right channel.
[in] | vol | level of volume 0<= vol <=255 |
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.