Created
October 29, 2017 08:17
Revisions
-
Mahesh Venkitachalam created this gist
Oct 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ struct BitBuf88 { // constr BitBuf88() { clearAll(); } // destr virtual ~BitBuf88() {} // set (i, j) void set(uint8_t i, uint8_t j) { _vals[i] |= (1 << j); } // clear (i, j) void clr(uint8_t i, uint8_t j) { _vals[i] &= ~(1 << j); } // get (i, j) bool get(uint8_t i, uint8_t j) { return _vals[i] & (1 << j) ? true : false; } // clear all bits void clearAll() { for(uint8_t i = 0; i < 8; i++) { _vals[i] = 0; } } // vals[i] represents digit (column) and bits vals[i][0:7] the rows uint8_t _vals[8]; };