\hypertarget{_misc_inits_8h}{\section{C\-:/\-Users/\-Ondra/\-Desktop/\-Wheelchair Control M\-C\-U/\-Misc\-Inits.h File Reference}
\label{_misc_inits_8h}\index{C\-:/\-Users/\-Ondra/\-Desktop/\-Wheelchair Control M\-C\-U/\-Misc\-Inits.\-h@{C\-:/\-Users/\-Ondra/\-Desktop/\-Wheelchair Control M\-C\-U/\-Misc\-Inits.\-h}}
}
{\ttfamily \#include \char`\"{}Defines.\-h\char`\"{}}\\*
\subsection*{Functions}
{\bf }\par
\begin{DoxyCompactItemize}
\item 
void \hyperlink{_misc_inits_8h_a2f9507a6f1c6431d0e145d5baa070482}{T\-I\-M\-E\-R1\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_a14bdf2934e5489f6e2aa8280a524fba8}{T\-I\-M\-E\-R2\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_a3c4a4c4b9a5c4e2b18d739f3cfa6d1d7}{T\-I\-M\-E\-R0\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_a8d38df244d20f302972d1ea315e7c395}{P\-O\-R\-T\-S\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_a96faa41569daee557be602aed594c5bf}{A\-C\-\_\-\-Disable} (void)
\item 
void \hyperlink{_misc_inits_8h_a5137b551f1b83b0f4d8df7d071a3d3a6}{A\-D\-C\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_a0bfce250cd8fdf336037502b2fdd0fe1}{E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init} (void)
\item 
void \hyperlink{_misc_inits_8h_aae323b3d73fcd790a7651e7f6e05e13b}{Init\-\_\-\-I\-S\-Rs\-Sharedstruct} (\hyperlink{structt___i_s_rs_shared_struct}{t\-\_\-\-I\-S\-Rs\-Shared\-Struct} $\ast$shared\-Struct)
\end{DoxyCompactItemize}



\subsection{Detailed Description}
Header file of A\-T\-M\-E\-G\-A16 peripherals and subsystems initialization library. 

Definition in file \hyperlink{_misc_inits_8h_source}{Misc\-Inits.\-h}.



\subsection{Function Documentation}
\hypertarget{_misc_inits_8h_a96faa41569daee557be602aed594c5bf}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!A\-C\-\_\-\-Disable@{A\-C\-\_\-\-Disable}}
\index{A\-C\-\_\-\-Disable@{A\-C\-\_\-\-Disable}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{A\-C\-\_\-\-Disable}]{\setlength{\rightskip}{0pt plus 5cm}void A\-C\-\_\-\-Disable (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a96faa41569daee557be602aed594c5bf}
Disables analog comparator. 

Definition at line 91 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a5137b551f1b83b0f4d8df7d071a3d3a6}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!A\-D\-C\-\_\-\-Init@{A\-D\-C\-\_\-\-Init}}
\index{A\-D\-C\-\_\-\-Init@{A\-D\-C\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{A\-D\-C\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void A\-D\-C\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a5137b551f1b83b0f4d8df7d071a3d3a6}
Initializes A/\-D converter. 

Definition at line 97 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a0bfce250cd8fdf336037502b2fdd0fe1}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init@{E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init}}
\index{E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init@{E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void E\-X\-T\-\_\-\-I\-N\-T\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a0bfce250cd8fdf336037502b2fdd0fe1}
Initializes registers of external interrupts 

Definition at line 104 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_aae323b3d73fcd790a7651e7f6e05e13b}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!Init\-\_\-\-I\-S\-Rs\-Sharedstruct@{Init\-\_\-\-I\-S\-Rs\-Sharedstruct}}
\index{Init\-\_\-\-I\-S\-Rs\-Sharedstruct@{Init\-\_\-\-I\-S\-Rs\-Sharedstruct}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{Init\-\_\-\-I\-S\-Rs\-Sharedstruct}]{\setlength{\rightskip}{0pt plus 5cm}void Init\-\_\-\-I\-S\-Rs\-Sharedstruct (
\begin{DoxyParamCaption}
\item[{{\bf t\-\_\-\-I\-S\-Rs\-Shared\-Struct} $\ast$}]{shared\-Struct}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_aae323b3d73fcd790a7651e7f6e05e13b}
Initializes inter-\/\-I\-S\-Rs shared structure.


\begin{DoxyParams}{Parameters}
{\em shared\-Struct} & \hyperlink{structt___i_s_rs_shared_struct}{t\-\_\-\-I\-S\-Rs\-Shared\-Struct} to be initialized.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See Also}
\hyperlink{structt___i_s_rs_shared_struct}{t\-\_\-\-I\-S\-Rs\-Shared\-Struct} 
\end{DoxySeeAlso}


Definition at line 114 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a8d38df244d20f302972d1ea315e7c395}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!P\-O\-R\-T\-S\-\_\-\-Init@{P\-O\-R\-T\-S\-\_\-\-Init}}
\index{P\-O\-R\-T\-S\-\_\-\-Init@{P\-O\-R\-T\-S\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{P\-O\-R\-T\-S\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void P\-O\-R\-T\-S\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a8d38df244d20f302972d1ea315e7c395}
Initializes I/\-O port A -\/ D (input/output, pull-\/ups etc.).

\begin{DoxyNote}{Note}
See this function in \hyperlink{_misc_inits_8c}{Misc\-Inits.\-c} file source code to obtain information about ports' configuration. 
\end{DoxyNote}


Definition at line 66 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a3c4a4c4b9a5c4e2b18d739f3cfa6d1d7}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!T\-I\-M\-E\-R0\-\_\-\-Init@{T\-I\-M\-E\-R0\-\_\-\-Init}}
\index{T\-I\-M\-E\-R0\-\_\-\-Init@{T\-I\-M\-E\-R0\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{T\-I\-M\-E\-R0\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void T\-I\-M\-E\-R0\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a3c4a4c4b9a5c4e2b18d739f3cfa6d1d7}
Initializes T\-I\-M\-E\-R0 (period 1 ms, used clear U\-A\-R\-T Rx index every 4ms). \par
\par


\begin{DoxyNote}{Note}
8-\/bit timer, interrupt flag is set on everflow. \par
 Overflow interrupt period\-: 16 M\-Hz / 64(prescaler) / 256 (8-\/bit resolution) = 1 ms. 
\end{DoxyNote}


Definition at line 13 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a2f9507a6f1c6431d0e145d5baa070482}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!T\-I\-M\-E\-R1\-\_\-\-Init@{T\-I\-M\-E\-R1\-\_\-\-Init}}
\index{T\-I\-M\-E\-R1\-\_\-\-Init@{T\-I\-M\-E\-R1\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{T\-I\-M\-E\-R1\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void T\-I\-M\-E\-R1\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a2f9507a6f1c6431d0e145d5baa070482}
Initializes T\-I\-M\-E\-R2 (period 2 ms) Measures the range every 50 ms, processes acquired data, P\-S\-D motors' regulators are run here. \par
\par


\begin{DoxyNote}{Note}
16-\/bit timer, R/\-C generation on O\-C\-R1\-X and T\-C\-N\-T1 match (non-\/inverting mode), T\-C\-N\-T1 top = I\-C\-R1. \par
 R/\-C signal period 20 ms, positive pulse length\-: \par
 --- 1.\-5 ms\-: Stop motor; O\-C\-R1\-X = 375. \par
 --- 1 ms\-: Full speed backwards; O\-C\-R1\-X = 250. \par
 --- 2 ms\-: Full speed forward; O\-C\-R1\-X = 500. \par
 No interrupts enabled for T\-I\-M\-E\-R1. 
\end{DoxyNote}


Definition at line 28 of file Misc\-Inits.\-c.

\hypertarget{_misc_inits_8h_a14bdf2934e5489f6e2aa8280a524fba8}{\index{Misc\-Inits.\-h@{Misc\-Inits.\-h}!T\-I\-M\-E\-R2\-\_\-\-Init@{T\-I\-M\-E\-R2\-\_\-\-Init}}
\index{T\-I\-M\-E\-R2\-\_\-\-Init@{T\-I\-M\-E\-R2\-\_\-\-Init}!MiscInits.h@{Misc\-Inits.\-h}}
\subsubsection[{T\-I\-M\-E\-R2\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void T\-I\-M\-E\-R2\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{_misc_inits_8h_a14bdf2934e5489f6e2aa8280a524fba8}
Initializes T\-I\-M\-E\-R2 (period 2 ms) Measures the range every 50 ms, processes acquired data, P\-S\-D motors' regulators are run here. \par
\par


\begin{DoxyNote}{Note}
8-\/bit timer, interrupt flag is set on everflow. \par
 Overflow interrupt period\-: 16 M\-Hz / 128(prescaler) / 256 (8-\/bit resolution) = 2 ms. 
\end{DoxyNote}


Definition at line 49 of file Misc\-Inits.\-c.

