\doxysection{I2\+C\+\_\+\+Interface Class Reference}
\hypertarget{classI2C__Interface}{}\label{classI2C__Interface}\index{I2C\_Interface@{I2C\_Interface}}


{\ttfamily \#include $<$7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h$>$}



Inheritance diagram for I2\+C\+\_\+\+Interface\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=176pt]{classI2C__Interface__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for I2\+C\+\_\+\+Interface\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=176pt]{classI2C__Interface__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \mbox{\hyperlink{classI2C__Interface_ae8147c4d6e54fe2622825d7e17493152}{begin\+I2C}} (uint8\+\_\+t addr, Two\+Wire \&wire, uint32\+\_\+t speed, uint8\+\_\+t sda=255, uint8\+\_\+t scl=255)
\item 
int8\+\_\+t \mbox{\hyperlink{classI2C__Interface_ae28f61d8a681f69a81d383f4b9d98fc9}{read}} (uint8\+\_\+t reg, uint8\+\_\+t \texorpdfstring{$\ast$}{*}data, uint32\+\_\+t len) override
\item 
bool \mbox{\hyperlink{classI2C__Interface_ac8ffcc85b81a8e7e43f1cae80e17e06e}{begin\+SPI}} (uint8\+\_\+t, SPIClass \&, uint32\+\_\+t, uint8\+\_\+t, uint8\+\_\+t, uint8\+\_\+t) override
\item 
int8\+\_\+t \mbox{\hyperlink{classI2C__Interface_aa3191e7336ca8b3167f60aeee058a523}{write}} (uint8\+\_\+t reg, const uint8\+\_\+t \texorpdfstring{$\ast$}{*}data, uint32\+\_\+t len) override
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{classInterface__7Semi}{Interface\+\_\+7\+Semi}}}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{classInterface__7Semi_a886abd3b127910a54640cee60696ffb5}{\texorpdfstring{$\sim$}{\string~}\+Interface\+\_\+7\+Semi}} ()
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
Two\+Wire \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{classI2C__Interface_aef1b0cf102ef2b57d5e47279848ea575}{i2c}} = nullptr
\item 
uint8\+\_\+t \mbox{\hyperlink{classI2C__Interface_a82b99f14771cafc58b37708e3cb9bf6e}{address}} = 0
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Static Protected Member Functions inherited from \mbox{\hyperlink{classInterface__7Semi}{Interface\+\_\+7\+Semi}}}
\begin{DoxyCompactItemize}
\item 
static void \mbox{\hyperlink{classInterface__7Semi_a7e9d62ef33227b06c85288712dc11c59}{delay\+\_\+us}} (uint32\+\_\+t us)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00005}{5}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.



\doxysubsection{Member Function Documentation}
\Hypertarget{classI2C__Interface_ae8147c4d6e54fe2622825d7e17493152}\label{classI2C__Interface_ae8147c4d6e54fe2622825d7e17493152} 
\index{I2C\_Interface@{I2C\_Interface}!beginI2C@{beginI2C}}
\index{beginI2C@{beginI2C}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{beginI2C()}{beginI2C()}}
{\footnotesize\ttfamily bool I2\+C\+\_\+\+Interface\+::begin\+I2C (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{address,  }\item[{Two\+Wire \&}]{wire,  }\item[{uint32\+\_\+t}]{speed,  }\item[{uint8\+\_\+t}]{sda = {\ttfamily 255},  }\item[{uint8\+\_\+t}]{scl = {\ttfamily 255} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

\doxylink{classI2C__Interface_ae8147c4d6e54fe2622825d7e17493152}{begin\+I2\+C()}


\begin{DoxyItemize}
\item Initializes I2C peripheral
\item Configures SDA / SCL pins if supported
\item Sets communication clock
\end{DoxyItemize}

Returns\+:
\begin{DoxyItemize}
\item true → Initialization successful
\item false → Initialization failed 
\end{DoxyItemize}

Implements \mbox{\hyperlink{classInterface__7Semi_acaf46ee0d90f79c3d0e0e68f777b5696}{Interface\+\_\+7\+Semi}}.



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00011}{11}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classI2C__Interface_ae8147c4d6e54fe2622825d7e17493152_icgraph}
\end{center}
\end{figure}
\Hypertarget{classI2C__Interface_ac8ffcc85b81a8e7e43f1cae80e17e06e}\label{classI2C__Interface_ac8ffcc85b81a8e7e43f1cae80e17e06e} 
\index{I2C\_Interface@{I2C\_Interface}!beginSPI@{beginSPI}}
\index{beginSPI@{beginSPI}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{beginSPI()}{beginSPI()}}
{\footnotesize\ttfamily bool I2\+C\+\_\+\+Interface\+::begin\+SPI (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{,  }\item[{SPIClass \&}]{,  }\item[{uint32\+\_\+t}]{,  }\item[{uint8\+\_\+t}]{,  }\item[{uint8\+\_\+t}]{,  }\item[{uint8\+\_\+t}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Implements \mbox{\hyperlink{classInterface__7Semi_a41d682876fe9f25b928835bb25816a80}{Interface\+\_\+7\+Semi}}.



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00069}{69}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.

\Hypertarget{classI2C__Interface_ae28f61d8a681f69a81d383f4b9d98fc9}\label{classI2C__Interface_ae28f61d8a681f69a81d383f4b9d98fc9} 
\index{I2C\_Interface@{I2C\_Interface}!read@{read}}
\index{read@{read}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{read()}{read()}}
{\footnotesize\ttfamily int8\+\_\+t I2\+C\+\_\+\+Interface\+::read (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{reg,  }\item[{uint8\+\_\+t \texorpdfstring{$\ast$}{*}}]{data,  }\item[{uint32\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}, {\ttfamily [virtual]}}

\doxylink{classI2C__Interface_ae28f61d8a681f69a81d383f4b9d98fc9}{read()}


\begin{DoxyItemize}
\item Reads data from device register
\end{DoxyItemize}

Parameters\+:
\begin{DoxyItemize}
\item reg \+: Register address
\item data \+: Output buffer
\item len \+: Number of bytes
\end{DoxyItemize}

Returns\+:
\begin{DoxyItemize}
\item 0 → Success
\item \texorpdfstring{$<$}{<}0 → Error 
\end{DoxyItemize}

Implements \mbox{\hyperlink{classInterface__7Semi_a8e267174d883544c418ce925f8c55e0f}{Interface\+\_\+7\+Semi}}.



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00032}{32}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.

\Hypertarget{classI2C__Interface_aa3191e7336ca8b3167f60aeee058a523}\label{classI2C__Interface_aa3191e7336ca8b3167f60aeee058a523} 
\index{I2C\_Interface@{I2C\_Interface}!write@{write}}
\index{write@{write}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{write()}{write()}}
{\footnotesize\ttfamily int8\+\_\+t I2\+C\+\_\+\+Interface\+::write (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{reg,  }\item[{const uint8\+\_\+t \texorpdfstring{$\ast$}{*}}]{data,  }\item[{uint32\+\_\+t}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}, {\ttfamily [virtual]}}

\doxylink{classI2C__Interface_aa3191e7336ca8b3167f60aeee058a523}{write()}


\begin{DoxyItemize}
\item Writes data to device register
\end{DoxyItemize}

Returns\+:
\begin{DoxyItemize}
\item 0 → Success
\item \texorpdfstring{$<$}{<}0 → Error 
\end{DoxyItemize}

Implements \mbox{\hyperlink{classInterface__7Semi_a35047310c257c82ae7f60d143326daa0}{Interface\+\_\+7\+Semi}}.



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00075}{75}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.



\doxysubsection{Member Data Documentation}
\Hypertarget{classI2C__Interface_a82b99f14771cafc58b37708e3cb9bf6e}\label{classI2C__Interface_a82b99f14771cafc58b37708e3cb9bf6e} 
\index{I2C\_Interface@{I2C\_Interface}!address@{address}}
\index{address@{address}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{address}{address}}
{\footnotesize\ttfamily uint8\+\_\+t I2\+C\+\_\+\+Interface\+::address = 0}



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00009}{9}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.

\Hypertarget{classI2C__Interface_aef1b0cf102ef2b57d5e47279848ea575}\label{classI2C__Interface_aef1b0cf102ef2b57d5e47279848ea575} 
\index{I2C\_Interface@{I2C\_Interface}!i2c@{i2c}}
\index{i2c@{i2c}!I2C\_Interface@{I2C\_Interface}}
\doxysubsubsection{\texorpdfstring{i2c}{i2c}}
{\footnotesize\ttfamily Two\+Wire\texorpdfstring{$\ast$}{*} I2\+C\+\_\+\+Interface\+::i2c = nullptr}



Definition at line \mbox{\hyperlink{7Semi__I2C__Interface_8h_source_l00008}{8}} of file \mbox{\hyperlink{7Semi__I2C__Interface_8h_source}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/\mbox{\hyperlink{7Semi__I2C__Interface_8h}{7\+Semi\+\_\+\+I2\+C\+\_\+\+Interface.\+h}}\end{DoxyCompactItemize}
