Permalink
Browse files

Putting all LCD related features in a wrapper lib around the Arduino'…

…s basic LCD library
  • Loading branch information...
1 parent e170b2e commit 93481595681802d0eec4523e866d3d09d72fa4db @reefab committed Mar 3, 2013
Showing with 38,773 additions and 51 deletions.
  1. +3 −0 .gitignore
  2. +267 −0 lib/LiquidCrystal/FastIO.cpp
  3. +219 −0 lib/LiquidCrystal/FastIO.h
  4. +198 −0 lib/LiquidCrystal/I2CIO.cpp
  5. +148 −0 lib/LiquidCrystal/I2CIO.h
  6. +347 −0 lib/LiquidCrystal/LCD.cpp
  7. +536 −0 lib/LiquidCrystal/LCD.h
  8. +299 −0 lib/LiquidCrystal/LiquidCrystal.cpp
  9. +161 −0 lib/LiquidCrystal/LiquidCrystal.h
  10. +291 −0 lib/LiquidCrystal/LiquidCrystal_I2C.cpp
  11. +204 −0 lib/LiquidCrystal/LiquidCrystal_I2C.h
  12. +209 −0 lib/LiquidCrystal/LiquidCrystal_SR.cpp
  13. +176 −0 lib/LiquidCrystal/LiquidCrystal_SR.h
  14. +135 −0 lib/LiquidCrystal/LiquidCrystal_SR2W.cpp
  15. +202 −0 lib/LiquidCrystal/LiquidCrystal_SR2W.h
  16. +283 −0 lib/LiquidCrystal/LiquidCrystal_SR3W.cpp
  17. +202 −0 lib/LiquidCrystal/LiquidCrystal_SR3W.h
  18. +1,749 −0 lib/LiquidCrystal/docs/Doxyfile
  19. +7,432 −0 lib/LiquidCrystal/docs/def/doxygen.def
  20. +2,897 −0 lib/LiquidCrystal/docs/def/doxygen.def.txt
  21. +549 −0 lib/LiquidCrystal/docs/html/_fast_i_o_8cpp.html
  22. +351 −0 lib/LiquidCrystal/docs/html/_fast_i_o_8cpp_source.html
  23. +786 −0 lib/LiquidCrystal/docs/html/_fast_i_o_8h.html
  24. +209 −0 lib/LiquidCrystal/docs/html/_fast_i_o_8h_source.html
  25. +92 −0 lib/LiquidCrystal/docs/html/_i2_c_i_o_8cpp.html
  26. +282 −0 lib/LiquidCrystal/docs/html/_i2_c_i_o_8cpp_source.html
  27. +114 −0 lib/LiquidCrystal/docs/html/_i2_c_i_o_8h.html
  28. +147 −0 lib/LiquidCrystal/docs/html/_i2_c_i_o_8h_source.html
  29. +93 −0 lib/LiquidCrystal/docs/html/_l_c_d_8cpp.html
  30. +431 −0 lib/LiquidCrystal/docs/html/_l_c_d_8cpp_source.html
  31. +711 −0 lib/LiquidCrystal/docs/html/_l_c_d_8h.html
  32. +301 −0 lib/LiquidCrystal/docs/html/_l_c_d_8h_source.html
  33. +146 −0 lib/LiquidCrystal/docs/html/_liquid_crystal_8cpp.html
  34. +383 −0 lib/LiquidCrystal/docs/html/_liquid_crystal_8cpp_source.html
  35. +117 −0 lib/LiquidCrystal/docs/html/_liquid_crystal_8h.html
  36. +176 −0 lib/LiquidCrystal/docs/html/_liquid_crystal_8h_source.html
  37. +247 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___i2_c_8cpp.html
  38. +344 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___i2_c_8cpp_source.html
  39. +97 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___i2_c_8h.html
  40. +172 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___i2_c_8h_source.html
  41. +89 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r2_w_8cpp.html
  42. +219 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r2_w_8cpp_source.html
  43. +164 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r2_w_8h.html
  44. +245 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r2_w_8h_source.html
  45. +249 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r3_w_8cpp.html
  46. +336 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r3_w_8cpp_source.html
  47. +96 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r3_w_8h.html
  48. +201 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r3_w_8h_source.html
  49. +94 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r_8cpp.html
  50. +293 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r_8cpp_source.html
  51. +148 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r_8h.html
  52. +210 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r_8h_source.html
  53. +147 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r___l_c_d3_8cpp.html
  54. +295 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r___l_c_d3_8cpp_source.html
  55. +95 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r___l_c_d3_8h.html
  56. +129 −0 lib/LiquidCrystal/docs/html/_liquid_crystal___s_r___l_c_d3_8h_source.html
  57. +95 −0 lib/LiquidCrystal/docs/html/annotated.html
  58. BIN lib/LiquidCrystal/docs/html/bc_s.png
  59. +95 −0 lib/LiquidCrystal/docs/html/class_i2_c_i_o-members.html
  60. +339 −0 lib/LiquidCrystal/docs/html/class_i2_c_i_o.html
  61. +120 −0 lib/LiquidCrystal/docs/html/class_l_c_d-members.html
  62. +982 −0 lib/LiquidCrystal/docs/html/class_l_c_d.html
  63. BIN lib/LiquidCrystal/docs/html/class_l_c_d.png
  64. +129 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal-members.html
  65. +827 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal.html
  66. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal.png
  67. +127 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___i2_c-members.html
  68. +599 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___i2_c.html
  69. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal___i2_c.png
  70. +122 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r-members.html
  71. +271 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r.html
  72. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r.png
  73. +122 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r2_w-members.html
  74. +230 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r2_w.html
  75. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r2_w.png
  76. +125 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r3_w-members.html
  77. +501 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r3_w.html
  78. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r3_w.png
  79. +120 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r___l_c_d3-members.html
  80. +200 −0 lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r___l_c_d3.html
  81. BIN lib/LiquidCrystal/docs/html/class_liquid_crystal___s_r___l_c_d3.png
  82. +91 −0 lib/LiquidCrystal/docs/html/classes.html
  83. BIN lib/LiquidCrystal/docs/html/closed.png
  84. +835 −0 lib/LiquidCrystal/docs/html/doxygen.css
  85. BIN lib/LiquidCrystal/docs/html/doxygen.png
  86. +102 −0 lib/LiquidCrystal/docs/html/files.html
  87. +319 −0 lib/LiquidCrystal/docs/html/functions.html
  88. +296 −0 lib/LiquidCrystal/docs/html/functions_func.html
  89. +109 −0 lib/LiquidCrystal/docs/html/functions_vars.html
  90. +419 −0 lib/LiquidCrystal/docs/html/globals.html
  91. +350 −0 lib/LiquidCrystal/docs/html/globals_defs.html
  92. +95 −0 lib/LiquidCrystal/docs/html/globals_enum.html
  93. +98 −0 lib/LiquidCrystal/docs/html/globals_eval.html
  94. +128 −0 lib/LiquidCrystal/docs/html/globals_func.html
  95. +98 −0 lib/LiquidCrystal/docs/html/globals_type.html
  96. +97 −0 lib/LiquidCrystal/docs/html/hierarchy.html
  97. +78 −0 lib/LiquidCrystal/docs/html/index.html
  98. +112 −0 lib/LiquidCrystal/docs/html/installdox
  99. +54 −0 lib/LiquidCrystal/docs/html/jquery.js
  100. BIN lib/LiquidCrystal/docs/html/logoGoogle.jpg
  101. BIN lib/LiquidCrystal/docs/html/nav_f.png
  102. BIN lib/LiquidCrystal/docs/html/nav_h.png
  103. BIN lib/LiquidCrystal/docs/html/open.png
  104. +62 −0 lib/LiquidCrystal/docs/html/search/all_5f.html
  105. +38 −0 lib/LiquidCrystal/docs/html/search/all_61.html
  106. +54 −0 lib/LiquidCrystal/docs/html/search/all_62.html
  107. +44 −0 lib/LiquidCrystal/docs/html/search/all_63.html
  108. +80 −0 lib/LiquidCrystal/docs/html/search/all_64.html
  109. +35 −0 lib/LiquidCrystal/docs/html/search/all_65.html
  110. +156 −0 lib/LiquidCrystal/docs/html/search/all_66.html
  111. +32 −0 lib/LiquidCrystal/docs/html/search/all_68.html
  112. +39 −0 lib/LiquidCrystal/docs/html/search/all_69.html
  113. +354 −0 lib/LiquidCrystal/docs/html/search/all_6c.html
  114. +32 −0 lib/LiquidCrystal/docs/html/search/all_6d.html
  115. +56 −0 lib/LiquidCrystal/docs/html/search/all_6e.html
  116. +32 −0 lib/LiquidCrystal/docs/html/search/all_6f.html
  117. +38 −0 lib/LiquidCrystal/docs/html/search/all_70.html
  118. +50 −0 lib/LiquidCrystal/docs/html/search/all_72.html
  119. +117 −0 lib/LiquidCrystal/docs/html/search/all_73.html
  120. +32 −0 lib/LiquidCrystal/docs/html/search/all_74.html
  121. +35 −0 lib/LiquidCrystal/docs/html/search/all_77.html
  122. +25 −0 lib/LiquidCrystal/docs/html/search/classes_69.html
  123. +50 −0 lib/LiquidCrystal/docs/html/search/classes_6c.html
  124. BIN lib/LiquidCrystal/docs/html/search/close.png
  125. +26 −0 lib/LiquidCrystal/docs/html/search/defines_5f.html
  126. +32 −0 lib/LiquidCrystal/docs/html/search/defines_61.html
  127. +32 −0 lib/LiquidCrystal/docs/html/search/defines_62.html
  128. +26 −0 lib/LiquidCrystal/docs/html/search/defines_63.html
  129. +62 −0 lib/LiquidCrystal/docs/html/search/defines_64.html
  130. +35 −0 lib/LiquidCrystal/docs/html/search/defines_65.html
  131. +56 −0 lib/LiquidCrystal/docs/html/search/defines_66.html
  132. +26 −0 lib/LiquidCrystal/docs/html/search/defines_68.html
  133. +219 −0 lib/LiquidCrystal/docs/html/search/defines_6c.html
  134. +38 −0 lib/LiquidCrystal/docs/html/search/defines_72.html
  135. +62 −0 lib/LiquidCrystal/docs/html/search/defines_73.html
  136. +26 −0 lib/LiquidCrystal/docs/html/search/defines_74.html
  137. +26 −0 lib/LiquidCrystal/docs/html/search/enums_74.html
  138. +26 −0 lib/LiquidCrystal/docs/html/search/enumvalues_6e.html
  139. +26 −0 lib/LiquidCrystal/docs/html/search/enumvalues_70.html
  140. +30 −0 lib/LiquidCrystal/docs/html/search/files_66.html
  141. +30 −0 lib/LiquidCrystal/docs/html/search/files_69.html
  142. +80 −0 lib/LiquidCrystal/docs/html/search/files_6c.html
  143. +26 −0 lib/LiquidCrystal/docs/html/search/functions_61.html
  144. +42 −0 lib/LiquidCrystal/docs/html/search/functions_62.html
  145. +38 −0 lib/LiquidCrystal/docs/html/search/functions_63.html
  146. +38 −0 lib/LiquidCrystal/docs/html/search/functions_64.html
  147. +26 −0 lib/LiquidCrystal/docs/html/search/functions_65.html
  148. +98 −0 lib/LiquidCrystal/docs/html/search/functions_66.html
  149. +26 −0 lib/LiquidCrystal/docs/html/search/functions_68.html
  150. +26 −0 lib/LiquidCrystal/docs/html/search/functions_69.html
  151. +83 −0 lib/LiquidCrystal/docs/html/search/functions_6c.html
  152. +32 −0 lib/LiquidCrystal/docs/html/search/functions_6d.html
  153. +50 −0 lib/LiquidCrystal/docs/html/search/functions_6e.html
  154. +32 −0 lib/LiquidCrystal/docs/html/search/functions_6f.html
  155. +32 −0 lib/LiquidCrystal/docs/html/search/functions_70.html
  156. +32 −0 lib/LiquidCrystal/docs/html/search/functions_72.html
  157. +75 −0 lib/LiquidCrystal/docs/html/search/functions_73.html
  158. +35 −0 lib/LiquidCrystal/docs/html/search/functions_77.html
  159. BIN lib/LiquidCrystal/docs/html/search/mag_sel.png
  160. +12 −0 lib/LiquidCrystal/docs/html/search/nomatches.html
  161. +240 −0 lib/LiquidCrystal/docs/html/search/search.css
  162. +742 −0 lib/LiquidCrystal/docs/html/search/search.js
  163. BIN lib/LiquidCrystal/docs/html/search/search_l.png
  164. BIN lib/LiquidCrystal/docs/html/search/search_m.png
  165. BIN lib/LiquidCrystal/docs/html/search/search_r.png
  166. +32 −0 lib/LiquidCrystal/docs/html/search/typedefs_66.html
  167. +56 −0 lib/LiquidCrystal/docs/html/search/variables_5f.html
  168. BIN lib/LiquidCrystal/docs/html/tab_a.png
  169. BIN lib/LiquidCrystal/docs/html/tab_b.png
  170. BIN lib/LiquidCrystal/docs/html/tab_h.png
  171. BIN lib/LiquidCrystal/docs/html/tab_s.png
  172. +59 −0 lib/LiquidCrystal/docs/html/tabs.css
  173. +78 −0 lib/LiquidCrystal/examples/HelloWorld_4bit/HelloWorld_4bit.pde
  174. +36 −0 lib/LiquidCrystal/examples/HelloWorld_SR/HelloWorld_SR.pde
  175. +61 −0 lib/LiquidCrystal/examples/HelloWorld_i2c/HelloWorld_i2c.pde
  176. +274 −0 lib/LiquidCrystal/examples/LCDiSpeed/LCDiSpeed.pde
  177. +20 −0 lib/LiquidCrystal/examples/LCDiSpeed/LCDiSpeed.txt
  178. +37 −0 lib/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde
  179. +246 −0 lib/LiquidCrystal/examples/i2cLCDextraIO/i2cLCDextraIO.pde
  180. +332 −0 lib/LiquidCrystal/examples/i2cLCDextraIO_tempLeonardo/i2cLCDextraIO_tempLeonardo.ino
  181. +480 −0 lib/LiquidCrystal/examples/performanceLCD/performanceLCD.pde
  182. +52 −0 lib/LiquidCrystal/keywords.txt
  183. +47 −0 src/lcd.cpp
  184. +23 −0 src/lcd.h
  185. +35 −51 src/sketch.ino
View
@@ -2,3 +2,6 @@
config.h
.build
ino.ini
+
+*.gch
+/src/tags
@@ -0,0 +1,267 @@
+// ---------------------------------------------------------------------------
+// Created by Florian Fida on 20/01/12
+// Copyright 2012 - Under creative commons license 3.0:
+// Attribution-ShareAlike CC BY-SA
+// http://creativecommons.org/licenses/by-sa/3.0/
+//
+// This software is furnished "as is", without technical support, and with no
+// warranty, express or implied, as to its usefulness for any purpose.
+// ---------------------------------------------------------------------------
+// fio_shiftOut1 functions are based on Shif1 protocol developed by Roman Black
+// (http://www.romanblack.com/shift1.htm)
+//
+// Thread Safe: No
+// Extendable: Yes
+//
+// @file FastIO.h
+// This file implements basic fast IO routines.
+//
+// @brief
+//
+// @version API 1.0.0
+//
+// @author Florian Fida -
+//
+// 2012-03-16 bperrybap updated fio_shiftout() to be smaller & faster
+//
+// @todo:
+// support chipkit:
+// (https://github.com/chipKIT32/chipKIT32-MAX/blob/master/hardware/pic32/
+// cores/pic32/wiring_digital.c)
+// ---------------------------------------------------------------------------
+#include "FastIO.h"
+
+
+fio_register fio_pinToOutputRegister(uint8_t pin, uint8_t initial_state)
+{
+ pinMode(pin, OUTPUT);
+
+ if(initial_state != SKIP)
+ {
+ digitalWrite(pin, initial_state); // also turns off pwm timer
+ }
+#ifdef FIO_FALLBACK
+ // just wasting memory if not using fast io...
+ return 0;
+#else
+ return portOutputRegister(digitalPinToPort(pin));
+#endif
+}
+
+
+fio_register fio_pinToInputRegister(uint8_t pin)
+{
+ pinMode(pin, INPUT);
+ digitalWrite(pin, LOW); // also turns off pwm timer and pullup
+#ifdef FIO_FALLBACK
+ // just wasting memory if not using fast io...
+ return 0;
+#else
+ return portInputRegister(digitalPinToPort(pin));
+#endif
+}
+
+
+fio_bit fio_pinToBit(uint8_t pin)
+{
+#ifdef FIO_FALLBACK
+ // (ab)use the bit variable to store the pin
+ return pin;
+#else
+ return digitalPinToBitMask(pin);
+#endif
+}
+
+
+void fio_digitalWrite(fio_register pinRegister, fio_bit pinBit, uint8_t value)
+{
+#ifdef FIO_FALLBACK
+ digitalWrite(pinBit, value);
+#else
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ if(value == LOW)
+ {
+ fio_digitalWrite_LOW(pinRegister,pinBit);
+ }
+ else
+ {
+ fio_digitalWrite_HIGH(pinRegister,pinBit);
+ }
+ }
+#endif
+}
+
+int fio_digitalRead(fio_register pinRegister, uint8_t pinBit)
+{
+#ifdef FIO_FALLBACK
+ return digitalRead (pinBit);
+#else
+ if (*pinRegister & pinBit)
+ {
+ return HIGH;
+ }
+ return LOW;
+#endif
+}
+
+void fio_shiftOut (fio_register dataRegister, fio_bit dataBit,
+ fio_register clockRegister, fio_bit clockBit,
+ uint8_t value, uint8_t bitOrder)
+{
+ // # disable interrupts
+ int8_t i;
+
+ if(bitOrder == LSBFIRST)
+ {
+ for(i = 0; i < 8; i++)
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ if(value & 1)
+ {
+ fio_digitalWrite_HIGH(dataRegister, dataBit);
+ }
+ else
+ {
+ fio_digitalWrite_LOW(dataRegister, dataBit);
+ }
+ value >>= 1;
+ fio_digitalWrite_HIGH (clockRegister, clockBit);
+ fio_digitalWrite_LOW (clockRegister,clockBit);
+ }
+ }
+
+ }
+ else
+ {
+ for(i = 0; i < 8; i++)
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ if(value & 0x80)
+ {
+ fio_digitalWrite_HIGH(dataRegister, dataBit);
+ }
+ else
+ {
+ fio_digitalWrite_LOW(dataRegister, dataBit);
+ }
+ value <<= 1;
+ fio_digitalWrite_HIGH (clockRegister, clockBit);
+ fio_digitalWrite_LOW (clockRegister,clockBit);
+ }
+ }
+ }
+}
+
+
+void fio_shiftOut(fio_register dataRegister, fio_bit dataBit,
+ fio_register clockRegister, fio_bit clockBit)
+{
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ // shift out 0x0 (B00000000) fast, byte order is irrelevant
+ fio_digitalWrite_LOW (dataRegister, dataBit);
+
+ for(uint8_t i = 0; i<8; ++i)
+ {
+ fio_digitalWrite_HIGH (clockRegister, clockBit);
+ fio_digitalWrite_SWITCH (clockRegister, clockBit);
+ }
+ }
+}
+
+
+void fio_shiftOut1_init(uint8_t pin)
+{
+ fio_shiftOut1_init(fio_pinToOutputRegister(pin,HIGH),fio_pinToBit(pin));
+}
+
+void fio_shiftOut1_init(fio_register shift1Register, fio_bit shift1Bit)
+{
+ // Make sure that capacitors are charged
+ // 300us is an educated guess...
+ fio_digitalWrite(shift1Register,shift1Bit,HIGH);
+ delayMicroseconds(300);
+}
+
+
+void fio_shiftOut1(fio_register shift1Register, fio_bit shift1Bit, uint8_t value,
+ boolean noLatch)
+{
+ /*
+ * this function are based on Shif1 protocol developed by Roman Black
+ * (http://www.romanblack.com/shift1.htm)
+ *
+ * test sketches:
+ * http://pastebin.com/raw.php?i=2hnC9v2Z
+ * http://pastebin.com/raw.php?i=bGg4DhXQ
+ * http://pastebin.com/raw.php?i=tg1ZFiM5
+ * http://pastebin.com/raw.php?i=93ExPDD3 - cascading
+ * tested with:
+ * TPIC6595N - seems to work fine (circuit: http://www.3guys1laser.com/
+ * arduino-one-wire-shift-register-prototype)
+ * 7HC595N
+ */
+
+ // iterate but ignore last bit (is it correct now?)
+ for(int8_t i = 7; i>=0; --i)
+ {
+
+ // assume that pin is HIGH (smokin' pot all day... :) - requires
+ // initialization
+ if(value & _BV(i))
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ // HIGH = 1 Bit
+ fio_digitalWrite_SWITCHTO(shift1Register,shift1Bit,LOW);
+ //hold pin LOW for 1us - done! :)
+ fio_digitalWrite_SWITCHTO(shift1Register,shift1Bit,HIGH);
+ } // end critical section
+ //hold pin HIGH for 15us
+ delayMicroseconds(15);
+ }
+ else
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ // LOW = 0 Bit
+ fio_digitalWrite_SWITCHTO(shift1Register,shift1Bit,LOW);
+ // hold pin LOW for 15us
+ delayMicroseconds(15);
+ fio_digitalWrite_SWITCHTO(shift1Register,shift1Bit,HIGH);
+ } // end critical section
+
+ // hold pin HIGH for 30us
+ delayMicroseconds(30);
+ }
+ if(!noLatch && i==1)
+ {
+ break;
+ }
+ }
+
+ if(!noLatch)
+ {
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ // send last bit (=LOW) and Latch command
+ fio_digitalWrite_SWITCHTO(shift1Register,shift1Bit,LOW);
+ } // end critical section
+ delayMicroseconds(199); // Hold pin low for 200us
+
+ ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
+ {
+ fio_digitalWrite_HIGH(shift1Register,shift1Bit);
+ } // end critical section
+ delayMicroseconds(299); // Hold pin high for 300us and leave it that
+ // way - using explicit HIGH here, just in case.
+ }
+}
+
+void fio_shiftOut1(uint8_t pin, uint8_t value, boolean noLatch)
+{
+ fio_shiftOut1(fio_pinToOutputRegister(pin, SKIP),fio_pinToBit(pin),value, noLatch);
+}
Oops, something went wrong.

0 comments on commit 9348159

Please sign in to comment.