From 3d31ca0c5d4f8c4779693079e42fbdd5bb9d823d Mon Sep 17 00:00:00 2001 From: morganPigeron <37436664+morganPigeron@users.noreply.github.com> Date: Mon, 13 Aug 2018 10:03:54 +0200 Subject: [PATCH] Create Hctl2022.h --- Hctl2022.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Hctl2022.h diff --git a/Hctl2022.h b/Hctl2022.h new file mode 100644 index 0000000..ac4e3e1 --- /dev/null +++ b/Hctl2022.h @@ -0,0 +1,43 @@ +#ifndef Hctl2022_h +#define hctl2022_h + +#include + +class Hctl2022 +{ + public: + Hctl2022(int,int,int); // constructor + unsigned long hctlRead(); // read the hctl2022 + void hctlDebug(); + + private: + void getMsb(); // get the most significant byte + void get3rd(); // get the 3rd byte + void get2nd(); // get the 2nd byte + void getLsb(); // get the least significant byte + + unsigned long _result; + unsigned long _temp; + int _oe; + int _sel1; + int _sel2; + + //intermediary result for read function + byte _hi_old; + byte _hi_new; + byte _result_hi; + + byte _2nd_old; + byte _2nd_new; + byte _result_2nd; + + byte _3rd_old; + byte _3rd_new; + byte _result_3rd; + + byte _lo_old; + byte _lo_new; + byte _result_lo; +}; + +#endif