23 template<u
int8_t cols_, u
int8_t rows_>
41 void unselectRows(
void);
42 void selectRow(uint8_t
row);
43 uint16_t readCols(
void);
46 template<u
int8_t cols_, u
int8_t rows_>
55 template<u
int8_t cols_, u
int8_t rows_>
57 DDRB &= ~(1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
58 PORTB |= (1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
59 DDRC &= ~(1<<7 | 1<<6);
60 PORTC |= (1<<7 | 1<<6);
61 DDRD &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
62 PORTD |= (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
63 DDRF &= ~(1<<6 | 1<<7);
64 PORTF |= (1<<6 | 1<<7);
67 template<u
int8_t cols_, u
int8_t rows_>
91 template<u
int8_t cols_, u
int8_t rows_>
93 return (PINF&(1<<6) ? 0 : (1<<0)) |
94 (PINF&(1<<7) ? 0 : (1<<1)) |
95 (PINB&(1<<4) ? 0 : (1<<2)) |
96 (PINB&(1<<5) ? 0 : (1<<3)) |
97 (PINB&(1<<6) ? 0 : (1<<4)) |
98 (PIND&(1<<7) ? 0 : (1<<5)) |
99 (PINC&(1<<6) ? 0 : (1<<6)) |
100 (PINC&(1<<7) ? 0 : (1<<7)) |
101 (PIND&(1<<3) ? 0 : (1<<8)) |
102 (PIND&(1<<2) ? 0 : (1<<9)) |
103 (PIND&(1<<1) ? 0 : (1<<10)) |
104 (PIND&(1<<0) ? 0 : (1<<11)) |
105 (PINB&(1<<7) ? 0 : (1<<12)) |
106 (PINB&(1<<3) ? 0 : (1<<13));
111 template<u
int8_t cols_, u
int8_t rows_>
122 template<u
int8_t cols_, u
int8_t rows_>
127 for (uint8_t i = 0; i < rows_; i++) {
129 uint16_t cols = readCols();
131 for (uint8_t c = 0; c < cols_ / 2; c++) {
132 uint8_t rowPos = i * (cols_ / 2);
134 bitWrite(
rightHandState.
all, rowPos + ((cols_ / 2 - 1) - c), bitRead(cols, (cols_ / 2) + c));
Definition: KeyboardioScanner.h:36
Definition: AtmegaScanner.h:26
Definition: AtmegaScanner.h:24
keydata_t leftHandState
Definition: AtmegaScanner.h:34
keydata_t rightHandState
Definition: AtmegaScanner.h:35
uint32_t all
Definition: AtmegaScanner.h:27
keydata_t previousRightHandState
Definition: AtmegaScanner.h:37
keydata_t previousLeftHandState
Definition: AtmegaScanner.h:36
bool readKeys(void)
Definition: AtmegaScanner.h:123
byte row
Definition: TapDance.cpp:229
AtmegaScanner(void)
Definition: AtmegaScanner.h:112