\doxysection{Bus\+IO\+\_\+7\+Semi.\+h}
\hypertarget{BusIO__7Semi_8h_source}{}\label{BusIO__7Semi_8h_source}\index{src/BusIO\_7Semi.h@{src/BusIO\_7Semi.h}}
\doxymbox{\hyperlink{BusIO__7Semi_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00001}00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00002}00002\ \textcolor{preprocessor}{\#include\ <Arduino.h>}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00003}00003\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00004}00004\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Bus>}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00005}\doxymbox{\hyperlink{classBusIO__7Semi}{00005}}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classBusIO__7Semi_abc6ad9da24a816c48b1f0cb88bcedb83}{BusIO\_7Semi}}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00006}00006\ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00007}00007\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00008}00008\ \textcolor{keyword}{public}:\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00009}00009\ \textcolor{comment}{\ \ \ \ /**}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00010}00010\ \textcolor{comment}{\ \ \ \ \ *\ Constructor}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00011}00011\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00012}00012\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Stores\ interface\ reference}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00013}00013\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00014}\doxymbox{\hyperlink{classBusIO__7Semi_abc6ad9da24a816c48b1f0cb88bcedb83}{00014}}\ \ \ \ \ \doxymbox{\hyperlink{classBusIO__7Semi_abc6ad9da24a816c48b1f0cb88bcedb83}{BusIO\_7Semi}}(Bus\ \&busRef)\ :\ bus(busRef)\ \{\}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00015}00015\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00016}00016\ \textcolor{comment}{\ \ \ \ /**\ read\ 8-\/bit\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00017}\doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{00017}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{read}}(uint8\_t\ reg,\ uint8\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00018}00018\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00019}00019\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (bus.read(reg,\ \&value,\ 1)\ ==\ 0);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00020}00020\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00021}00021\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00022}00022\ \textcolor{comment}{\ \ \ \ /**\ read\ 16-\/bit\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00023}\doxymbox{\hyperlink{classBusIO__7Semi_a0383e934309702605863f2e63eceae1e}{00023}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a0383e934309702605863f2e63eceae1e}{read}}(uint8\_t\ reg,\ uint16\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00024}00024\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00025}00025\ \ \ \ \ \ \ \ \ uint8\_t\ data[2];}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00026}00026\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (bus.read(reg,\ data,\ 2)\ !=\ 0)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00027}00027\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00028}00028\ \ \ \ \ \ \ \ \ value\ =\ (data[0]\ <<\ 8)\ |\ data[1];}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00029}00029\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00030}00030\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00031}00031\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00032}00032\ \textcolor{comment}{\ \ \ \ /**\ read\ burst\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00033}\doxymbox{\hyperlink{classBusIO__7Semi_a731ddae1770b47b4fa200811043dca87}{00033}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a731ddae1770b47b4fa200811043dca87}{read}}(uint8\_t\ reg,\ uint8\_t\ *data,\ uint32\_t\ len)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00034}00034\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00035}00035\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (bus.read(reg,\ data,\ len)\ ==\ 0);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00036}00036\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00037}00037\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00038}00038\ \textcolor{comment}{\ \ \ \ /**\ write\ 8-\/bit\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00039}\doxymbox{\hyperlink{classBusIO__7Semi_aa633479356af692cb9ea334771b7c0c5}{00039}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_aa633479356af692cb9ea334771b7c0c5}{write}}(uint8\_t\ reg,\ uint8\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00040}00040\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00041}00041\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (bus.write(reg,\ \&value,\ 1)\ ==\ 0);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00042}00042\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00043}00043\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00044}00044\ \textcolor{comment}{\ \ \ \ /**\ write\ 16-\/bit\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00045}\doxymbox{\hyperlink{classBusIO__7Semi_aaa3c727db8143b9af43dc4b449f43ece}{00045}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_aaa3c727db8143b9af43dc4b449f43ece}{write}}(uint8\_t\ reg,\ uint16\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00046}00046\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00047}00047\ \ \ \ \ \ \ \ \ uint8\_t\ data[2]\ =\ \{(uint8\_t)(value\ >>\ 8),\ (uint8\_t)(value\ \&\ 0xFF)\};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00048}00048\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (bus.write(reg,\ data,\ 2)\ ==\ 0);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00049}00049\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00050}00050\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00051}00051\ \textcolor{comment}{\ \ \ \ /**\ write\ burst\ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00052}\doxymbox{\hyperlink{classBusIO__7Semi_a9261e4a7ea9ae5b528a4c9f38e0bf329}{00052}}\ \ \ \ \ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a9261e4a7ea9ae5b528a4c9f38e0bf329}{write}}(uint8\_t\ reg,\ \textcolor{keyword}{const}\ uint8\_t\ *data,\ uint32\_t\ len)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00053}00053\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00054}00054\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (bus.write(reg,\ data,\ len)\ ==\ 0);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00055}00055\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00056}00056\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00057}00057\ \textcolor{comment}{\ \ \ \ /**}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00058}00058\ \textcolor{comment}{\ \ \ \ \ *\ readBits\ (8-\/bit\ register)}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00059}00059\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00060}\doxymbox{\hyperlink{classBusIO__7Semi_aed7b0973e323495f8516a0d253089af8}{00060}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_aed7b0973e323495f8516a0d253089af8}{readBits}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ len,\ uint8\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00061}00061\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00062}00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (len\ ==\ 0\ ||\ len\ >\ 8\ ||\ (pos\ +\ len)\ >\ 8)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00063}00063\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00064}00064\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00065}00065\ \ \ \ \ \ \ \ \ uint8\_t\ reg\_val;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00066}00066\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{read}}(reg,\ reg\_val))}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00067}00067\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00068}00068\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00069}00069\ \ \ \ \ \ \ \ \ uint8\_t\ mask\ =\ ((uint8\_t)1\ <<\ len)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00070}00070\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00071}00071\ \ \ \ \ \ \ \ \ value\ =\ (reg\_val\ >>\ pos)\ \&\ mask;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00072}00072\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00073}00073\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00074}00074\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00075}00075\ \textcolor{comment}{\ \ \ \ /**}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00076}00076\ \textcolor{comment}{\ \ \ \ \ *\ readBits\ (16-\/bit\ register)}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00077}00077\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00078}\doxymbox{\hyperlink{classBusIO__7Semi_a15f260e24f2c2f806965744c40f0f52f}{00078}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a15f260e24f2c2f806965744c40f0f52f}{readBits}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ len,\ uint16\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00079}00079\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00080}00080\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (len\ ==\ 0\ ||\ len\ >\ 16\ ||\ (pos\ +\ len)\ >\ 16)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00081}00081\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00082}00082\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00083}00083\ \ \ \ \ \ \ \ \ uint8\_t\ reg\_val;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00084}00084\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{read}}(reg,\ reg\_val))}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00085}00085\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00086}00086\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00087}00087\ \ \ \ \ \ \ \ \ uint16\_t\ mask\ =\ ((uint16\_t)1\ <<\ len)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00088}00088\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00089}00089\ \ \ \ \ \ \ \ \ value\ =\ (reg\_val\ >>\ pos)\ \&\ mask;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00090}00090\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00091}00091\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00092}00092\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00093}00093\ \textcolor{comment}{\ \ \ \ /**}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00094}00094\ \textcolor{comment}{\ \ \ \ \ *\ writeBits\ (8-\/bit\ register)}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00095}00095\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00096}00096\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Modifies\ specific\ bits\ in\ 8-\/bit\ register}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00097}00097\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00098}\doxymbox{\hyperlink{classBusIO__7Semi_a855c7388d4118e632c84c7f8e2e3ddc2}{00098}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a855c7388d4118e632c84c7f8e2e3ddc2}{writeBits}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ len,\ uint8\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00099}00099\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00100}00100\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (len\ ==\ 0\ ||\ len\ >\ 8\ ||\ (pos\ +\ len)\ >\ 8)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00101}00101\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00102}00102\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00103}00103\ \ \ \ \ \ \ \ \ uint8\_t\ reg\_val;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00104}00104\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{read}}(reg,\ reg\_val))}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00105}00105\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00106}00106\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00107}00107\ \ \ \ \ \ \ \ \ uint8\_t\ mask\ =\ ((uint8\_t)1\ <<\ len)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00108}00108\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00109}00109\ \ \ \ \ \ \ \ \ reg\_val\ \&=\ \string~(mask\ <<\ pos);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00110}00110\ \ \ \ \ \ \ \ \ reg\_val\ |=\ (value\ \&\ mask)\ <<\ pos;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00111}00111\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00112}00112\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_aa633479356af692cb9ea334771b7c0c5}{write}}(reg,\ reg\_val);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00113}00113\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00114}00114\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00115}00115\ \textcolor{comment}{\ \ \ \ /**}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00116}00116\ \textcolor{comment}{\ \ \ \ \ *\ writeBits\ (16-\/bit\ register)}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00117}00117\ \textcolor{comment}{\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00118}00118\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Modifies\ specific\ bits\ in\ 16-\/bit\ register}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00119}00119\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00120}\doxymbox{\hyperlink{classBusIO__7Semi_af38d37d409c6d8bc956522465fa39390}{00120}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_af38d37d409c6d8bc956522465fa39390}{writeBits}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ len,\ uint16\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00121}00121\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00122}00122\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (len\ ==\ 0\ ||\ len\ >\ 16\ ||\ (pos\ +\ len)\ >\ 16)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00123}00123\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00124}00124\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00125}00125\ \ \ \ \ \ \ \ \ uint8\_t\ reg\_val;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00126}00126\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\doxymbox{\hyperlink{classBusIO__7Semi_a933c66d9a1afe84102323e209a93dd31}{read}}(reg,\ reg\_val))}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00127}00127\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00128}00128\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00129}00129\ \ \ \ \ \ \ \ \ uint16\_t\ mask\ =\ ((uint16\_t)1\ <<\ len)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00130}00130\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00131}00131\ \ \ \ \ \ \ \ \ reg\_val\ \&=\ \string~(mask\ <<\ pos);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00132}00132\ \ \ \ \ \ \ \ \ reg\_val\ |=\ (value\ \&\ mask)\ <<\ pos;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00133}00133\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00134}00134\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_aa633479356af692cb9ea334771b7c0c5}{write}}(reg,\ reg\_val);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00135}00135\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00137}\doxymbox{\hyperlink{classBusIO__7Semi_a0d76100d6e83237e0ee97eba7044147d}{00137}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a0d76100d6e83237e0ee97eba7044147d}{readBit}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00138}00138\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00139}00139\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_aed7b0973e323495f8516a0d253089af8}{readBits}}(reg,\ pos,\ 1,\ value);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00140}00140\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00141}00141\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00142}\doxymbox{\hyperlink{classBusIO__7Semi_a51b4ef7309cdfddaa3c94d99eac09065}{00142}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a51b4ef7309cdfddaa3c94d99eac09065}{readBit}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint16\_t\ \&value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00143}00143\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00144}00144\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_aed7b0973e323495f8516a0d253089af8}{readBits}}(reg,\ pos,\ 1,\ value);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00145}00145\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00146}00146\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00147}\doxymbox{\hyperlink{classBusIO__7Semi_ac7b3d1c425f7187abbe1bbec64d9ccea}{00147}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_ac7b3d1c425f7187abbe1bbec64d9ccea}{writeBit}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint8\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00148}00148\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00149}00149\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_a855c7388d4118e632c84c7f8e2e3ddc2}{writeBits}}(reg,\ pos,\ 1,\ (uint8\_t)value\ );}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00150}00150\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00151}\doxymbox{\hyperlink{classBusIO__7Semi_a6a07d4bd0a308294b37166b6d25209b2}{00151}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classBusIO__7Semi_a6a07d4bd0a308294b37166b6d25209b2}{writeBit}}(uint8\_t\ reg,\ uint8\_t\ pos,\ uint16\_t\ value)}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00152}00152\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00153}00153\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classBusIO__7Semi_a855c7388d4118e632c84c7f8e2e3ddc2}{writeBits}}(reg,\ pos,\ 1,\ value);}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00154}00154\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00155}00155\ }
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00156}00156\ \textcolor{keyword}{private}:}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00157}00157\ \ \ \ \ Bus\ \&bus;}
\DoxyCodeLine{\Hypertarget{BusIO__7Semi_8h_source_l00158}00158\ \};}

\end{DoxyCode}
