\hypertarget{__1wire_8h}{}\section{include/utl/com/\+\_\+1wire.h File Reference}
\label{__1wire_8h}\index{include/utl/com/\+\_\+1wire.\+h@{include/utl/com/\+\_\+1wire.\+h}}


An 1-\/wire interface implementation.  


{\ttfamily \#include $<$utl/core/impl.\+h$>$}\newline
{\ttfamily \#include $<$utl/core/crtp.\+h$>$}\newline
{\ttfamily \#include $<$utl/com/\+\_\+1wire\+\_\+id.\+h$>$}\newline
{\ttfamily \#include $<$utl/meta/meta.\+h$>$}\newline
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \mbox{\hyperlink{classutl_1_1__1wire__i}{utl\+::\+\_\+1wire\+\_\+i$<$ impl\+\_\+t $>$}}
\begin{DoxyCompactList}\small\item\em Template base class for 1-\/wire communication interface using C\+R\+TP. \end{DoxyCompactList}\item 
class \mbox{\hyperlink{classutl_1_1__1wire__i_3_01virtual__tag_01_4}{utl\+::\+\_\+1wire\+\_\+i$<$ virtual\+\_\+tag $>$}}
\begin{DoxyCompactList}\small\item\em A virtual base class implementation. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structutl_1_1__1wire__i__det_1_1is__1wire__}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::is\+\_\+1wire\+\_\+$<$ \+\_\+\+Tp, typename $>$}}
\begin{DoxyCompactList}\small\item\em Primary template to catch any non 1-\/wire interface types. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structutl_1_1__1wire__i__det_1_1is__1wire___3_01___tp_00_01meta_1_1void__t_3_01void_01_4_01_4}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::is\+\_\+1wire\+\_\+$<$ \+\_\+\+Tp, meta\+::void\+\_\+t$<$ void $>$ $>$}}
\begin{DoxyCompactList}\small\item\em template to catch a proper 1-\/wire interface type \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Namespaces}
\begin{DoxyCompactItemize}
\item 
 \mbox{\hyperlink{namespaceutl}{utl}}
\begin{DoxyCompactList}\small\item\em S\+TL\textquotesingle{}s core language concepts. \end{DoxyCompactList}\item 
 \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det}}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a502fff2c967d26334aa3c2fcf0b037ba}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+reset\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().reset(declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a303cf58468da38ceeaa2477570f82948}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+rx1\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().rx\+\_\+data(declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_ac6a2b551bcf51b426c2e8506ab2473fe}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+tx1\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().tx\+\_\+data(declval$<$ byte\+\_\+t $>$(), declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a3416ddb06e089a5c191d356dd358ff00}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+match\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().match(declval$<$ \+\_\+1wire\+\_\+id\+\_\+t \& $>$(), declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_aa85f59a97c388dc259589cb517824233}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+match\+\_\+n\+\_\+ovdr\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().match\+\_\+n\+\_\+ovdr(declval$<$ \+\_\+1wire\+\_\+id\+\_\+t \& $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a9d0825a40484e7868bf41fc4825b4f7d}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+skip\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().skip(declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_af6c9df3cb6bf2479e8d30a5d36ab71cb}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+skip\+\_\+n\+\_\+ovdr\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().skip\+\_\+n\+\_\+ovdr())
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a3dc7b4df37cebf753556ba527306cf9f}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+first\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().first(declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\item 
{\footnotesize template$<$class \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a67a086b8e4e3ee051ccb0351e6456630}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::try\+\_\+next\+\_\+t}} = decltype(declval$<$ \+\_\+\+Tp $>$().next(declval$<$ typename \+\_\+\+Tp\+::\+Speed $>$()))
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\byte\+\_\+t \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a85a3a19778edb037f6341f37135a5494}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+touch}} (\+\_\+T \&obj, byte\+\_\+t out, typename \+\_\+\+T\+::\+Speed s)
\begin{DoxyCompactList}\small\item\em Write a byte to 1-\/\+Wire bus and read the response. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\void \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a1b07e623a39ce82f1514846169f3a954}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+match}} (\+\_\+T \&obj, \+\_\+1wire\+\_\+id\+\_\+t \&id, typename \+\_\+\+T\+::\+Speed s)
\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\void \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a1e14f734d5e232c914be6ea97982aa40}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+match\+\_\+n\+\_\+ovdr}} (\+\_\+T \&obj, \+\_\+1wire\+\_\+id\+\_\+t \&id)
\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\void \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a9ea80f4ef2422a7fd71788c42b228053}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+skip}} (\+\_\+T \&obj, typename \+\_\+\+T\+::\+Speed s)
\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\void \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_ace224a4d329166bfd9f3448e492baf2b}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+skip\+\_\+n\+\_\+ovdr}} (\+\_\+T \&obj)
\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\\+\_\+1wire\+\_\+id\+\_\+t \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a237719ffa105f988cb175d6720712a4a}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+first}} (\+\_\+T \&obj, typename \+\_\+\+T\+::\+Speed s, bool alarm)
\begin{DoxyCompactList}\small\item\em \textquotesingle{}first\textquotesingle{} operation, to search on the 1-\/\+Wire for the first device. This is performed by setting dec\+\_\+, pos\+\_\+ and cur\+\_\+ to zero and then doing the search. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename \+\_\+T $>$ }\\\+\_\+1wire\+\_\+id\+\_\+t \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_a1f7b692a40769ebe59343613b147e01d}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+next}} (\+\_\+T \&obj, typename \+\_\+\+T\+::\+Speed s, bool alarm)
\begin{DoxyCompactList}\small\item\em \textquotesingle{}next\textquotesingle{} operation, to search on the 1-\/\+Wire for the next device. This search is usually performed after a \textquotesingle{}first\textquotesingle{} operation or another \textquotesingle{}next\textquotesingle{} operation. Based on maxim-\/ic application note 187. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
An 1-\/wire interface implementation. 

Copyright (C) 2018 Christos Choutouridis

This program is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU Lesser General Public License for more details.

You should have received a copy of the G\+NU Lesser General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 