From 4faddf9248fd6ba97226b0214273cbe024a3c889 Mon Sep 17 00:00:00 2001 From: jvblanck Date: Wed, 9 Jun 2021 12:10:12 +0200 Subject: [PATCH] Initial commit This is just the 2018 code configured for PlatformIO --- .gitignore | 3 + .vscode/extensions.json | 7 + include/README | 39 + lib/Bounce2/.gitignore | 1 + lib/Bounce2/Bounce1.zip | Bin 0 -> 7844 bytes lib/Bounce2/Bounce2.cpp | 125 + lib/Bounce2/Bounce2.h | 110 + lib/Bounce2/BouncySwitch_lockout.png | Bin 0 -> 16093 bytes lib/Bounce2/BouncySwitch_stable.png | Bin 0 -> 9330 bytes lib/Bounce2/INSTALL.txt | 1 + lib/Bounce2/LICENSE | 20 + lib/Bounce2/README.md | 37 + lib/Bounce2/examples/bounce/bounce.ino | 48 + .../bounce2buttons/bounce2buttons.ino | 64 + .../bounce_multiple/bounce_multiple.ino | 56 + lib/Bounce2/examples/change/change.ino | 48 + ...rcuit-bounce-change-duration-retrigger.png | Bin 0 -> 48556 bytes lib/Bounce2/examples/duration/duration.ino | 53 + lib/Bounce2/examples/retrigger/retrigger.ino | 86 + lib/Bounce2/keywords.txt | 29 + lib/Bounce2/library.json | 16 + lib/Bounce2/library.properties | 9 + lib/DueTimer/DueTimer.cpp | 308 +++ lib/DueTimer/DueTimer.h | 109 + lib/DueTimer/LICENSE.txt | 21 + lib/DueTimer/README.md | 119 + lib/DueTimer/TimerCounter.md | 106 + .../AvaliableTimer/AvaliableTimer.pde | 60 + .../MultipleTimers/MultipleTimers.pde | 29 + .../examples/SimpleTimer/SimpleTimer.pde | 25 + lib/DueTimer/keywords.txt | 20 + lib/DueTimer/library.json | 12 + lib/DueTimer/library.properties | 9 + lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp | 406 +++ lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.h | 28 + lib/FT18_STW_INIT/FT18_STW_INIT.cpp | 200 ++ lib/FT18_STW_INIT/FT18_STW_INIT.h | 101 + lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.cpp | 407 +++ lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.h | 28 + lib/FT18e_STW_INIT/FT18e_STW_INIT.cpp | 200 ++ lib/FT18e_STW_INIT/FT18e_STW_INIT.h | 101 + lib/FT_2018_STW_CAN/FT_2018_STW_CAN.cpp | 262 ++ lib/FT_2018_STW_CAN/FT_2018_STW_CAN.h | 12 + lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.cpp | 262 ++ lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.h | 12 + lib/README | 46 + lib/RotaryEncoder/RotaryEncoder.cpp | 51 + lib/RotaryEncoder/RotaryEncoder.h | 35 + .../examples/VelocityTest/VelocityTest.ino | 20 + lib/RotaryEncoder/license.txt | 26 + lib/arduino-ediptft-master/.gitignore | 1 + lib/arduino-ediptft-master/CHANGELOG | 38 + lib/arduino-ediptft-master/Doxyfile | 2329 +++++++++++++++++ lib/arduino-ediptft-master/EDIPTFT.cpp | 697 +++++ lib/arduino-ediptft-master/EDIPTFT.h | 434 +++ lib/arduino-ediptft-master/LICENSE | 165 ++ lib/arduino-ediptft-master/README | 36 + lib/arduino-ediptft-master/Readme.md | 55 + lib/arduino-ediptft-master/keywords.txt | 31 + lib/due_can/README.md | 9 + lib/due_can/due_can.cpp | 1387 ++++++++++ lib/due_can/due_can.h | 314 +++ .../examples/CAN_EchoTest/CAN_EchoTest.ino | 87 + .../CAN_ExtendedPingPong.ino | 108 + .../CAN_SendingTest/CAN_SendingTest.ino | 55 + .../CAN_SnoopCB_WithObjects.ino | 93 + .../CAN_SnooperCB_Range.ino | 101 + .../CAN_SnooperCallback.ino | 97 + .../CAN_TrafficModifier.ino | 63 + .../CAN_TrafficSnooper/CAN_TrafficSnooper.ino | 65 + lib/due_can/howtouse.txt | 195 ++ lib/due_can/keywords.txt | 117 + lib/due_can/library.properties | 9 + platformio.ini | 20 + src/18estw.cpp | 25 + src/18stw.cpp | 25 + test/README | 11 + 77 files changed, 10334 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/extensions.json create mode 100644 include/README create mode 100644 lib/Bounce2/.gitignore create mode 100644 lib/Bounce2/Bounce1.zip create mode 100644 lib/Bounce2/Bounce2.cpp create mode 100644 lib/Bounce2/Bounce2.h create mode 100644 lib/Bounce2/BouncySwitch_lockout.png create mode 100644 lib/Bounce2/BouncySwitch_stable.png create mode 100644 lib/Bounce2/INSTALL.txt create mode 100644 lib/Bounce2/LICENSE create mode 100644 lib/Bounce2/README.md create mode 100644 lib/Bounce2/examples/bounce/bounce.ino create mode 100644 lib/Bounce2/examples/bounce2buttons/bounce2buttons.ino create mode 100644 lib/Bounce2/examples/bounce_multiple/bounce_multiple.ino create mode 100644 lib/Bounce2/examples/change/change.ino create mode 100644 lib/Bounce2/examples/circuit-bounce-change-duration-retrigger.png create mode 100644 lib/Bounce2/examples/duration/duration.ino create mode 100644 lib/Bounce2/examples/retrigger/retrigger.ino create mode 100644 lib/Bounce2/keywords.txt create mode 100644 lib/Bounce2/library.json create mode 100644 lib/Bounce2/library.properties create mode 100644 lib/DueTimer/DueTimer.cpp create mode 100644 lib/DueTimer/DueTimer.h create mode 100644 lib/DueTimer/LICENSE.txt create mode 100644 lib/DueTimer/README.md create mode 100644 lib/DueTimer/TimerCounter.md create mode 100644 lib/DueTimer/examples/AvaliableTimer/AvaliableTimer.pde create mode 100644 lib/DueTimer/examples/MultipleTimers/MultipleTimers.pde create mode 100644 lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde create mode 100644 lib/DueTimer/keywords.txt create mode 100644 lib/DueTimer/library.json create mode 100644 lib/DueTimer/library.properties create mode 100644 lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp create mode 100644 lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.h create mode 100644 lib/FT18_STW_INIT/FT18_STW_INIT.cpp create mode 100644 lib/FT18_STW_INIT/FT18_STW_INIT.h create mode 100644 lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.cpp create mode 100644 lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.h create mode 100644 lib/FT18e_STW_INIT/FT18e_STW_INIT.cpp create mode 100644 lib/FT18e_STW_INIT/FT18e_STW_INIT.h create mode 100644 lib/FT_2018_STW_CAN/FT_2018_STW_CAN.cpp create mode 100644 lib/FT_2018_STW_CAN/FT_2018_STW_CAN.h create mode 100644 lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.cpp create mode 100644 lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.h create mode 100644 lib/README create mode 100644 lib/RotaryEncoder/RotaryEncoder.cpp create mode 100644 lib/RotaryEncoder/RotaryEncoder.h create mode 100644 lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino create mode 100644 lib/RotaryEncoder/license.txt create mode 100644 lib/arduino-ediptft-master/.gitignore create mode 100644 lib/arduino-ediptft-master/CHANGELOG create mode 100644 lib/arduino-ediptft-master/Doxyfile create mode 100644 lib/arduino-ediptft-master/EDIPTFT.cpp create mode 100644 lib/arduino-ediptft-master/EDIPTFT.h create mode 100644 lib/arduino-ediptft-master/LICENSE create mode 100644 lib/arduino-ediptft-master/README create mode 100644 lib/arduino-ediptft-master/Readme.md create mode 100644 lib/arduino-ediptft-master/keywords.txt create mode 100644 lib/due_can/README.md create mode 100644 lib/due_can/due_can.cpp create mode 100644 lib/due_can/due_can.h create mode 100644 lib/due_can/examples/CAN_EchoTest/CAN_EchoTest.ino create mode 100644 lib/due_can/examples/CAN_ExtendedPingPong/CAN_ExtendedPingPong.ino create mode 100644 lib/due_can/examples/CAN_SendingTest/CAN_SendingTest.ino create mode 100644 lib/due_can/examples/CAN_SnoopCB_WithObjects/CAN_SnoopCB_WithObjects.ino create mode 100644 lib/due_can/examples/CAN_SnooperCB_Range/CAN_SnooperCB_Range.ino create mode 100644 lib/due_can/examples/CAN_SnooperCallback/CAN_SnooperCallback.ino create mode 100644 lib/due_can/examples/CAN_TrafficModifier/CAN_TrafficModifier.ino create mode 100644 lib/due_can/examples/CAN_TrafficSnooper/CAN_TrafficSnooper.ino create mode 100644 lib/due_can/howtouse.txt create mode 100644 lib/due_can/keywords.txt create mode 100644 lib/due_can/library.properties create mode 100644 platformio.ini create mode 100644 src/18estw.cpp create mode 100644 src/18stw.cpp create mode 100644 test/README diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5bd5828 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.pio +.vscode/* +!.vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..0f0d740 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} diff --git a/include/README b/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/lib/Bounce2/.gitignore b/lib/Bounce2/.gitignore new file mode 100644 index 0000000..3997bea --- /dev/null +++ b/lib/Bounce2/.gitignore @@ -0,0 +1 @@ +*.db \ No newline at end of file diff --git a/lib/Bounce2/Bounce1.zip b/lib/Bounce2/Bounce1.zip new file mode 100644 index 0000000000000000000000000000000000000000..4b6c0cd46b4a6b74e95fcec8320126e39a444acd GIT binary patch literal 7844 zcmai(by!qe7l((Gyo8i=Bi$(~Aq~=ql+@78P|`3U-9v}SNGTvK4blihD=i(;k^;hq za=90b`<*{#o%1|o#|4V zWI4Eb${U!~27O=ZjfoH+C{g;`KtGrA$Tiq2S0DiG8r+pjG@#mi2dbs-t-}|cGgixw zdvCDqM%D$=5JvhhyRi}lXoL{=H4O!q9Y<7Z)^-e3vMBiRX4LR63o|*-IxN>=R!r+T ztgiF+V_3(1)QR24;!8JrJcm#VYCdk|CgwoQF!OW?QjAeWdGiGSV>jN7CcOhbpzrGB z9>FKvgq{RaBYq?Bv*J=zg=4l+BKtfKtFxOr0r7s0#z2$Nu;LIhtCyV4z#xHUoY}(Z zEkj*7;yE1~mn_z7iikK$X3-rqhv%7waIIjoAZd+O6N_PgTz$rG!`RB)A;5-Xl-Dcb z+oWqmUH&$#Muk$#bi1`AS~L{)=FiLAPTm15r^cHR<_!j$;1}aho8u-9g8IBFXQJrDB|B6C431Q<^awW1mzeWm$=eVwOtGA(M0yh$BujZlrE=zS}lV;OrM zckxg@QxQ;0f@8AceSJ*A`^=IdAOZkdr~m-=uVd0IO=H|G&2B<5{)dkQ}?3s0$ws_z*s{;H8Wg z;4d>V+E(bbRJ=37W33aTzL603oL1R zXxZvOoAk4-JtLtqN>=u29_47}J9PZ&QB4(WC5r>gkY;**EyL|}KacrPjb0N2wGLfyDko}MmC1${5+726tNxS*;yCWN zE^+jM;z81z3XQvWzs^WVP!6pQ#xm5AC$pvDC7o=@D6cxn`qWmts7d#|P}3;H!$tRK zMolU2*l?6*(LAsc!S4%8!;}wQb>_(@cP#);pa^*fSYZ<)C3eCMNvWXbtjYRk?~Cr( z8Ir}_mJQId_sDg0%f0!21WWSe>fl~_9)_M!_{U;C<<+6c$Vhz0+ZN)V-wrK1K=`tI zPh^i})ekY)S}NetYgTTfVA@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ijgy`)&{!zGSK~WoZ;?XP?ot=CN&`!i8zv2w}!OO_Cn+>3hDUWJ!XLpozc@yxS#* zUvW*CQR*HB((W#MJnEi41Ht!2d-33ghD`{68&xkI1_m-D+PbJmG^ClwahejGZWGl! zY(v$Y?l&`J*L0mko802LaW5EF2pnI|Bo;ok+RX5n9XXntZTZ?5k9k2K#$@9movx2smkJJm2;E&QHYOGvF85Yfg4cpqq=WgR$fH*gq}0 z7tK!uyR8?kzS$>1Xptn&TSNsO{l(mnO$B95Nd(09lL>gNbG>H0z5AqobbG1O(R0Kl zW(zelKaQXTOlm0|7Z{YG&dfeB)E&E|6?cS9Mdie6t6v@wKyI6ZFN z*(*4SX9=M5Z;_|YoR6Y=^M2q1hIt3BYhhH&9@(qn9Kn+96bv4nPFhx^Kce%-9EaY1<)&KfeEM`FD2$mo0y9=W3*JLHK?{aFs#B zW%Q%XuX7h|U)rA;*K@pA8P(@Ly!`inGt90M%yKRWm!wPkGvRtt=qh3L{I27Y@Jov5 zDk^^O0(FVJwEv=hbp_5fS1jE47xhn0<|^V<7w|`aUD`ZS+=)YlJ2JGy=V_h;Y?a%tI=LN3n zoBB`ICG=+xs1DlabU|M7m+b=`Nd=Nrv0BlGh7am{y^bNgrev$pHUoU7X2|0nAb`m^sY*ZKd) uy}o;1<*uEF-pin = pin; + state = 0; + if (readCurrentState()) { + setStateFlag(DEBOUNCED_STATE | UNSTABLE_STATE); + } +#ifdef BOUNCE_LOCK_OUT + previous_millis = 0; +#else + previous_millis = millis(); +#endif +} + +void Bounce::attach(int pin, int mode){ + setPinMode(pin, mode); + this->attach(pin); +} + +void Bounce::interval(uint16_t interval_millis) +{ + this->interval_millis = interval_millis; +} + +bool Bounce::update() +{ + + unsetStateFlag(CHANGED_STATE); +#ifdef BOUNCE_LOCK_OUT + + // Ignore everything if we are locked out + if (millis() - previous_millis >= interval_millis) { + bool currentState = readCurrentState(); + if ( currentState != getStateFlag(DEBOUNCED_STATE) ) { + previous_millis = millis(); + toggleStateFlag(DEBOUNCED_STATE); + setStateFlag(CHANGED_STATE); + } + } + + +#elif defined BOUNCE_WITH_PROMPT_DETECTION + // Read the state of the switch port into a temporary variable. + bool readState = readCurrentState(); + + + if ( readState != getStateFlag(DEBOUNCED_STATE) ) { + // We have seen a change from the current button state. + + if ( millis() - previous_millis >= interval_millis ) { + // We have passed the time threshold, so a new change of state is allowed. + // set the STATE_CHANGED flag and the new DEBOUNCED_STATE. + // This will be prompt as long as there has been greater than interval_misllis ms since last change of input. + // Otherwise debounced state will not change again until bouncing is stable for the timeout period. + toggleStateFlag(DEBOUNCED_STATE); + setStateFlag(CHANGED_STATE ); + } + } + + // If the readState is different from previous readState, reset the debounce timer - as input is still unstable + // and we want to prevent new button state changes until the previous one has remained stable for the timeout. + if ( readState != getStateFlag(UNSTABLE_STATE) ) { + // Update Unstable Bit to macth readState + toggleStateFlag(UNSTABLE_STATE); + previous_millis = millis(); + } + + +#else + // Read the state of the switch in a temporary variable. + bool currentState = readCurrentState(); + + + // If the reading is different from last reading, reset the debounce counter + if ( currentState != getStateFlag(UNSTABLE_STATE) ) { + previous_millis = millis(); + toggleStateFlag(UNSTABLE_STATE); + } else + if ( millis() - previous_millis >= interval_millis ) { + // We have passed the threshold time, so the input is now stable + // If it is different from last state, set the STATE_CHANGED flag + if (currentState != getStateFlag(DEBOUNCED_STATE) ) { + previous_millis = millis(); + toggleStateFlag(DEBOUNCED_STATE); + setStateFlag(CHANGED_STATE) ; + } + } + + +#endif + +return getStateFlag(CHANGED_STATE); + +} + +bool Bounce::read() +{ + return getStateFlag(DEBOUNCED_STATE); +} + +bool Bounce::rose() +{ + return getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE); +} + +bool Bounce::fell() +{ + return !getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE); +} diff --git a/lib/Bounce2/Bounce2.h b/lib/Bounce2/Bounce2.h new file mode 100644 index 0000000..8e6eebb --- /dev/null +++ b/lib/Bounce2/Bounce2.h @@ -0,0 +1,110 @@ +/* + The MIT License (MIT) + + Copyright (c) 2013 thomasfredericks + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Main code by Thomas O Fredericks (tof@t-o-f.info) + Previous contributions by Eric Lowry, Jim Schimpf and Tom Harkaway + * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef Bounce2_h +#define Bounce2_h + +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +// Uncomment the following line for "LOCK-OUT" debounce method +//#define BOUNCE_LOCK_OUT + +// Uncomment the following line for "BOUNCE_WITH_PROMPT_DETECTION" debounce method +//#define BOUNCE_WITH_PROMPT_DETECTION + +#include + +/* +#ifndef _BV +#define _BV(n) (1<<(n)) +#endif +*/ + +class Bounce +{ + public: + // Create an instance of the bounce library + Bounce(); + + // Attach to a pin (and also sets initial state) + void attach(int pin); + + // Attach to a pin (and also sets initial state) and sets pin to mode (INPUT/INPUT_PULLUP/OUTPUT) + void attach(int pin, int mode); + + // Sets the debounce interval + void interval(uint16_t interval_millis); + + // Updates the pin + // Returns 1 if the state changed + // Returns 0 if the state did not change + bool update(); + + // Returns the updated pin state + bool read(); + + // Returns the falling pin state + bool fell(); + + // Returns the rising pin state + bool rose(); + + // Partial compatibility for programs written with Bounce version 1 + bool risingEdge() { return rose(); } + bool fallingEdge() { return fell(); } + Bounce(uint8_t pin, unsigned long interval_millis ) : Bounce() { + attach(pin); + interval(interval_millis); + } + + protected: + unsigned long previous_millis; + uint16_t interval_millis; + uint8_t state; + uint8_t pin; + virtual bool readCurrentState() { return digitalRead(pin); } + virtual void setPinMode(int pin, int mode) { +#if defined(ARDUINO_STM_NUCLEO_F103RB) || defined(ARDUINO_GENERIC_STM32F103C) + pinMode(pin, (WiringPinMode)mode); +#else + pinMode(pin, mode); +#endif + } + + private: + inline void setStateFlag(const uint8_t flag) {state |= flag;} + inline void unsetStateFlag(const uint8_t flag) {state &= ~flag;} + inline void toggleStateFlag(const uint8_t flag) {state ^= flag;} + inline bool getStateFlag(const uint8_t flag) {return((state & flag) != 0);} +}; + +#endif diff --git a/lib/Bounce2/BouncySwitch_lockout.png b/lib/Bounce2/BouncySwitch_lockout.png new file mode 100644 index 0000000000000000000000000000000000000000..d8313d4872954caf58605b975301b675d687b9e4 GIT binary patch literal 16093 zcmaibbwHF&^zJSTE8rqXd~``kNh2t+q@*CQbV+vzO2Z;Zmk3Ii1^fhard4j zNd2y@ll!&Xa#{=z1g;5PmD2JwUQPEYc0~BC7ga^unvMM+v<4~k__n9tO}<^NUTVq|YBrA**!5kl7^m?m5#2lSf5E>+-OTqTX>MP) zc|Fa3wbM1gB8t!ImKlV%BZ)SGpoPNx!Bt_9dDK+)BnbE-bl3^hi3kqi>qv@D^V^*w zReYK)uDXmc_F<7mQ4?H>z9dK%ynBN&^>e-1P%ni5$4lAz9;t(x2pbn0W}Czp34Z7= zyz4(m9j_6;P|o(sm+q98o->6kW@fXp#yIpGZc`pV zm{LZ7dk5!@;B1oXYqE>`Iz>>3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Pn800nI%@y z7A7=5YXy~Vms1F-rK`LdOESXfUW6YEoHb%V7i^;XDQdkDc*S>$&AEjF+W8X}gF49G zmkE4IYUWZSEJuN3gT=zP)cEAQMdNyjdw_1WS)RYR<{3RHu=ag^f6ecRNd%@2zq8dZ zNyeZ-)tTfBCH0u(YKl8Y2j8JZ*$+N8tQnX%=P)IFRvlDi26NGUk|w%vUrLIeJx>Ok z9FTE0EGgXqSQb^kts2^>7|O$~_3``7FQ6 zY$-jXYfI=?=iS{Z-sQ?ra-LZlr%p2f6_hi#Y;KQVY^~Slp)ezT|7jx0yw|j~%rKc7 z+%Y$1N4Kiva`n>2sk!PX^oR*ircft7JT*-o7R2M5YbNAy+#OoMyXi(w$oS~Xw@^~) zh@>I^j}?Af-6ZHMn82Z0tryOLR%ZvR`0O60@Tf=SEO(Ij);<29F;Z=9NyOr + +#define BUTTON_PIN 2 +#define LED_PIN 13 + +// Instantiate a Bounce object +Bounce debouncer = Bounce(); + +void setup() { + + // Setup the button with an internal pull-up : + pinMode(BUTTON_PIN,INPUT_PULLUP); + + // After setting up the button, setup the Bounce instance : + debouncer.attach(BUTTON_PIN); + debouncer.interval(5); // interval in ms + + //Setup the LED : + pinMode(LED_PIN,OUTPUT); + +} + +void loop() { + // Update the Bounce instance : + debouncer.update(); + + // Get the updated value : + int value = debouncer.read(); + + // Turn on or off the LED as determined by the state : + if ( value == LOW ) { + digitalWrite(LED_PIN, HIGH ); + } + else { + digitalWrite(LED_PIN, LOW ); + } + +} + + diff --git a/lib/Bounce2/examples/bounce2buttons/bounce2buttons.ino b/lib/Bounce2/examples/bounce2buttons/bounce2buttons.ino new file mode 100644 index 0000000..416d738 --- /dev/null +++ b/lib/Bounce2/examples/bounce2buttons/bounce2buttons.ino @@ -0,0 +1,64 @@ + +/* + DESCRIPTION + ==================== + Simple example of the Bounce library that switches the debug LED when + either of 2 buttons are pressed. + */ + +// Include the Bounce2 library found here : +// https://github.com/thomasfredericks/Bounce2 +#include + +#define BUTTON_PIN_1 2 +#define BUTTON_PIN_2 3 + + +#define LED_PIN 13 + +// Instantiate a Bounce object +Bounce debouncer1 = Bounce(); + +// Instantiate another Bounce object +Bounce debouncer2 = Bounce(); + +void setup() { + + // Setup the first button with an internal pull-up : + pinMode(BUTTON_PIN_1,INPUT_PULLUP); + // After setting up the button, setup the Bounce instance : + debouncer1.attach(BUTTON_PIN_1); + debouncer1.interval(5); // interval in ms + + // Setup the second button with an internal pull-up : + pinMode(BUTTON_PIN_2,INPUT_PULLUP); + // After setting up the button, setup the Bounce instance : + debouncer2.attach(BUTTON_PIN_2); + debouncer2.interval(5); // interval in ms + + + //Setup the LED : + pinMode(LED_PIN,OUTPUT); + +} + +void loop() { + // Update the Bounce instances : + debouncer1.update(); + debouncer2.update(); + + // Get the updated value : + int value1 = debouncer1.read(); + int value2 = debouncer2.read(); + + // Turn on the LED if either button is pressed : + if ( value1 == LOW || value2 == LOW ) { + digitalWrite(LED_PIN, HIGH ); + } + else { + digitalWrite(LED_PIN, LOW ); + } + +} + + diff --git a/lib/Bounce2/examples/bounce_multiple/bounce_multiple.ino b/lib/Bounce2/examples/bounce_multiple/bounce_multiple.ino new file mode 100644 index 0000000..25b92c7 --- /dev/null +++ b/lib/Bounce2/examples/bounce_multiple/bounce_multiple.ino @@ -0,0 +1,56 @@ +// Detect the falling edge of multiple buttons. +// Eight buttons with internal pullups. +// Toggles a LED when any button is pressed. +// Buttons on pins 2,3,4,5,6,7,8,9 + +// Include the Bounce2 library found here : +// https://github.com/thomasfredericks/Bounce2 +#include + +#define LED_PIN 13 + +#define NUM_BUTTONS 8 +const uint8_t BUTTON_PINS[NUM_BUTTONS] = {2, 3, 4, 5, 6, 7, 8, 9}; + +int ledState = LOW; + +Bounce * buttons = new Bounce[NUM_BUTTONS]; + +void setup() { + + for (int i = 0; i < NUM_BUTTONS; i++) { + buttons[i].attach( BUTTON_PINS[i] , INPUT_PULLUP ); //setup the bounce instance for the current button + buttons[i].interval(25); // interval in ms + } + + // Setup the LED : + pinMode(LED_PIN, OUTPUT); + digitalWrite(LED_PIN, ledState); + + +} + +void loop() { + + bool needToToggleLed = false; + + + for (int i = 0; i < NUM_BUTTONS; i++) { + // Update the Bounce instance : + buttons[i].update(); + // If it fell, flag the need to toggle the LED + if ( buttons[i].fell() ) { + needToToggleLed = true; + } + } + + // if a LED toggle has been flagged : + if ( needToToggleLed ) { + // Toggle LED state : + ledState = !ledState; + digitalWrite(LED_PIN, ledState); + } + + +} + diff --git a/lib/Bounce2/examples/change/change.ino b/lib/Bounce2/examples/change/change.ino new file mode 100644 index 0000000..0ece35b --- /dev/null +++ b/lib/Bounce2/examples/change/change.ino @@ -0,0 +1,48 @@ + +// Detect the falling edge + +// Include the Bounce2 library found here : +// https://github.com/thomasfredericks/Bounce2 +#include + + +#define BUTTON_PIN 2 +#define LED_PIN 13 + +int ledState = LOW; + + +// Instantiate a Bounce object : +Bounce debouncer = Bounce(); + +void setup() { + + // Setup the button with an internal pull-up : + pinMode(BUTTON_PIN,INPUT_PULLUP); + + // After setting up the button, setup the Bounce instance : + debouncer.attach(BUTTON_PIN); + debouncer.interval(500); + + // Setup the LED : + pinMode(LED_PIN,OUTPUT); + digitalWrite(LED_PIN,ledState); + + +} + +void loop() { + + // Update the Bounce instance : + debouncer.update(); + + // Call code if Bounce fell (transition from HIGH to LOW) : + if ( debouncer.fell() ) { + + // Toggle LED state : + ledState = !ledState; + digitalWrite(LED_PIN,ledState); + + } +} + diff --git a/lib/Bounce2/examples/circuit-bounce-change-duration-retrigger.png b/lib/Bounce2/examples/circuit-bounce-change-duration-retrigger.png new file mode 100644 index 0000000000000000000000000000000000000000..2e4114862b7a67742ba534487a215f09bf9855bf GIT binary patch literal 48556 zcmcG$by$>Z_Xa8>4Z_fk1Be15-62CrqkwctcMC{6NDW9xNJvU6t(0`5bax1dG)POI zXZZI1zTb8JI{zH6YrFBCdFy%By4St#wH9HjPv!35Qsdsbb?c6Tyo~y-TM+22TWEvW znBd5tThBAW|Il8l%SqiT>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d38wuwb;Hn~X~r+WecRv5g!%=JRwDwpf6eq}D#H+@_l7uEnij>fBE zNyl(evBYQ&yepP8W`z+WVXZMzBrR)<0?FGNqe{xc>z=^|qVY@ACS#m#sydOkIZfS) zSNEK@R!u}8HA=u>V=RlRZRNCT@D(lF*x&1@JJ2h2`0u+kYnQeFGMW-LL8NVlb3 z(Od#J#He;vWyWyATS07M6a) + + +#define BUTTON_PIN 2 +#define LED_PIN 13 + +// Instantiate a Bounce object : +Bounce debouncer = Bounce(); + +unsigned long buttonPressTimeStamp; + +void setup() { + + Serial.begin(57600); + + // Setup the button with an internal pull-up : + pinMode(BUTTON_PIN,INPUT_PULLUP); + + // After setting up the button, setup the Bounce instance : + debouncer.attach(BUTTON_PIN); + debouncer.interval(5); + + // Setup the LED : + pinMode(LED_PIN,OUTPUT); + +} + +void loop() { + + // Update the Bounce instance : + debouncer.update(); + + // Call code if Bounce fell (transition from HIGH to LOW) : + if ( debouncer.fell() ) {; + + Serial.println( millis()-buttonPressTimeStamp ); + buttonPressTimeStamp = millis(); + + } + + +} + diff --git a/lib/Bounce2/examples/retrigger/retrigger.ino b/lib/Bounce2/examples/retrigger/retrigger.ino new file mode 100644 index 0000000..dfc53fd --- /dev/null +++ b/lib/Bounce2/examples/retrigger/retrigger.ino @@ -0,0 +1,86 @@ + +/* +DESCRIPTION +==================== +Example of the bounce library that shows how to retrigger an event when a button is held down. +In this case, the debug LED will blink every 500 ms as long as the button is held down. +Open the Serial Monitor (57600 baud) for debug messages. + +*/ + +// Include the Bounce2 library found here : +// https://github.com/thomasfredericks/Bounce2 +#include + + +#define BUTTON_PIN 2 +#define LED_PIN 13 + +// Instantiate a Bounce object +Bounce debouncer = Bounce(); + +int buttonState; +unsigned long buttonPressTimeStamp; + +int ledState; + +void setup() { + + Serial.begin(57600); + + // Setup the button + pinMode(BUTTON_PIN,INPUT); + // Activate internal pull-up + digitalWrite(BUTTON_PIN,HIGH); + + // After setting up the button, setup debouncer + debouncer.attach(BUTTON_PIN); + debouncer.interval(5); + + //Setup the LED + pinMode(LED_PIN,OUTPUT); + digitalWrite(LED_PIN,ledState); + +} + +void loop() { + // Update the debouncer and get the changed state + boolean changed = debouncer.update(); + + + + if ( changed ) { + // Get the update value + int value = debouncer.read(); + if ( value == HIGH) { + ledState = LOW; + digitalWrite(LED_PIN, ledState ); + + buttonState = 0; + Serial.println("Button released (state 0)"); + + } else { + ledState = HIGH; + digitalWrite(LED_PIN, ledState ); + + buttonState = 1; + Serial.println("Button pressed (state 1)"); + buttonPressTimeStamp = millis(); + + } + } + + if ( buttonState == 1 ) { + if ( millis() - buttonPressTimeStamp >= 500 ) { + buttonPressTimeStamp = millis(); + if ( ledState == HIGH ) ledState = LOW; + else if ( ledState == LOW ) ledState = HIGH; + digitalWrite(LED_PIN, ledState ); + Serial.println("Retriggering button"); + } + } + + +} + + diff --git a/lib/Bounce2/keywords.txt b/lib/Bounce2/keywords.txt new file mode 100644 index 0000000..22285fe --- /dev/null +++ b/lib/Bounce2/keywords.txt @@ -0,0 +1,29 @@ +####################################### +# Syntax Coloring Map For Bounce2 +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +Bounce KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +update KEYWORD2 +interval KEYWORD2 +read KEYWORD2 +attach KEYWORD2 +rose KEYWORD2 +fell KEYWORD2 + +####################################### +# Instances (KEYWORD2) +####################################### + +####################################### +# Constants (LITERAL1) +####################################### + diff --git a/lib/Bounce2/library.json b/lib/Bounce2/library.json new file mode 100644 index 0000000..327baa8 --- /dev/null +++ b/lib/Bounce2/library.json @@ -0,0 +1,16 @@ +{ + "name": "Bounce2", + "keywords": "bounce, signal, input, ouput", + "description": "Debouncing library for Arduino or Wiring", + "repository": { + "type": "git", + "url": "https://github.com/thomasfredericks/Bounce2.git" + }, + "version": "2.41", + "exclude": [ + "*.png", + "*.zip" + ], + "frameworks": "arduino", + "platforms": "*" +} diff --git a/lib/Bounce2/library.properties b/lib/Bounce2/library.properties new file mode 100644 index 0000000..ee9933d --- /dev/null +++ b/lib/Bounce2/library.properties @@ -0,0 +1,9 @@ +name=Bounce2 +version=2.41 +author=Thomas O Fredericks with contributions fromEric Lowry, Jim Schimpf and Tom Harkaway +maintainer=Thomas O Fredericks +sentence=Debouncing library for Arduino and Wiring. +paragraph=Deboucing switches and toggles is important. +category=Signal Input/Output +url=https://github.com/thomasfredericks/Bounce2 +architectures=* diff --git a/lib/DueTimer/DueTimer.cpp b/lib/DueTimer/DueTimer.cpp new file mode 100644 index 0000000..950fffa --- /dev/null +++ b/lib/DueTimer/DueTimer.cpp @@ -0,0 +1,308 @@ +/* + DueTimer.cpp - Implementation of Timers defined on DueTimer.h + For instructions, go to https://github.com/ivanseidel/DueTimer + + Created by Ivan Seidel Gomes, March, 2013. + Modified by Philipp Klaus, June 2013. + Thanks to stimmer (from Arduino forum), for coding the "timer soul" (Register stuff) + Released into the public domain. +*/ + +#include +#if defined(_SAM3XA_) +#include "DueTimer.h" + +const DueTimer::Timer DueTimer::Timers[NUM_TIMERS] = { + {TC0,0,TC0_IRQn}, + {TC0,1,TC1_IRQn}, + {TC0,2,TC2_IRQn}, + {TC1,0,TC3_IRQn}, + {TC1,1,TC4_IRQn}, + {TC1,2,TC5_IRQn}, + {TC2,0,TC6_IRQn}, + {TC2,1,TC7_IRQn}, + {TC2,2,TC8_IRQn}, +}; + +// Fix for compatibility with Servo library +#ifdef USING_SERVO_LIB + // Set callbacks as used, allowing DueTimer::getAvailable() to work + void (*DueTimer::callbacks[NUM_TIMERS])() = { + (void (*)()) 1, // Timer 0 - Occupied + (void (*)()) 0, // Timer 1 + (void (*)()) 1, // Timer 2 - Occupied + (void (*)()) 1, // Timer 3 - Occupied + (void (*)()) 1, // Timer 4 - Occupied + (void (*)()) 1, // Timer 5 - Occupied + (void (*)()) 0, // Timer 6 + (void (*)()) 0, // Timer 7 + (void (*)()) 0 // Timer 8 + }; +#else + void (*DueTimer::callbacks[NUM_TIMERS])() = {}; +#endif +double DueTimer::_frequency[NUM_TIMERS] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; + +/* + Initializing all timers, so you can use them like this: Timer0.start(); +*/ +DueTimer Timer(0); + +DueTimer Timer1(1); +// Fix for compatibility with Servo library +#ifndef USING_SERVO_LIB + DueTimer Timer0(0); + DueTimer Timer2(2); + DueTimer Timer3(3); + DueTimer Timer4(4); + DueTimer Timer5(5); +#endif +DueTimer Timer6(6); +DueTimer Timer7(7); +DueTimer Timer8(8); + +DueTimer::DueTimer(unsigned short _timer) : timer(_timer){ + /* + The constructor of the class DueTimer + */ +} + +DueTimer DueTimer::getAvailable(void){ + /* + Return the first timer with no callback set + */ + + for(int i = 0; i < NUM_TIMERS; i++){ + if(!callbacks[i]) + return DueTimer(i); + } + // Default, return Timer0; + return DueTimer(0); +} + +DueTimer& DueTimer::attachInterrupt(void (*isr)()){ + /* + Links the function passed as argument to the timer of the object + */ + + callbacks[timer] = isr; + + return *this; +} + +DueTimer& DueTimer::detachInterrupt(void){ + /* + Links the function passed as argument to the timer of the object + */ + + stop(); // Stop the currently running timer + + callbacks[timer] = NULL; + + return *this; +} + +DueTimer& DueTimer::start(long microseconds){ + /* + Start the timer + If a period is set, then sets the period and start the timer + */ + + if(microseconds > 0) + setPeriod(microseconds); + + if(_frequency[timer] <= 0) + setFrequency(1); + + NVIC_ClearPendingIRQ(Timers[timer].irq); + NVIC_EnableIRQ(Timers[timer].irq); + + TC_Start(Timers[timer].tc, Timers[timer].channel); + + return *this; +} + +DueTimer& DueTimer::stop(void){ + /* + Stop the timer + */ + + NVIC_DisableIRQ(Timers[timer].irq); + + TC_Stop(Timers[timer].tc, Timers[timer].channel); + + return *this; +} + +uint8_t DueTimer::bestClock(double frequency, uint32_t& retRC){ + /* + Pick the best Clock, thanks to Ogle Basil Hall! + + Timer Definition + TIMER_CLOCK1 MCK / 2 + TIMER_CLOCK2 MCK / 8 + TIMER_CLOCK3 MCK / 32 + TIMER_CLOCK4 MCK /128 + */ + const struct { + uint8_t flag; + uint8_t divisor; + } clockConfig[] = { + { TC_CMR_TCCLKS_TIMER_CLOCK1, 2 }, + { TC_CMR_TCCLKS_TIMER_CLOCK2, 8 }, + { TC_CMR_TCCLKS_TIMER_CLOCK3, 32 }, + { TC_CMR_TCCLKS_TIMER_CLOCK4, 128 } + }; + float ticks; + float error; + int clkId = 3; + int bestClock = 3; + float bestError = 9.999e99; + do + { + ticks = (float) VARIANT_MCK / frequency / (float) clockConfig[clkId].divisor; + // error = abs(ticks - round(ticks)); + error = clockConfig[clkId].divisor * abs(ticks - round(ticks)); // Error comparison needs scaling + if (error < bestError) + { + bestClock = clkId; + bestError = error; + } + } while (clkId-- > 0); + ticks = (float) VARIANT_MCK / frequency / (float) clockConfig[bestClock].divisor; + retRC = (uint32_t) round(ticks); + return clockConfig[bestClock].flag; +} + + +DueTimer& DueTimer::setFrequency(double frequency){ + /* + Set the timer frequency (in Hz) + */ + + // Prevent negative frequencies + if(frequency <= 0) { frequency = 1; } + + // Remember the frequency — see below how the exact frequency is reported instead + //_frequency[timer] = frequency; + + // Get current timer configuration + Timer t = Timers[timer]; + + uint32_t rc = 0; + uint8_t clock; + + // Tell the Power Management Controller to disable + // the write protection of the (Timer/Counter) registers: + pmc_set_writeprotect(false); + + // Enable clock for the timer + pmc_enable_periph_clk((uint32_t)t.irq); + + // Find the best clock for the wanted frequency + clock = bestClock(frequency, rc); + + switch (clock) { + case TC_CMR_TCCLKS_TIMER_CLOCK1: + _frequency[timer] = (double)VARIANT_MCK / 2.0 / (double)rc; + break; + case TC_CMR_TCCLKS_TIMER_CLOCK2: + _frequency[timer] = (double)VARIANT_MCK / 8.0 / (double)rc; + break; + case TC_CMR_TCCLKS_TIMER_CLOCK3: + _frequency[timer] = (double)VARIANT_MCK / 32.0 / (double)rc; + break; + default: // TC_CMR_TCCLKS_TIMER_CLOCK4 + _frequency[timer] = (double)VARIANT_MCK / 128.0 / (double)rc; + break; + } + + // Set up the Timer in waveform mode which creates a PWM + // in UP mode with automatic trigger on RC Compare + // and sets it up with the determined internal clock as clock input. + TC_Configure(t.tc, t.channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | clock); + // Reset counter and fire interrupt when RC value is matched: + TC_SetRC(t.tc, t.channel, rc); + // Enable the RC Compare Interrupt... + t.tc->TC_CHANNEL[t.channel].TC_IER=TC_IER_CPCS; + // ... and disable all others. + t.tc->TC_CHANNEL[t.channel].TC_IDR=~TC_IER_CPCS; + + return *this; +} + +DueTimer& DueTimer::setPeriod(unsigned long microseconds){ + /* + Set the period of the timer (in microseconds) + */ + + // Convert period in microseconds to frequency in Hz + double frequency = 1000000.0 / microseconds; + setFrequency(frequency); + return *this; +} + +double DueTimer::getFrequency(void) const { + /* + Get current time frequency + */ + + return _frequency[timer]; +} + +long DueTimer::getPeriod(void) const { + /* + Get current time period + */ + + return 1.0/getFrequency()*1000000; +} + + +/* + Implementation of the timer callbacks defined in + arduino-1.5.2/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/include/sam3x8e.h +*/ +// Fix for compatibility with Servo library +#ifndef USING_SERVO_LIB +void TC0_Handler(void){ + TC_GetStatus(TC0, 0); + DueTimer::callbacks[0](); +} +#endif +void TC1_Handler(void){ + TC_GetStatus(TC0, 1); + DueTimer::callbacks[1](); +} +// Fix for compatibility with Servo library +#ifndef USING_SERVO_LIB +void TC2_Handler(void){ + TC_GetStatus(TC0, 2); + DueTimer::callbacks[2](); +} +void TC3_Handler(void){ + TC_GetStatus(TC1, 0); + DueTimer::callbacks[3](); +} +void TC4_Handler(void){ + TC_GetStatus(TC1, 1); + DueTimer::callbacks[4](); +} +void TC5_Handler(void){ + TC_GetStatus(TC1, 2); + DueTimer::callbacks[5](); +} +#endif +void TC6_Handler(void){ + TC_GetStatus(TC2, 0); + DueTimer::callbacks[6](); +} +void TC7_Handler(void){ + TC_GetStatus(TC2, 1); + DueTimer::callbacks[7](); +} +void TC8_Handler(void){ + TC_GetStatus(TC2, 2); + DueTimer::callbacks[8](); +} +#endif diff --git a/lib/DueTimer/DueTimer.h b/lib/DueTimer/DueTimer.h new file mode 100644 index 0000000..fdfe9c2 --- /dev/null +++ b/lib/DueTimer/DueTimer.h @@ -0,0 +1,109 @@ +/* + DueTimer.h - DueTimer header file, definition of methods and attributes... + For instructions, go to https://github.com/ivanseidel/DueTimer + + Created by Ivan Seidel Gomes, March, 2013. + Modified by Philipp Klaus, June 2013. + Released into the public domain. +*/ + +#ifdef __arm__ + +#ifndef DueTimer_h +#define DueTimer_h + +#include "Arduino.h" + +#include + +/* + This fixes compatibility for Arduono Servo Library. + Uncomment to make it compatible. + + Note that: + + Timers: 0,2,3,4,5 WILL NOT WORK, and will + neither be accessible by Timer0,... +*/ +// #define USING_SERVO_LIB true + +#ifdef USING_SERVO_LIB + #warning "HEY! You have set flag USING_SERVO_LIB. Timer0, 2,3,4 and 5 are not available" +#endif + + +#define NUM_TIMERS 9 + +class DueTimer +{ +protected: + + // Represents the timer id (index for the array of Timer structs) + const unsigned short timer; + + // Stores the object timer frequency + // (allows to access current timer period and frequency): + static double _frequency[NUM_TIMERS]; + + // Picks the best clock to lower the error + static uint8_t bestClock(double frequency, uint32_t& retRC); + + // Make Interrupt handlers friends, so they can use callbacks + friend void TC0_Handler(void); + friend void TC1_Handler(void); + friend void TC2_Handler(void); + friend void TC3_Handler(void); + friend void TC4_Handler(void); + friend void TC5_Handler(void); + friend void TC6_Handler(void); + friend void TC7_Handler(void); + friend void TC8_Handler(void); + + static void (*callbacks[NUM_TIMERS])(); + + struct Timer + { + Tc *tc; + uint32_t channel; + IRQn_Type irq; + }; + + // Store timer configuration (static, as it's fixed for every object) + static const Timer Timers[NUM_TIMERS]; + +public: + + static DueTimer getAvailable(void); + + DueTimer(unsigned short _timer); + DueTimer& attachInterrupt(void (*isr)()); + DueTimer& detachInterrupt(void); + DueTimer& start(long microseconds = -1); + DueTimer& stop(void); + DueTimer& setFrequency(double frequency); + DueTimer& setPeriod(unsigned long microseconds); + + double getFrequency(void) const; + long getPeriod(void) const; +}; + +// Just to call Timer.getAvailable instead of Timer::getAvailable() : +extern DueTimer Timer; + +extern DueTimer Timer1; +// Fix for compatibility with Servo library +#ifndef USING_SERVO_LIB + extern DueTimer Timer0; + extern DueTimer Timer2; + extern DueTimer Timer3; + extern DueTimer Timer4; + extern DueTimer Timer5; +#endif +extern DueTimer Timer6; +extern DueTimer Timer7; +extern DueTimer Timer8; + +#endif + +#else + #error Oops! Trying to include DueTimer on another device? +#endif diff --git a/lib/DueTimer/LICENSE.txt b/lib/DueTimer/LICENSE.txt new file mode 100644 index 0000000..5c02604 --- /dev/null +++ b/lib/DueTimer/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ivan Seidel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/DueTimer/README.md b/lib/DueTimer/README.md new file mode 100644 index 0000000..89ad2df --- /dev/null +++ b/lib/DueTimer/README.md @@ -0,0 +1,119 @@ +# DueTimer + +Timer Library to work with Arduino DUE + +## Installation + +1. [Download](https://github.com/ivanseidel/DueTimer/releases) the Latest release from GitHub. +2. Unzip and modify the Folder name to "DueTimer" (Remove the '-version') +3. Paste the modified folder on your Library folder (On your `Libraries` folder inside Sketchbooks or Arduino software). +4. Re-open Arduino Software + +## Getting Started + +To call a function `handler` every `1000` microseconds: + +```c++ +Timer3.attachInterrupt(handler).start(1000); +// or: +Timer3.attachInterrupt(handler).setPeriod(1000).start(); +// or, to select whichever available timer: +Timer.getAvailable().attachInterrupt(handler).start(1000); +``` + +To call a function `handler` `10` times a second: + +```c++ +Timer3.attachInterrupt(handler).setFrequency(10).start(); +``` + +In case you need to stop a timer, just do like this: + +```c++ +Timer3.stop(); +``` + +And to continue running: + +```c++ +Timer3.start(); +``` + +There are `9` Timer objects already instantiated for you: +`Timer0`, `Timer1`, `Timer2`, `Timer3`, `Timer4`, `Timer5`, `Timer6`, `Timer7` and `Timer8`. + +### TIPs and Warnings + +```c++ +Timer4.attachInterrupt(handler).setFrequency(10).start(); +// Is the same as: +Timer4.attachInterrupt(handler); +Timer4.setFrequency(10); +Timer4.start(); + +// To create a custom timer, refer to: +DueTimer myTimer = DueTimer(0); // Creates a Timer 0 object. +DueTimer myTimer = DueTimer(3); // Creates a Timer 3 object. +DueTimer myTimer = DueTimer(t); // Creates a Timer t object. +// Note: Maximum t allowed is 8, as there is only 9 timers [0..8]; + +Timer1.attachInterrupt(handler1).start(10); +Timer1.attachInterrupt(handler2).start(10); +DueTimer myTimer = DueTimer(1); +myTimer.attachInterrupt(handler3).start(20); +// Will run only handle3, on Timer 1 (You are just overriding the callback) + +Timer.getAvailable().attachInterrupt(callback1).start(10); +// Start timer on first available timer +DueTimer::getAvailable().attachInterrupt(callback2).start(10); +// Start timer on second available timer +// And so on... +``` + +### Compatibility with Servo.h + +Because Servo Library uses the same callbacks of DueTimer, we provides a custom solution for working with both of them. However, Timers 0,2,3,4 and 5 will not Work anymore. + +You will need uncommend the line in `DueTimer.h` in `DueTimer` folder inside the `Libraries` folder. Uncomment the following line in `DueTimer.h`: + +``` +#define USING_SERVO_LIB true +``` + +## Library Reference + +### You should know: + +- `getAvailable()` - Get the first available Timer. + +- `attachInterrupt(void (*isr)())` - Attach a interrupt (callback function) for the timer of the object. + +- `detachInterrupt()` - Detach current callback of timer. + +- `start(long microseconds = -1)` - Start the timer with an optional period parameter. + +- `stop()` - Stop the timer + +- `setFrequency(long frequency)` - Set the timer frequency + +- `long getFrequency()` - Get the timer frequency + +- `setPeriod(long microseconds)` - Set the timer period (in microseconds) + +- `long getPeriod()` - Get the timer period (in microseconds) + +### You don't need to know: + +- `unsigned short timer` - Stores the object timer id (to access Timers struct array). + +- `DueTimer(unsigned short _timer)` - Instantiate a new DueTimer object for Timer _timer (NOTE: All objects are already instantiated!). + +- `static const Timer Timers[]` - Stores all timers information + +- `static void (*callbacks[])()` - Stores all callbacks for all timers + + +### Hardware Information + +More information on the Timer Counter module of the µC on the Arduino Due +can be found in the documentation file [TimerCounter](TimerCounter.md). \ No newline at end of file diff --git a/lib/DueTimer/TimerCounter.md b/lib/DueTimer/TimerCounter.md new file mode 100644 index 0000000..dd651b3 --- /dev/null +++ b/lib/DueTimer/TimerCounter.md @@ -0,0 +1,106 @@ +# The Timer Counter blocks of Arduino Due's AT91SAM3X8E + +The AT91SAM3X8E embedds nine general-purpose 32-bit timers/counters. They are organized in three blocks (`TC0`, `TC1`, `TC2`) each containing three channels (`0`, `1`, `2`). +Each block and channel has input lines for their clock and input/output lines which can be used in different ways, such as PWM pins etc. + + +### Resources + +Information on the Timer Counter and its I/O signals pins can be found here: + +* Section **37 Timer Counter (TC)** in the [Atmel SAM3X Datasheet][] + You find this chapter on the pages 869 through 920. It explains in detail how to operate the counter in different modes and has nice diagrams that show you how the clock input works and how to set up interrupts based on counter values etc. +* [Arduino Due's SAM3X Pin Mapping][] and the +* [Arduino Due pinout diagram][]. + +### The Timer Counter Signals / Pins + +Many of the I/O lines of the Timer Counter are directly accessible on pin headers of the Arduino Due board. This section helps you to find out which of them are and which are not. + +In order to actually connect those signals (`TCLKx`, `TIOAx` and `TIOBx`) to the pins on the Arduino Due, you must tell the Parallel I/O Controllers (`PIOA`, `PIOB`, `PIOC` or `PIOD`) to set up their mux (multiplexer) accordingly.
+A useful resource to find out how to set the PIOs is +[Arduino's const array of PinDescriptions](https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/variants/arduino_due_x/variant.cpp#L117) and the +[definition of PinDescription](https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/cores/arduino/Arduino.h#L166), the data type of its entries. + +#### Overview of the I/O lines of the Timer Counter + +Here is a table of the Timer Counter channels and their `TCLKx` (external clock input), `TIOAx` (I/O Line _A_) and `TIOBx` (I/O Line _B_) signals: + +Instance | TC | Channel| External Clock Input | I/O Line A | I/O Line B +---------|-----|--------|----------------------|------------|----------- + T0 | TC0 | 0 | TCLK0 | TIOA0 | TIOB0 + T1 | TC0 | 1 | TCLK1 | TIOA1 | TIOB1 + T2 | TC0 | 2 | TCLK2 | TIOA2 | TIOB2 + T3 | TC1 | 0 | TCLK3 | TIOA3 | TIOB3 + T4 | TC1 | 1 | TCLK4 | TIOA4 | TIOB4 + T5 | TC1 | 2 | TCLK5 | TIOA5 | TIOB5 + T6 | TC2 | 0 | TCLK6 | TIOA6 | TIOB6 + T7 | TC2 | 1 | TCLK7 | TIOA7 | TIOB7 + T8 | TC2 | 2 | TCLK8 | TIOA8 | TIOB8 + +##### TCLKx + +Here is how the **external clock inputs** are routed to pins on the Arduino Due board: + +Clock Input | Port Pin of µC | Pin on Arduino Due Board +------------|------------|----------------------------- +TCLK0 | PB 26 | Digital Pin 22 +TCLK1 | PA 4 | Analog In 5 +TCLK2 | PA 7 | Digital Pin 31 +TCLK3 | PA 22 | Analog In 3 +TCLK4 | PA 23 | Analog In 2 +TCLK5 | PB 16 | DAC1 +TCLK6 | PC 27 | / +TCLK7 | PC 30 | LED "RX" +TCLK8 | PD 9 | Digital Pin 30 + +##### TIOAx + +Here is how the **I/O Lines _A_** are routed to pins on the Arduino Due board: + +I/O Line A | Port Pin of µC | Pin on Arduino Due Board +-----------|----------------|----------------------------- +TIOA0 | PB 25 | Digital Pin 2 +TIOA1 | PA 2 | Analog In 7 +TIOA2 | PA 5 | / +TIOA3 | PE 9 | / +TIOA4 | PE 11 | / +TIOA5 | PE 13 | / +TIOA6 | PC 25 | Digital Pin 5 +TIOA7 | PC 28 | Digital Pin 3 +TIOA8 | PD 7 | Digital Pin 11 + +##### TIOBx + +Here is how the **I/O Lines _B_** are routed to pins on the Arduino Due board: + +I/O Line B|Port Pin of µC| Pin on Arduino Due Board +----------|--------------|------------------------------------------ +TIOB0 | PB 27 | Digital Pin 13 / Amber LED "L" +TIOB1 | PA 3 | Analog In 6 +TIOB2 | PA 6 | Analog In 4 +TIOB3 | PE 10 | / +TIOB4 | PE 12 | / +TIOB5 | PE 14 | / +TIOB6 | PC 26 | Digital Pin 4 (also connected to PA29) +TIOB7 | PC 29 | Digital Pin 10 (also connected to PA28) +TIOB8 | PD 8 | Digital Pin 12 + +#### TC Clock Source Selection + +The *clock of the counters* can be set very flexibly to internal or external signals. To *use the channel as a timer*, it makes sense to connect its clock input to an internal timer clock. Here are the options: + +Name | Definition +-------------|----------- +TIMER_CLOCK1 | `MCK / 2` +TIMER_CLOCK2 | `MCK / 8` +TIMER_CLOCK3 | `MCK / 32` +TIMER_CLOCK4 | `MCK / 128` +TIMER_CLOCK5 | `SLCK` + + +Where `MCK` is the master clock (84 MHz for the Arduino Due) and SLCK is the slow clock (which can be clocked at 32.768 kHz by Y2 on the Arduino Due). + +[Atmel SAM3X Datasheet]: http://www.atmel.com/Images/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf +[Arduino Due's SAM3X Pin Mapping]: http://arduino.cc/en/Hacking/PinMappingSAM3X +[Arduino Due pinout diagram]: http://www.robgray.com/temp/Due-pinout.pdf diff --git a/lib/DueTimer/examples/AvaliableTimer/AvaliableTimer.pde b/lib/DueTimer/examples/AvaliableTimer/AvaliableTimer.pde new file mode 100644 index 0000000..332698e --- /dev/null +++ b/lib/DueTimer/examples/AvaliableTimer/AvaliableTimer.pde @@ -0,0 +1,60 @@ +#include + +void playVideogame(){ + Serial.println("[- ] I'm playing Videogame!"); +} + +void drinkWater(){ + Serial.println("[ - ] I'm driking water!"); +} + +void makeSushi(){ + Serial.println("[ - ] Slicing Salmon..."); +} + +void singOnShower(){ + Serial.println("[ - ] Hello World! Hello world!"); +} + +void studyMath(){ + int x = random(1, 40), y = random(1,40); + Serial.print("[ - ] "); + Serial.print(x); Serial.print(" x "); Serial.print(y); Serial.print(" = "); + Serial.println(x*y); +} + +void watchStarTrek(){ + Serial.println("[ - ] Long live and prosper \\\\//_"); +} + +void eatSushi(){ + Serial.println("[ - ] ..."); +} + +void readTextMessage(){ + Serial.println("[ - ] [Unlock ---->>]"); +} + +void goToSleep(){ + Serial.println("[ -] zzzzzz"); +} + +void setup(){ + Serial.begin(9600); + + Timer.getAvailable().attachInterrupt(playVideogame).start(); delay(50); + Timer.getAvailable().attachInterrupt(drinkWater).start(); delay(50); + Timer.getAvailable().attachInterrupt(makeSushi).start(); delay(50); + Timer.getAvailable().attachInterrupt(singOnShower).start(); delay(50); + Timer.getAvailable().attachInterrupt(studyMath).start(); delay(50); + Timer.getAvailable().attachInterrupt(watchStarTrek).start(); delay(50); + Timer.getAvailable().attachInterrupt(eatSushi).start(); delay(50); + Timer.getAvailable().attachInterrupt(readTextMessage).start(); delay(50); + Timer.getAvailable().attachInterrupt(goToSleep).start(); delay(50); +} + +void loop(){ + while(1){ + // ... + } +} \ No newline at end of file diff --git a/lib/DueTimer/examples/MultipleTimers/MultipleTimers.pde b/lib/DueTimer/examples/MultipleTimers/MultipleTimers.pde new file mode 100644 index 0000000..7095ca0 --- /dev/null +++ b/lib/DueTimer/examples/MultipleTimers/MultipleTimers.pde @@ -0,0 +1,29 @@ +#include + +void firstHandler(){ + Serial.println("[- ] First Handler!"); +} + +void secondHandler(){ + Serial.println("[ - ] Second Handler!"); +} + +void thirdHandler(){ + Serial.println("[ -] Third Handler!"); +} + +void setup(){ + Serial.begin(9600); + + Timer3.attachInterrupt(firstHandler).start(500000); // Every 500ms + Timer4.attachInterrupt(secondHandler).setFrequency(1).start(); + Timer5.attachInterrupt(thirdHandler).setFrequency(10); +} + +void loop(){ + delay(2000); + Timer5.start(); + + delay(2000); + Timer5.stop(); +} \ No newline at end of file diff --git a/lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde b/lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde new file mode 100644 index 0000000..fa10517 --- /dev/null +++ b/lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde @@ -0,0 +1,25 @@ +#include + +int myLed = 13; + +bool ledOn = false; +void myHandler(){ + ledOn = !ledOn; + + digitalWrite(myLed, ledOn); // Led on, off, on, off... +} + +void setup(){ + pinMode(myLed, OUTPUT); + + Timer3.attachInterrupt(myHandler); + Timer3.start(50000); // Calls every 50ms +} + +void loop(){ + + while(1){ + // I'm stuck in here! help me... + } + +} \ No newline at end of file diff --git a/lib/DueTimer/keywords.txt b/lib/DueTimer/keywords.txt new file mode 100644 index 0000000..28a7c2f --- /dev/null +++ b/lib/DueTimer/keywords.txt @@ -0,0 +1,20 @@ +DueTimer KEYWORD2 +start KEYWORD2 +stop KEYWORD2 +attachInterrupt KEYWORD2 +detachInterrupt KEYWORD2 +setPeriod KEYWORD2 +setFrequency KEYWORD2 +getFrequency KEYWORD2 +getPeriod KEYWORD2 + +Timer KEYWORD1 +Timer0 KEYWORD1 +Timer1 KEYWORD1 +Timer2 KEYWORD1 +Timer3 KEYWORD1 +Timer4 KEYWORD1 +Timer5 KEYWORD1 +Timer6 KEYWORD1 +Timer7 KEYWORD1 + diff --git a/lib/DueTimer/library.json b/lib/DueTimer/library.json new file mode 100644 index 0000000..c4188fb --- /dev/null +++ b/lib/DueTimer/library.json @@ -0,0 +1,12 @@ +{ + "name": "DueTimer", + "keywords": "timer", + "description": "Timer Library fully implemented for Arduino DUE", + "repository": + { + "type": "git", + "url": "https://github.com/ivanseidel/DueTimer.git" + }, + "frameworks": "arduino", + "platforms": "atmelsam" +} diff --git a/lib/DueTimer/library.properties b/lib/DueTimer/library.properties new file mode 100644 index 0000000..da3eb6b --- /dev/null +++ b/lib/DueTimer/library.properties @@ -0,0 +1,9 @@ +name=DueTimer +version=1.4.7 +author=Ivan Seidel +maintainer=Ivan Seidel +sentence=Timer Library fully implemented for Arduino DUE +paragraph=There are 9 Timer objects already instantiated for you: Timer0, Timer1, Timer2, Timer3, Timer4, Timer5, Timer6, Timer7 and Timer8. +category=Timing +url=https://github.com/ivanseidel/DueTimer +architectures=sam diff --git a/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp new file mode 100644 index 0000000..84afc35 --- /dev/null +++ b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp @@ -0,0 +1,406 @@ +#include "Arduino.h" +#include "EDIPTFT.h" +#include "FT_2018_STW_CAN.h" +#include "FT18_STW_INIT.h" +#include "FT18_STW_DISPLAY.h" + +EDIPTFT tft(true,false); +String bezeichnungen[]={"T_mot","T_oil","P_oil","% fa","U_batt","P_wat","T_air", + "P_b_front","P_b_rear","Error Type","Speed_fl","Speed_fr","Speed"}; +//"Drehzahl","P_fuel","Index" +int vergleichsindex; +int sizeaalt; +int sizeaneu; +int sizebalt; +int sizebneu; +int sizecalt; +int sizecneu; +int sizedalt; +int sizedneu; +int sizeealt; +int sizeeneu; +uint8_t clearcounter = 56; +uint8_t trcalt = Stw_data.trc; +uint8_t modealt = Stw_data.mode; +uint8_t trccounter;// = Stw_data.trc; +uint8_t modecounter;// = Stw_data.mode; +bool trctimer; +bool modetimer; +int led_s[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; +unsigned long poiltimer; +unsigned long tmottimer; +unsigned long toiltimer; +bool poilbool = true; +bool tmotbool = true; +bool toilbool = true; + +void init_display() { + pinMode(writeprotect, OUTPUT); + digitalWrite(writeprotect, HIGH); + pinMode(reset, OUTPUT); + pinMode(disp_cs, OUTPUT); + pinMode(MOSI, OUTPUT); + pinMode(MISO, OUTPUT); + //pinMode(CLK, INPUT); + digitalWrite(disp_cs, HIGH); + digitalWrite(MOSI, HIGH); + digitalWrite(MISO, HIGH); + digitalWrite(reset, LOW); + //edip.smallProtoSelect(7); + //edip.setNewColor(EA_GREY, 0xe3, 0xe3,0xe3); // redefine r-g-b-values of EA_GREY + //edip.drawImage(0,50,FASTTUBE_LOGO_PNG); + digitalWrite(reset,HIGH); + tft.begin(115200); // start display communication + /*int h = 20; + char charh[2]; + String strh = String(h); + strh.toCharArray(charh,2); + tft.DisplayLight(charh);*/ + tft.cursorOn(false); + tft.terminalOn(false); + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + //tft.setTextFont('4'); + tft.setTextSize(5,8); + tft.clear(); + //tft.displayLight('30'); + tft.drawText(0, 14, 'C', "FaSTTUBe"); //draw some text + //tft.loadImage(0,0,1); + //delay(2000); +} + +double get_value(int a){ + double value; + if (a == 0){ + value = Vehicle_data.gear; + //}else if (a == 11){ + // value = Stw_data.i; + //}else if (a == 1){ + // value = Vehicle_data.revol/2; + }else if (a == 1){ + value = Vehicle_data.t_mot-40; + }else if (a == 5){ + value = 0.0706949*Vehicle_data.u_batt; + }else if (a == 7){ + value = Vehicle_data.t_air-40; + }else if(a == 10){ + value = Stw_data.error_type; + }else if (a == 2){ + value = Vehicle_data.t_oil-40; + }else if (a == 6){ + value = 0.0514*Vehicle_data.p_wat; + //}else if (a == 7){ + // value = 0.0514*Vehicle_data.p_fuel; + }else if (a == 3){ + value = 0.0514*Vehicle_data.p_oil; + }else if (a == 8){ + value = Vehicle_data.p_brake_front; + }else if (a == 9){ + value = Vehicle_data.p_brake_rear; + }else if(a == 4){ + value = 200*Vehicle_data.p_brake_front/(Vehicle_data.p_brake_rear+(2*Vehicle_data.p_brake_front)); + }else if (a == 11){ + value = Vehicle_data.speed_fl; + }else if (a == 12){ + value = Vehicle_data.speed_fr; + }else if(a == 13){ + value = Vehicle_data.speed; + } + return value; +} + +void update_display(){ + if(((millis()-poiltimer)>=20000) and poilbool){ + poilbool = false; + alarm("P_oil"); + } + if(((millis()-tmottimer)>=20000) and tmotbool){ + tmotbool = false; + alarm("T_mot"); + } + if(((millis()-toiltimer)>=10000) and toilbool){ + toilbool = false; + alarm("T_oil"); + } + if((0.0514*Vehicle_data.p_oil)>=0,1 or Vehicle_data.speed == 0){ + poiltimer = millis(); + } + if(((Vehicle_data.t_mot - 40) <= 0x69) or ((Vehicle_data.t_mot - 40)==0xC8)){ + tmottimer = millis(); + } + if((Vehicle_data.t_oil - 40) <= 0x96){ + toiltimer = millis(); + } + if(Stw_data.buttonState1 & Stw_data.buttonState4){ + alarm(""); + } + if(!tft._displaybool){ + tft.cursorOn(false); + if(trcalt!=Stw_data.trc or trctimer == true or Stw_data.buttonStateEnc1 == HIGH){ + display_trc(); + }else if(modealt!=Stw_data.mode or modetimer == true or Stw_data.buttonStateEnc2 == HIGH){ + display_mode(); + }else{ + if(clearcounter>=56){ + tft.clear(); + clearcounter = 0; + } + clearcounter+=1; + if(Stw_data.buttonState4){ + if(Stw_data.displayindex>=sizeof(bezeichnungen)/sizeof(String)-3){ + Stw_data.displayindex = 0; + delay(250); + }else{ + Stw_data.displayindex+=1; + delay(250); + } + } + if(Stw_data.buttonState1){ + if(Stw_data.displayindex<=0){ + Stw_data.displayindex = sizeof(bezeichnungen)/sizeof(String)-3; + delay(250); + }else{ + Stw_data.displayindex-=1; + delay(250); + } + } + if(vergleichsindex!=Stw_data.displayindex){ + tft.clear(); + vergleichsindex=Stw_data.displayindex; + } + int a = sizeof(bezeichnungen[Stw_data.displayindex]); + int g = sizeof(bezeichnungen[Stw_data.displayindex+1]); + int h = sizeof(bezeichnungen[Stw_data.displayindex+2]); + char d[a]; + char e[g]; + char f[h]; + bezeichnungen[Stw_data.displayindex].toCharArray(d,a); + bezeichnungen[Stw_data.displayindex+1].toCharArray(e,g); + bezeichnungen[Stw_data.displayindex+2].toCharArray(f,h); + char b[2]; + char c[5]; + char i[5]; + char j[5]; + char k[5]; + char m[5]; + String str=String(int(get_value(0))); + if(str.equals(String(0))){ + str = "N"; + } + String str1; + String str2; + String str3; + if(Stw_data.displayindex+1==0 or Stw_data.displayindex+1==2 or Stw_data.displayindex+1==1 or Stw_data.displayindex+1==10 or Stw_data.displayindex+1==7 or Stw_data.displayindex+1==11 or Stw_data.displayindex+1==12 or Stw_data.displayindex+1==13){ + str1=String(int(get_value(Stw_data.displayindex+1))); + }else{ + str1=String(get_value(Stw_data.displayindex+1)); + } + if(Stw_data.displayindex+1 == 10){ + if(str1.equals(String(1))){ + str1 = "PC"; + }else if(str1.equals(String(2))){ + str1 = "BSE"; + }else if(str1.equals(String(3))){ + str1 = "APS"; + }else if(str1.equals(String(4))){ + str1 = "ETB"; + }else if(str1.equals(String(0))){ + str1 = "None"; + } + } + if(Stw_data.displayindex+2==0 or Stw_data.displayindex+2==2 or Stw_data.displayindex+2==1 or Stw_data.displayindex+2==10 or Stw_data.displayindex+2==7 or Stw_data.displayindex+2==11 or Stw_data.displayindex+2==12 or Stw_data.displayindex+2==13){ + str2=String(int(get_value(Stw_data.displayindex+2))); + }else{ + str2=String(get_value(Stw_data.displayindex+2)); + } + if(Stw_data.displayindex+2 == 10){ + if(str2.equals(String(1))){ + str2 = "PC"; + }else if(str2.equals(String(2))){ + str2 = "BSE"; + }else if(str2.equals(String(3))){ + str2 = "APS"; + }else if(str2.equals(String(4))){ + str2 = "ETB"; + }else if(str2.equals(String(0))){ + str2 = "None"; + } + } + if(Stw_data.displayindex+3==0 or Stw_data.displayindex+3==2 or Stw_data.displayindex+3==1 or Stw_data.displayindex+3==10 or Stw_data.displayindex+3==7 or Stw_data.displayindex+3==11 or Stw_data.displayindex+3==12 or Stw_data.displayindex+3==13){ + str3=String(int(get_value(Stw_data.displayindex+3))); + }else{ + str3=String(get_value(Stw_data.displayindex+3)); + } + if(Stw_data.displayindex+3 == 10){ + if(str3.equals(String(1))){ + str3 = "PC"; + }else if(str3.equals(String(2))){ + str3 = "BSE"; + }else if(str3.equals(String(3))){ + str3 = "APS"; + }else if(str3.equals(String(4))){ + str3 = "ETB"; + }else if(str3.equals(String(0))){ + str3 = "None"; + } + } + String str5=String(Vehicle_data.revol/2); + String str4=String(0.0514*Vehicle_data.p_fuel); + str.toCharArray(b,2); + str1.toCharArray(c,5); + str2.toCharArray(i,5); + str3.toCharArray(j,5); + str4.toCharArray(k,5); + str5.toCharArray(m,5); + sizeaneu = strlen(c); + sizebneu = strlen(i); + sizecneu = strlen(j); + sizedneu = strlen(k); + sizeeneu = strlen(m); + if(sizeaalt!=sizeaneu){ + tft.clear(); + sizeaalt=sizeaneu; + } + if(sizebalt!=sizebneu){ + tft.clear(); + sizebalt=sizebneu; + } + if(sizecalt!=sizecneu){ + tft.clear(); + sizecalt=sizecneu; + } + if(sizedalt!=sizedneu){ + tft.clear(); + sizedalt=sizedneu; + } + if(sizeealt!=sizeeneu){ + tft.clear(); + sizeealt=sizeeneu; + } + tft.setTextSize(6,8); + tft.drawText(132, 0, 'L', b); + tft.setTextSize(2,7); + tft.drawText(0, 20, 'L', k); + tft.drawText(240, 20, 'L', m); + tft.drawText(0,130, 'L', c); + tft.drawText(120, 130, 'L', i); + tft.drawText(240,130, 'L', j); + tft.setTextSize(1,1); + tft.drawText(136,116, 'L', "Gang"); + tft.drawText(0,116, 'L', "P_fuel"); + tft.drawText(240,116, 'L', "Drehzahl"); + tft.drawText(0,226, 'L', d); + tft.drawText(120,226, 'L', e); + tft.drawText(240,226, 'L', f); + /*if (cleaner){ + tft.setTextSize(5,8); + tft.drawText(0, 14, 'C', "FaSTTUBe"); // draw some text + tft.setTextSize(4,4); + tft.drawText(24, 120, 'C', "insert coin"); // draw some text + tft.drawText(0, 180, 'C', "to continue"); + cleaner = false; + }else{ + tft.setTextSize(5,8); + tft.drawText(0, 14, 'C', "FaSTTUBe"); // draw some text + tft.setTextSize(4,4); + tft.drawText(24, 120, 'C', " "); // draw some text + tft.drawText(0, 180, 'C', " "); + cleaner = true; + } + delay(80);*/ + } + } +} + +void display_trc(){ + if(trcalt!=Stw_data.trc or Stw_data.buttonStateEnc1 == HIGH){ + tft.clear(); + tft.setTextSize(7,8); + tft.setDisplayColor(EA_WHITE,EA_RED); + tft.setTextColor(EA_WHITE,EA_RED); + char trcanzeige[7]; + String str = String("ARB:"); + if(Stw_data.trc==11){ + str+="ED"; + }else{ + str+=String(Stw_data.trc); + } + str.toCharArray(trcanzeige,7); + tft.drawText(0,0,'L'," "); + tft.drawText(0,60,'L'," "); + tft.drawText(0,120,'L'," "); + tft.drawText(0,180,'L'," "); + tft.drawText(15,68,'L',trcanzeige); + trccounter = 0; + trcalt = Stw_data.trc; + trctimer = true; + }else if(trccounter >= 255){ + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + tft.clear(); + trctimer = false; + }else{ + trccounter+=1; + delay(5); + } +} + +void display_mode(){ + if(modealt!=Stw_data.mode or Stw_data.buttonStateEnc2 == HIGH){ + tft.clear(); + tft.setTextSize(6,8); + tft.setDisplayColor(EA_WHITE,EA_RED); + tft.setTextColor(EA_WHITE,EA_RED); + char modeanzeige[7]; + String str = String("MODE:"); + str+=String(Stw_data.mode); + str.toCharArray(modeanzeige,7); + tft.drawText(0,0,'L'," "); + tft.drawText(0,60,'L'," "); + tft.drawText(0,120,'L'," "); + tft.drawText(0,180,'L'," "); + tft.drawText(15,68,'L',modeanzeige); + modecounter = 0; + modealt = Stw_data.mode; + modetimer = true; + }else if(modecounter >= 255){ + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + tft.clear(); + modetimer = false; + }else{ + modecounter+=1; + delay(5); + } +} + +void alarm(String textstr){ + uint8_t x = 1;; + char text[7]; + textstr.toCharArray(text,7); + tft.setTextSize(8,8); + while(x==1){ + if(!tft._displaybool){ + tft.setTextColor(EA_BLACK,EA_RED); + tft.fillDisplayColor(EA_RED); + tft.drawText(5,68,'L',text); + } + for (int j = 0; j < 16; j++){ + digitalWrite(led_s[j], HIGH); + } + delay(100); + if(!tft._displaybool){ + tft.setTextColor(EA_BLACK,EA_WHITE); + tft.fillDisplayColor(EA_WHITE); + tft.drawText(5,68,'L',text); + } + for (int j = 0; j < 16; j++){ + digitalWrite(led_s[j], LOW); + } + delay(100); + if(Stw_data.buttonState1 & Stw_data.buttonState4){ + x=0; + tft.setTextColor(EA_WHITE,EA_BLACK); + } + } +} \ No newline at end of file diff --git a/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.h b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.h new file mode 100644 index 0000000..f3384a5 --- /dev/null +++ b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.h @@ -0,0 +1,28 @@ +#include "Arduino.h" +#include "EDIPTFT.h" +#include "FT_2018_STW_CAN.h" +#include "FT18_STW_INIT.h" +#ifndef FT18_STW_DISPLAY_h + #define FT18_STW_DISPLAY_h + + #define EA_BLACK 1 + #define EA_RED 3 + #define EA_GREY 10 + #define EA_WHITE 8 + + #define MOSI 75 + #define MISO 74 + #define CLK 76 + #define disp_cs 42 + #define reset 43 + #define writeprotect 52 + + + void init_display(void); + void update_display(void); + double get_value(int a); + void display_trc(void); + void display_mode(void); + void alarm(String text); + +#endif \ No newline at end of file diff --git a/lib/FT18_STW_INIT/FT18_STW_INIT.cpp b/lib/FT18_STW_INIT/FT18_STW_INIT.cpp new file mode 100644 index 0000000..6c19bc4 --- /dev/null +++ b/lib/FT18_STW_INIT/FT18_STW_INIT.cpp @@ -0,0 +1,200 @@ +#include "Arduino.h" +#include "FT18_STW_INIT.h" +#include "Bounce2.h" +#include "RotaryEncoder.h" + +volatile stw_data_type Stw_data = {0}; //alles mit 0 initialisieren +volatile vehicle_data_type Vehicle_data = {0}; //alles mit 0 initialisieren +bool enc1PinALast,enc1PinANow,enc2PinALast,enc2PinANow; +int led[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; +bool entprell; +int buttons[] = {button1,button2,button3,button4,button5,button6,enc1PinS,enc2PinS}; +Bounce debouncer[8]; +double val = 0; +double val2 = 0; +RotaryEncoder encoder(enc1PinA,enc1PinB,1,1,50); +RotaryEncoder encoder2(enc2PinA,enc2PinB,1,1,50); +/////////////////////////////////////////////////// +// functions +/////////////////////////////////////////////////// + +void set_pins(){ + pinMode (l,OUTPUT); + for (int thisLed = 0; thisLed < sizeof(led)/sizeof(int); thisLed++) { + pinMode(led[thisLed], OUTPUT); + } + /*pinMode(button1, INPUT); + pinMode(button2, INPUT); + pinMode(button3, INPUT); + pinMode(button4, INPUT); + pinMode(button5, INPUT); + pinMode(button6, INPUT);*/ + pinMode(enc1PinA, INPUT); + pinMode(enc1PinB, INPUT); + //pinMode(enc1PinS, INPUT); + pinMode(enc2PinA, INPUT); + pinMode(enc2PinB, INPUT); + //pinMode(enc2PinS, INPUT); + //Stw_data.i=0; + enc1PinALast=LOW; + enc1PinANow=LOW; + enc2PinALast=LOW; + enc2PinANow=LOW; + for(int i = 0; i < 8; i++){ + pinMode(buttons[i], INPUT); + debouncer[i].attach(buttons[i]); + debouncer[i].interval(10); + } +} + +void read_buttons(){ + /*entprell = digitalRead(button3); + delay(10); + if(digitalRead(button3)){ + Stw_data.Stw_auto_shift = entprell; + } + entprell = digitalRead(button2); + delay(10); + if(digitalRead(button2)){ + Stw_data.Stw_neutral = entprell; + } + entprell = digitalRead(button1); + delay(10); + if(digitalRead(button1)){ + Stw_data.buttonState1 = entprell; + } + entprell = digitalRead(button6); + delay(10); + if(digitalRead(button6)){ + Stw_data.Stw_shift_up = entprell; + } + entprell = digitalRead(button5); + delay(10); + if(digitalRead(button5)){ + Stw_data.Stw_shift_down = entprell; + } + entprell = digitalRead(button4); + delay(10); + if(digitalRead(button4)){ + Stw_data.buttonState4 = entprell; + } + entprell = digitalRead(enc1PinS); + delay(10); + if(digitalRead(enc1PinS)){ + Stw_data.buttonStateEnc1 = entprell; + } + entprell = digitalRead(enc2PinS); + delay(10); + if(digitalRead(enc2PinS)){ + Stw_data.buttonStateEnc2 = entprell; + }*/ + Stw_data.Stw_auto_shift = digitalRead(button3); + Stw_data.Stw_neutral = digitalRead(button2); + Stw_data.buttonState1 = digitalRead(button1); + Stw_data.Stw_shift_up = digitalRead(button6); + Stw_data.Stw_shift_down = digitalRead(button5); + Stw_data.buttonState4 = digitalRead(button4); + Stw_data.buttonStateEnc1 = digitalRead(enc1PinS); + Stw_data.buttonStateEnc2 = digitalRead(enc2PinS); + + /*for(int i = 0;i < 8; i++){ + debouncer[i].update(); + } + debouncer[2].update(); + if(debouncer[2].fell()){ + Stw_data.Stw_auto_shift = HIGH; + } + if(debouncer[1].fell()){ + Stw_data.Stw_neutral = digitalRead(button2); + } + if(debouncer[0].fell()){ + Stw_data.buttonState1 = digitalRead(button1); + } + if(debouncer[5].fell()){ + Stw_data.Stw_shift_up = digitalRead(button6); + } + if(debouncer[4].fell()){ + Stw_data.Stw_shift_down = digitalRead(button5); + } + if(debouncer[3].fell()){ + Stw_data.buttonState4 = digitalRead(button4); + } + if(debouncer[6].fell()){ + Stw_data.buttonStateEnc1 = digitalRead(enc1PinS); + } + if(debouncer[7].fell()){ + Stw_data.buttonStateEnc2 = digitalRead(enc2PinS); + }*/ + } + +void read_rotary(){ + int enc = encoder.readEncoder(); + int enc2 = encoder2.readEncoder(); + if(enc != 0){ + val = val +0.5*enc; + if (val==1 or val ==-1){ + if(Stw_data.trc==0 and enc<0){ + Stw_data.trc = 11; + }else if(Stw_data.trc==11 and enc>0){ + Stw_data.trc=0; + }else{ + Stw_data.trc = Stw_data.trc + enc; + } + val = 0; + } + } + /*enc1PinANow = digitalRead(enc1PinA); + enc2PinANow = digitalRead(enc2PinA); + if ((enc1PinALast == LOW) && (enc1PinANow == HIGH)) { + if (digitalRead(enc1PinB) == HIGH) { + if(Stw_data.trc==0){ + Stw_data.trc = 5; + }else{ + Stw_data.trc--; + } + }else { + if(Stw_data.trc==5){ + Stw_data.trc=0; + }else{ + Stw_data.trc++; + } + } + } + enc1PinALast = enc1PinANow; + /*if (Stw_data.buttonStateEnc1 == HIGH){ + digitalWrite(led[Stw_data.i], HIGH); + }*/ + if(enc2 != 0){ + val2 = val2 +0.5*enc2; + if(val2==1 or val2==-1){ + if((Stw_data.mode==1 or Stw_data.mode==0) and enc2<0){ + Stw_data.mode = 5; + }else if(Stw_data.mode==5 and enc2>0){ + Stw_data.mode=1; + }else{ + Stw_data.mode = Stw_data.mode + enc2; + } + val2=0; + } + } + /*if ((enc2PinALast == LOW) && (enc2PinANow == HIGH)) { + //if(enc2PinALast != enc2PinANow){ + if (digitalRead(enc2PinB) == HIGH) { + if(Stw_data.i==0){ + Stw_data.i = sizeof(led)/sizeof(int)-1; + }else{ + Stw_data.i--; + } + }else { + if(Stw_data.i==sizeof(led)/sizeof(int)-1){ + Stw_data.i=0; + }else{ + Stw_data.i++; + } + } + } + enc2PinALast = enc2PinANow;*/ + /*if (Stw_data.buttonStateEnc2 == HIGH){ + digitalWrite(led[Stw_data.i], HIGH); + }*/ +} diff --git a/lib/FT18_STW_INIT/FT18_STW_INIT.h b/lib/FT18_STW_INIT/FT18_STW_INIT.h new file mode 100644 index 0000000..7df5c0f --- /dev/null +++ b/lib/FT18_STW_INIT/FT18_STW_INIT.h @@ -0,0 +1,101 @@ +#include "Arduino.h" +#ifndef FT18_STW_Init +#define FT18_STW_Init + +#define l 78 //test_led +#define led1 12//PD8 +#define led2 11//PD7 +#define led3 9//PC21 +#define led4 8//PC22 +#define led5 7//PC23 +#define led6 6//PC24 +#define led7 5//PC25 +#define led8 4//PC26 und PA29 +#define led9 3//PC28 +#define led10 2//PB25 +#define led11 10//PC29 und PA28 +#define led12 22//PB26 +#define led13 19//PA10 +#define led14 13//PB27 +#define led15 17//PA12 +#define led16 18//PA11 +#define button1 48//bl +#define button2 47//gl +#define button3 44//gr +#define button4 46//br +#define button5 45//sl +#define button6 49//sr +#define enc1PinA 37 +#define enc1PinB 38 +#define enc1PinS 35 +#define enc2PinA 40 +#define enc2PinB 41 +#define enc2PinS 39 + + +// define Drehzahlgrenzen TODOOOO + #define RPM_THRES_1 1000 + #define RPM_THRES_2 6000 + #define RPM_THRES_3 7000 + #define RPM_THRES_4 8000 + #define RPM_THRES_5 10000 + #define RPM_THRES_6 14000 + #define RPM_THRES_7 17000 + #define RPM_THRES_8 18000 + #define RPM_THRES_9 20000 + #define RPM_THRES_10 20000 + + +void set_pins(void); +void read_buttons(void); +void read_rotary(void); // read rotary switches + +typedef struct + { + uint8_t Stw_shift_up; // 1 Bit 0 + uint8_t Stw_shift_down; // 1 Bit 1 + uint8_t Stw_neutral; // 1 Bit 2 + uint8_t Stw_auto_shift; // 1 Bit 3 + uint8_t buttonState1; // 1 Bit 4 + uint8_t buttonState4; // 1 Bit 5 + //bool CAN_toggle; + //bool CAN_check; + //uint8_t i; //Index linker Drehschalter + uint8_t buttonStateEnc1; // button + //uint8_t br; //test mode : mittlere Drehschalter position + uint8_t buttonStateEnc2; //button + uint8_t displayindex; //index für Displayanzeige + uint8_t error_type; //Extrainfos über Error-LED + uint8_t trc; + uint8_t mode; + + } stw_data_type; + + typedef struct + { + uint8_t e_thro; // E-Drossel + uint8_t g_auto; // Auto-Shift + uint8_t gear; // Gang + uint16_t revol; // Drehzahl + uint8_t t_oil; // Öl-Motor-Temperatur + uint8_t t_mot; // Wasser-Motor-Temperatur + uint8_t t_air; // LLK-Temperatur + uint8_t u_batt; // Batteriespannung + uint8_t rev_lim; // Drehzahllimit Bit + uint8_t p_wat; + uint8_t p_fuel; + uint8_t p_oil; + uint8_t p_brake_front; + uint8_t p_brake_rear; + uint8_t speed_fl; + uint8_t speed_fr; + uint8_t speed; + + } vehicle_data_type; + + + extern volatile stw_data_type Stw_data; + extern volatile vehicle_data_type Vehicle_data; + + +#endif \ No newline at end of file diff --git a/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.cpp b/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.cpp new file mode 100644 index 0000000..ccb76aa --- /dev/null +++ b/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.cpp @@ -0,0 +1,407 @@ +#include "Arduino.h" +#include "EDIPTFT.h" +#include "FT_2018e_STW_CAN.h" +#include "FT18e_STW_INIT.h" +#include "FT18e_STW_DISPLAY.h" + +EDIPTFT tft(true,false); +String bezeichnungen[]={"Batterieleistung","Moment","Batterietemp"}; + //"T_mot","T_oil","P_oil","% fa","U_batt","P_wat","T_air", + //"P_b_front","P_b_rear","Error Type","Speed_fl","Speed_fr","Speed"}; +//"Drehzahl","P_fuel","Index" +int vergleichsindex; +int sizeaalt; +int sizeaneu; +int sizebalt; +int sizebneu; +int sizecalt; +int sizecneu; +int sizedalt; +int sizedneu; +int sizeealt; +int sizeeneu; +uint8_t clearcounter = 56; +uint8_t trcalt = Stw_data.trc; +uint8_t modealt = Stw_data.mode; +uint8_t trccounter;// = Stw_data.trc; +uint8_t modecounter;// = Stw_data.mode; +bool trctimer; +bool modetimer; +int led_s[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; +unsigned long poiltimer; +unsigned long tmottimer; +unsigned long toiltimer; +bool poilbool = true; +bool tmotbool = true; +bool toilbool = true; + +void init_display() { + pinMode(writeprotect, OUTPUT); + digitalWrite(writeprotect, HIGH); + pinMode(reset, OUTPUT); + pinMode(disp_cs, OUTPUT); + pinMode(MOSI, OUTPUT); + pinMode(MISO, OUTPUT); + //pinMode(CLK, INPUT); + digitalWrite(disp_cs, HIGH); + digitalWrite(MOSI, HIGH); + digitalWrite(MISO, HIGH); + digitalWrite(reset, LOW); + //edip.smallProtoSelect(7); + //edip.setNewColor(EA_GREY, 0xe3, 0xe3,0xe3); // redefine r-g-b-values of EA_GREY + //edip.drawImage(0,50,FASTTUBE_LOGO_PNG); + digitalWrite(reset,HIGH); + tft.begin(115200); // start display communication + /*int h = 20; + char charh[2]; + String strh = String(h); + strh.toCharArray(charh,2); + tft.DisplayLight(charh);*/ + tft.cursorOn(false); + tft.terminalOn(false); + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + //tft.setTextFont('4'); + tft.setTextSize(5,8); + tft.clear(); + //tft.displayLight('30'); + tft.drawText(0, 14, 'C', "FaSTTUBe"); //draw some text + //tft.loadImage(0,0,1); + //delay(2000); +} + +double get_value(int a){ + double value; + if (a == 0){ + value = Vehicle_data.gear; + //}else if (a == 11){ + // value = Stw_data.i; + //}else if (a == 1){ + // value = Vehicle_data.revol/2; + }else if (a == 1){ + value = Vehicle_data.t_mot;//-40; + }else if (a == 5){ + value = 0.0706949*Vehicle_data.u_batt; + }else if (a == 7){ + value = Vehicle_data.t_air;//-40; + }else if(a == 10){ + value = Stw_data.error_type; + }else if (a == 2){ + value = Vehicle_data.t_oil;//-40; + }else if (a == 6){ + value = 0.0514*Vehicle_data.p_wat; + //}else if (a == 7){ + // value = 0.0514*Vehicle_data.p_fuel; + }else if (a == 3){ + value = 0.0514*Vehicle_data.p_oil; + }else if (a == 8){ + value = Vehicle_data.p_brake_front; + }else if (a == 9){ + value = Vehicle_data.p_brake_rear; + }else if(a == 4){ + value = 200*Vehicle_data.p_brake_front/(Vehicle_data.p_brake_rear+(2*Vehicle_data.p_brake_front)); + }else if (a == 11){ + value = Vehicle_data.speed_fl; + }else if (a == 12){ + value = Vehicle_data.speed_fr; + }else if(a == 13){ + value = Vehicle_data.speed; + } + return value; +} + +void update_display(){ + /*if(((millis()-poiltimer)>=20000) and poilbool){ + poilbool = false; + alarm("P_oil"); + } + if(((millis()-tmottimer)>=20000) and tmotbool){ + tmotbool = false; + alarm("T_mot"); + } + if(((millis()-toiltimer)>=10000) and toilbool){ + toilbool = false; + alarm("T_oil"); + } + if((0.0514*Vehicle_data.p_oil)>=0,1 or Vehicle_data.speed == 0){ + poiltimer = millis(); + } + if(((Vehicle_data.t_mot - 40) <= 0x69) or ((Vehicle_data.t_mot - 40)==0xC8)){ + tmottimer = millis(); + } + if((Vehicle_data.t_oil - 40) <= 0x96){ + toiltimer = millis(); + }*/ + if(Stw_data.buttonState1 & Stw_data.buttonState4){ + alarm(""); + } + if(!tft._displaybool){ + tft.cursorOn(false); + if(trcalt!=Stw_data.trc or trctimer == true or Stw_data.buttonStateEnc1 == HIGH){ + display_trc(); + }else if(modealt!=Stw_data.mode or modetimer == true or Stw_data.buttonStateEnc2 == HIGH){ + display_mode(); + }else{ + if(clearcounter>=56){ + tft.clear(); + clearcounter = 0; + } + clearcounter+=1; + if(Stw_data.buttonState4){ + if(Stw_data.displayindex>=sizeof(bezeichnungen)/sizeof(String)-3){ + Stw_data.displayindex = 0; + delay(250); + }else{ + Stw_data.displayindex+=1; + delay(250); + } + } + if(Stw_data.buttonState1){ + if(Stw_data.displayindex<=0){ + Stw_data.displayindex = sizeof(bezeichnungen)/sizeof(String)-3; + delay(250); + }else{ + Stw_data.displayindex-=1; + delay(250); + } + } + if(vergleichsindex!=Stw_data.displayindex){ + tft.clear(); + vergleichsindex=Stw_data.displayindex; + } + int a = sizeof(bezeichnungen[Stw_data.displayindex]); + int g = sizeof(bezeichnungen[Stw_data.displayindex+1]); + int h = sizeof(bezeichnungen[Stw_data.displayindex+2]); + char d[a]; + char e[g]; + char f[h]; + bezeichnungen[Stw_data.displayindex].toCharArray(d,a); + bezeichnungen[Stw_data.displayindex+1].toCharArray(e,g); + bezeichnungen[Stw_data.displayindex+2].toCharArray(f,h); + char b[2]; + char c[5]; + char i[5]; + char j[5]; + char k[5]; + char m[5]; + String str=String(int(get_value(0))); + /*if(str.equals(String(0))){ + str = "N"; + }*/ + String str1; + String str2; + String str3; + if(Stw_data.displayindex+1==0 or Stw_data.displayindex+1==2 or Stw_data.displayindex+1==1 or Stw_data.displayindex+1==10 or Stw_data.displayindex+1==7 or Stw_data.displayindex+1==11 or Stw_data.displayindex+1==12 or Stw_data.displayindex+1==13){ + str1=String(int(get_value(Stw_data.displayindex+1))); + }else{ + str1=String(get_value(Stw_data.displayindex+1)); + } + /*if(Stw_data.displayindex+1 == 10){ + if(str1.equals(String(1))){ + str1 = "PC"; + }else if(str1.equals(String(2))){ + str1 = "BSE"; + }else if(str1.equals(String(3))){ + str1 = "APS"; + }else if(str1.equals(String(4))){ + str1 = "ETB"; + }else if(str1.equals(String(0))){ + str1 = "None"; + } + }*/ + if(Stw_data.displayindex+2==0 or Stw_data.displayindex+2==2 or Stw_data.displayindex+2==1 or Stw_data.displayindex+2==10 or Stw_data.displayindex+2==7 or Stw_data.displayindex+2==11 or Stw_data.displayindex+2==12 or Stw_data.displayindex+2==13){ + str2=String(int(get_value(Stw_data.displayindex+2))); + }else{ + str2=String(get_value(Stw_data.displayindex+2)); + } + /*if(Stw_data.displayindex+2 == 10){ + if(str2.equals(String(1))){ + str2 = "PC"; + }else if(str2.equals(String(2))){ + str2 = "BSE"; + }else if(str2.equals(String(3))){ + str2 = "APS"; + }else if(str2.equals(String(4))){ + str2 = "ETB"; + }else if(str2.equals(String(0))){ + str2 = "None"; + } + }*/ + if(Stw_data.displayindex+3==0 or Stw_data.displayindex+3==2 or Stw_data.displayindex+3==1 or Stw_data.displayindex+3==10 or Stw_data.displayindex+3==7 or Stw_data.displayindex+3==11 or Stw_data.displayindex+3==12 or Stw_data.displayindex+3==13){ + str3=String(int(get_value(Stw_data.displayindex+3))); + }else{ + str3=String(get_value(Stw_data.displayindex+3)); + } + /*if(Stw_data.displayindex+3 == 10){ + if(str3.equals(String(1))){ + str3 = "PC"; + }else if(str3.equals(String(2))){ + str3 = "BSE"; + }else if(str3.equals(String(3))){ + str3 = "APS"; + }else if(str3.equals(String(4))){ + str3 = "ETB"; + }else if(str3.equals(String(0))){ + str3 = "None"; + } + }*/ + String str5=String(Vehicle_data.revol/2); + String str4=String(0.0514*Vehicle_data.p_fuel); + str.toCharArray(b,2); + str1.toCharArray(c,5); + str2.toCharArray(i,5); + str3.toCharArray(j,5); + str4.toCharArray(k,5); + str5.toCharArray(m,5); + sizeaneu = strlen(c); + sizebneu = strlen(i); + sizecneu = strlen(j); + sizedneu = strlen(k); + sizeeneu = strlen(m); + if(sizeaalt!=sizeaneu){ + tft.clear(); + sizeaalt=sizeaneu; + } + if(sizebalt!=sizebneu){ + tft.clear(); + sizebalt=sizebneu; + } + if(sizecalt!=sizecneu){ + tft.clear(); + sizecalt=sizecneu; + } + if(sizedalt!=sizedneu){ + tft.clear(); + sizedalt=sizedneu; + } + if(sizeealt!=sizeeneu){ + tft.clear(); + sizeealt=sizeeneu; + } + tft.setTextSize(6,8); + tft.drawText(132, 0, 'L', b); + tft.setTextSize(2,7); + tft.drawText(0, 20, 'L', k); + tft.drawText(240, 20, 'L', m); + tft.drawText(0,130, 'L', c); + tft.drawText(120, 130, 'L', i); + tft.drawText(240,130, 'L', j); + tft.setTextSize(1,1); + tft.drawText(136,116, 'L', "Energiemodus"); + tft.drawText(0,116, 'L', "U_Batt"); + tft.drawText(240,116, 'L', "Drehzahl"); + tft.drawText(0,226, 'L', d); + tft.drawText(120,226, 'L', e); + tft.drawText(240,226, 'L', f); + /*if (cleaner){ + tft.setTextSize(5,8); + tft.drawText(0, 14, 'C', "FaSTTUBe"); // draw some text + tft.setTextSize(4,4); + tft.drawText(24, 120, 'C', "insert coin"); // draw some text + tft.drawText(0, 180, 'C', "to continue"); + cleaner = false; + }else{ + tft.setTextSize(5,8); + tft.drawText(0, 14, 'C', "FaSTTUBe"); // draw some text + tft.setTextSize(4,4); + tft.drawText(24, 120, 'C', " "); // draw some text + tft.drawText(0, 180, 'C', " "); + cleaner = true; + } + delay(80);*/ + } + } +} + +void display_trc(){ + if(trcalt!=Stw_data.trc or Stw_data.buttonStateEnc1 == HIGH){ + tft.clear(); + tft.setTextSize(7,8); + tft.setDisplayColor(EA_WHITE,EA_RED); + tft.setTextColor(EA_WHITE,EA_RED); + char trcanzeige[7]; + String str = String("ARB:"); + if(Stw_data.trc==11){ + str+="ED"; + }else{ + str+=String(Stw_data.trc); + } + str.toCharArray(trcanzeige,7); + tft.drawText(0,0,'L'," "); + tft.drawText(0,60,'L'," "); + tft.drawText(0,120,'L'," "); + tft.drawText(0,180,'L'," "); + tft.drawText(15,68,'L',trcanzeige); + trccounter = 0; + trcalt = Stw_data.trc; + trctimer = true; + }else if(trccounter >= 255){ + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + tft.clear(); + trctimer = false; + }else{ + trccounter+=1; + delay(5); + } +} + +void display_mode(){ + if(modealt!=Stw_data.mode or Stw_data.buttonStateEnc2 == HIGH){ + tft.clear(); + tft.setTextSize(6,8); + tft.setDisplayColor(EA_WHITE,EA_RED); + tft.setTextColor(EA_WHITE,EA_RED); + char modeanzeige[7]; + String str = String("MODE:"); + str+=String(Stw_data.mode); + str.toCharArray(modeanzeige,7); + tft.drawText(0,0,'L'," "); + tft.drawText(0,60,'L'," "); + tft.drawText(0,120,'L'," "); + tft.drawText(0,180,'L'," "); + tft.drawText(15,68,'L',modeanzeige); + modecounter = 0; + modealt = Stw_data.mode; + modetimer = true; + }else if(modecounter >= 255){ + tft.setDisplayColor(EA_WHITE,EA_BLACK); + tft.setTextColor(EA_WHITE,EA_BLACK); + tft.clear(); + modetimer = false; + }else{ + modecounter+=1; + delay(5); + } +} + +void alarm(String textstr){ + uint8_t x = 1;; + char text[7]; + textstr.toCharArray(text,7); + tft.setTextSize(8,8); + while(x==1){ + if(!tft._displaybool){ + tft.setTextColor(EA_BLACK,EA_RED); + tft.fillDisplayColor(EA_RED); + tft.drawText(5,68,'L',text); + } + for (int j = 0; j < 16; j++){ + digitalWrite(led_s[j], HIGH); + } + delay(100); + if(!tft._displaybool){ + tft.setTextColor(EA_BLACK,EA_WHITE); + tft.fillDisplayColor(EA_WHITE); + tft.drawText(5,68,'L',text); + } + for (int j = 0; j < 16; j++){ + digitalWrite(led_s[j], LOW); + } + delay(100); + if(Stw_data.buttonState1 & Stw_data.buttonState4){ + x=0; + tft.setTextColor(EA_WHITE,EA_BLACK); + } + } +} \ No newline at end of file diff --git a/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.h b/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.h new file mode 100644 index 0000000..17d74c6 --- /dev/null +++ b/lib/FT18e_STW_DISPLAY/FT18e_STW_DISPLAY.h @@ -0,0 +1,28 @@ +#include "Arduino.h" +#include "EDIPTFT.h" +#include "FT_2018e_STW_CAN.h" +#include "FT18e_STW_INIT.h" +#ifndef FT18e_STW_DISPLAY_h + #define FT18e_STW_DISPLAY_h + + #define EA_BLACK 1 + #define EA_RED 3 + #define EA_GREY 10 + #define EA_WHITE 8 + + #define MOSI 75 + #define MISO 74 + #define CLK 76 + #define disp_cs 42 + #define reset 43 + #define writeprotect 52 + + + void init_display(void); + void update_display(void); + double get_value(int a); + void display_trc(void); + void display_mode(void); + void alarm(String text); + +#endif \ No newline at end of file diff --git a/lib/FT18e_STW_INIT/FT18e_STW_INIT.cpp b/lib/FT18e_STW_INIT/FT18e_STW_INIT.cpp new file mode 100644 index 0000000..b5813b8 --- /dev/null +++ b/lib/FT18e_STW_INIT/FT18e_STW_INIT.cpp @@ -0,0 +1,200 @@ +#include "Arduino.h" +#include "FT18e_STW_INIT.h" +#include "Bounce2.h" +#include "RotaryEncoder.h" + +volatile stw_data_type Stw_data = {0}; //alles mit 0 initialisieren +volatile vehicle_data_type Vehicle_data = {0}; //alles mit 0 initialisieren +bool enc1PinALast,enc1PinANow,enc2PinALast,enc2PinANow; +int led[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; +bool entprell; +int buttons[] = {button1,button2,button3,button4,button5,button6,enc1PinS,enc2PinS}; +Bounce debouncer[8]; +double val = 0; +double val2 = 0; +RotaryEncoder encoder(enc1PinA,enc1PinB,1,1,50); +RotaryEncoder encoder2(enc2PinA,enc2PinB,1,1,50); +/////////////////////////////////////////////////// +// functions +/////////////////////////////////////////////////// + +void set_pins(){ + pinMode (l,OUTPUT); + for (int thisLed = 0; thisLed < sizeof(led)/sizeof(int); thisLed++) { + pinMode(led[thisLed], OUTPUT); + } + /*pinMode(button1, INPUT); + pinMode(button2, INPUT); + pinMode(button3, INPUT); + pinMode(button4, INPUT); + pinMode(button5, INPUT); + pinMode(button6, INPUT);*/ + pinMode(enc1PinA, INPUT); + pinMode(enc1PinB, INPUT); + //pinMode(enc1PinS, INPUT); + pinMode(enc2PinA, INPUT); + pinMode(enc2PinB, INPUT); + //pinMode(enc2PinS, INPUT); + //Stw_data.i=0; + enc1PinALast=LOW; + enc1PinANow=LOW; + enc2PinALast=LOW; + enc2PinANow=LOW; + for(int i = 0; i < 8; i++){ + pinMode(buttons[i], INPUT); + debouncer[i].attach(buttons[i]); + debouncer[i].interval(10); + } +} + +void read_buttons(){ + /*entprell = digitalRead(button3); + delay(10); + if(digitalRead(button3)){ + Stw_data.Stw_auto_shift = entprell; + } + entprell = digitalRead(button2); + delay(10); + if(digitalRead(button2)){ + Stw_data.Stw_neutral = entprell; + } + entprell = digitalRead(button1); + delay(10); + if(digitalRead(button1)){ + Stw_data.buttonState1 = entprell; + } + entprell = digitalRead(button6); + delay(10); + if(digitalRead(button6)){ + Stw_data.Stw_shift_up = entprell; + } + entprell = digitalRead(button5); + delay(10); + if(digitalRead(button5)){ + Stw_data.Stw_shift_down = entprell; + } + entprell = digitalRead(button4); + delay(10); + if(digitalRead(button4)){ + Stw_data.buttonState4 = entprell; + } + entprell = digitalRead(enc1PinS); + delay(10); + if(digitalRead(enc1PinS)){ + Stw_data.buttonStateEnc1 = entprell; + } + entprell = digitalRead(enc2PinS); + delay(10); + if(digitalRead(enc2PinS)){ + Stw_data.buttonStateEnc2 = entprell; + }*/ + Stw_data.Stw_auto_shift = digitalRead(button3); + Stw_data.Stw_neutral = digitalRead(button2); + Stw_data.buttonState1 = digitalRead(button1); + Stw_data.Stw_shift_up = digitalRead(button6); + Stw_data.Stw_shift_down = digitalRead(button5); + Stw_data.buttonState4 = digitalRead(button4); + Stw_data.buttonStateEnc1 = digitalRead(enc1PinS); + Stw_data.buttonStateEnc2 = digitalRead(enc2PinS); + + /*for(int i = 0;i < 8; i++){ + debouncer[i].update(); + } + debouncer[2].update(); + if(debouncer[2].fell()){ + Stw_data.Stw_auto_shift = HIGH; + } + if(debouncer[1].fell()){ + Stw_data.Stw_neutral = digitalRead(button2); + } + if(debouncer[0].fell()){ + Stw_data.buttonState1 = digitalRead(button1); + } + if(debouncer[5].fell()){ + Stw_data.Stw_shift_up = digitalRead(button6); + } + if(debouncer[4].fell()){ + Stw_data.Stw_shift_down = digitalRead(button5); + } + if(debouncer[3].fell()){ + Stw_data.buttonState4 = digitalRead(button4); + } + if(debouncer[6].fell()){ + Stw_data.buttonStateEnc1 = digitalRead(enc1PinS); + } + if(debouncer[7].fell()){ + Stw_data.buttonStateEnc2 = digitalRead(enc2PinS); + }*/ + } + +void read_rotary(){ + int enc = encoder.readEncoder(); + int enc2 = encoder2.readEncoder(); + if(enc != 0){ + val = val +0.5*enc; + if (val==1 or val ==-1){ + if(Stw_data.trc==0 and enc<0){ + Stw_data.trc = 11; + }else if(Stw_data.trc==11 and enc>0){ + Stw_data.trc=0; + }else{ + Stw_data.trc = Stw_data.trc + enc; + } + val = 0; + } + } + /*enc1PinANow = digitalRead(enc1PinA); + enc2PinANow = digitalRead(enc2PinA); + if ((enc1PinALast == LOW) && (enc1PinANow == HIGH)) { + if (digitalRead(enc1PinB) == HIGH) { + if(Stw_data.trc==0){ + Stw_data.trc = 5; + }else{ + Stw_data.trc--; + } + }else { + if(Stw_data.trc==5){ + Stw_data.trc=0; + }else{ + Stw_data.trc++; + } + } + } + enc1PinALast = enc1PinANow; + /*if (Stw_data.buttonStateEnc1 == HIGH){ + digitalWrite(led[Stw_data.i], HIGH); + }*/ + if(enc2 != 0){ + val2 = val2 +0.5*enc2; + if(val2==1 or val2==-1){ + if((Stw_data.mode==1 or Stw_data.mode==0) and enc2<0){ + Stw_data.mode = 5; + }else if(Stw_data.mode==5 and enc2>0){ + Stw_data.mode=1; + }else{ + Stw_data.mode = Stw_data.mode + enc2; + } + val2=0; + } + } + /*if ((enc2PinALast == LOW) && (enc2PinANow == HIGH)) { + //if(enc2PinALast != enc2PinANow){ + if (digitalRead(enc2PinB) == HIGH) { + if(Stw_data.i==0){ + Stw_data.i = sizeof(led)/sizeof(int)-1; + }else{ + Stw_data.i--; + } + }else { + if(Stw_data.i==sizeof(led)/sizeof(int)-1){ + Stw_data.i=0; + }else{ + Stw_data.i++; + } + } + } + enc2PinALast = enc2PinANow;*/ + /*if (Stw_data.buttonStateEnc2 == HIGH){ + digitalWrite(led[Stw_data.i], HIGH); + }*/ +} \ No newline at end of file diff --git a/lib/FT18e_STW_INIT/FT18e_STW_INIT.h b/lib/FT18e_STW_INIT/FT18e_STW_INIT.h new file mode 100644 index 0000000..c77e8f3 --- /dev/null +++ b/lib/FT18e_STW_INIT/FT18e_STW_INIT.h @@ -0,0 +1,101 @@ +#include "Arduino.h" +#ifndef FT18e_STW_Init +#define FT18e_STW_Init + +#define l 78 //test_led +#define led1 12//PD8 +#define led2 11//PD7 +#define led3 9//PC21 +#define led4 8//PC22 +#define led5 7//PC23 +#define led6 6//PC24 +#define led7 5//PC25 +#define led8 4//PC26 und PA29 +#define led9 3//PC28 +#define led10 2//PB25 +#define led11 10//PC29 und PA28 +#define led12 22//PB26 +#define led13 19//PA10 +#define led14 13//PB27 +#define led15 17//PA12 +#define led16 18//PA11 +#define button1 48//bl +#define button2 47//gl +#define button3 44//gr +#define button4 46//br +#define button5 45//sl +#define button6 49//sr +#define enc1PinA 37 +#define enc1PinB 38 +#define enc1PinS 35 +#define enc2PinA 40 +#define enc2PinB 41 +#define enc2PinS 39 + + +// define Drehzahlgrenzen TODOOOO + #define RPM_THRES_1 1000 + #define RPM_THRES_2 6000 + #define RPM_THRES_3 7000 + #define RPM_THRES_4 8000 + #define RPM_THRES_5 10000 + #define RPM_THRES_6 14000 + #define RPM_THRES_7 17000 + #define RPM_THRES_8 18000 + #define RPM_THRES_9 20000 + #define RPM_THRES_10 20000 + + +void set_pins(void); +void read_buttons(void); +void read_rotary(void); // read rotary switches + +typedef struct + { + uint8_t Stw_shift_up; // 1 Bit 0 + uint8_t Stw_shift_down; // 1 Bit 1 + uint8_t Stw_neutral; // 1 Bit 2 + uint8_t Stw_auto_shift; // 1 Bit 3 + uint8_t buttonState1; // 1 Bit 4 + uint8_t buttonState4; // 1 Bit 5 + //bool CAN_toggle; + //bool CAN_check; + //uint8_t i; //Index linker Drehschalter + uint8_t buttonStateEnc1; // button + //uint8_t br; //test mode : mittlere Drehschalter position + uint8_t buttonStateEnc2; //button + uint8_t displayindex; //index für Displayanzeige + uint8_t error_type; //Extrainfos über Error-LED + uint8_t trc; + uint8_t mode; + + } stw_data_type; + + typedef struct + { + uint8_t e_thro; // E-Drossel + uint8_t g_auto; // Auto-Shift + uint8_t gear; // Gang + uint16_t revol; // Drehzahl + uint8_t t_oil; // Öl-Motor-Temperatur + uint8_t t_mot; // Wasser-Motor-Temperatur + uint8_t t_air; // LLK-Temperatur + uint8_t u_batt; // Batteriespannung + uint8_t rev_lim; // Drehzahllimit Bit + uint8_t p_wat; + uint8_t p_fuel; + uint8_t p_oil; + uint8_t p_brake_front; + uint8_t p_brake_rear; + uint8_t speed_fl; + uint8_t speed_fr; + uint8_t speed; + + } vehicle_data_type; + + + extern volatile stw_data_type Stw_data; + extern volatile vehicle_data_type Vehicle_data; + + +#endif \ No newline at end of file diff --git a/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.cpp b/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.cpp new file mode 100644 index 0000000..b6e7b78 --- /dev/null +++ b/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.cpp @@ -0,0 +1,262 @@ +/* +FT_2018_STW_CAN.cpp +*/ + +#include "Arduino.h" +#include "DueTimer.h" +#include "due_can.h" +#include "FT_2018_STW_CAN.h" +#include "FT18_STW_INIT.h" + +CAN_FRAME can_0_msg; +//can_1_msg.id = 0x110; +int can_0_temp_data = 0; +int leds[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; + + +void Init_Can_0(){ + Can0.begin(1000000); // set CAN0 baud to 1kbit/s and don`t use enable pin! + Can0.setNumTXBoxes(1); // reserves mailbox 0 for tx only 8 mailboxes are available (the other 7 mailboxes are for rx) + Can0.watchFor(0x502); // set CAN RX filter for ID 0x502 and reserves mailbox 1 for rx + Can0.watchFor(0x504); + Can0.watchFor(0x500); + Can0.watchFor(0x773); // set CAN RX filter for ID 0x773 and reserves mailbox 3 for rx + Can0.watchFor(0x775); +// Can0.watchFor(0x777); // set CAN RX filter for ID 0x777 and reserves mailbox 5 for rx + Can0.watchFor(0x779); // set CAN RX filter for ID 0x779 and reserves mailbox 6 for rx + Can0.watchFor(0x77A); + Can0.setGeneralCallback(Receive_Can_0); + Timer3.attachInterrupt(Send_0x110); // set send interrupt + Timer3.start(10000); // Calls every 10ms +} + +void Send_0x110(){ + read_buttons(); + read_rotary(); + can_0_msg.id = 0x110; + can_0_msg.fid = 0; + can_0_msg.rtr = 0; + can_0_msg.priority = 0; + can_0_msg.length = 2; + can_0_msg.extended = 0; + can_0_temp_data = 0; + can_0_temp_data |= Stw_data.Stw_shift_up & 0b00000001; + can_0_temp_data |= Stw_data.Stw_shift_down << 1 & 0b00000010; + can_0_temp_data |= Stw_data.Stw_neutral << 2 & 0b00000100; + can_0_temp_data |= Stw_data.Stw_auto_shift << 3 & 0b00001000; + can_0_temp_data |= Stw_data.buttonStateEnc1 << 5 & 0b00100000; //pitlane + can_0_msg.data.byte[0] = can_0_temp_data; + can_0_msg.data.byte[1] = Stw_data.trc & 0b00001111; + can_0_msg.data.byte[2] = Stw_data.mode & 0b00000111; + if ((Stw_data.Stw_auto_shift << 3 & 0b00001000)){ + if(Vehicle_data.g_auto){ + Vehicle_data.g_auto = false; + }else{ + Vehicle_data.g_auto = true; + } + } + Can0.sendFrame(can_0_msg); +} + +void Receive_Can_0(CAN_FRAME *temp_message){ + switch (temp_message->id) { + //g_auto + case 0x502:{ // eDrossel error bit + Vehicle_data.e_thro = (temp_message->data.byte[0] & 0x80) | (temp_message->data.byte[0] & 0x40) | (temp_message->data.byte[0] & 0x20) | (temp_message->data.byte[0] & 0x10); // bit 4-7 + + if(temp_message->data.byte[0] & 0x80){ + Stw_data.error_type = 1;//"pc_error"; + } + if(temp_message->data.byte[0] & 0x40){ + Stw_data.error_type = 2;//"bse_error"; + } + if(temp_message->data.byte[0] & 0x20){ + Stw_data.error_type = 3;//"aps_error"; + } + if(temp_message->data.byte[0] & 0x10){ + Stw_data.error_type = 4;//"etb_error"; + } + //can_1_temp_data |= g_etb_e << 4; + //can_1_temp_data |= g_aps_e << 5; + //can_1_temp_data |= g_bse_e << 6; + //can_1_temp_data |= g_pc_e << 7; + break; + } + case 0x504:{ //autoshift+gear + //Vehicle_data.g_auto = (temp_message->data.byte[1]) >> 4; + Vehicle_data.gear = (temp_message->data.byte[1]) >> 5; + break; + } + case 0x773:{ // rpm + Vehicle_data.revol = (temp_message->data.byte[4] | temp_message->data.byte[3] << 8); + break; + } + case 0x779:{ // battery voltage + Vehicle_data.u_batt = temp_message->data.byte[6]; + break; + } + /*case 0x77A: // revolution limit bit + Vehicle_data.rev_lim = (temp_message->data.byte[3] & 0x20) >> 4; + switch(temp_message->data.byte[0]) { + case 0x02: // temp. intercooler + Vehicle_data.t_air = temp_message->data.byte[7]; + break; + case 0x05: // temp. water + Vehicle_data.t_mot = temp_message->data.byte[4]; + break; + case 0x04: // temp. oil + Vehicle_data.t_oil = temp_message->data.byte[5]; + case 0x01: { + Vehicle_data.p_wat = temp_message->data.byte[6]; + Vehicle_data.p_fuel = temp_message->data.byte[7]; + Vehicle_data.p_oil = temp_message->data.byte[5]; + break; + } + } + break;*/ + case 0x77A:{//temp und p + //g_ms4_idle_b = (temp_message->data.byte[2] & 0b10000000) >> 7; + //g_ms4_engine_status = (temp_message->data.byte[3] & 0b01000000) >> 6; + //g_ms4_ignoff_b = (temp_message->data.byte[3] & 0b10000000) >> 7; + + if ( temp_message->data.byte[0] == 1){ + Vehicle_data.p_oil = temp_message->data.byte[5]; + Vehicle_data.p_fuel = temp_message->data.byte[7]; + } + else if ( temp_message->data.byte[0] == 2){ + Vehicle_data.t_air = temp_message->data.byte[7]; + } + else if ( temp_message->data.byte[0] == 4){ + Vehicle_data.t_oil = temp_message->data.byte[5]; + } + else if ( temp_message->data.byte[0] == 5){ + Vehicle_data.t_mot = temp_message->data.byte[4]; + } + break; + } + case 0x775:{//speed + Vehicle_data.speed_fl = 2*(temp_message->data.byte[2]); + Vehicle_data.speed_fr = 2*(temp_message->data.byte[3]); + Vehicle_data.speed = (Vehicle_data.speed_fl+Vehicle_data.speed_fr)/2; + break; + } + /*case 0x777:{//m4_gear + Vehicle_data.gear = temp_message->data.byte[0]; + break; + }*/ + case 0x500:{ + Vehicle_data.p_brake_front = temp_message->data.byte[1]; + Vehicle_data.p_brake_rear = temp_message->data.byte[2]; + break; + } + } +} + +void update_LED(){ +//Copyright Michael Dietzel +//m.dietzel@fasttube.de +//Edit Michael Witt 05-2015 +//m.witt@fasttube.de + +//EDIT BAHA ZARROUKI 05-2107 +//z.baha@fasttube.de + +// alle Werte als Hex-Werte angegeben + bool t_oil = (Vehicle_data.t_oil - 40) >= 0x96; // 150°C temp.oil + bool t_air = (Vehicle_data.t_air - 40) >= 0x3C; // 60°C temp.llk + bool t_mot = ((Vehicle_data.t_mot - 40) >= 0x69) and ((Vehicle_data.t_mot - 40)!=0xC8); // 105°C temp.water und !=200 + + bool g_auto = Vehicle_data.g_auto; + bool u_batt = Vehicle_data.u_batt <= 0xB1; // 12.5V batt.spann. + bool e_dros = Vehicle_data.e_thro; // error-bit + + bool rev_lim = Vehicle_data.rev_lim; + + uint16_t rev = Vehicle_data.revol; + + /*if(Vehicle_data.rev_lim){ + for (int j = 0; j < 10; j++){ + digitalWrite(leds[j], HIGH); + //analogWrite(leds[j], STW_data.br); //nur eine der zwei zeilen + } + delay(100); + for (int j = 0; j < 10; j++){ + digitalWrite(leds[j], LOW); + } + delay(100); + }else{*/ + /*uint8_t helligkeit = 20; + if(RPM_THRES_1 <= rev){ + analogWrite(led1, helligkeit); + }else{ + analogWrite(led1, 0); + } + if(RPM_THRES_2 <= rev){ + analogWrite(led2, helligkeit); + }else{ + analogWrite(led2, 0); + } + if(RPM_THRES_3 <= rev){ + analogWrite(led3, helligkeit); + }else{ + analogWrite(led3, 0); + } + if(RPM_THRES_4 <= rev){ + analogWrite(led4, helligkeit); + }else{ + analogWrite(led4, 0); + } + if(RPM_THRES_5 <= rev){ + analogWrite(led5, helligkeit); + }else{ + analogWrite(led5, 0); + } + if(RPM_THRES_6 <= rev){ + analogWrite(led6, helligkeit); + }else{ + analogWrite(led6, 0); + } + if(RPM_THRES_7 <= rev){ + analogWrite(led7, helligkeit); + }else{ + analogWrite(led7, 0); + } + if(RPM_THRES_8 <= rev){ + analogWrite(led8, helligkeit); + }else{ + analogWrite(led8, 0); + } + if(RPM_THRES_9 <= rev){ + analogWrite(led9, helligkeit); + }else{ + analogWrite(led9, 0); + } + if(RPM_THRES_10 <= rev){ + analogWrite(led10, helligkeit); + }else{ + analogWrite(led10, 0); + }*/ + digitalWrite(led1, RPM_THRES_1 <= rev); + digitalWrite(led2, RPM_THRES_2 <= rev); + digitalWrite(led3, RPM_THRES_3 <= rev); + digitalWrite(led4, RPM_THRES_4 <= rev); + digitalWrite(led5, RPM_THRES_5 <= rev); + digitalWrite(led6, RPM_THRES_6 <= rev); + digitalWrite(led7, RPM_THRES_7 <= rev); + digitalWrite(led8, RPM_THRES_8 <= rev); + digitalWrite(led9, RPM_THRES_9 <= rev); + digitalWrite(led10, RPM_THRES_10 <= rev); + + digitalWrite(led11, t_mot); // rot, links, oben + digitalWrite(led12, t_air); // rot, links, mitte + digitalWrite(led13, t_oil); // rot, links, unten + + digitalWrite(led14, e_dros); // rot, rechts, oben + digitalWrite(led15, u_batt); // rot rechts, mitte + digitalWrite(led16, g_auto); // blau rechts, unten + /*if(Vehicle_data.g_auto){ + digitalWrite(led16, HIGH); + }else{ + digitalWrite(led16, LOW); + }*/ +} diff --git a/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.h b/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.h new file mode 100644 index 0000000..57124cd --- /dev/null +++ b/lib/FT_2018_STW_CAN/FT_2018_STW_CAN.h @@ -0,0 +1,12 @@ +/* +FT_2018_STW_CAN.h +*/ + +#include "Arduino.h" +#include "DueTimer.h" +#include "due_can.h" + +void Init_Can_0(); +void Send_0x110(); +void Receive_Can_0(CAN_FRAME *frame); +void update_LED(void); \ No newline at end of file diff --git a/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.cpp b/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.cpp new file mode 100644 index 0000000..669432e --- /dev/null +++ b/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.cpp @@ -0,0 +1,262 @@ +/* +FT_2018_STW_CAN.cpp +*/ + +#include "Arduino.h" +#include "DueTimer.h" +#include "due_can.h" +#include "FT_2018e_STW_CAN.h" +#include "FT18e_STW_INIT.h" + +CAN_FRAME can_0_msg; +//can_1_msg.id = 0x110; +int can_0_temp_data = 0; +int leds[] = {led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16}; + + +void Init_Can_0(){ + Can0.begin(1000000); // set CAN0 baud to 1kbit/s and don`t use enable pin! + Can0.setNumTXBoxes(1); // reserves mailbox 0 for tx only 8 mailboxes are available (the other 7 mailboxes are for rx) + Can0.watchFor(0x502); // set CAN RX filter for ID 0x502 and reserves mailbox 1 for rx + Can0.watchFor(0x504); + Can0.watchFor(0x500); + Can0.watchFor(0x773); // set CAN RX filter for ID 0x773 and reserves mailbox 3 for rx + Can0.watchFor(0x775); +// Can0.watchFor(0x777); // set CAN RX filter for ID 0x777 and reserves mailbox 5 for rx + Can0.watchFor(0x779); // set CAN RX filter for ID 0x779 and reserves mailbox 6 for rx + Can0.watchFor(0x77A); + Can0.setGeneralCallback(Receive_Can_0); + Timer3.attachInterrupt(Send_0x110); // set send interrupt + Timer3.start(10000); // Calls every 10ms +} + +void Send_0x110(){ + read_buttons(); + read_rotary(); + can_0_msg.id = 0x110; + can_0_msg.fid = 0; + can_0_msg.rtr = 0; + can_0_msg.priority = 0; + can_0_msg.length = 2; + can_0_msg.extended = 0; + can_0_temp_data = 0; + can_0_temp_data |= Stw_data.Stw_shift_up & 0b00000001; + can_0_temp_data |= Stw_data.Stw_shift_down << 1 & 0b00000010; + can_0_temp_data |= Stw_data.Stw_neutral << 2 & 0b00000100; + can_0_temp_data |= Stw_data.Stw_auto_shift << 3 & 0b00001000; + can_0_temp_data |= Stw_data.buttonStateEnc1 << 5 & 0b00100000; //pitlane + can_0_msg.data.byte[0] = can_0_temp_data; + can_0_msg.data.byte[1] = Stw_data.trc & 0b00001111; + can_0_msg.data.byte[2] = Stw_data.mode & 0b00000111; + if ((Stw_data.Stw_auto_shift << 3 & 0b00001000)){ + if(Vehicle_data.g_auto){ + Vehicle_data.g_auto = false; + }else{ + Vehicle_data.g_auto = true; + } + } + Can0.sendFrame(can_0_msg); +} + +void Receive_Can_0(CAN_FRAME *temp_message){ + switch (temp_message->id) { + //g_auto + case 0x502:{ // eDrossel error bit + Vehicle_data.e_thro = (temp_message->data.byte[0] & 0x80) | (temp_message->data.byte[0] & 0x40) | (temp_message->data.byte[0] & 0x20) | (temp_message->data.byte[0] & 0x10); // bit 4-7 + + if(temp_message->data.byte[0] & 0x80){ + Stw_data.error_type = 1;//"pc_error"; + } + if(temp_message->data.byte[0] & 0x40){ + Stw_data.error_type = 2;//"bse_error"; + } + if(temp_message->data.byte[0] & 0x20){ + Stw_data.error_type = 3;//"aps_error"; + } + if(temp_message->data.byte[0] & 0x10){ + Stw_data.error_type = 4;//"etb_error"; + } + //can_1_temp_data |= g_etb_e << 4; + //can_1_temp_data |= g_aps_e << 5; + //can_1_temp_data |= g_bse_e << 6; + //can_1_temp_data |= g_pc_e << 7; + break; + } + case 0x504:{ //autoshift+gear + //Vehicle_data.g_auto = (temp_message->data.byte[1]) >> 4; + Vehicle_data.gear = (temp_message->data.byte[1]) >> 5; + break; + } + case 0x773:{ // rpm + Vehicle_data.revol = (temp_message->data.byte[4] | temp_message->data.byte[3] << 8); + break; + } + case 0x779:{ // battery voltage + Vehicle_data.u_batt = temp_message->data.byte[6]; + break; + } + /*case 0x77A: // revolution limit bit + Vehicle_data.rev_lim = (temp_message->data.byte[3] & 0x20) >> 4; + switch(temp_message->data.byte[0]) { + case 0x02: // temp. intercooler + Vehicle_data.t_air = temp_message->data.byte[7]; + break; + case 0x05: // temp. water + Vehicle_data.t_mot = temp_message->data.byte[4]; + break; + case 0x04: // temp. oil + Vehicle_data.t_oil = temp_message->data.byte[5]; + case 0x01: { + Vehicle_data.p_wat = temp_message->data.byte[6]; + Vehicle_data.p_fuel = temp_message->data.byte[7]; + Vehicle_data.p_oil = temp_message->data.byte[5]; + break; + } + } + break;*/ + case 0x77A:{//temp und p + //g_ms4_idle_b = (temp_message->data.byte[2] & 0b10000000) >> 7; + //g_ms4_engine_status = (temp_message->data.byte[3] & 0b01000000) >> 6; + //g_ms4_ignoff_b = (temp_message->data.byte[3] & 0b10000000) >> 7; + + if ( temp_message->data.byte[0] == 1){ + Vehicle_data.p_oil = temp_message->data.byte[5]; + Vehicle_data.p_fuel = temp_message->data.byte[7]; + } + else if ( temp_message->data.byte[0] == 2){ + Vehicle_data.t_air = temp_message->data.byte[7]; + } + else if ( temp_message->data.byte[0] == 4){ + Vehicle_data.t_oil = temp_message->data.byte[5]; + } + else if ( temp_message->data.byte[0] == 5){ + Vehicle_data.t_mot = temp_message->data.byte[4]; + } + break; + } + case 0x775:{//speed + Vehicle_data.speed_fl = 2*(temp_message->data.byte[2]); + Vehicle_data.speed_fr = 2*(temp_message->data.byte[3]); + Vehicle_data.speed = (Vehicle_data.speed_fl+Vehicle_data.speed_fr)/2; + break; + } + /*case 0x777:{//m4_gear + Vehicle_data.gear = temp_message->data.byte[0]; + break; + }*/ + case 0x500:{ + Vehicle_data.p_brake_front = temp_message->data.byte[1]; + Vehicle_data.p_brake_rear = temp_message->data.byte[2]; + break; + } + } +} + +void update_LED(){ +//Copyright Michael Dietzel +//m.dietzel@fasttube.de +//Edit Michael Witt 05-2015 +//m.witt@fasttube.de + +//EDIT BAHA ZARROUKI 05-2107 +//z.baha@fasttube.de + +// alle Werte als Hex-Werte angegeben + bool t_oil = (Vehicle_data.t_oil - 40) >= 0x96; // 150°C temp.oil + bool t_air = (Vehicle_data.t_air - 40) >= 0x3C; // 60°C temp.llk + bool t_mot = ((Vehicle_data.t_mot - 40) >= 0x69) and ((Vehicle_data.t_mot - 40)!=0xC8); // 105°C temp.water und !=200 + + bool g_auto = Vehicle_data.g_auto; + bool u_batt = Vehicle_data.u_batt <= 0xB1; // 12.5V batt.spann. + bool e_dros = Vehicle_data.e_thro; // error-bit + + bool rev_lim = Vehicle_data.rev_lim; + + uint16_t rev = Vehicle_data.revol; + + /*if(Vehicle_data.rev_lim){ + for (int j = 0; j < 10; j++){ + digitalWrite(leds[j], HIGH); + //analogWrite(leds[j], STW_data.br); //nur eine der zwei zeilen + } + delay(100); + for (int j = 0; j < 10; j++){ + digitalWrite(leds[j], LOW); + } + delay(100); + }else{*/ + /*uint8_t helligkeit = 20; + if(RPM_THRES_1 <= rev){ + analogWrite(led1, helligkeit); + }else{ + analogWrite(led1, 0); + } + if(RPM_THRES_2 <= rev){ + analogWrite(led2, helligkeit); + }else{ + analogWrite(led2, 0); + } + if(RPM_THRES_3 <= rev){ + analogWrite(led3, helligkeit); + }else{ + analogWrite(led3, 0); + } + if(RPM_THRES_4 <= rev){ + analogWrite(led4, helligkeit); + }else{ + analogWrite(led4, 0); + } + if(RPM_THRES_5 <= rev){ + analogWrite(led5, helligkeit); + }else{ + analogWrite(led5, 0); + } + if(RPM_THRES_6 <= rev){ + analogWrite(led6, helligkeit); + }else{ + analogWrite(led6, 0); + } + if(RPM_THRES_7 <= rev){ + analogWrite(led7, helligkeit); + }else{ + analogWrite(led7, 0); + } + if(RPM_THRES_8 <= rev){ + analogWrite(led8, helligkeit); + }else{ + analogWrite(led8, 0); + } + if(RPM_THRES_9 <= rev){ + analogWrite(led9, helligkeit); + }else{ + analogWrite(led9, 0); + } + if(RPM_THRES_10 <= rev){ + analogWrite(led10, helligkeit); + }else{ + analogWrite(led10, 0); + }*/ + digitalWrite(led1, RPM_THRES_1 <= rev); + digitalWrite(led2, RPM_THRES_2 <= rev); + digitalWrite(led3, RPM_THRES_3 <= rev); + digitalWrite(led4, RPM_THRES_4 <= rev); + digitalWrite(led5, RPM_THRES_5 <= rev); + digitalWrite(led6, RPM_THRES_6 <= rev); + digitalWrite(led7, RPM_THRES_7 <= rev); + digitalWrite(led8, RPM_THRES_8 <= rev); + digitalWrite(led9, RPM_THRES_9 <= rev); + digitalWrite(led10, RPM_THRES_10 <= rev); + + digitalWrite(led11, t_mot); // rot, links, oben + digitalWrite(led12, t_air); // rot, links, mitte + digitalWrite(led13, t_oil); // rot, links, unten + + digitalWrite(led14, e_dros); // rot, rechts, oben + digitalWrite(led15, u_batt); // rot rechts, mitte + digitalWrite(led16, g_auto); // blau rechts, unten + /*if(Vehicle_data.g_auto){ + digitalWrite(led16, HIGH); + }else{ + digitalWrite(led16, LOW); + }*/ +} diff --git a/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.h b/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.h new file mode 100644 index 0000000..cc4bbfb --- /dev/null +++ b/lib/FT_2018e_STW_CAN/FT_2018e_STW_CAN.h @@ -0,0 +1,12 @@ +/* +FT_2018e_STW_CAN.h +*/ + +#include "Arduino.h" +#include "DueTimer.h" +#include "due_can.h" + +void Init_Can_0(); +void Send_0x110(); +void Receive_Can_0(CAN_FRAME *frame); +void update_LED(void); \ No newline at end of file diff --git a/lib/README b/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/lib/RotaryEncoder/RotaryEncoder.cpp b/lib/RotaryEncoder/RotaryEncoder.cpp new file mode 100644 index 0000000..90166b8 --- /dev/null +++ b/lib/RotaryEncoder/RotaryEncoder.cpp @@ -0,0 +1,51 @@ +#include "RotaryEncoder.h" + +RotaryEncoder::RotaryEncoder(int ENC_A, int ENC_B, int multiplier, int stepSize, int pauseLength) { + _ENC_A = ENC_A; + _ENC_B = ENC_B; + _multiplier = multiplier; + _stepSize = stepSize; + _pauseLength = pauseLength; + _oldENC_A = 0; + _oldENC_B = 0; + _lastENCread = 0; + _ENCcounter = 0; + _lastENCreadTime = micros(); + //define pin modes + pinMode(_ENC_A, INPUT); + pinMode(_ENC_B, INPUT); + digitalWrite(_ENC_A,HIGH); //these pins do not have pull up resistors on an attiny... + digitalWrite(_ENC_B,HIGH); //you must pull them up on the board. +} +int RotaryEncoder::readEncoder() { + int a0Pin = digitalRead(_ENC_A); + int a1Pin = digitalRead(_ENC_B); + int changevalue = 1; + int returnVal = 0; + if(a0Pin != _oldENC_A || a1Pin != _oldENC_B) { + if(_oldENC_A == a1Pin && _oldENC_B != a0Pin) { + returnVal = 1; + } else if (_oldENC_B == a0Pin && _oldENC_A != a1Pin) { + returnVal = -1; + } + _oldENC_A = a0Pin; + _oldENC_B = a1Pin; + + if(returnVal != 0) { + if(returnVal == _lastENCread) { + _ENCcounter++; + if((micros() - _lastENCreadTime) < _pauseLength) { + changevalue = max((_ENCcounter/_stepSize)*_multiplier,1); + } + _lastENCreadTime = micros(); + } else { + _ENCcounter=0; + } + _lastENCread = returnVal; + } + + return returnVal*changevalue; + } else { + return 0; + } +} diff --git a/lib/RotaryEncoder/RotaryEncoder.h b/lib/RotaryEncoder/RotaryEncoder.h new file mode 100644 index 0000000..c02f5c4 --- /dev/null +++ b/lib/RotaryEncoder/RotaryEncoder.h @@ -0,0 +1,35 @@ +/*********************************** +Written by Joshua Oster-Morris/craftycoder. +BSD license, check license.txt for more information +All text above must be included in any redistribution + +I strongly urge hardware debouncing with rotary encoders. +A 10000pF cap between both the A and B pins to GND (the C pin) +is suffcient to offer very consistent reads. + +*ENC_A* is the arduino pin the A pin of the encoder is plugged in to. +*ENC_B* is the arduino pin the B pin of the encoder is plugged in to. +*multiplier* is what is sounds like +*stepSize* is used to find the *multiplicand* +*pauseLength* is the maximum amount of time in microseconds a user can pause before the number of steps resets +Equations of interest. +*multiplicand* = (consecutive steps in one direction with less than a *pauseLength* between them)/*stepSize* +*direction* = 1 for clockwise or -1 for counterclockwise +readEncoder() returns *multiplicand*x*multiplier*x*direction* +****************************************/ + +#if ARDUINO >= 100 + #include "Arduino.h" +#else + #include "WProgram.h" +#endif + +class RotaryEncoder { + public: + RotaryEncoder(int ENC_A, int ENC_B, int multiplier, int stepSize, int pauseLength); + int readEncoder(); + private: + int _ENC_A, _ENC_B, _oldENC_A, _oldENC_B, _lastENCread, _ENCcounter, _pauseLength, _multiplier, _stepSize; + long _lastENCreadTime; +}; + diff --git a/lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino b/lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino new file mode 100644 index 0000000..87469db --- /dev/null +++ b/lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino @@ -0,0 +1,20 @@ +#include ; +int val = 0; +RotaryEncoder encoder(A0,A2,5,6,3000); +void setup() +{ + Serial.begin(57600); +} +void loop() +{ + int enc = encoder.readEncoder(); + int changevalue = 1; + if(enc != 0) { + val = val + (enc); + val = min(val,4095); + val = max(val,0); + Serial.println(val); + } + delayMicroseconds(5); +} + diff --git a/lib/RotaryEncoder/license.txt b/lib/RotaryEncoder/license.txt new file mode 100644 index 0000000..b33c4ef --- /dev/null +++ b/lib/RotaryEncoder/license.txt @@ -0,0 +1,26 @@ +Software License Agreement (BSD License) + +Copyright (c) 2012, Joshua Oster-Morris +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holders nor the +names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/arduino-ediptft-master/.gitignore b/lib/arduino-ediptft-master/.gitignore new file mode 100644 index 0000000..cc786a9 --- /dev/null +++ b/lib/arduino-ediptft-master/.gitignore @@ -0,0 +1 @@ +doc/ \ No newline at end of file diff --git a/lib/arduino-ediptft-master/CHANGELOG b/lib/arduino-ediptft-master/CHANGELOG new file mode 100644 index 0000000..c0f55e1 --- /dev/null +++ b/lib/arduino-ediptft-master/CHANGELOG @@ -0,0 +1,38 @@ +------------------------------------------------------------------------------ +Library for controlling Electronic Assembly eDIPTFT displays + + Copyright (c) 2013 Stefan Gofferje. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later + version. + + This library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU Lesser General Public License for more + details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA +------------------------------------------------------------------------------ +---- 10feb2015 Stefan Lehmann +- Added support for displays with only 1 Byte display coordinates (<255 pixels): + eDIP128, eDIP160 and eDIP240 + +---- 24feb2013 Stefan Gofferje +- Added functions for touch switches and radio groups + +---- 03feb2013 Stefan Gofferje +- Smallprotocol works!!! Yay! +- More functions added. + +---- 29jan2013 Stefan Gofferje +- Basic functionality is there + +---- 26jan2013 Stefan Gofferje +- Project started diff --git a/lib/arduino-ediptft-master/Doxyfile b/lib/arduino-ediptft-master/Doxyfile new file mode 100644 index 0000000..cb7a4b8 --- /dev/null +++ b/lib/arduino-ediptft-master/Doxyfile @@ -0,0 +1,2329 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "ediptft" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 0.0.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "A library for controllin Electonic Assembly ediptft displays" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = Readme.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /