\section{aversive\_\-10-03-12/modules/base/time\_\-ext/time\_\-ext.h File Reference}
\label{time__ext_8h}\index{aversive\_\-10-03-12/modules/base/time\_\-ext/time\_\-ext.h@{aversive\_\-10-03-12/modules/base/time\_\-ext/time\_\-ext.h}}
{\tt \#include $<$time\_\-ext\_\-config.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf \_\-time\_\-ext}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf \_\-TIME\_\-EXT\_\-H}
\item 
\#define {\bf NANO\_\-PER\_\-US}~1000UL
\item 
\#define {\bf NANO\_\-PER\_\-MS}~1000000UL
\item 
\#define {\bf NANO\_\-PER\_\-S}~1000000000UL
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-OFF}~0
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-1}~1
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-8}~2
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-32}~3
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-64}~4
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-128}~5
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-256}~6
\item 
\#define {\bf TIMER2\_\-PRESCALER\_\-1024}~7
\item 
\#define {\bf NANO\_\-PER\_\-QUARTZ\_\-TICK}~TIME\_\-EXT\_\-QUARTZ\_\-PERIOD
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef struct {\bf \_\-time\_\-ext} {\bf time\_\-ext\_\-t}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf time\_\-ext\_\-init} (void)
\item 
void {\bf time\_\-ext\_\-set\_\-prescaler} (uint8\_\-t p)
\item 
uint8\_\-t {\bf time\_\-ext\_\-get\_\-prescaler} (void)
\item 
uint32\_\-t {\bf time\_\-ext\_\-get\_\-s} (void)
\item 
uint32\_\-t {\bf time\_\-ext\_\-get\_\-ns} (void)
\item 
{\bf time\_\-ext\_\-t} {\bf time\_\-ext\_\-get} (void)
\item 
void {\bf time\_\-ext\_\-set} (uint32\_\-t sec, uint32\_\-t nano)
\end{CompactItemize}


\subsection{Define Documentation}
\index{time\_\-ext.h@{time\_\-ext.h}!\_\-TIME\_\-EXT\_\-H@{\_\-TIME\_\-EXT\_\-H}}
\index{\_\-TIME\_\-EXT\_\-H@{\_\-TIME\_\-EXT\_\-H}!time_ext.h@{time\_\-ext.h}}
\subsubsection[\_\-TIME\_\-EXT\_\-H]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-TIME\_\-EXT\_\-H}\label{time__ext_8h_c43330176a8124c2dfd4a934db4162d2}




Definition at line 24 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!NANO\_\-PER\_\-MS@{NANO\_\-PER\_\-MS}}
\index{NANO\_\-PER\_\-MS@{NANO\_\-PER\_\-MS}!time_ext.h@{time\_\-ext.h}}
\subsubsection[NANO\_\-PER\_\-MS]{\setlength{\rightskip}{0pt plus 5cm}\#define NANO\_\-PER\_\-MS~1000000UL}\label{time__ext_8h_d12697792e084a941b34da6516eb231e}




Definition at line 39 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!NANO\_\-PER\_\-QUARTZ\_\-TICK@{NANO\_\-PER\_\-QUARTZ\_\-TICK}}
\index{NANO\_\-PER\_\-QUARTZ\_\-TICK@{NANO\_\-PER\_\-QUARTZ\_\-TICK}!time_ext.h@{time\_\-ext.h}}
\subsubsection[NANO\_\-PER\_\-QUARTZ\_\-TICK]{\setlength{\rightskip}{0pt plus 5cm}\#define NANO\_\-PER\_\-QUARTZ\_\-TICK~TIME\_\-EXT\_\-QUARTZ\_\-PERIOD}\label{time__ext_8h_0344c654cda3e94bbc3d1d221e996313}




Definition at line 55 of file time\_\-ext.h.

Referenced by SIG\_\-OVERFLOW2(), and time\_\-ext\_\-get\_\-ns().\index{time\_\-ext.h@{time\_\-ext.h}!NANO\_\-PER\_\-S@{NANO\_\-PER\_\-S}}
\index{NANO\_\-PER\_\-S@{NANO\_\-PER\_\-S}!time_ext.h@{time\_\-ext.h}}
\subsubsection[NANO\_\-PER\_\-S]{\setlength{\rightskip}{0pt plus 5cm}\#define NANO\_\-PER\_\-S~1000000000UL}\label{time__ext_8h_e16cf8115fab79cb734eb0377c1b17b1}




Definition at line 40 of file time\_\-ext.h.

Referenced by SIG\_\-OVERFLOW2(), and time\_\-ext\_\-get().\index{time\_\-ext.h@{time\_\-ext.h}!NANO\_\-PER\_\-US@{NANO\_\-PER\_\-US}}
\index{NANO\_\-PER\_\-US@{NANO\_\-PER\_\-US}!time_ext.h@{time\_\-ext.h}}
\subsubsection[NANO\_\-PER\_\-US]{\setlength{\rightskip}{0pt plus 5cm}\#define NANO\_\-PER\_\-US~1000UL}\label{time__ext_8h_ceeb49128817f63950c1ed3ba123746b}




Definition at line 38 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-1@{TIMER2\_\-PRESCALER\_\-1}}
\index{TIMER2\_\-PRESCALER\_\-1@{TIMER2\_\-PRESCALER\_\-1}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-1]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-1~1}\label{time__ext_8h_4207957712ad9efc2143b8e933abda41}




Definition at line 45 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-1024@{TIMER2\_\-PRESCALER\_\-1024}}
\index{TIMER2\_\-PRESCALER\_\-1024@{TIMER2\_\-PRESCALER\_\-1024}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-1024]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-1024~7}\label{time__ext_8h_0ba2a8bb8d80f561734d33c8e1a78bfe}




Definition at line 51 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-128@{TIMER2\_\-PRESCALER\_\-128}}
\index{TIMER2\_\-PRESCALER\_\-128@{TIMER2\_\-PRESCALER\_\-128}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-128]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-128~5}\label{time__ext_8h_115942e306d51fcfa2a64301e3f39184}




Definition at line 49 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-256@{TIMER2\_\-PRESCALER\_\-256}}
\index{TIMER2\_\-PRESCALER\_\-256@{TIMER2\_\-PRESCALER\_\-256}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-256]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-256~6}\label{time__ext_8h_e9641647d0408d74151d86ccac0ccf35}




Definition at line 50 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-32@{TIMER2\_\-PRESCALER\_\-32}}
\index{TIMER2\_\-PRESCALER\_\-32@{TIMER2\_\-PRESCALER\_\-32}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-32]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-32~3}\label{time__ext_8h_0cf023a0a602fa0cb8cf2049e2f820ac}




Definition at line 47 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-64@{TIMER2\_\-PRESCALER\_\-64}}
\index{TIMER2\_\-PRESCALER\_\-64@{TIMER2\_\-PRESCALER\_\-64}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-64]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-64~4}\label{time__ext_8h_a8878a84999ccf9dc22eb305453a5aad}




Definition at line 48 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-8@{TIMER2\_\-PRESCALER\_\-8}}
\index{TIMER2\_\-PRESCALER\_\-8@{TIMER2\_\-PRESCALER\_\-8}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-8]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-8~2}\label{time__ext_8h_e7cdccdb8643e1ac3d10f1bd5d837e90}




Definition at line 46 of file time\_\-ext.h.\index{time\_\-ext.h@{time\_\-ext.h}!TIMER2\_\-PRESCALER\_\-OFF@{TIMER2\_\-PRESCALER\_\-OFF}}
\index{TIMER2\_\-PRESCALER\_\-OFF@{TIMER2\_\-PRESCALER\_\-OFF}!time_ext.h@{time\_\-ext.h}}
\subsubsection[TIMER2\_\-PRESCALER\_\-OFF]{\setlength{\rightskip}{0pt plus 5cm}\#define TIMER2\_\-PRESCALER\_\-OFF~0}\label{time__ext_8h_cca8ca395d6a8ceddfbeb7fe220d0a9e}




Definition at line 44 of file time\_\-ext.h.

\subsection{Typedef Documentation}
\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-t@{time\_\-ext\_\-t}}
\index{time\_\-ext\_\-t@{time\_\-ext\_\-t}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \_\-time\_\-ext}  {\bf time\_\-ext\_\-t}}\label{time__ext_8h_fc801d1b2def465e1d11af094439712f}




\subsection{Function Documentation}
\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-get@{time\_\-ext\_\-get}}
\index{time\_\-ext\_\-get@{time\_\-ext\_\-get}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-get]{\setlength{\rightskip}{0pt plus 5cm}{\bf time\_\-ext\_\-t} time\_\-ext\_\-get (void)}\label{time__ext_8h_d7645492a516c72dc7a945511b91d27c}




Definition at line 297 of file time\_\-ext.c.

References \_\-time\_\-ext::nano, NANO\_\-PER\_\-S, \_\-time\_\-ext::sec, time\_\-ext\_\-get\_\-ns(), and time\_\-ext\_\-get\_\-s().

Referenced by main(), and mylog().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-get\_\-ns@{time\_\-ext\_\-get\_\-ns}}
\index{time\_\-ext\_\-get\_\-ns@{time\_\-ext\_\-get\_\-ns}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-get\_\-ns]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t time\_\-ext\_\-get\_\-ns (void)\hspace{0.3cm}{\tt  [inline]}}\label{time__ext_8h_1afb892fd2386c62fea4c0bd4fa666b2}




Definition at line 285 of file time\_\-ext.c.

References \_\-time\_\-ext::nano, NANO\_\-PER\_\-QUARTZ\_\-TICK, and time\_\-ext\_\-get\_\-prescaler().

Referenced by time\_\-ext\_\-get().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-get\_\-prescaler@{time\_\-ext\_\-get\_\-prescaler}}
\index{time\_\-ext\_\-get\_\-prescaler@{time\_\-ext\_\-get\_\-prescaler}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-get\_\-prescaler]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t time\_\-ext\_\-get\_\-prescaler (void)\hspace{0.3cm}{\tt  [inline]}}\label{time__ext_8h_23990a169adc3497fd3e746a7a718601}




Definition at line 232 of file time\_\-ext.c.

Referenced by SIG\_\-OVERFLOW2(), and time\_\-ext\_\-get\_\-ns().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-get\_\-s@{time\_\-ext\_\-get\_\-s}}
\index{time\_\-ext\_\-get\_\-s@{time\_\-ext\_\-get\_\-s}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-get\_\-s]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t time\_\-ext\_\-get\_\-s (void)\hspace{0.3cm}{\tt  [inline]}}\label{time__ext_8h_77c3aee2d07bda4ae242e114ad02fca7}




Definition at line 280 of file time\_\-ext.c.

References \_\-time\_\-ext::sec.

Referenced by time\_\-ext\_\-get().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-init@{time\_\-ext\_\-init}}
\index{time\_\-ext\_\-init@{time\_\-ext\_\-init}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void time\_\-ext\_\-init (void)}\label{time__ext_8h_9d53c7d425c39676741d434e44a37b61}




Definition at line 175 of file time\_\-ext.c.

References E\_\-TIME\_\-EXT, \_\-time\_\-ext::nano, NOTICE, and \_\-time\_\-ext::sec.

Referenced by main().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-set@{time\_\-ext\_\-set}}
\index{time\_\-ext\_\-set@{time\_\-ext\_\-set}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-set]{\setlength{\rightskip}{0pt plus 5cm}void time\_\-ext\_\-set (uint32\_\-t {\em sec}, \/  uint32\_\-t {\em nano})\hspace{0.3cm}{\tt  [inline]}}\label{time__ext_8h_2cf39b5a768779052dadbe10a82d5c04}




Definition at line 314 of file time\_\-ext.c.

References E\_\-TIME\_\-EXT, \_\-time\_\-ext::nano, NOTICE, and \_\-time\_\-ext::sec.

Referenced by main().\index{time\_\-ext.h@{time\_\-ext.h}!time\_\-ext\_\-set\_\-prescaler@{time\_\-ext\_\-set\_\-prescaler}}
\index{time\_\-ext\_\-set\_\-prescaler@{time\_\-ext\_\-set\_\-prescaler}!time_ext.h@{time\_\-ext.h}}
\subsubsection[time\_\-ext\_\-set\_\-prescaler]{\setlength{\rightskip}{0pt plus 5cm}void time\_\-ext\_\-set\_\-prescaler (uint8\_\-t {\em p})\hspace{0.3cm}{\tt  [inline]}}\label{time__ext_8h_693501606d4e9842b3bb520b391dce13}




Definition at line 223 of file time\_\-ext.c.