\hypertarget{i2c_8c}{
\section{i2c.c File Reference}
\label{i2c_8c}\index{i2c.c@{i2c.c}}
}
{\ttfamily \#include \char`\"{}i2c.h\char`\"{}}\par
{\ttfamily \#include $<$util/delay\_\-basic.h$>$}\par
{\ttfamily \#include $<$util/delay.h$>$}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{i2c_8c_a2dca72c99f7680a64f2b19dd55bfafc3}{i2c\_\-timerproc} (void)
\item 
uint8\_\-t \hyperlink{i2c_8c_a1779ddcf2d76b7a996905b9a8585df8d}{read\_\-i2c\_\-device} (uint8\_\-t address, uint8\_\-t rbytes, uint8\_\-t $\ast$rdata)
\begin{DoxyCompactList}\small\item\em Read 1 or more bytes from an I2C device to memory. \item\end{DoxyCompactList}\item 
uint8\_\-t \hyperlink{i2c_8c_a833a9508922c48efad60adf521942873}{write\_\-i2c\_\-device} (uint8\_\-t address, uint8\_\-t wbytes, uint8\_\-t $\ast$wdata)
\begin{DoxyCompactList}\small\item\em Write 1 or more bytes to an I2C device from memory. \item\end{DoxyCompactList}\item 
uint8\_\-t \hyperlink{i2c_8c_aac7ed590769c92a1bf20cbcad8c85a2e}{write\_\-read\_\-i2c\_\-device} (uint8\_\-t address, uint8\_\-t wbytes, uint8\_\-t $\ast$wdata, uint8\_\-t rbytes, uint8\_\-t $\ast$rdata)
\begin{DoxyCompactList}\small\item\em Write 1 or more bytes to an I2C device followed by a read without releasing the bus. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{i2c_8c_a2dca72c99f7680a64f2b19dd55bfafc3}{
\index{i2c.c@{i2c.c}!i2c\_\-timerproc@{i2c\_\-timerproc}}
\index{i2c\_\-timerproc@{i2c\_\-timerproc}!i2c.c@{i2c.c}}
\subsubsection[{i2c\_\-timerproc}]{\setlength{\rightskip}{0pt plus 5cm}void i2c\_\-timerproc (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{i2c_8c_a2dca72c99f7680a64f2b19dd55bfafc3}
\hypertarget{i2c_8c_a1779ddcf2d76b7a996905b9a8585df8d}{
\index{i2c.c@{i2c.c}!read\_\-i2c\_\-device@{read\_\-i2c\_\-device}}
\index{read\_\-i2c\_\-device@{read\_\-i2c\_\-device}!i2c.c@{i2c.c}}
\subsubsection[{read\_\-i2c\_\-device}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t read\_\-i2c\_\-device (
\begin{DoxyParamCaption}
\item[{uint8\_\-t}]{ address, }
\item[{uint8\_\-t}]{ bytes, }
\item[{uint8\_\-t $\ast$}]{ rdata}
\end{DoxyParamCaption}
)}}
\label{i2c_8c_a1779ddcf2d76b7a996905b9a8585df8d}


Read 1 or more bytes from an I2C device to memory. 


\begin{DoxyParams}{Parameters}
\item[{\em address}]Address if I2C device. The bottom bit is set to enfoce an I2C read. \item[{\em bytes}]Number of bytes to be returned. \item[{\em $\ast$rdata}]Pointer to location to store values returned.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
returns error code generated from I2C transaction, or 0 for success 
\end{DoxyReturn}
\hypertarget{i2c_8c_a833a9508922c48efad60adf521942873}{
\index{i2c.c@{i2c.c}!write\_\-i2c\_\-device@{write\_\-i2c\_\-device}}
\index{write\_\-i2c\_\-device@{write\_\-i2c\_\-device}!i2c.c@{i2c.c}}
\subsubsection[{write\_\-i2c\_\-device}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t write\_\-i2c\_\-device (
\begin{DoxyParamCaption}
\item[{uint8\_\-t}]{ address, }
\item[{uint8\_\-t}]{ bytes, }
\item[{uint8\_\-t $\ast$}]{ wdata}
\end{DoxyParamCaption}
)}}
\label{i2c_8c_a833a9508922c48efad60adf521942873}


Write 1 or more bytes to an I2C device from memory. 


\begin{DoxyParams}{Parameters}
\item[{\em address}]Address if I2C device. The bottom bit is cleared to enforce an I2C write. \item[{\em bytes}]Number of bytes to be sent. \item[{\em $\ast$wdata}]Pointer to location in memory of first byte of set of data.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
returns error code generated from I2C transaction, or 0 for success 
\end{DoxyReturn}
\hypertarget{i2c_8c_aac7ed590769c92a1bf20cbcad8c85a2e}{
\index{i2c.c@{i2c.c}!write\_\-read\_\-i2c\_\-device@{write\_\-read\_\-i2c\_\-device}}
\index{write\_\-read\_\-i2c\_\-device@{write\_\-read\_\-i2c\_\-device}!i2c.c@{i2c.c}}
\subsubsection[{write\_\-read\_\-i2c\_\-device}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t write\_\-read\_\-i2c\_\-device (
\begin{DoxyParamCaption}
\item[{uint8\_\-t}]{ address, }
\item[{uint8\_\-t}]{ wbytes, }
\item[{uint8\_\-t $\ast$}]{ wdata, }
\item[{uint8\_\-t}]{ rbytes, }
\item[{uint8\_\-t $\ast$}]{ rdata}
\end{DoxyParamCaption}
)}}
\label{i2c_8c_aac7ed590769c92a1bf20cbcad8c85a2e}


Write 1 or more bytes to an I2C device followed by a read without releasing the bus. 


\begin{DoxyParams}{Parameters}
\item[{\em address}]Address if I2C device. The bottom bit is manipulated as appropriate for R/W \item[{\em wbytes}]Number of bytes to write. \item[{\em $\ast$wdata}]Pointer to location in memory of first byte to write. \item[{\em rbytes}]Number of bytes to read. \item[{\em $\ast$rdata}]Pointer to location in memory of first byte of set of data.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
returns error code generated from I2C transaction, or 0 for success 
\end{DoxyReturn}
