\doxysection{twi.\+h}
\hypertarget{twi_8h_source}{}\label{twi_8h_source}\index{src/utility/twi.h@{src/utility/twi.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ \ twi.h\ -\/\ TWI/I2C\ library\ for\ Wiring\ \&\ Arduino}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ \ Copyright\ (c)\ 2006\ Nicholas\ Zambetti.\ \ All\ right\ reserved.}}
\DoxyCodeLine{00004\ \textcolor{comment}{}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ \ This\ library\ is\ free\ software;\ you\ can\ redistribute\ it\ and/or}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ \ modify\ it\ under\ the\ terms\ of\ the\ GNU\ Lesser\ General\ Public}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ \ License\ as\ published\ by\ the\ Free\ Software\ Foundation;\ either}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ \ version\ 2.1\ of\ the\ License,\ or\ (at\ your\ option)\ any\ later\ version.}}
\DoxyCodeLine{00009\ \textcolor{comment}{}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ \ This\ library\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ \ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ \ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.\ \ See\ the\ GNU}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ \ Lesser\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{00014\ \textcolor{comment}{}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ \ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ Lesser\ General\ Public}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ \ License\ along\ with\ this\ library;\ if\ not,\ write\ to\ the\ Free\ Software}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ \ Foundation,\ Inc.,\ 51\ Franklin\ St,\ Fifth\ Floor,\ Boston,\ MA\ \ 02110-\/1301\ \ USA}}
\DoxyCodeLine{00018\ \textcolor{comment}{*/}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifndef\ twi\_h}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ twi\_h}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\ \ \#include\ <inttypes.h>}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \ \ \textcolor{comment}{//\#define\ ATMEGA8}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\ \ \#ifndef\ TWI\_FREQ}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\ \ \#define\ TWI\_FREQ\ 100000L}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\ \ \#ifndef\ TWI\_BUFFER\_LENGTH}}
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\ \ \#define\ TWI\_BUFFER\_LENGTH\ 32}}
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \textcolor{preprocessor}{\ \ \#define\ TWI\_READY\ 0}}
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\ \ \#define\ TWI\_MRX\ \ \ 1}}
\DoxyCodeLine{00037\ \textcolor{preprocessor}{\ \ \#define\ TWI\_MTX\ \ \ 2}}
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\ \ \#define\ TWI\_SRX\ \ \ 3}}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\ \ \#define\ TWI\_STX\ \ \ 4}}
\DoxyCodeLine{00040\ \ \ }
\DoxyCodeLine{00041\ \ \ \textcolor{keywordtype}{void}\ twi\_init(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00042\ \ \ \textcolor{keywordtype}{void}\ twi\_disable(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00043\ \ \ \textcolor{keywordtype}{void}\ twi\_setAddress(uint8\_t);}
\DoxyCodeLine{00044\ \ \ uint8\_t\ twi\_readFrom(uint8\_t,\ uint8\_t*,\ uint8\_t,\ uint8\_t);}
\DoxyCodeLine{00045\ \ \ uint8\_t\ twi\_writeTo(uint8\_t,\ uint8\_t*,\ uint8\_t,\ uint8\_t,\ uint8\_t);}
\DoxyCodeLine{00046\ \ \ uint8\_t\ twi\_transmit(\textcolor{keyword}{const}\ uint8\_t*,\ uint8\_t);}
\DoxyCodeLine{00047\ \ \ \textcolor{keywordtype}{void}\ twi\_attachSlaveRxEvent(\ \textcolor{keywordtype}{void}\ (*)(uint8\_t*,\ \textcolor{keywordtype}{int})\ );}
\DoxyCodeLine{00048\ \ \ \textcolor{keywordtype}{void}\ twi\_attachSlaveTxEvent(\ \textcolor{keywordtype}{void}\ (*)(\textcolor{keywordtype}{void})\ );}
\DoxyCodeLine{00049\ \ \ \textcolor{keywordtype}{void}\ twi\_reply(uint8\_t);}
\DoxyCodeLine{00050\ \ \ \textcolor{keywordtype}{void}\ twi\_stop(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00051\ \ \ \textcolor{keywordtype}{void}\ twi\_releaseBus(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00054\ }

\end{DoxyCode}
