libogc
v2.9.0
|
AUDIO subsystem. More...
#include <gctypes.h>
Macros | |
#define | AI_SAMPLERATE_32KHZ 0x00000000 |
#define | AI_SAMPLERATE_48KHZ 0x00000001 |
#define | AI_STREAM_START 0x00000001 |
#define | AI_STREAM_STOP 0x00000000 |
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 | |
u32 | AUDIO_GetDMABytesLeft (void) |
Get the count of bytes, left to play, from the audio DMA interface. More... | |
u16 | AUDIO_GetDMAEnableFlag (void) |
Get the audio DMA flag. More... | |
u32 | AUDIO_GetDMALength (void) |
Get the DMA transfer length configured in the audio DMA interface. More... | |
u32 | AUDIO_GetDMAStartAddr (void) |
Get the main memory address for the DMA operation. More... | |
u32 | AUDIO_GetDSPSampleRate (void) |
Get the sampling rate for the DSP interface. More... | |
u32 | AUDIO_GetStreamPlayState (void) |
Get the play state from the streaming audio interface. More... | |
u32 | AUDIO_GetStreamSampleRate (void) |
Get streaming sample rate. More... | |
u8 | AUDIO_GetStreamVolLeft (void) |
Get streaming volume of the left channel. More... | |
u8 | AUDIO_GetStreamVolRight (void) |
Get streaming volume of the right channel. More... | |
void | AUDIO_Init (u8 *stack) |
Initialize the AUDIO subsystem. More... | |
void | AUDIO_InitDMA (u32 startaddr, u32 len) |
Initialize an audio DMA transfer. More... | |
AIDCallback | AUDIO_RegisterDMACallback (AIDCallback callback) |
Register a user callback function for the audio DMA interface. More... | |
AISCallback | AUDIO_RegisterStreamCallback (AISCallback callback) |
Register a user callback function for the AUDIO streaming interface. More... | |
void | AUDIO_ResetStreamSampleCnt (void) |
Reset the stream sample count register. More... | |
void | AUDIO_SetDSPSampleRate (u8 rate) |
Set the sampling rate for the DSP interface. More... | |
void | AUDIO_SetStreamPlayState (u32 state) |
Set the play state for the streaming audio interface. More... | |
void | AUDIO_SetStreamSampleRate (u32 rate) |
Set streaming sample rate. More... | |
void | AUDIO_SetStreamTrigger (u32 cnt) |
Set the sample count for the stream trigger. More... | |
void | AUDIO_SetStreamVolLeft (u8 vol) |
Set streaming volume on the left channel. More... | |
void | AUDIO_SetStreamVolRight (u8 vol) |
set streaming volume of the right channel. More... | |
void | AUDIO_StartDMA (void) |
Start the audio DMA operation. More... | |
void | AUDIO_StopDMA (void) |
Stop the previously started audio DMA operation. More... | |
AUDIO subsystem.
void(* AIDCallback)(void) |
function pointer typedef for the user's Audio DMA interrupt callback
none |
void(* AISCallback)(u32 smp_cnt) |
function pointer typedef for the user's Audio Streaming interrupt callback
smp_cnt | AI sample count |
u32 AUDIO_GetDMABytesLeft | ( | void | ) |
Get the count of bytes, left to play, from the audio DMA interface.
u16 AUDIO_GetDMAEnableFlag | ( | void | ) |
Get the audio DMA flag.
u32 AUDIO_GetDMALength | ( | void | ) |
Get the DMA transfer length configured in the audio DMA interface.
u32 AUDIO_GetDMAStartAddr | ( | void | ) |
Get the main memory address for the DMA operation.
u32 AUDIO_GetDSPSampleRate | ( | void | ) |
Get the sampling rate for the DSP interface.
u32 AUDIO_GetStreamPlayState | ( | void | ) |
Get the play state from the streaming audio interface.
u32 AUDIO_GetStreamSampleRate | ( | void | ) |
Get streaming sample rate.
u8 AUDIO_GetStreamVolLeft | ( | void | ) |
Get streaming volume of the left channel.
u8 AUDIO_GetStreamVolRight | ( | void | ) |
Get streaming volume of the right channel.
void AUDIO_Init | ( | u8 * | stack | ) |
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 | ( | void | ) |
Reset the stream sample count register.
void AUDIO_SetDSPSampleRate | ( | u8 | rate | ) |
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_SetStreamPlayState | ( | u32 | state | ) |
Set the play state for the streaming audio interface.
[in] | state | playstate of the streaming audio interface (AI_STREAM_STOP,AI_STREAM_START) |
void AUDIO_SetStreamSampleRate | ( | u32 | rate | ) |
void AUDIO_SetStreamTrigger | ( | u32 | cnt | ) |
Set the sample count for the stream trigger.
[in] | cnt | count of samples when to trigger the audio stream. |
void AUDIO_SetStreamVolLeft | ( | u8 | vol | ) |
Set streaming volume on the left channel.
[in] | vol | level of volume 0<= vol <=255 |
void AUDIO_SetStreamVolRight | ( | u8 | vol | ) |
set streaming volume of the right channel.
[in] | vol | level of volume 0<= vol <=255 |
void AUDIO_StartDMA | ( | void | ) |
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 | ( | void | ) |
Stop the previously started audio DMA operation.