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