dsp.h File Reference

#include <types.h>
#include <broadway.h>

Go to the source code of this file.

Data Structures

struct  dsp_ucode_t

Functions

int dsp_initialize (void)
 Initialize the DSP subsystem.
int dsp_shutdown (void)
 Shut down the DSP subsystem.
void dsp_reset (void)
 Resets the DSP.
void dsp_send_mail (u32 data)
 Sends mail to the DSP.
u32 dsp_read_outbox (void)
 Reads mail sent to the DSP.
u32 dsp_recv_mail (void)
 Recieves mail from the DSP.
BOOL dsp_check_inbox (void)
 Checks if the incoming mail is valid.
BOOL dsp_check_outbox (void)
 Checks if the outgoing mail is valid.
BOOL dsp_halt (void)
 Halts the DSP.
BOOL dsp_unhalt (void)
 Unhalts the DSP.
int irq_dsp_register_handler (int(*exec)(u32 irq, void *data), void *data)
 Register the DSP IRQ handler.
irq_handler_t irq_dsp_get_handler (void)
 Gets the DSP IRQ handler.
void irq_dsp_enable (void)
 Enables the DSP IRQ.
void irq_dsp_disable (void)
 Disables the DSP IRQ.
int dsp_upload_ucode (dsp_ucode_t ucode)
 Uploads a uCode to the DSP.

Detailed Description

An abstraction of the interface to the DSP. Buggy.

Todo:

Disassemble the DSP init code.

Clean up dsp_initialize()


Function Documentation

BOOL dsp_check_inbox ( void   ) 

Checks if the incoming mail is valid.

Returns:
TRUE if the incoming mail is valid, FALSE otherwise.
See also:
dsp_read_outbox(), dsp_check_outbox(), dsp_recv_mail()
BOOL dsp_check_outbox ( void   ) 

Checks if the outgoing mail is valid.

Returns:
TRUE if the outgoing mail is valid, FALSE otherwise.
See also:
dsp_read_outbox(), dsp_check_inbox(), dsp_recv_mail()
BOOL dsp_halt ( void   ) 

Halts the DSP.

Returns:
TRUE if the the DSP was previously running, FALSE otherwise.
See also:
dsp_unhalt()
int dsp_initialize ( void   ) 

Initialize the DSP subsystem.

Initializes the DSP subsystem, and performs all other required initialization tasks.

Returns:
If initialization was successful, returns 1. Otherwise 0.
See also:
dsp_shutdown()
u32 dsp_read_outbox ( void   ) 

Reads mail sent to the DSP.

Returns:
The data sent to the DSP.
See also:
dsp_send_mail(), dsp_check_outbox(), dsp_recv_mail()
u32 dsp_recv_mail ( void   ) 

Recieves mail from the DSP.

Returns:
The data recieved from the DSP.
See also:
dsp_read_outbox(), dsp_check_inbox(), dsp_send_mail()
void dsp_send_mail ( u32  data  ) 

Sends mail to the DSP.

Parameters:
data the data to be sent to the DSP.
See also:
dsp_read_outbox(), dsp_check_outbox(), dsp_recv_mail()
int dsp_shutdown ( void   ) 

Shut down the DSP subsystem.

Shuts down the DSP subsystem, and performs all other required shut down tasks.

Returns:
If shut down was successful, returns 1. Otherwise 0.
See also:
dsp_initialize()
BOOL dsp_unhalt ( void   ) 

Unhalts the DSP.

Returns:
TRUE if the the DSP was previously running, FALSE otherwise.
See also:
dsp_halt()
int dsp_upload_ucode ( dsp_ucode_t  ucode  ) 

Uploads a uCode to the DSP.

The DSP must not be halted when this function is called.

Parameters:
ucode the uCode to upload to the DSP.
Returns:
Returns 1 on success, 0 on failure.
void irq_dsp_disable ( void   ) 

Disables the DSP IRQ.

See also:
irq_dsp_enable()
void irq_dsp_enable ( void   ) 

Enables the DSP IRQ.

See also:
irq_dsp_disable()
irq_handler_t irq_dsp_get_handler ( void   ) 

Gets the DSP IRQ handler.

Returns:
The irq_handler_t structure containing information about the handler.
See also:
irq_dsp_register_handler()
int irq_dsp_register_handler ( int(*)(u32 irq, void *data)  exec,
void *  data 
)

Register the DSP IRQ handler.

Parameters:
exec the callback to be called when the IRQ fires. Pass NULL to unregister the IRQ.
data the data to be passed to the IRQ when it fires.
Returns:
Returns 1 on success, 0 on failure.
See also:
irq_dsp_get_handler()
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3