\section{aversive\_\-10-03-12/include/aversive.h File Reference}
\label{aversive_8h}\index{aversive\_\-10-03-12/include/aversive.h@{aversive\_\-10-03-12/include/aversive.h}}
{\tt \#include $<$autoconf.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$aversive/types.h$>$}\par
{\tt \#include $<$aversive/errno.h$>$}\par
{\tt \#include $<$aversive/irq\_\-lock.h$>$}\par
{\tt \#include $<$avr/signal.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf extract32}
\item 
struct {\bf extract16}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf \_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-}~0UL
\item 
\#define {\bf F\_\-CPU}~((unsigned long)CONFIG\_\-QUARTZ)
\item 
\#define {\bf Hz}~1l
\item 
\#define {\bf KHz}~1000l
\item 
\#define {\bf MHz}~1000000l
\item 
\#define {\bf S\_\-MAX}(to\_\-saturate, value\_\-max)
\item 
\#define {\bf U\_\-MAX}(to\_\-saturate, value\_\-max)
\item 
\#define {\bf MAX}(to\_\-saturate, value\_\-max)
\item 
\#define {\bf MIN}(to\_\-saturate, value\_\-min)
\item 
\#define {\bf ABS}(val)~( ((val) $<$ 0) ? -(val) : (val) )
\item 
\#define {\bf extr32\_\-08\_\-0}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-0; \})
\item 
\#define {\bf extr32\_\-08\_\-1}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-1; \})
\item 
\#define {\bf extr32\_\-08\_\-2}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-2; \})
\item 
\#define {\bf extr32\_\-08\_\-3}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-3; \})
\item 
\#define {\bf extr32\_\-16\_\-0}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16.u16\_\-0; \})
\item 
\#define {\bf extr32\_\-16\_\-1}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16.u16\_\-1; \})
\item 
\#define {\bf extr32\_\-16\_\-mid}({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16\_\-b.u16\_\-mid; \})
\item 
\#define {\bf extr16\_\-08\_\-0}({\bf i})~(\{ struct {\bf extract16} \_\-\_\-x; {\bf \_\-\_\-x.u.u16} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-0; \})
\item 
\#define {\bf extr16\_\-08\_\-1}({\bf i})~(\{ struct {\bf extract16} \_\-\_\-x; {\bf \_\-\_\-x.u.u16} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-1; \})
\item 
\#define {\bf nop}()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}NOP$\backslash$n\char`\"{})
\item 
\#define {\bf nothing}()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{} $\backslash$n\char`\"{})
\item 
\#define {\bf cli}()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}CLI$\backslash$n\char`\"{})
\item 
\#define {\bf sei}()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}SEI$\backslash$n\char`\"{})
\item 
\#define {\bf reset}()
\item 
\#define {\bf BIT\_\-TOGGLE}(port, bit)
\item 
\#define {\bf FALSE}~0
\item 
\#define {\bf TRUE}~1
\item 
\#define {\bf False}~FALSE
\item 
\#define {\bf false}~FALSE
\item 
\#define {\bf True}~TRUE
\item 
\#define {\bf true}~TRUE
\item 
\#define {\bf DDR}(port)~($\ast$(\&(port) -1))
\item 
\#define {\bf PIN}(port)~($\ast$(\&(port) -2))
\item 
\#define {\bf OPEN\_\-CO\_\-INIT}(port, bit)~sbi(port,bit)
\item 
\#define {\bf OPEN\_\-CO\_\-HIGH}(port, bit)~cbi(DDR(port),bit)
\item 
\#define {\bf OPEN\_\-CO\_\-LOW}(port, bit)~cbi(DDR(port),bit)
\item 
\#define {\bf cbi}(sfr, bit)~( sfr \&= $\sim$ \_\-BV(bit))
\item 
\#define {\bf sbi}(sfr, bit)~( sfr $|$= \_\-BV(bit))
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
struct {\bf extract32} {\bf packed}
\end{CompactItemize}


\subsection{Define Documentation}
\index{aversive.h@{aversive.h}!\_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-@{\_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-}}
\index{\_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-@{\_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-}!aversive.h@{aversive.h}}
\subsubsection[\_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-\_\-AVR\_\-LIBC\_\-VERSION\_\-\_\-~0UL}\label{aversive_8h_161e98ee1c31a16eeb71fc87dc73526f}


here are some cute little macros, and other stuff, microcontroller related ! 

Definition at line 44 of file aversive.h.\index{aversive.h@{aversive.h}!ABS@{ABS}}
\index{ABS@{ABS}!aversive.h@{aversive.h}}
\subsubsection[ABS]{\setlength{\rightskip}{0pt plus 5cm}\#define ABS(val)~( ((val) $<$ 0) ? -(val) : (val) )}\label{aversive_8h_898024f90ac9f0bfb29fb98c0e0c82d8}


absolute while the abs() function in the libc works only with int type this macro works with every numerical type including floats 

Definition at line 110 of file aversive.h.

Referenced by bd\_\-manage\_\-from\_\-speed\_\-cmd(), pts2line(), and quadramp\_\-derivate\_\-do\_\-filter().\index{aversive.h@{aversive.h}!BIT\_\-TOGGLE@{BIT\_\-TOGGLE}}
\index{BIT\_\-TOGGLE@{BIT\_\-TOGGLE}!aversive.h@{aversive.h}}
\subsubsection[BIT\_\-TOGGLE]{\setlength{\rightskip}{0pt plus 5cm}\#define BIT\_\-TOGGLE(port, \/  bit)}\label{aversive_8h_d74184b8ca54081897e3ee2c9bec1cfa}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {\
      if(bit_is_set(PIN(port),bit)) \
        cbi(port,bit); \
      else \
        sbi(port,bit); \
      } while(0)
\end{verbatim}
\end{Code}
little bit toggeling macro

change pin state usage : \doxyref{BIT\_\-TOGGLE(PORTB,2)}{p.}{aversive_8h_d74184b8ca54081897e3ee2c9bec1cfa} to make the pin 2 of PORTB toggle 

Definition at line 229 of file aversive.h.\index{aversive.h@{aversive.h}!cbi@{cbi}}
\index{cbi@{cbi}!aversive.h@{aversive.h}}
\subsubsection[cbi]{\setlength{\rightskip}{0pt plus 5cm}\#define cbi(sfr, \/  bit)~( sfr \&= $\sim$ \_\-BV(bit))}\label{aversive_8h_e70baf5399951da1e7ad45a0ed890832}


deprecated macros in libc, but they're almost used, so we implement them again ;) 

Definition at line 257 of file aversive.h.

Referenced by adc\_\-get\_\-value(), adc\_\-init(), adc\_\-launch(), init\_\-ports(), initial\_\-8\_\-bit\_\-write(), mf2\_\-client\_\-init(), mf2\_\-server\_\-init(), multiservo\_\-del(), multiservo\_\-init(), SIGNAL(), and uart\_\-send\_\-next\_\-char().\index{aversive.h@{aversive.h}!cli@{cli}}
\index{cli@{cli}!aversive.h@{aversive.h}}
\subsubsection[cli]{\setlength{\rightskip}{0pt plus 5cm}\#define cli()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}CLI$\backslash$n\char`\"{})}\label{aversive_8h_68c330e94fe121eba993e5a5973c3162}




Definition at line 200 of file aversive.h.

Referenced by scheduler\_\-interrupt().\index{aversive.h@{aversive.h}!DDR@{DDR}}
\index{DDR@{DDR}!aversive.h@{aversive.h}}
\subsubsection[DDR]{\setlength{\rightskip}{0pt plus 5cm}\#define DDR(port)~($\ast$(\&(port) -1))}\label{aversive_8h_cf5495926a719aad80975feec317be4b}


DDR and PINS from port adress 

Definition at line 247 of file aversive.h.

Referenced by cc2420\_\-init(), encoders\_\-microb\_\-init(), lcd\_\-init(), multiservo\_\-add(), multiservo\_\-del(), pwm\_\-ng\_\-init(), and spi\_\-init().\index{aversive.h@{aversive.h}!extr16\_\-08\_\-0@{extr16\_\-08\_\-0}}
\index{extr16\_\-08\_\-0@{extr16\_\-08\_\-0}!aversive.h@{aversive.h}}
\subsubsection[extr16\_\-08\_\-0]{\setlength{\rightskip}{0pt plus 5cm}\#define extr16\_\-08\_\-0({\bf i})~(\{ struct {\bf extract16} \_\-\_\-x; {\bf \_\-\_\-x.u.u16} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-0; \})}\label{aversive_8h_10c8fc976f8c6793e51b59dd35dbe9bc}




Definition at line 185 of file aversive.h.\index{aversive.h@{aversive.h}!extr16\_\-08\_\-1@{extr16\_\-08\_\-1}}
\index{extr16\_\-08\_\-1@{extr16\_\-08\_\-1}!aversive.h@{aversive.h}}
\subsubsection[extr16\_\-08\_\-1]{\setlength{\rightskip}{0pt plus 5cm}\#define extr16\_\-08\_\-1({\bf i})~(\{ struct {\bf extract16} \_\-\_\-x; {\bf \_\-\_\-x.u.u16} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-1; \})}\label{aversive_8h_5c9cd91be4449df8c0303feb6981633e}




Definition at line 186 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-08\_\-0@{extr32\_\-08\_\-0}}
\index{extr32\_\-08\_\-0@{extr32\_\-08\_\-0}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-08\_\-0]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-08\_\-0({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-0; \})}\label{aversive_8h_45a3185e48cedbf46a5fe04e8f9999d0}




Definition at line 160 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-08\_\-1@{extr32\_\-08\_\-1}}
\index{extr32\_\-08\_\-1@{extr32\_\-08\_\-1}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-08\_\-1]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-08\_\-1({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-1; \})}\label{aversive_8h_e9f0818907c47266763eb8f80a4685f7}




Definition at line 161 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-08\_\-2@{extr32\_\-08\_\-2}}
\index{extr32\_\-08\_\-2@{extr32\_\-08\_\-2}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-08\_\-2]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-08\_\-2({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-2; \})}\label{aversive_8h_f4b11b154124cece43b8e8fde28969bb}




Definition at line 162 of file aversive.h.

Referenced by hamming\_\-expand().\index{aversive.h@{aversive.h}!extr32\_\-08\_\-3@{extr32\_\-08\_\-3}}
\index{extr32\_\-08\_\-3@{extr32\_\-08\_\-3}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-08\_\-3]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-08\_\-3({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u8.u8\_\-3; \})}\label{aversive_8h_6c2a0f825654322530458b2f9a8d7bdb}




Definition at line 163 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-16\_\-0@{extr32\_\-16\_\-0}}
\index{extr32\_\-16\_\-0@{extr32\_\-16\_\-0}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-16\_\-0]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-16\_\-0({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16.u16\_\-0; \})}\label{aversive_8h_d2752f7ae6185bdde1df8b9e23897f2d}




Definition at line 165 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-16\_\-1@{extr32\_\-16\_\-1}}
\index{extr32\_\-16\_\-1@{extr32\_\-16\_\-1}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-16\_\-1]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-16\_\-1({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16.u16\_\-1; \})}\label{aversive_8h_bc10937e3a81280931dfa8ecd0d33dae}




Definition at line 166 of file aversive.h.\index{aversive.h@{aversive.h}!extr32\_\-16\_\-mid@{extr32\_\-16\_\-mid}}
\index{extr32\_\-16\_\-mid@{extr32\_\-16\_\-mid}!aversive.h@{aversive.h}}
\subsubsection[extr32\_\-16\_\-mid]{\setlength{\rightskip}{0pt plus 5cm}\#define extr32\_\-16\_\-mid({\bf i})~(\{ struct {\bf extract32} \_\-\_\-x; {\bf \_\-\_\-x.u.u32} = {\bf i}; \_\-\_\-x.u.u16\_\-b.u16\_\-mid; \})}\label{aversive_8h_beb54218a44258374812a400b9e16840}




Definition at line 167 of file aversive.h.

Referenced by hamming\_\-expand().\index{aversive.h@{aversive.h}!F\_\-CPU@{F\_\-CPU}}
\index{F\_\-CPU@{F\_\-CPU}!aversive.h@{aversive.h}}
\subsubsection[F\_\-CPU]{\setlength{\rightskip}{0pt plus 5cm}\#define F\_\-CPU~((unsigned long)CONFIG\_\-QUARTZ)}\label{aversive_8h_43bafb28b29491ec7f871319b5a3b2f8}




Definition at line 53 of file aversive.h.

Referenced by uart\_\-getconf(), and uart\_\-setconf().\index{aversive.h@{aversive.h}!false@{false}}
\index{false@{false}!aversive.h@{aversive.h}}
\subsubsection[false]{\setlength{\rightskip}{0pt plus 5cm}\#define false~FALSE}\label{aversive_8h_65e9886d74aaee76545e83dd09011727}




Definition at line 241 of file aversive.h.\index{aversive.h@{aversive.h}!False@{False}}
\index{False@{False}!aversive.h@{aversive.h}}
\subsubsection[False]{\setlength{\rightskip}{0pt plus 5cm}\#define False~FALSE}\label{aversive_8h_306ebd41c0cd1303b1372c6153f0caf8}




Definition at line 240 of file aversive.h.\index{aversive.h@{aversive.h}!FALSE@{FALSE}}
\index{FALSE@{FALSE}!aversive.h@{aversive.h}}
\subsubsection[FALSE]{\setlength{\rightskip}{0pt plus 5cm}\#define FALSE~0}\label{aversive_8h_a93f0eb578d23995850d61f7d61c55c1}


booleans 

Definition at line 238 of file aversive.h.

Referenced by dialog\_\-checklist(), dialog\_\-menu(), dialog\_\-textbox(), spi\_\-init(), and spi\_\-slave\_\-deselect().\index{aversive.h@{aversive.h}!Hz@{Hz}}
\index{Hz@{Hz}!aversive.h@{aversive.h}}
\subsubsection[Hz]{\setlength{\rightskip}{0pt plus 5cm}\#define Hz~1l}\label{aversive_8h_2344d042b01c5e206dc80d736560cda0}




Definition at line 55 of file aversive.h.\index{aversive.h@{aversive.h}!KHz@{KHz}}
\index{KHz@{KHz}!aversive.h@{aversive.h}}
\subsubsection[KHz]{\setlength{\rightskip}{0pt plus 5cm}\#define KHz~1000l}\label{aversive_8h_e350efd4bd8727abeaaf87a33ce373ec}




Definition at line 56 of file aversive.h.\index{aversive.h@{aversive.h}!MAX@{MAX}}
\index{MAX@{MAX}!aversive.h@{aversive.h}}
\subsubsection[MAX]{\setlength{\rightskip}{0pt plus 5cm}\#define MAX(to\_\-saturate, \/  value\_\-max)}\label{aversive_8h_dbeba82d2f47707dc6d1e9834f0eca17}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                     \
   if (to_saturate > value_max)          \
     to_saturate = value_max;            \
} while(0)
\end{verbatim}
\end{Code}
simple maximum 

Definition at line 90 of file aversive.h.\index{aversive.h@{aversive.h}!MHz@{MHz}}
\index{MHz@{MHz}!aversive.h@{aversive.h}}
\subsubsection[MHz]{\setlength{\rightskip}{0pt plus 5cm}\#define MHz~1000000l}\label{aversive_8h_978be084da4a9180ba3bd85c0d385ce2}




Definition at line 57 of file aversive.h.\index{aversive.h@{aversive.h}!MIN@{MIN}}
\index{MIN@{MIN}!aversive.h@{aversive.h}}
\subsubsection[MIN]{\setlength{\rightskip}{0pt plus 5cm}\#define MIN(to\_\-saturate, \/  value\_\-min)}\label{aversive_8h_3953c6195a3221a6aba0c3c1096eeeaf}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                     \
   if (to_saturate < value_min)          \
     to_saturate = value_min;            \
} while(0)
\end{verbatim}
\end{Code}
simple minimum 

Definition at line 99 of file aversive.h.\index{aversive.h@{aversive.h}!nop@{nop}}
\index{nop@{nop}!aversive.h@{aversive.h}}
\subsubsection[nop]{\setlength{\rightskip}{0pt plus 5cm}\#define nop()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}NOP$\backslash$n\char`\"{})}\label{aversive_8h_6c92c29fa8e83ab85e05543010e10d7c}




Definition at line 194 of file aversive.h.\index{aversive.h@{aversive.h}!nothing@{nothing}}
\index{nothing@{nothing}!aversive.h@{aversive.h}}
\subsubsection[nothing]{\setlength{\rightskip}{0pt plus 5cm}\#define nothing()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{} $\backslash$n\char`\"{})}\label{aversive_8h_fc5c6ba8fe8a6402e1f14c610c2bf146}




Definition at line 197 of file aversive.h.\index{aversive.h@{aversive.h}!OPEN\_\-CO\_\-HIGH@{OPEN\_\-CO\_\-HIGH}}
\index{OPEN\_\-CO\_\-HIGH@{OPEN\_\-CO\_\-HIGH}!aversive.h@{aversive.h}}
\subsubsection[OPEN\_\-CO\_\-HIGH]{\setlength{\rightskip}{0pt plus 5cm}\#define OPEN\_\-CO\_\-HIGH(port, \/  bit)~cbi(DDR(port),bit)}\label{aversive_8h_2d6f688c434e9533deb56296642ac12c}




Definition at line 252 of file aversive.h.\index{aversive.h@{aversive.h}!OPEN\_\-CO\_\-INIT@{OPEN\_\-CO\_\-INIT}}
\index{OPEN\_\-CO\_\-INIT@{OPEN\_\-CO\_\-INIT}!aversive.h@{aversive.h}}
\subsubsection[OPEN\_\-CO\_\-INIT]{\setlength{\rightskip}{0pt plus 5cm}\#define OPEN\_\-CO\_\-INIT(port, \/  bit)~sbi(port,bit)}\label{aversive_8h_f1cd0021350e968ad7a461419471634f}


open collector simulation macros 

Definition at line 251 of file aversive.h.\index{aversive.h@{aversive.h}!OPEN\_\-CO\_\-LOW@{OPEN\_\-CO\_\-LOW}}
\index{OPEN\_\-CO\_\-LOW@{OPEN\_\-CO\_\-LOW}!aversive.h@{aversive.h}}
\subsubsection[OPEN\_\-CO\_\-LOW]{\setlength{\rightskip}{0pt plus 5cm}\#define OPEN\_\-CO\_\-LOW(port, \/  bit)~cbi(DDR(port),bit)}\label{aversive_8h_6b7c7c4aae617f71c9966dd31b9bbd62}




Definition at line 253 of file aversive.h.\index{aversive.h@{aversive.h}!PIN@{PIN}}
\index{PIN@{PIN}!aversive.h@{aversive.h}}
\subsubsection[PIN]{\setlength{\rightskip}{0pt plus 5cm}\#define PIN(port)~($\ast$(\&(port) -2))}\label{aversive_8h_c0b8f76e4a1d5c23d0782868f2e632dc}




Definition at line 248 of file aversive.h.

Referenced by SIGNAL().\index{aversive.h@{aversive.h}!reset@{reset}}
\index{reset@{reset}!aversive.h@{aversive.h}}
\subsubsection[reset]{\setlength{\rightskip}{0pt plus 5cm}\#define reset()}\label{aversive_8h_dff1ae9368523be49ce8ef497d4ca902}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                 \
  __asm__ __volatile__ ("ldi r30,0\n");  \
  __asm__ __volatile__ ("ldi r31,0\n");  \
  __asm__ __volatile__ ("ijmp\n");  \
} while(0)
\end{verbatim}
\end{Code}
simple software reset, but doesn't initialize the registers 

Definition at line 207 of file aversive.h.\index{aversive.h@{aversive.h}!S\_\-MAX@{S\_\-MAX}}
\index{S\_\-MAX@{S\_\-MAX}!aversive.h@{aversive.h}}
\subsubsection[S\_\-MAX]{\setlength{\rightskip}{0pt plus 5cm}\#define S\_\-MAX(to\_\-saturate, \/  value\_\-max)}\label{aversive_8h_4cfabb950646021560db2fa64bafdeaa}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                     \
   if (to_saturate > value_max)          \
     to_saturate = value_max;            \
   else if (to_saturate < -value_max)    \
     to_saturate = -value_max;           \
 } while(0)
\end{verbatim}
\end{Code}
signed maxmimum : both signs are tested 

Definition at line 68 of file aversive.h.

Referenced by pid\_\-do\_\-filter(), and pwm\_\-set().\index{aversive.h@{aversive.h}!sbi@{sbi}}
\index{sbi@{sbi}!aversive.h@{aversive.h}}
\subsubsection[sbi]{\setlength{\rightskip}{0pt plus 5cm}\#define sbi(sfr, \/  bit)~( sfr $|$= \_\-BV(bit))}\label{aversive_8h_c4a5536d9bf092116f88b94797ddc882}




Definition at line 260 of file aversive.h.

Referenced by adc\_\-get\_\-value(), adc\_\-launch(), adc\_\-shutdown(), brushless\_\-init(), encoders\_\-microb\_\-init(), i2c\_\-init(), lcd\_\-init(), main(), multiservo\_\-add(), multiservo\_\-init(), SIGNAL(), uart\_\-send\_\-9bits\_\-nowait(), uart\_\-send\_\-next\_\-char(), and uart\_\-send\_\-nowait().\index{aversive.h@{aversive.h}!sei@{sei}}
\index{sei@{sei}!aversive.h@{aversive.h}}
\subsubsection[sei]{\setlength{\rightskip}{0pt plus 5cm}\#define sei()~\_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\- (\char`\"{}SEI$\backslash$n\char`\"{})}\label{aversive_8h_ad5ebd34cb344c26ac87594f79b06b73}




Definition at line 203 of file aversive.h.

Referenced by main(), scheduler\_\-interrupt(), and SIGNAL().\index{aversive.h@{aversive.h}!true@{true}}
\index{true@{true}!aversive.h@{aversive.h}}
\subsubsection[true]{\setlength{\rightskip}{0pt plus 5cm}\#define true~TRUE}\label{aversive_8h_41f9c5fb8b08eb5dc3edce4dcb37fee7}




Definition at line 243 of file aversive.h.\index{aversive.h@{aversive.h}!True@{True}}
\index{True@{True}!aversive.h@{aversive.h}}
\subsubsection[True]{\setlength{\rightskip}{0pt plus 5cm}\#define True~TRUE}\label{aversive_8h_dd3ca9eefe3b5b754426f51d3043e579}




Definition at line 242 of file aversive.h.\index{aversive.h@{aversive.h}!TRUE@{TRUE}}
\index{TRUE@{TRUE}!aversive.h@{aversive.h}}
\subsubsection[TRUE]{\setlength{\rightskip}{0pt plus 5cm}\#define TRUE~1}\label{aversive_8h_a8cecfc5c5c054d2875c03e77b7be15d}




Definition at line 239 of file aversive.h.

Referenced by dialog\_\-checklist(), dialog\_\-inputbox(), dialog\_\-menu(), dialog\_\-msgbox(), dialog\_\-textbox(), dialog\_\-yesno(), init\_\-dialog(), ISR(), and spi\_\-slave\_\-select().\index{aversive.h@{aversive.h}!U\_\-MAX@{U\_\-MAX}}
\index{U\_\-MAX@{U\_\-MAX}!aversive.h@{aversive.h}}
\subsubsection[U\_\-MAX]{\setlength{\rightskip}{0pt plus 5cm}\#define U\_\-MAX(to\_\-saturate, \/  value\_\-max)}\label{aversive_8h_74a73169983efdfa0ad787260dd71209}


\textbf{Value:}

\begin{Code}\begin{verbatim}do {                                     \
   if (to_saturate > value_max)          \
     to_saturate = value_max;            \
   else if (to_saturate < 0)             \
     to_saturate = 0;                    \
 } while(0)
\end{verbatim}
\end{Code}
unsigned maximum : result $>$0 is forced 

Definition at line 79 of file aversive.h.

\subsection{Variable Documentation}
\index{aversive.h@{aversive.h}!packed@{packed}}
\index{packed@{packed}!aversive.h@{aversive.h}}
\subsubsection[packed]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf extract16} {\bf packed}}\label{aversive_8h_4110d3b0c84b51758ea703d221bd7ae8}


