Micro template library A library for building device drivers
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

79 linhas
8.2 KiB

  1. \hypertarget{__1wire_8h}{}\section{include/utl/com/\+\_\+1wire.h File Reference}
  2. \label{__1wire_8h}\index{include/utl/com/\+\_\+1wire.\+h@{include/utl/com/\+\_\+1wire.\+h}}
  3. An 1-\/wire interface implementation.
  4. {\ttfamily \#include $<$utl/core/impl.\+h$>$}\newline
  5. {\ttfamily \#include $<$utl/core/crtp.\+h$>$}\newline
  6. {\ttfamily \#include $<$utl/com/\+\_\+1wire\+\_\+id.\+h$>$}\newline
  7. {\ttfamily \#include $<$utl/meta/meta.\+h$>$}\newline
  8. \subsection*{Classes}
  9. \begin{DoxyCompactItemize}
  10. \item
  11. class \mbox{\hyperlink{classutl_1_1__1wire__i}{utl\+::\+\_\+1wire\+\_\+i$<$ impl\+\_\+t $>$}}
  12. \begin{DoxyCompactList}\small\item\em Template base class for 1-\/wire communication interface using C\+R\+TP. \end{DoxyCompactList}\item
  13. class \mbox{\hyperlink{classutl_1_1__1wire__i_3_01virtual__tag_01_4}{utl\+::\+\_\+1wire\+\_\+i$<$ virtual\+\_\+tag $>$}}
  14. \begin{DoxyCompactList}\small\item\em A virtual base class implementation. \end{DoxyCompactList}\item
  15. struct \mbox{\hyperlink{structutl_1_1__1wire__i__det_1_1is__1wire__}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::is\+\_\+1wire\+\_\+$<$ \+\_\+\+Tp, typename $>$}}
  16. \begin{DoxyCompactList}\small\item\em Primary template to catch any non 1-\/wire interface types. \end{DoxyCompactList}\item
  17. 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 $>$ $>$}}
  18. \begin{DoxyCompactList}\small\item\em template to catch a proper 1-\/wire interface type \end{DoxyCompactList}\end{DoxyCompactItemize}
  19. \subsection*{Namespaces}
  20. \begin{DoxyCompactItemize}
  21. \item
  22. \mbox{\hyperlink{namespaceutl}{utl}}
  23. \begin{DoxyCompactList}\small\item\em S\+TL\textquotesingle{}s core language concepts. \end{DoxyCompactList}\item
  24. \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det}}
  25. \end{DoxyCompactItemize}
  26. \subsection*{Typedefs}
  27. \begin{DoxyCompactItemize}
  28. \item
  29. {\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 $>$()))
  30. \item
  31. {\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 $>$()))
  32. \item
  33. {\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 $>$()))
  34. \item
  35. {\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 $>$()))
  36. \item
  37. {\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 \& $>$()))
  38. \item
  39. {\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 $>$()))
  40. \item
  41. {\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())
  42. \item
  43. {\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 $>$()))
  44. \item
  45. {\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 $>$()))
  46. \end{DoxyCompactItemize}
  47. \subsection*{Functions}
  48. \begin{DoxyCompactItemize}
  49. \item
  50. {\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)
  51. \begin{DoxyCompactList}\small\item\em Write a byte to 1-\/\+Wire bus and read the response. \end{DoxyCompactList}\item
  52. {\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)
  53. \item
  54. {\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)
  55. \item
  56. {\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)
  57. \item
  58. {\footnotesize template$<$typename \+\_\+T $>$ }\\void \mbox{\hyperlink{namespaceutl_1_1__1wire__i__det_ace224a4d329166bfd9f3448e492baf2b}{utl\+::\+\_\+1wire\+\_\+i\+\_\+det\+::\+\_\+skip\+\_\+n\+\_\+ovdr}} (\+\_\+T \&obj)
  59. \item
  60. {\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)
  61. \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
  62. {\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)
  63. \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}
  64. \subsection{Detailed Description}
  65. An 1-\/wire interface implementation.
  66. Copyright (C) 2018 Christos Choutouridis
  67. 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.
  68. 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.
  69. 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/}.