\doxysection{7Semi\+\_\+\+Interface.\+h}
\hypertarget{7Semi__Interface_8h_source}{}\label{7Semi__Interface_8h_source}\index{src/7Semi\_Interface.h@{src/7Semi\_Interface.h}}
\mbox{\hyperlink{7Semi__Interface_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00001}00001\ \textcolor{comment}{//\ \#pragma\ once}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00002}00002\ \textcolor{preprocessor}{\#ifndef\ INTERFACE\_7SEMI\_H}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00003}00003\ \textcolor{preprocessor}{\#define\ INTERFACE\_7SEMI\_H}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00004}00004\ }
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00005}00005\ \textcolor{preprocessor}{\#include\ <Arduino.h>}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00006}00006\ \textcolor{preprocessor}{\#include\ <Wire.h>}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00007}00007\ \textcolor{preprocessor}{\#include\ <SPI.h>}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00008}00008\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00009}00009\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00010}00010\ \textcolor{comment}{\ *\ 7Semi\ Universal\ Interface\ Layer}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00011}00011\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00012}00012\ \textcolor{comment}{\ *\ -\/\ Abstract\ communication\ layer\ for\ I2C\ /\ SPI}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00013}00013\ \textcolor{comment}{\ *\ -\/\ Ensures\ sensor\ drivers\ remain\ hardware\ independent}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00014}00014\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00015}\mbox{\hyperlink{classInterface__7Semi}{00015}}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classInterface__7Semi}{Interface\_7Semi}}\ \{}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00016}00016\ \textcolor{keyword}{public}:}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00017}00017\ }
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00018}\mbox{\hyperlink{classInterface__7Semi_a886abd3b127910a54640cee60696ffb5}{00018}}\ \ \ \ \ \textcolor{keyword}{virtual}\ \mbox{\hyperlink{classInterface__7Semi_a886abd3b127910a54640cee60696ffb5}{\string~Interface\_7Semi}}()\ \{\}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00019}00019\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00020}00020\ \textcolor{comment}{\ \ \ \ /**\ }}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00021}00021\ \textcolor{comment}{\ \ \ \ \ *\ beginI2C()}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00022}00022\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00023}00023\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Initializes\ I2C\ peripheral}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00024}00024\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Configures\ SDA\ /\ SCL\ pins\ if\ supported}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00025}00025\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Sets\ communication\ clock}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00026}00026\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00027}00027\ \textcolor{comment}{\ \ \ \ \ *\ Returns:}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00028}00028\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ true\ \ →\ Initialization\ successful}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00029}00029\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ false\ →\ Initialization\ failed}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00030}00030\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00031}\mbox{\hyperlink{classInterface__7Semi_acaf46ee0d90f79c3d0e0e68f777b5696}{00031}}\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classInterface__7Semi_acaf46ee0d90f79c3d0e0e68f777b5696}{beginI2C}}(}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00032}00032\ \ \ \ \ \ \ \ \ uint8\_t\ address,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00033}00033\ \ \ \ \ \ \ \ \ TwoWire\ \&wire,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00034}00034\ \ \ \ \ \ \ \ \ uint32\_t\ speed,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00035}00035\ \ \ \ \ \ \ \ \ uint8\_t\ sda\ =\ 255,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00036}00036\ \ \ \ \ \ \ \ \ uint8\_t\ scl\ =\ 255)\ =\ 0;}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00037}00037\ }
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00038}\mbox{\hyperlink{classInterface__7Semi_a41d682876fe9f25b928835bb25816a80}{00038}}\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classInterface__7Semi_a41d682876fe9f25b928835bb25816a80}{beginSPI}}(}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00039}00039\ \ \ \ \ \ \ \ \ uint8\_t\ cs\_pin,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00040}00040\ \ \ \ \ \ \ \ \ SPIClass\ \&wire,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00041}00041\ \ \ \ \ \ \ \ \ uint32\_t\ speed,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00042}00042\ \ \ \ \ \ \ \ \ uint8\_t\ csk\ =\ 255,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00043}00043\ \ \ \ \ \ \ \ \ uint8\_t\ miso\ =\ 255,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00044}00044\ \ \ \ \ \ \ \ \ uint8\_t\ mosi\ =\ 255)\ =\ 0;}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00045}00045\ }
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00046}00046\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00047}00047\ \textcolor{comment}{\ \ \ \ /**\ }}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00048}00048\ \textcolor{comment}{\ \ \ \ \ *\ read()}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00049}00049\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00050}00050\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Reads\ data\ from\ device\ register}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00051}00051\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00052}00052\ \textcolor{comment}{\ \ \ \ \ *\ Parameters:}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00053}00053\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ reg\ \ :\ Register\ address}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00054}00054\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ data\ :\ Output\ buffer}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00055}00055\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ len\ \ :\ Number\ of\ bytes}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00056}00056\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00057}00057\ \textcolor{comment}{\ \ \ \ \ *\ Returns:}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00058}00058\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ 0\ \ →\ Success}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00059}00059\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ <0\ →\ Error}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00060}00060\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00061}\mbox{\hyperlink{classInterface__7Semi_a8e267174d883544c418ce925f8c55e0f}{00061}}\ \ \ \ \ \textcolor{keyword}{virtual}\ int8\_t\ \mbox{\hyperlink{classInterface__7Semi_a8e267174d883544c418ce925f8c55e0f}{read}}(}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00062}00062\ \ \ \ \ \ \ \ \ uint8\_t\ reg,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00063}00063\ \ \ \ \ \ \ \ \ uint8\_t\ *data,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00064}00064\ \ \ \ \ \ \ \ \ uint32\_t\ len)\ =\ 0;}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00065}00065\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00066}00066\ \textcolor{comment}{\ \ \ \ /**\ }}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00067}00067\ \textcolor{comment}{\ \ \ \ \ *\ write()}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00068}00068\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00069}00069\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Writes\ data\ to\ device\ register}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00070}00070\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00071}00071\ \textcolor{comment}{\ \ \ \ \ *\ Returns:}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00072}00072\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ 0\ \ →\ Success}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00073}00073\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ <0\ →\ Error}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00074}00074\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00075}\mbox{\hyperlink{classInterface__7Semi_a35047310c257c82ae7f60d143326daa0}{00075}}\ \ \ \ \ \textcolor{keyword}{virtual}\ int8\_t\ \mbox{\hyperlink{classInterface__7Semi_a35047310c257c82ae7f60d143326daa0}{write}}(}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00076}00076\ \ \ \ \ \ \ \ \ uint8\_t\ reg,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00077}00077\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ uint8\_t\ *data,}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00078}00078\ \ \ \ \ \ \ \ \ uint32\_t\ len)\ =\ 0;}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00079}00079\ }
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00080}00080\ \textcolor{keyword}{protected}:\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00081}00081\ \textcolor{comment}{\ \ \ \ /**\ Delay\ wrapper\ */}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00082}\mbox{\hyperlink{classInterface__7Semi_a7e9d62ef33227b06c85288712dc11c59}{00082}}\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classInterface__7Semi_a7e9d62ef33227b06c85288712dc11c59}{delay\_us}}(uint32\_t\ us)}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00083}00083\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00084}00084\ \ \ \ \ \ \ \ \ delayMicroseconds(us);}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00085}00085\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00086}00086\ \};}
\DoxyCodeLine{\Hypertarget{7Semi__Interface_8h_source_l00087}00087\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
