class_a_d_s1118.tex 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. \hypertarget{class_a_d_s1118}{}\section{A\+D\+S1118 Class Reference}
  2. \label{class_a_d_s1118}\index{A\+D\+S1118@{A\+D\+S1118}}
  3. {\ttfamily \#include $<$A\+D\+S1118.\+h$>$}
  4. \subsection*{Public Member Functions}
  5. \begin{DoxyCompactItemize}
  6. \item
  7. \mbox{\hyperlink{class_a_d_s1118_afaddf1d46e3b32d433c67122d96a6ebb}{A\+D\+S1118}} (uint8\+\_\+t io\+\_\+pin\+\_\+cs)
  8. \begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
  9. void \mbox{\hyperlink{class_a_d_s1118_a817f1a7619d97e19475458dc3eea5f88}{begin}} ()
  10. \begin{DoxyCompactList}\small\item\em This method initialize the S\+PI port and the config register. \end{DoxyCompactList}\item
  11. double \mbox{\hyperlink{class_a_d_s1118_acf67a3c09b9d165f04e2e37e618e4fcb}{get\+Temperature}} ()
  12. \begin{DoxyCompactList}\small\item\em Getting the temperature in degrees celsius from the internal sensor of the \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}}. \end{DoxyCompactList}\item
  13. uint16\+\_\+t \mbox{\hyperlink{class_a_d_s1118_adf872650d20977b5872f88fa36182d3a}{get\+A\+D\+C\+Value}} (uint8\+\_\+t inputs)
  14. \begin{DoxyCompactList}\small\item\em Getting a sample from the specified input. \end{DoxyCompactList}\item
  15. double \mbox{\hyperlink{class_a_d_s1118_a11e4c070217773d71da1d22506e64c00}{get\+Milli\+Volts}} (uint8\+\_\+t inputs)
  16. \begin{DoxyCompactList}\small\item\em Getting the millivolts from the specified inputs. \end{DoxyCompactList}\item
  17. double \mbox{\hyperlink{class_a_d_s1118_a5d88241e78575ca86f6206f02cec0614}{get\+Milli\+Volts}} ()
  18. \begin{DoxyCompactList}\small\item\em Getting the millivolts from the settled inputs. \end{DoxyCompactList}\item
  19. void \mbox{\hyperlink{class_a_d_s1118_a8d79b157a07574bd8745137a8347649e}{decode\+Config\+Register}} (union \mbox{\hyperlink{union_config}{Config}} \mbox{\hyperlink{class_a_d_s1118_ab41e0ba159527f2fc8d48cbedc653380}{config\+Register}})
  20. \begin{DoxyCompactList}\small\item\em Decoding a config\+Register structure and then print it out to the Serial port. \end{DoxyCompactList}\item
  21. void \mbox{\hyperlink{class_a_d_s1118_abcabaf741cc3e45e53a6967e0d113073}{set\+Samplig\+Rate}} (uint8\+\_\+t sampling\+Rate)
  22. \begin{DoxyCompactList}\small\item\em Setting the sampling rate specified in the config register. \end{DoxyCompactList}\item
  23. void \mbox{\hyperlink{class_a_d_s1118_a15fcd99b88c988fef9b4cc04347b08a5}{set\+Full\+Scale\+Range}} (uint8\+\_\+t fsr)
  24. \begin{DoxyCompactList}\small\item\em Setting the full scale range in the config register. \end{DoxyCompactList}\item
  25. void \mbox{\hyperlink{class_a_d_s1118_af739fb00547d7a5df8c5010c40b64c6a}{set\+Continuous\+Mode}} ()
  26. \begin{DoxyCompactList}\small\item\em Setting to continuous adquisition mode. \end{DoxyCompactList}\item
  27. void \mbox{\hyperlink{class_a_d_s1118_a9e2e456dee0ee957fe89319d12bd833c}{set\+Single\+Shot\+Mode}} ()
  28. \begin{DoxyCompactList}\small\item\em Setting to single shot adquisition and power down mode. \end{DoxyCompactList}\item
  29. void \mbox{\hyperlink{class_a_d_s1118_a649c53bdf46a93b5ab682d04b9f9df5e}{disable\+Pullup}} ()
  30. \begin{DoxyCompactList}\small\item\em Disabling the internal pull-\/up resistor of the D\+O\+UT pin. \end{DoxyCompactList}\item
  31. void \mbox{\hyperlink{class_a_d_s1118_a833326b882b86608d62450fcedabbe4a}{enable\+Pullup}} ()
  32. \begin{DoxyCompactList}\small\item\em Enabling the internal pull-\/up resistor of the D\+O\+UT pin. \end{DoxyCompactList}\item
  33. void \mbox{\hyperlink{class_a_d_s1118_a074c71a9eeb1d0db946f5f4b1308c69f}{set\+Input\+Selected}} (uint8\+\_\+t input)
  34. \begin{DoxyCompactList}\small\item\em Setting the inputs to be adquired in the config register. \end{DoxyCompactList}\end{DoxyCompactItemize}
  35. \subsection*{Public Attributes}
  36. \begin{DoxyCompactItemize}
  37. \item
  38. \mbox{\Hypertarget{class_a_d_s1118_ad655c0ffe0e3fb2c8c2644176c67f1aa}\label{class_a_d_s1118_ad655c0ffe0e3fb2c8c2644176c67f1aa}}
  39. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_ad655c0ffe0e3fb2c8c2644176c67f1aa}{D\+I\+F\+F\+\_\+0\+\_\+1}} = 0b000
  40. \begin{DoxyCompactList}\small\item\em Differential input\+: Vin=A0-\/\+A1. \end{DoxyCompactList}\item
  41. \mbox{\Hypertarget{class_a_d_s1118_a1caeae913293ef4806516976a2dc7f4b}\label{class_a_d_s1118_a1caeae913293ef4806516976a2dc7f4b}}
  42. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a1caeae913293ef4806516976a2dc7f4b}{D\+I\+F\+F\+\_\+0\+\_\+3}} = 0b001
  43. \begin{DoxyCompactList}\small\item\em Differential input\+: Vin=A0-\/\+A3. \end{DoxyCompactList}\item
  44. \mbox{\Hypertarget{class_a_d_s1118_a683b66748ece91703c8ccc1920a6f762}\label{class_a_d_s1118_a683b66748ece91703c8ccc1920a6f762}}
  45. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a683b66748ece91703c8ccc1920a6f762}{D\+I\+F\+F\+\_\+1\+\_\+3}} = 0b010
  46. \begin{DoxyCompactList}\small\item\em Differential input\+: Vin=A1-\/\+A3. \end{DoxyCompactList}\item
  47. \mbox{\Hypertarget{class_a_d_s1118_a8e9e4f86cb2487a24b539c2f7424324d}\label{class_a_d_s1118_a8e9e4f86cb2487a24b539c2f7424324d}}
  48. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a8e9e4f86cb2487a24b539c2f7424324d}{D\+I\+F\+F\+\_\+2\+\_\+3}} = 0b011
  49. \begin{DoxyCompactList}\small\item\em Differential input\+: Vin=A2-\/\+A3. \end{DoxyCompactList}\item
  50. \mbox{\Hypertarget{class_a_d_s1118_aca6400b67c3254276ac2bee98153ce1b}\label{class_a_d_s1118_aca6400b67c3254276ac2bee98153ce1b}}
  51. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_aca6400b67c3254276ac2bee98153ce1b}{A\+I\+N\+\_\+0}} = 0b100
  52. \begin{DoxyCompactList}\small\item\em Single ended input\+: Vin=A0. \end{DoxyCompactList}\item
  53. \mbox{\Hypertarget{class_a_d_s1118_a252939e56baf2c563a81778d36471b57}\label{class_a_d_s1118_a252939e56baf2c563a81778d36471b57}}
  54. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a252939e56baf2c563a81778d36471b57}{A\+I\+N\+\_\+1}} = 0b101
  55. \begin{DoxyCompactList}\small\item\em Single ended input\+: Vin=A1. \end{DoxyCompactList}\item
  56. \mbox{\Hypertarget{class_a_d_s1118_ae54c53aaa6546ca3d6ff0a5f94bca2da}\label{class_a_d_s1118_ae54c53aaa6546ca3d6ff0a5f94bca2da}}
  57. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_ae54c53aaa6546ca3d6ff0a5f94bca2da}{A\+I\+N\+\_\+2}} = 0b110
  58. \begin{DoxyCompactList}\small\item\em Single ended input\+: Vin=A2. \end{DoxyCompactList}\item
  59. \mbox{\Hypertarget{class_a_d_s1118_a960aed37cacaba71cdc4d4761bce7fd4}\label{class_a_d_s1118_a960aed37cacaba71cdc4d4761bce7fd4}}
  60. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a960aed37cacaba71cdc4d4761bce7fd4}{A\+I\+N\+\_\+3}} = 0b111
  61. \begin{DoxyCompactList}\small\item\em Single ended input\+: Vin=A3. \end{DoxyCompactList}\item
  62. \mbox{\Hypertarget{class_a_d_s1118_ab41e0ba159527f2fc8d48cbedc653380}\label{class_a_d_s1118_ab41e0ba159527f2fc8d48cbedc653380}}
  63. union \mbox{\hyperlink{union_config}{Config}} \mbox{\hyperlink{class_a_d_s1118_ab41e0ba159527f2fc8d48cbedc653380}{config\+Register}}
  64. \begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{union_config}{Config}} register. \end{DoxyCompactList}\item
  65. \mbox{\Hypertarget{class_a_d_s1118_a2e1f9b252a8468439c3c4a8b46ec5b9e}\label{class_a_d_s1118_a2e1f9b252a8468439c3c4a8b46ec5b9e}}
  66. const uint16\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a2e1f9b252a8468439c3c4a8b46ec5b9e}{S\+C\+LK}} = 2000000
  67. \begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}} S\+C\+LK frequency\+: 4000000 Hz Maximum for \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}}. \end{DoxyCompactList}\item
  68. \mbox{\Hypertarget{class_a_d_s1118_af146984531345834e8caaf0ffe017735}\label{class_a_d_s1118_af146984531345834e8caaf0ffe017735}}
  69. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_af146984531345834e8caaf0ffe017735}{S\+T\+A\+R\+T\+\_\+\+N\+OW}} = 1
  70. \begin{DoxyCompactList}\small\item\em Start of conversion in single-\/shot mode. \end{DoxyCompactList}\item
  71. \mbox{\Hypertarget{class_a_d_s1118_ace81e16e9c09d65487c451dbc0c86cc5}\label{class_a_d_s1118_ace81e16e9c09d65487c451dbc0c86cc5}}
  72. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_ace81e16e9c09d65487c451dbc0c86cc5}{A\+D\+C\+\_\+\+M\+O\+DE}} = 0
  73. \begin{DoxyCompactList}\small\item\em External (inputs) voltage reading mode. \end{DoxyCompactList}\item
  74. \mbox{\Hypertarget{class_a_d_s1118_aae519c1c967c59c8d40e06f7517fca0c}\label{class_a_d_s1118_aae519c1c967c59c8d40e06f7517fca0c}}
  75. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_aae519c1c967c59c8d40e06f7517fca0c}{T\+E\+M\+P\+\_\+\+M\+O\+DE}} = 1
  76. \begin{DoxyCompactList}\small\item\em Internal temperature sensor reading mode. \end{DoxyCompactList}\item
  77. \mbox{\Hypertarget{class_a_d_s1118_ac79cd7f4808c3b4ff2721e2e8b6140ba}\label{class_a_d_s1118_ac79cd7f4808c3b4ff2721e2e8b6140ba}}
  78. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_ac79cd7f4808c3b4ff2721e2e8b6140ba}{C\+O\+N\+T\+I\+N\+U\+O\+US}} = 0
  79. \begin{DoxyCompactList}\small\item\em Continuous conversion mode. \end{DoxyCompactList}\item
  80. \mbox{\Hypertarget{class_a_d_s1118_a71a3c608158cd617c24b51986f2fccc0}\label{class_a_d_s1118_a71a3c608158cd617c24b51986f2fccc0}}
  81. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a71a3c608158cd617c24b51986f2fccc0}{S\+I\+N\+G\+L\+E\+\_\+\+S\+H\+OT}} = 1
  82. \begin{DoxyCompactList}\small\item\em Single-\/shot conversion and power down mode. \end{DoxyCompactList}\item
  83. \mbox{\Hypertarget{class_a_d_s1118_ab5035f17d58adff567e8002d3e5c40fa}\label{class_a_d_s1118_ab5035f17d58adff567e8002d3e5c40fa}}
  84. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_ab5035f17d58adff567e8002d3e5c40fa}{P\+U\+L\+L\+UP}} = 1
  85. \begin{DoxyCompactList}\small\item\em Internal pull-\/up resistor enabled for D\+O\+UT $\ast$$\ast$$\ast$\+D\+E\+F\+A\+U\+LT. \end{DoxyCompactList}\item
  86. \mbox{\Hypertarget{class_a_d_s1118_a9c4404b5040ec1b5f43094961e2f62d5}\label{class_a_d_s1118_a9c4404b5040ec1b5f43094961e2f62d5}}
  87. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a9c4404b5040ec1b5f43094961e2f62d5}{N\+O\+\_\+\+P\+U\+L\+L\+UP}} = 0
  88. \begin{DoxyCompactList}\small\item\em Internal pull-\/up resistor disabled. \end{DoxyCompactList}\item
  89. \mbox{\Hypertarget{class_a_d_s1118_afc7ff1f66a8cda9826daeaf3fe5ba6ab}\label{class_a_d_s1118_afc7ff1f66a8cda9826daeaf3fe5ba6ab}}
  90. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_afc7ff1f66a8cda9826daeaf3fe5ba6ab}{V\+A\+L\+I\+D\+\_\+\+C\+FG}} = 0b01
  91. \begin{DoxyCompactList}\small\item\em Data will be written to \mbox{\hyperlink{union_config}{Config}} register. \end{DoxyCompactList}\item
  92. \mbox{\Hypertarget{class_a_d_s1118_aca0198f642c007b7ae32728ecc7b4b1f}\label{class_a_d_s1118_aca0198f642c007b7ae32728ecc7b4b1f}}
  93. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_aca0198f642c007b7ae32728ecc7b4b1f}{N\+O\+\_\+\+V\+A\+L\+I\+D\+\_\+\+C\+FG}} = 0b00
  94. \begin{DoxyCompactList}\small\item\em Data won\textquotesingle{}t be written to \mbox{\hyperlink{union_config}{Config}} register. \end{DoxyCompactList}\item
  95. \mbox{\Hypertarget{class_a_d_s1118_addf0469ded07f0cf2c7566745a9bf197}\label{class_a_d_s1118_addf0469ded07f0cf2c7566745a9bf197}}
  96. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_addf0469ded07f0cf2c7566745a9bf197}{R\+E\+S\+E\+R\+V\+ED}} = 1
  97. \begin{DoxyCompactList}\small\item\em Its value is always 1, reserved. \end{DoxyCompactList}\item
  98. \mbox{\Hypertarget{class_a_d_s1118_afc58ecaefacef5592c90c4c843d81dde}\label{class_a_d_s1118_afc58ecaefacef5592c90c4c843d81dde}}
  99. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_afc58ecaefacef5592c90c4c843d81dde}{F\+S\+R\+\_\+6144}} = 0b000
  100. \begin{DoxyCompactList}\small\item\em Range\+: ±6.144 v. L\+SB S\+I\+ZE = 187.\+5μV. \end{DoxyCompactList}\item
  101. \mbox{\Hypertarget{class_a_d_s1118_a9ef5d9e47353e4e30ceab533e2edf3ad}\label{class_a_d_s1118_a9ef5d9e47353e4e30ceab533e2edf3ad}}
  102. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a9ef5d9e47353e4e30ceab533e2edf3ad}{F\+S\+R\+\_\+4096}} = 0b001
  103. \begin{DoxyCompactList}\small\item\em Range\+: ±4.096 v. L\+SB S\+I\+ZE = 125μV. \end{DoxyCompactList}\item
  104. \mbox{\Hypertarget{class_a_d_s1118_a2acfebaaa24ac5a6925be110a5a3edfa}\label{class_a_d_s1118_a2acfebaaa24ac5a6925be110a5a3edfa}}
  105. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a2acfebaaa24ac5a6925be110a5a3edfa}{F\+S\+R\+\_\+2048}} = 0b010
  106. \begin{DoxyCompactList}\small\item\em Range\+: ±2.048 v. L\+SB S\+I\+ZE = 62.\+5μV $\ast$$\ast$$\ast$\+D\+E\+F\+A\+U\+LT. \end{DoxyCompactList}\item
  107. \mbox{\Hypertarget{class_a_d_s1118_a64ab7dc3b0b643889a45b4a8a15ed73b}\label{class_a_d_s1118_a64ab7dc3b0b643889a45b4a8a15ed73b}}
  108. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a64ab7dc3b0b643889a45b4a8a15ed73b}{F\+S\+R\+\_\+1024}} = 0b011
  109. \begin{DoxyCompactList}\small\item\em Range\+: ±1.024 v. L\+SB S\+I\+ZE = 31.\+25μV. \end{DoxyCompactList}\item
  110. \mbox{\Hypertarget{class_a_d_s1118_aa90c0882b487e68fa6cfe27790d6a5fa}\label{class_a_d_s1118_aa90c0882b487e68fa6cfe27790d6a5fa}}
  111. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_aa90c0882b487e68fa6cfe27790d6a5fa}{F\+S\+R\+\_\+0512}} = 0b100
  112. \begin{DoxyCompactList}\small\item\em Range\+: ±0.512 v. L\+SB S\+I\+ZE = 15.\+625μV. \end{DoxyCompactList}\item
  113. \mbox{\Hypertarget{class_a_d_s1118_a5b0abd4476219e551141a10c1266c451}\label{class_a_d_s1118_a5b0abd4476219e551141a10c1266c451}}
  114. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a5b0abd4476219e551141a10c1266c451}{F\+S\+R\+\_\+0256}} = 0b111
  115. \begin{DoxyCompactList}\small\item\em Range\+: ±0.256 v. L\+SB S\+I\+ZE = 7.\+8125μV. \end{DoxyCompactList}\item
  116. \mbox{\Hypertarget{class_a_d_s1118_a693fdcb47c270a6f3244df1eefdca4ca}\label{class_a_d_s1118_a693fdcb47c270a6f3244df1eefdca4ca}}
  117. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a693fdcb47c270a6f3244df1eefdca4ca}{R\+A\+T\+E\+\_\+8\+S\+PS}} = 0b000
  118. \begin{DoxyCompactList}\small\item\em 8 samples/s, Tconv=125ms \end{DoxyCompactList}\item
  119. \mbox{\Hypertarget{class_a_d_s1118_a6b92ca329799360f0dfc19bec589280c}\label{class_a_d_s1118_a6b92ca329799360f0dfc19bec589280c}}
  120. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a6b92ca329799360f0dfc19bec589280c}{R\+A\+T\+E\+\_\+16\+S\+PS}} = 0b001
  121. \begin{DoxyCompactList}\small\item\em 16 samples/s, Tconv=62.\+5ms \end{DoxyCompactList}\item
  122. \mbox{\Hypertarget{class_a_d_s1118_af9f2d072f99bdce404c613135ba07829}\label{class_a_d_s1118_af9f2d072f99bdce404c613135ba07829}}
  123. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_af9f2d072f99bdce404c613135ba07829}{R\+A\+T\+E\+\_\+32\+S\+PS}} = 0b010
  124. \begin{DoxyCompactList}\small\item\em 32 samples/s, Tconv=31.\+25ms \end{DoxyCompactList}\item
  125. \mbox{\Hypertarget{class_a_d_s1118_a6f1e5499c69409830f3dad1c0c66fc07}\label{class_a_d_s1118_a6f1e5499c69409830f3dad1c0c66fc07}}
  126. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a6f1e5499c69409830f3dad1c0c66fc07}{R\+A\+T\+E\+\_\+64\+S\+PS}} = 0b011
  127. \begin{DoxyCompactList}\small\item\em 64 samples/s, Tconv=15.\+625ms \end{DoxyCompactList}\item
  128. \mbox{\Hypertarget{class_a_d_s1118_a10ab539a0704cc42d3441f3c94a9a649}\label{class_a_d_s1118_a10ab539a0704cc42d3441f3c94a9a649}}
  129. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a10ab539a0704cc42d3441f3c94a9a649}{R\+A\+T\+E\+\_\+128\+S\+PS}} = 0b100
  130. \begin{DoxyCompactList}\small\item\em 128 samples/s, Tconv=7.\+8125ms \end{DoxyCompactList}\item
  131. \mbox{\Hypertarget{class_a_d_s1118_a6deae5bd5b8578a481b376349edcebe1}\label{class_a_d_s1118_a6deae5bd5b8578a481b376349edcebe1}}
  132. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a6deae5bd5b8578a481b376349edcebe1}{R\+A\+T\+E\+\_\+250\+S\+PS}} = 0b101
  133. \begin{DoxyCompactList}\small\item\em 250 samples/s, Tconv=4ms \end{DoxyCompactList}\item
  134. \mbox{\Hypertarget{class_a_d_s1118_a5682051293d721f5efc05d05f997d150}\label{class_a_d_s1118_a5682051293d721f5efc05d05f997d150}}
  135. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_a5682051293d721f5efc05d05f997d150}{R\+A\+T\+E\+\_\+475\+S\+PS}} = 0b110
  136. \begin{DoxyCompactList}\small\item\em 475 samples/s, Tconv=2.\+105ms \end{DoxyCompactList}\item
  137. \mbox{\Hypertarget{class_a_d_s1118_adaff9f6a747f4b3b6cb10608b8581ab0}\label{class_a_d_s1118_adaff9f6a747f4b3b6cb10608b8581ab0}}
  138. const uint8\+\_\+t \mbox{\hyperlink{class_a_d_s1118_adaff9f6a747f4b3b6cb10608b8581ab0}{R\+A\+T\+E\+\_\+860\+S\+PS}} = 0b111
  139. \begin{DoxyCompactList}\small\item\em 860 samples/s, Tconv=1.\+163ms \end{DoxyCompactList}\end{DoxyCompactItemize}
  140. \subsection{Detailed Description}
  141. Class representing the \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}} sensor chip \begin{DoxyAuthor}{Author}
  142. Alvaro Salazar \href{mailto:alvaro@denkitronik.com}{\tt alvaro@denkitronik.\+com}
  143. \end{DoxyAuthor}
  144. \subsection{Constructor \& Destructor Documentation}
  145. \mbox{\Hypertarget{class_a_d_s1118_afaddf1d46e3b32d433c67122d96a6ebb}\label{class_a_d_s1118_afaddf1d46e3b32d433c67122d96a6ebb}}
  146. \index{A\+D\+S1118@{A\+D\+S1118}!A\+D\+S1118@{A\+D\+S1118}}
  147. \index{A\+D\+S1118@{A\+D\+S1118}!A\+D\+S1118@{A\+D\+S1118}}
  148. \subsubsection{\texorpdfstring{A\+D\+S1118()}{ADS1118()}}
  149. {\footnotesize\ttfamily A\+D\+S1118\+::\+A\+D\+S1118 (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{io\+\_\+pin\+\_\+cs }\end{DoxyParamCaption})}
  150. Constructor.
  151. Constructor of the class
  152. \begin{DoxyParams}{Parameters}
  153. {\em io\+\_\+pin\+\_\+cs} & a byte indicating the pin to be use as the chip select pin (CS) \\
  154. \hline
  155. \end{DoxyParams}
  156. \subsection{Member Function Documentation}
  157. \mbox{\Hypertarget{class_a_d_s1118_a817f1a7619d97e19475458dc3eea5f88}\label{class_a_d_s1118_a817f1a7619d97e19475458dc3eea5f88}}
  158. \index{A\+D\+S1118@{A\+D\+S1118}!begin@{begin}}
  159. \index{begin@{begin}!A\+D\+S1118@{A\+D\+S1118}}
  160. \subsubsection{\texorpdfstring{begin()}{begin()}}
  161. {\footnotesize\ttfamily void A\+D\+S1118\+::begin (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  162. This method initialize the S\+PI port and the config register.
  163. This method initialize the S\+PI port and the config register \mbox{\Hypertarget{class_a_d_s1118_a8d79b157a07574bd8745137a8347649e}\label{class_a_d_s1118_a8d79b157a07574bd8745137a8347649e}}
  164. \index{A\+D\+S1118@{A\+D\+S1118}!decode\+Config\+Register@{decode\+Config\+Register}}
  165. \index{decode\+Config\+Register@{decode\+Config\+Register}!A\+D\+S1118@{A\+D\+S1118}}
  166. \subsubsection{\texorpdfstring{decode\+Config\+Register()}{decodeConfigRegister()}}
  167. {\footnotesize\ttfamily void A\+D\+S1118\+::decode\+Config\+Register (\begin{DoxyParamCaption}\item[{union \mbox{\hyperlink{union_config}{Config}}}]{config\+Register }\end{DoxyParamCaption})}
  168. Decoding a config\+Register structure and then print it out to the Serial port.
  169. Decoding a config\+Register structure and then print it out to the Serial port
  170. \begin{DoxyParams}{Parameters}
  171. {\em config\+Register} & The config register in \char`\"{}union Config\char`\"{} format \\
  172. \hline
  173. \end{DoxyParams}
  174. \mbox{\Hypertarget{class_a_d_s1118_a649c53bdf46a93b5ab682d04b9f9df5e}\label{class_a_d_s1118_a649c53bdf46a93b5ab682d04b9f9df5e}}
  175. \index{A\+D\+S1118@{A\+D\+S1118}!disable\+Pullup@{disable\+Pullup}}
  176. \index{disable\+Pullup@{disable\+Pullup}!A\+D\+S1118@{A\+D\+S1118}}
  177. \subsubsection{\texorpdfstring{disable\+Pullup()}{disablePullup()}}
  178. {\footnotesize\ttfamily void A\+D\+S1118\+::disable\+Pullup (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  179. Disabling the internal pull-\/up resistor of the D\+O\+UT pin.
  180. Disabling the internal pull-\/up resistor of the D\+O\+UT pin \mbox{\Hypertarget{class_a_d_s1118_a833326b882b86608d62450fcedabbe4a}\label{class_a_d_s1118_a833326b882b86608d62450fcedabbe4a}}
  181. \index{A\+D\+S1118@{A\+D\+S1118}!enable\+Pullup@{enable\+Pullup}}
  182. \index{enable\+Pullup@{enable\+Pullup}!A\+D\+S1118@{A\+D\+S1118}}
  183. \subsubsection{\texorpdfstring{enable\+Pullup()}{enablePullup()}}
  184. {\footnotesize\ttfamily void A\+D\+S1118\+::enable\+Pullup (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  185. Enabling the internal pull-\/up resistor of the D\+O\+UT pin.
  186. Enabling the internal pull-\/up resistor of the D\+O\+UT pin \mbox{\Hypertarget{class_a_d_s1118_adf872650d20977b5872f88fa36182d3a}\label{class_a_d_s1118_adf872650d20977b5872f88fa36182d3a}}
  187. \index{A\+D\+S1118@{A\+D\+S1118}!get\+A\+D\+C\+Value@{get\+A\+D\+C\+Value}}
  188. \index{get\+A\+D\+C\+Value@{get\+A\+D\+C\+Value}!A\+D\+S1118@{A\+D\+S1118}}
  189. \subsubsection{\texorpdfstring{get\+A\+D\+C\+Value()}{getADCValue()}}
  190. {\footnotesize\ttfamily uint16\+\_\+t A\+D\+S1118\+::get\+A\+D\+C\+Value (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{inputs }\end{DoxyParamCaption})}
  191. Getting a sample from the specified input.
  192. Getting a sample from the specified input
  193. \begin{DoxyParams}{Parameters}
  194. {\em inputs} & Sets the input of the A\+DC\+: Diferential inputs\+: D\+I\+F\+F\+\_\+0\+\_\+1, D\+I\+F\+F\+\_\+0\+\_\+3, D\+I\+F\+F\+\_\+1\+\_\+3, D\+I\+F\+F\+\_\+2\+\_\+3. Single ended input\+: A\+I\+N\+\_\+0, A\+I\+N\+\_\+1, A\+I\+N\+\_\+2, A\+I\+N\+\_\+3 \\
  195. \hline
  196. \end{DoxyParams}
  197. \begin{DoxyReturn}{Returns}
  198. A word containing the A\+DC value
  199. \end{DoxyReturn}
  200. \mbox{\Hypertarget{class_a_d_s1118_a11e4c070217773d71da1d22506e64c00}\label{class_a_d_s1118_a11e4c070217773d71da1d22506e64c00}}
  201. \index{A\+D\+S1118@{A\+D\+S1118}!get\+Milli\+Volts@{get\+Milli\+Volts}}
  202. \index{get\+Milli\+Volts@{get\+Milli\+Volts}!A\+D\+S1118@{A\+D\+S1118}}
  203. \subsubsection{\texorpdfstring{get\+Milli\+Volts()}{getMilliVolts()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
  204. {\footnotesize\ttfamily double A\+D\+S1118\+::get\+Milli\+Volts (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{inputs }\end{DoxyParamCaption})}
  205. Getting the millivolts from the specified inputs.
  206. Getting the millivolts from the specified inputs
  207. \begin{DoxyParams}{Parameters}
  208. {\em inputs} & Sets the inputs to be adquired. Diferential inputs\+: D\+I\+F\+F\+\_\+0\+\_\+1, D\+I\+F\+F\+\_\+0\+\_\+3, D\+I\+F\+F\+\_\+1\+\_\+3, D\+I\+F\+F\+\_\+2\+\_\+3. Single ended input\+: A\+I\+N\+\_\+0, A\+I\+N\+\_\+1, A\+I\+N\+\_\+2, A\+I\+N\+\_\+3 \\
  209. \hline
  210. \end{DoxyParams}
  211. \begin{DoxyReturn}{Returns}
  212. A double (32bits) containing the A\+DC value in millivolts
  213. \end{DoxyReturn}
  214. \mbox{\Hypertarget{class_a_d_s1118_a5d88241e78575ca86f6206f02cec0614}\label{class_a_d_s1118_a5d88241e78575ca86f6206f02cec0614}}
  215. \index{A\+D\+S1118@{A\+D\+S1118}!get\+Milli\+Volts@{get\+Milli\+Volts}}
  216. \index{get\+Milli\+Volts@{get\+Milli\+Volts}!A\+D\+S1118@{A\+D\+S1118}}
  217. \subsubsection{\texorpdfstring{get\+Milli\+Volts()}{getMilliVolts()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
  218. {\footnotesize\ttfamily double A\+D\+S1118\+::get\+Milli\+Volts (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  219. Getting the millivolts from the settled inputs.
  220. Getting the millivolts from the settled inputs \begin{DoxyReturn}{Returns}
  221. A double (32bits) containing the A\+DC value in millivolts
  222. \end{DoxyReturn}
  223. \mbox{\Hypertarget{class_a_d_s1118_acf67a3c09b9d165f04e2e37e618e4fcb}\label{class_a_d_s1118_acf67a3c09b9d165f04e2e37e618e4fcb}}
  224. \index{A\+D\+S1118@{A\+D\+S1118}!get\+Temperature@{get\+Temperature}}
  225. \index{get\+Temperature@{get\+Temperature}!A\+D\+S1118@{A\+D\+S1118}}
  226. \subsubsection{\texorpdfstring{get\+Temperature()}{getTemperature()}}
  227. {\footnotesize\ttfamily double A\+D\+S1118\+::get\+Temperature (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  228. Getting the temperature in degrees celsius from the internal sensor of the \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}}.
  229. Getting the temperature in degrees celsius from the internal sensor of the \mbox{\hyperlink{class_a_d_s1118}{A\+D\+S1118}} \begin{DoxyReturn}{Returns}
  230. A double (32bits) containing the temperature in degrees celsius of the internal sensor
  231. \end{DoxyReturn}
  232. \mbox{\Hypertarget{class_a_d_s1118_af739fb00547d7a5df8c5010c40b64c6a}\label{class_a_d_s1118_af739fb00547d7a5df8c5010c40b64c6a}}
  233. \index{A\+D\+S1118@{A\+D\+S1118}!set\+Continuous\+Mode@{set\+Continuous\+Mode}}
  234. \index{set\+Continuous\+Mode@{set\+Continuous\+Mode}!A\+D\+S1118@{A\+D\+S1118}}
  235. \subsubsection{\texorpdfstring{set\+Continuous\+Mode()}{setContinuousMode()}}
  236. {\footnotesize\ttfamily void A\+D\+S1118\+::set\+Continuous\+Mode (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  237. Setting to continuous adquisition mode.
  238. Setting to continuous adquisition mode \mbox{\Hypertarget{class_a_d_s1118_a15fcd99b88c988fef9b4cc04347b08a5}\label{class_a_d_s1118_a15fcd99b88c988fef9b4cc04347b08a5}}
  239. \index{A\+D\+S1118@{A\+D\+S1118}!set\+Full\+Scale\+Range@{set\+Full\+Scale\+Range}}
  240. \index{set\+Full\+Scale\+Range@{set\+Full\+Scale\+Range}!A\+D\+S1118@{A\+D\+S1118}}
  241. \subsubsection{\texorpdfstring{set\+Full\+Scale\+Range()}{setFullScaleRange()}}
  242. {\footnotesize\ttfamily void A\+D\+S1118\+::set\+Full\+Scale\+Range (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{fsr }\end{DoxyParamCaption})}
  243. Setting the full scale range in the config register.
  244. Setting the full scale range in the config register
  245. \begin{DoxyParams}{Parameters}
  246. {\em fsr} & The full scale range\+: F\+S\+R\+\_\+6144 (±6.144V)$\ast$, F\+S\+R\+\_\+4096(±4.096V)$\ast$, F\+S\+R\+\_\+2048(±2.048V), F\+S\+R\+\_\+1024(±1.024V), F\+S\+R\+\_\+0512(±0.512V), F\+S\+R\+\_\+0256(±0.256V). ($\ast$) No more than V\+DD + 0.\+3 V must be applied to this device. \\
  247. \hline
  248. \end{DoxyParams}
  249. \mbox{\Hypertarget{class_a_d_s1118_a074c71a9eeb1d0db946f5f4b1308c69f}\label{class_a_d_s1118_a074c71a9eeb1d0db946f5f4b1308c69f}}
  250. \index{A\+D\+S1118@{A\+D\+S1118}!set\+Input\+Selected@{set\+Input\+Selected}}
  251. \index{set\+Input\+Selected@{set\+Input\+Selected}!A\+D\+S1118@{A\+D\+S1118}}
  252. \subsubsection{\texorpdfstring{set\+Input\+Selected()}{setInputSelected()}}
  253. {\footnotesize\ttfamily void A\+D\+S1118\+::set\+Input\+Selected (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{input }\end{DoxyParamCaption})}
  254. Setting the inputs to be adquired in the config register.
  255. Setting the inputs to be adquired in the config register.
  256. \begin{DoxyParams}{Parameters}
  257. {\em input} & The input selected\+: Diferential inputs\+: D\+I\+F\+F\+\_\+0\+\_\+1, D\+I\+F\+F\+\_\+0\+\_\+3, D\+I\+F\+F\+\_\+1\+\_\+3, D\+I\+F\+F\+\_\+2\+\_\+3. Single ended input\+: A\+I\+N\+\_\+0, A\+I\+N\+\_\+1, A\+I\+N\+\_\+2, A\+I\+N\+\_\+3 \\
  258. \hline
  259. \end{DoxyParams}
  260. \mbox{\Hypertarget{class_a_d_s1118_abcabaf741cc3e45e53a6967e0d113073}\label{class_a_d_s1118_abcabaf741cc3e45e53a6967e0d113073}}
  261. \index{A\+D\+S1118@{A\+D\+S1118}!set\+Samplig\+Rate@{set\+Samplig\+Rate}}
  262. \index{set\+Samplig\+Rate@{set\+Samplig\+Rate}!A\+D\+S1118@{A\+D\+S1118}}
  263. \subsubsection{\texorpdfstring{set\+Samplig\+Rate()}{setSampligRate()}}
  264. {\footnotesize\ttfamily void A\+D\+S1118\+::set\+Samplig\+Rate (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{sampling\+Rate }\end{DoxyParamCaption})}
  265. Setting the sampling rate specified in the config register.
  266. Setting the sampling rate specified in the config register
  267. \begin{DoxyParams}{Parameters}
  268. {\em sampling\+Rate} & It\textquotesingle{}s the sampling rate\+: R\+A\+T\+E\+\_\+8\+S\+PS, R\+A\+T\+E\+\_\+16\+S\+PS, R\+A\+T\+E\+\_\+32\+S\+PS, R\+A\+T\+E\+\_\+64\+S\+PS, R\+A\+T\+E\+\_\+128\+S\+PS, R\+A\+T\+E\+\_\+250\+S\+PS, R\+A\+T\+E\+\_\+475\+S\+PS, R\+A\+T\+E\+\_\+860\+S\+PS \\
  269. \hline
  270. \end{DoxyParams}
  271. \mbox{\Hypertarget{class_a_d_s1118_a9e2e456dee0ee957fe89319d12bd833c}\label{class_a_d_s1118_a9e2e456dee0ee957fe89319d12bd833c}}
  272. \index{A\+D\+S1118@{A\+D\+S1118}!set\+Single\+Shot\+Mode@{set\+Single\+Shot\+Mode}}
  273. \index{set\+Single\+Shot\+Mode@{set\+Single\+Shot\+Mode}!A\+D\+S1118@{A\+D\+S1118}}
  274. \subsubsection{\texorpdfstring{set\+Single\+Shot\+Mode()}{setSingleShotMode()}}
  275. {\footnotesize\ttfamily void A\+D\+S1118\+::set\+Single\+Shot\+Mode (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
  276. Setting to single shot adquisition and power down mode.
  277. Setting to single shot adquisition and power down mode
  278. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  279. \item
  280. A\+D\+S1118.\+h\item
  281. A\+D\+S1118.\+cpp\end{DoxyCompactItemize}