\hypertarget{buzzer_8c}{
\section{buzzer.c File Reference}
\label{buzzer_8c}\index{buzzer.c@{buzzer.c}}
}


Buzzer driver.  


{\ttfamily \#include $<$avr/io.h$>$}\par
{\ttfamily \#include $<$avr/interrupt.h$>$}\par
{\ttfamily \#include $<$util/delay.h$>$}\par
{\ttfamily \#include \char`\"{}buzzer.h\char`\"{}}\par
Include dependency graph for buzzer.c:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=372pt]{buzzer_8c__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\hypertarget{buzzer_8c_a1899e831bdec0747d1c423f4c79288b0}{
\#define {\bfseries \_\-BUZZER\_\-C\_\-}~1}
\label{buzzer_8c_a1899e831bdec0747d1c423f4c79288b0}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{buzzer_8c_a0cead532fdd0c0de5fa1c1de0f6556bd}{buzzer\_\-init} (void)
\begin{DoxyCompactList}\small\item\em Initialise the Buzzer driver. \item\end{DoxyCompactList}\item 
void \hyperlink{buzzer_8c_aba6bdbd2d3c26746c60c4a0c7ae2bed3}{buzzer\_\-start} (uint16\_\-t time)
\begin{DoxyCompactList}\small\item\em start making noise \item\end{DoxyCompactList}\item 
void \hyperlink{buzzer_8c_a0b5e97d5c00be597d96fd80c6cd1ad56}{buzzer\_\-stop} (void)
\begin{DoxyCompactList}\small\item\em stop making noise \item\end{DoxyCompactList}\item 
\hypertarget{buzzer_8c_ab16889ae984b9b798989a0d239283cac}{
{\bfseries ISR} (TIMER1\_\-OVF\_\-vect)}
\label{buzzer_8c_ab16889ae984b9b798989a0d239283cac}

\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{buzzer_8c_a4fb7dd2a0b1ec6cd637cd5b9a8639dba}{
uint16\_\-t {\bfseries buzzer\_\-time} = 0}
\label{buzzer_8c_a4fb7dd2a0b1ec6cd637cd5b9a8639dba}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Buzzer driver. \begin{DoxyAuthor}{Author}
Dominic Rathje (\href{mailto:dominic.rathje@uni-ulm.de}{\tt dominic.rathje@uni-\/ulm.de}) 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
1.0 
\end{DoxyVersion}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Compiler : WinAVR 20100110
\item Supported devices : ATMega8 
\end{DoxyItemize}
\end{DoxyNote}


Definition in file \hyperlink{buzzer_8c_source}{buzzer.c}.



\subsection{Function Documentation}
\hypertarget{buzzer_8c_a0cead532fdd0c0de5fa1c1de0f6556bd}{
\index{buzzer.c@{buzzer.c}!buzzer\_\-init@{buzzer\_\-init}}
\index{buzzer\_\-init@{buzzer\_\-init}!buzzer.c@{buzzer.c}}
\subsubsection[{buzzer\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void buzzer\_\-init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{buzzer_8c_a0cead532fdd0c0de5fa1c1de0f6556bd}


Initialise the Buzzer driver. 

Configures the Port Registers and Timer. Call this function at the beginning of your main function. 

Definition at line 23 of file buzzer.c.

\hypertarget{buzzer_8c_aba6bdbd2d3c26746c60c4a0c7ae2bed3}{
\index{buzzer.c@{buzzer.c}!buzzer\_\-start@{buzzer\_\-start}}
\index{buzzer\_\-start@{buzzer\_\-start}!buzzer.c@{buzzer.c}}
\subsubsection[{buzzer\_\-start}]{\setlength{\rightskip}{0pt plus 5cm}void buzzer\_\-start (
\begin{DoxyParamCaption}
\item[{uint16\_\-t}]{ time}
\end{DoxyParamCaption}
)}}
\label{buzzer_8c_aba6bdbd2d3c26746c60c4a0c7ae2bed3}


start making noise 

call this function to start the buzzer. the sund will be disabled after time ticks. one tick equals 0.25ms


\begin{DoxyParams}{Parameters}
{\em time} & duration of the beep \\
\hline
\end{DoxyParams}


Definition at line 37 of file buzzer.c.



Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=256pt]{buzzer_8c_aba6bdbd2d3c26746c60c4a0c7ae2bed3_icgraph}
\end{center}
\end{figure}


\hypertarget{buzzer_8c_a0b5e97d5c00be597d96fd80c6cd1ad56}{
\index{buzzer.c@{buzzer.c}!buzzer\_\-stop@{buzzer\_\-stop}}
\index{buzzer\_\-stop@{buzzer\_\-stop}!buzzer.c@{buzzer.c}}
\subsubsection[{buzzer\_\-stop}]{\setlength{\rightskip}{0pt plus 5cm}void buzzer\_\-stop (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{buzzer_8c_a0b5e97d5c00be597d96fd80c6cd1ad56}


stop making noise 

this function disables the buzzer. for those who want to do the timing be themselves 

Definition at line 45 of file buzzer.c.

