RetroArch
Classes | Macros | Typedefs | Functions
dsp.h File Reference

DSP subsystem. More...

#include <gctypes.h>
Include dependency graph for dsp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _dsp_task
 

Macros

#define DSPTASK_INIT   0
 
#define DSPTASK_RUN   1
 
#define DSPTASK_YIELD   2
 
#define DSPTASK_DONE   3
 
#define DSPTASK_CLEARALL   0x00000000
 
#define DSPTASK_ATTACH   0x00000001
 
#define DSPTASK_CANCEL   0x00000002
 

Typedefs

typedef struct _dsp_task dsptask_t
 forward typdef to struct _dsp_task. This struture holds certain DSP task information for execution. More...
 
typedef void(* DSPTaskCallback) (dsptask_t *task)
 function pointer typedef for the user's DSP task callbacks More...
 
typedef void(* DSPCallback) (void)
 function pointer typedef for the user's DSP interrupt callback More...
 

Functions

void DSP_Init ()
 Initialize DSP subsystem. More...
 
u32 DSP_CheckMailTo ()
 Check if mail was sent to DSP. More...
 
u32 DSP_CheckMailFrom ()
 Check for mail from DSP. More...
 
u32 DSP_ReadMailFrom ()
 Read mail from DSP. More...
 
void DSP_AssertInt ()
 Asserts the processor interface interrupt. More...
 
void DSP_SendMailTo (u32 mail)
 Send mail to DSP. More...
 
u32 DSP_ReadCPUtoDSP ()
 Read back CPU->DSP mailbox. More...
 
dsptask_tDSP_AddTask (dsptask_t *task)
 Add a DSP task to the tasklist and start executing if necessary. More...
 
dsptask_tDSP_AssertTask (dsptask_t *task)
 
void DSP_CancelTask (dsptask_t *task)
 
void DSP_Reset ()
 
void DSP_Halt ()
 
void DSP_Unhalt ()
 
DSPCallback DSP_RegisterCallback (DSPCallback usr_cb)
 Register an user's interrupt callback. This may be used to handle DSP interrupts on its own. By default a system default callback is installed on DSP_Init(). More...
 

Detailed Description

DSP subsystem.

Typedef Documentation

◆ DSPCallback

void(* DSPCallback)(void)

function pointer typedef for the user's DSP interrupt callback

◆ dsptask_t

forward typdef to struct _dsp_task. This struture holds certain DSP task information for execution.

Parameters
statecurrent task state set
priopriority of the task
flagscurrnet task flag(s) set.
init_vecinitialization vector. depends on the DSP code to execute.
resume_vecresume vector. depends on the DSP code to execute.
iram_maddrmain memory address of i-ram image. NOTE: Has to be aligned on a 32byte boundery!
iram_lensize of i-ram image. NOTE: Should be a multiple of 32
iram_addrDSP i-ram address to load the image to.
dram_maddrmain memory address of d-ram image. NOTE: Has to be aligned on a 32byte boundery!
dram_lensize of d-ram image. NOTE: Should be a multiple of 32
dram_addrDSP d-ram address to load the image to.
init_cbpointer to the user's init callback function. Called durring task initialization.
res_cbpointer to the user's resume callback function. Called when the task should resume.
done_cbpointer to the user's done callback function. Called when the task has finished.
req_cbpointer to the user's request callback function. Used to retrieve data from main application durring execution.
nextpointer to the next task in the doubly linked list.
prevpointer to the previous task in the doubly linked list.

◆ DSPTaskCallback

void(* DSPTaskCallback)(dsptask_t *task)

function pointer typedef for the user's DSP task callbacks

Parameters
[in]taskpointer to the dsp_task structure.

Function Documentation

◆ DSP_AddTask()

dsptask_t * DSP_AddTask ( dsptask_t task)

Add a DSP task to the tasklist and start executing if necessary.

Parameters
[in]taskpointer to a dsptask_t structure which holds all necessary values for DSP task execution.
Returns
current task
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DSP_AssertInt()

void DSP_AssertInt ( )

Asserts the processor interface interrupt.

Returns
none

◆ DSP_AssertTask()

dsptask_t* DSP_AssertTask ( dsptask_t task)

◆ DSP_CancelTask()

void DSP_CancelTask ( dsptask_t task)

◆ DSP_CheckMailFrom()

u32 DSP_CheckMailFrom ( )

Check for mail from DSP.

Returns
1: has mail, 0: no mail
Here is the caller graph for this function:

◆ DSP_CheckMailTo()

u32 DSP_CheckMailTo ( )

Check if mail was sent to DSP.

Returns
1: mail sent, 0: mail on route
Here is the caller graph for this function:

◆ DSP_Halt()

void DSP_Halt ( )

◆ DSP_Init()

void DSP_Init ( )

Initialize DSP subsystem.

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DSP_ReadCPUtoDSP()

u32 DSP_ReadCPUtoDSP ( )

Read back CPU->DSP mailbox.

Returns
mail value received

◆ DSP_ReadMailFrom()

u32 DSP_ReadMailFrom ( )

Read mail from DSP.

Returns
mail value received
Here is the caller graph for this function:

◆ DSP_RegisterCallback()

DSPCallback DSP_RegisterCallback ( DSPCallback  usr_cb)

Register an user's interrupt callback. This may be used to handle DSP interrupts on its own. By default a system default callback is installed on DSP_Init().

Parameters
[in]user_cbpointer to the user's interrupt callback function. \
Returns
pointer to old interrupt callback function.
Here is the call graph for this function:

◆ DSP_Reset()

void DSP_Reset ( )

◆ DSP_SendMailTo()

void DSP_SendMailTo ( u32  mail)

Send mail to DSP.

Parameters
[in]mailvalue to send
Returns
none
Here is the caller graph for this function:

◆ DSP_Unhalt()

void DSP_Unhalt ( )