#ifndef ROWBASE_H #define ROWBASE_H #include #include #include #include #include /* RowBase is an abstract base class. */ class RowBase { private: Key *const *const ptrsKeys; //array of Key pointers RowPort &refRowPort; //this row's IC port const uint8_t rowPin; //bitwise, 1 indicates IC pin connected to this row ColPort *const *const ptrsColPorts; //array of column ports const uint8_t colPortCount; void scan(const bool activeHigh); uint8_t getRowState(uint16_t& rowEnd, const bool activeHigh); virtual uint8_t debounce(const uint8_t rowState)=0; void pressRelease(const uint16_t rowEnd, const uint8_t debouncedChanged); virtual void keyWasPressed(); protected: uint8_t previousDebounced; //bitwise, one bit per key public: RowBase( RowPort &refRowPort, const uint8_t rowPin, ColPort *const ptrsColPorts[], const uint8_t colPortCount, Key *const ptrsKeys[]) : ptrsKeys(ptrsKeys), refRowPort(refRowPort), rowPin(rowPin), ptrsColPorts(ptrsColPorts), colPortCount(colPortCount), previousDebounced(0) { } //Key* getPtrKey(uint8_t col) const; todo delete, no longer needed 5/31/16 void process(const bool activeHigh); }; #endif