\hypertarget{dsp_8h}{
\section{libbroadway/include/broadway/dsp.h File Reference}
\label{dsp_8h}\index{libbroadway/include/broadway/dsp.h@{libbroadway/include/broadway/dsp.h}}
}
{\ttfamily \#include $<$types.h$>$}\par
{\ttfamily \#include $<$broadway.h$>$}\par
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structdsp__ucode__t}{dsp\_\-ucode\_\-t}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{dsp_8h_a206c2f206eba52163bb9623fd06cfed7}{dsp\_\-initialize} (void)
\begin{DoxyCompactList}\small\item\em Initialize the DSP subsystem. \item\end{DoxyCompactList}\item 
int \hyperlink{dsp_8h_ab4a936d5a7b57902203f49a2bd8307be}{dsp\_\-shutdown} (void)
\begin{DoxyCompactList}\small\item\em Shut down the DSP subsystem. \item\end{DoxyCompactList}\item 
\hypertarget{dsp_8h_ab08e3df0b8dbb2a34536e6335c3b5474}{
void \hyperlink{dsp_8h_ab08e3df0b8dbb2a34536e6335c3b5474}{dsp\_\-reset} (void)}
\label{dsp_8h_ab08e3df0b8dbb2a34536e6335c3b5474}

\begin{DoxyCompactList}\small\item\em Resets the DSP. \item\end{DoxyCompactList}\item 
void \hyperlink{dsp_8h_a7d774be579daa809f4f7c8550b8b3d48}{dsp\_\-send\_\-mail} (u32 data)
\begin{DoxyCompactList}\small\item\em Sends mail to the DSP. \item\end{DoxyCompactList}\item 
u32 \hyperlink{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{dsp\_\-read\_\-outbox} (void)
\begin{DoxyCompactList}\small\item\em Reads mail sent to the DSP. \item\end{DoxyCompactList}\item 
u32 \hyperlink{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{dsp\_\-recv\_\-mail} (void)
\begin{DoxyCompactList}\small\item\em Recieves mail from the DSP. \item\end{DoxyCompactList}\item 
BOOL \hyperlink{dsp_8h_a924ecb910f47db1ab473755c73301465}{dsp\_\-check\_\-inbox} (void)
\begin{DoxyCompactList}\small\item\em Checks if the incoming mail is valid. \item\end{DoxyCompactList}\item 
BOOL \hyperlink{dsp_8h_aca2ab99d57560e812652a958a35d3c96}{dsp\_\-check\_\-outbox} (void)
\begin{DoxyCompactList}\small\item\em Checks if the outgoing mail is valid. \item\end{DoxyCompactList}\item 
BOOL \hyperlink{dsp_8h_a915b248a7d0ecf9500b39b8fffb7517b}{dsp\_\-halt} (void)
\begin{DoxyCompactList}\small\item\em Halts the DSP. \item\end{DoxyCompactList}\item 
BOOL \hyperlink{dsp_8h_a2a1e7a399fd69567c4bce1ac10a0ae2c}{dsp\_\-unhalt} (void)
\begin{DoxyCompactList}\small\item\em Unhalts the DSP. \item\end{DoxyCompactList}\item 
int \hyperlink{dsp_8h_af302f196c5ee5a99e471e4e21160d8c1}{irq\_\-dsp\_\-register\_\-handler} (int($\ast$exec)(u32 irq, void $\ast$data), void $\ast$data)
\begin{DoxyCompactList}\small\item\em Register the DSP IRQ handler. \item\end{DoxyCompactList}\item 
\hyperlink{structirq__handler__t}{irq\_\-handler\_\-t} \hyperlink{dsp_8h_a077d0b0de4503798a2f4f13c3b4da744}{irq\_\-dsp\_\-get\_\-handler} (void)
\begin{DoxyCompactList}\small\item\em Gets the DSP IRQ handler. \item\end{DoxyCompactList}\item 
void \hyperlink{dsp_8h_aa2f06f73a1d33377c8d3bca54e5414b2}{irq\_\-dsp\_\-enable} (void)
\begin{DoxyCompactList}\small\item\em Enables the DSP IRQ. \item\end{DoxyCompactList}\item 
void \hyperlink{dsp_8h_a4a13edb09663be90d9a33fa9c6b0e36f}{irq\_\-dsp\_\-disable} (void)
\begin{DoxyCompactList}\small\item\em Disables the DSP IRQ. \item\end{DoxyCompactList}\item 
int \hyperlink{dsp_8h_ab0ecf3c2fcaf508786c5f7b026d49690}{dsp\_\-upload\_\-ucode} (\hyperlink{structdsp__ucode__t}{dsp\_\-ucode\_\-t} ucode)
\begin{DoxyCompactList}\small\item\em Uploads a uCode to the DSP. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
An abstraction of the interface to the DSP. Buggy. \begin{Desc}
\item[\hyperlink{todo__todo000001}{Todo}]Disassemble the DSP init code. 

Clean up \hyperlink{dsp_8h_a206c2f206eba52163bb9623fd06cfed7}{dsp\_\-initialize()} \end{Desc}


\subsection{Function Documentation}
\hypertarget{dsp_8h_a924ecb910f47db1ab473755c73301465}{
\index{dsp.h@{dsp.h}!dsp\_\-check\_\-inbox@{dsp\_\-check\_\-inbox}}
\index{dsp\_\-check\_\-inbox@{dsp\_\-check\_\-inbox}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-check\_\-inbox}]{\setlength{\rightskip}{0pt plus 5cm}BOOL dsp\_\-check\_\-inbox (void)}}
\label{dsp_8h_a924ecb910f47db1ab473755c73301465}


Checks if the incoming mail is valid. 

\begin{DoxyReturn}{Returns}
TRUE if the incoming mail is valid, FALSE otherwise. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{dsp\_\-read\_\-outbox()}, \hyperlink{dsp_8h_aca2ab99d57560e812652a958a35d3c96}{dsp\_\-check\_\-outbox()}, \hyperlink{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{dsp\_\-recv\_\-mail()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_aca2ab99d57560e812652a958a35d3c96}{
\index{dsp.h@{dsp.h}!dsp\_\-check\_\-outbox@{dsp\_\-check\_\-outbox}}
\index{dsp\_\-check\_\-outbox@{dsp\_\-check\_\-outbox}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-check\_\-outbox}]{\setlength{\rightskip}{0pt plus 5cm}BOOL dsp\_\-check\_\-outbox (void)}}
\label{dsp_8h_aca2ab99d57560e812652a958a35d3c96}


Checks if the outgoing mail is valid. 

\begin{DoxyReturn}{Returns}
TRUE if the outgoing mail is valid, FALSE otherwise. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{dsp\_\-read\_\-outbox()}, \hyperlink{dsp_8h_a924ecb910f47db1ab473755c73301465}{dsp\_\-check\_\-inbox()}, \hyperlink{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{dsp\_\-recv\_\-mail()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a915b248a7d0ecf9500b39b8fffb7517b}{
\index{dsp.h@{dsp.h}!dsp\_\-halt@{dsp\_\-halt}}
\index{dsp\_\-halt@{dsp\_\-halt}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-halt}]{\setlength{\rightskip}{0pt plus 5cm}BOOL dsp\_\-halt (void)}}
\label{dsp_8h_a915b248a7d0ecf9500b39b8fffb7517b}


Halts the DSP. 

\begin{DoxyReturn}{Returns}
TRUE if the the DSP was previously running, FALSE otherwise. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a2a1e7a399fd69567c4bce1ac10a0ae2c}{dsp\_\-unhalt()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a206c2f206eba52163bb9623fd06cfed7}{
\index{dsp.h@{dsp.h}!dsp\_\-initialize@{dsp\_\-initialize}}
\index{dsp\_\-initialize@{dsp\_\-initialize}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-initialize}]{\setlength{\rightskip}{0pt plus 5cm}int dsp\_\-initialize (void)}}
\label{dsp_8h_a206c2f206eba52163bb9623fd06cfed7}


Initialize the DSP subsystem. 

Initializes the DSP subsystem, and performs all other required initialization tasks. \begin{DoxyReturn}{Returns}
If initialization was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_ab4a936d5a7b57902203f49a2bd8307be}{dsp\_\-shutdown()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{
\index{dsp.h@{dsp.h}!dsp\_\-read\_\-outbox@{dsp\_\-read\_\-outbox}}
\index{dsp\_\-read\_\-outbox@{dsp\_\-read\_\-outbox}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-read\_\-outbox}]{\setlength{\rightskip}{0pt plus 5cm}u32 dsp\_\-read\_\-outbox (void)}}
\label{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}


Reads mail sent to the DSP. 

\begin{DoxyReturn}{Returns}
The data sent to the DSP. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a7d774be579daa809f4f7c8550b8b3d48}{dsp\_\-send\_\-mail()}, \hyperlink{dsp_8h_aca2ab99d57560e812652a958a35d3c96}{dsp\_\-check\_\-outbox()}, \hyperlink{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{dsp\_\-recv\_\-mail()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{
\index{dsp.h@{dsp.h}!dsp\_\-recv\_\-mail@{dsp\_\-recv\_\-mail}}
\index{dsp\_\-recv\_\-mail@{dsp\_\-recv\_\-mail}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-recv\_\-mail}]{\setlength{\rightskip}{0pt plus 5cm}u32 dsp\_\-recv\_\-mail (void)}}
\label{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}


Recieves mail from the DSP. 

\begin{DoxyReturn}{Returns}
The data recieved from the DSP. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{dsp\_\-read\_\-outbox()}, \hyperlink{dsp_8h_a924ecb910f47db1ab473755c73301465}{dsp\_\-check\_\-inbox()}, \hyperlink{dsp_8h_a7d774be579daa809f4f7c8550b8b3d48}{dsp\_\-send\_\-mail()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a7d774be579daa809f4f7c8550b8b3d48}{
\index{dsp.h@{dsp.h}!dsp\_\-send\_\-mail@{dsp\_\-send\_\-mail}}
\index{dsp\_\-send\_\-mail@{dsp\_\-send\_\-mail}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-send\_\-mail}]{\setlength{\rightskip}{0pt plus 5cm}void dsp\_\-send\_\-mail (u32 {\em data})}}
\label{dsp_8h_a7d774be579daa809f4f7c8550b8b3d48}


Sends mail to the DSP. 


\begin{DoxyParams}{Parameters}
\item[{\em data}]the data to be sent to the DSP. \end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a3024c48b1c2afd726e314b13be3b01b4}{dsp\_\-read\_\-outbox()}, \hyperlink{dsp_8h_aca2ab99d57560e812652a958a35d3c96}{dsp\_\-check\_\-outbox()}, \hyperlink{dsp_8h_a37f98f708aeb19aa050d10b84230e41a}{dsp\_\-recv\_\-mail()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_ab4a936d5a7b57902203f49a2bd8307be}{
\index{dsp.h@{dsp.h}!dsp\_\-shutdown@{dsp\_\-shutdown}}
\index{dsp\_\-shutdown@{dsp\_\-shutdown}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int dsp\_\-shutdown (void)}}
\label{dsp_8h_ab4a936d5a7b57902203f49a2bd8307be}


Shut down the DSP subsystem. 

Shuts down the DSP subsystem, and performs all other required shut down tasks. \begin{DoxyReturn}{Returns}
If shut down was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a206c2f206eba52163bb9623fd06cfed7}{dsp\_\-initialize()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a2a1e7a399fd69567c4bce1ac10a0ae2c}{
\index{dsp.h@{dsp.h}!dsp\_\-unhalt@{dsp\_\-unhalt}}
\index{dsp\_\-unhalt@{dsp\_\-unhalt}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-unhalt}]{\setlength{\rightskip}{0pt plus 5cm}BOOL dsp\_\-unhalt (void)}}
\label{dsp_8h_a2a1e7a399fd69567c4bce1ac10a0ae2c}


Unhalts the DSP. 

\begin{DoxyReturn}{Returns}
TRUE if the the DSP was previously running, FALSE otherwise. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a915b248a7d0ecf9500b39b8fffb7517b}{dsp\_\-halt()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_ab0ecf3c2fcaf508786c5f7b026d49690}{
\index{dsp.h@{dsp.h}!dsp\_\-upload\_\-ucode@{dsp\_\-upload\_\-ucode}}
\index{dsp\_\-upload\_\-ucode@{dsp\_\-upload\_\-ucode}!dsp.h@{dsp.h}}
\subsubsection[{dsp\_\-upload\_\-ucode}]{\setlength{\rightskip}{0pt plus 5cm}int dsp\_\-upload\_\-ucode ({\bf dsp\_\-ucode\_\-t} {\em ucode})}}
\label{dsp_8h_ab0ecf3c2fcaf508786c5f7b026d49690}


Uploads a uCode to the DSP. 

The DSP must not be halted when this function is called. 
\begin{DoxyParams}{Parameters}
\item[{\em ucode}]the uCode to upload to the DSP. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns 1 on success, 0 on failure. 
\end{DoxyReturn}
\hypertarget{dsp_8h_a4a13edb09663be90d9a33fa9c6b0e36f}{
\index{dsp.h@{dsp.h}!irq\_\-dsp\_\-disable@{irq\_\-dsp\_\-disable}}
\index{irq\_\-dsp\_\-disable@{irq\_\-dsp\_\-disable}!dsp.h@{dsp.h}}
\subsubsection[{irq\_\-dsp\_\-disable}]{\setlength{\rightskip}{0pt plus 5cm}void irq\_\-dsp\_\-disable (void)}}
\label{dsp_8h_a4a13edb09663be90d9a33fa9c6b0e36f}


Disables the DSP IRQ. 

\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_aa2f06f73a1d33377c8d3bca54e5414b2}{irq\_\-dsp\_\-enable()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_aa2f06f73a1d33377c8d3bca54e5414b2}{
\index{dsp.h@{dsp.h}!irq\_\-dsp\_\-enable@{irq\_\-dsp\_\-enable}}
\index{irq\_\-dsp\_\-enable@{irq\_\-dsp\_\-enable}!dsp.h@{dsp.h}}
\subsubsection[{irq\_\-dsp\_\-enable}]{\setlength{\rightskip}{0pt plus 5cm}void irq\_\-dsp\_\-enable (void)}}
\label{dsp_8h_aa2f06f73a1d33377c8d3bca54e5414b2}


Enables the DSP IRQ. 

\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a4a13edb09663be90d9a33fa9c6b0e36f}{irq\_\-dsp\_\-disable()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_a077d0b0de4503798a2f4f13c3b4da744}{
\index{dsp.h@{dsp.h}!irq\_\-dsp\_\-get\_\-handler@{irq\_\-dsp\_\-get\_\-handler}}
\index{irq\_\-dsp\_\-get\_\-handler@{irq\_\-dsp\_\-get\_\-handler}!dsp.h@{dsp.h}}
\subsubsection[{irq\_\-dsp\_\-get\_\-handler}]{\setlength{\rightskip}{0pt plus 5cm}{\bf irq\_\-handler\_\-t} irq\_\-dsp\_\-get\_\-handler (void)}}
\label{dsp_8h_a077d0b0de4503798a2f4f13c3b4da744}


Gets the DSP IRQ handler. 

\begin{DoxyReturn}{Returns}
The \hyperlink{structirq__handler__t}{irq\_\-handler\_\-t} structure containing information about the handler. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_af302f196c5ee5a99e471e4e21160d8c1}{irq\_\-dsp\_\-register\_\-handler()} 
\end{DoxySeeAlso}
\hypertarget{dsp_8h_af302f196c5ee5a99e471e4e21160d8c1}{
\index{dsp.h@{dsp.h}!irq\_\-dsp\_\-register\_\-handler@{irq\_\-dsp\_\-register\_\-handler}}
\index{irq\_\-dsp\_\-register\_\-handler@{irq\_\-dsp\_\-register\_\-handler}!dsp.h@{dsp.h}}
\subsubsection[{irq\_\-dsp\_\-register\_\-handler}]{\setlength{\rightskip}{0pt plus 5cm}int irq\_\-dsp\_\-register\_\-handler (int($\ast$)(u32 irq, void $\ast$data) {\em exec}, \/  void $\ast$ {\em data})}}
\label{dsp_8h_af302f196c5ee5a99e471e4e21160d8c1}


Register the DSP IRQ handler. 


\begin{DoxyParams}{Parameters}
\item[{\em exec}]the callback to be called when the IRQ fires. Pass NULL to unregister the IRQ. \item[{\em data}]the data to be passed to the IRQ when it fires. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns 1 on success, 0 on failure. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{dsp_8h_a077d0b0de4503798a2f4f13c3b4da744}{irq\_\-dsp\_\-get\_\-handler()} 
\end{DoxySeeAlso}
