diff --git a/src/DebouncerInterface.h b/src/DebouncerInterface.h index 0a9d64b..764fc61 100644 --- a/src/DebouncerInterface.h +++ b/src/DebouncerInterface.h @@ -3,7 +3,7 @@ #include -/* +/* debounce() takes rawSignal and returns debounced signal. Signals are bit paterns. */ class DebouncerInterface diff --git a/src/Port_MCP23S17.cpp b/src/Port_MCP23S17.cpp index 541c259..cda2c35 100644 --- a/src/Port_MCP23S17.cpp +++ b/src/Port_MCP23S17.cpp @@ -4,18 +4,18 @@ MCP23S17 SPI interface is 10 MHz max. The electrical limitation to bus speed is bus capacitance and the length of the wires involved. -Longer wires require lower clock speeds. +Longer wires require lower clock speeds. */ uint8_t Port_MCP23S17::transfer(const uint8_t command, const uint8_t registerAddr, - const uint8_t data) + const uint8_t data) { uint8_t portState; //bit pattern SPI.beginTransaction( SPISettings(5000000, MSBFIRST, SPI_MODE0) ); //control SPI bus, 5 MHz digitalWrite(SS, LOW); //enable Slave Select - SPI.transfer(command); //write or read command - SPI.transfer(registerAddr); //register address to write data to - portState = SPI.transfer(data); //write data, read portState + SPI.transfer(command); //write or read command + SPI.transfer(registerAddr); //register address to write data to + portState = SPI.transfer(data); //write data, read portState digitalWrite(SS, HIGH); //disable Slave Select SPI.endTransaction(); diff --git a/src/Port_PCA9655E.cpp b/src/Port_PCA9655E.cpp index 053c7bb..bb450f1 100644 --- a/src/Port_PCA9655E.cpp +++ b/src/Port_PCA9655E.cpp @@ -4,7 +4,7 @@ PCA9655E supports I2C SCL Clock Frequencies: 100 kHz, 400 kHz, 1000 kHz (Datasheet page 1 & 6) The electrical limitation to bus speed is bus capacitance and the length of the wires involved. -Longer wires require lower clock speeds. +Longer wires require lower clock speeds. http://playground.arduino.cc/Main/WireLibraryDetailedReference > Wire.setclock() */ void Port_PCA9655E::beginProtocol() diff --git a/src/Row.cpp b/src/Row.cpp index 0db56a5..953ed94 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -4,9 +4,9 @@ init() is called once for each row, to set scanner's uC strobePin to output. */ Row::Row(ScannerInterface& refScanner, const uint8_t strobePin, - Key* const ptrsKeys[], const uint8_t keyCount) + Key* const ptrsKeys[], const uint8_t keyCount) : refScanner(refScanner), strobePin(strobePin), - ptrsKeys(ptrsKeys), keyCount(keyCount), debounced(0) + ptrsKeys(ptrsKeys), keyCount(keyCount), debounced(0) { refScanner.init(strobePin); } diff --git a/src/Row.h b/src/Row.h index 281935a..a44c784 100644 --- a/src/Row.h +++ b/src/Row.h @@ -31,7 +31,7 @@ class Row read_pins_t debounced; //bit pattern, state of keys after debouncing, 1=pressed, 0=released public: Row(ScannerInterface& refScanner, const uint8_t strobePin, - Key* const ptrsKeys[], const uint8_t keyCount); + Key* const ptrsKeys[], const uint8_t keyCount); virtual void process(); }; #endif diff --git a/src/Scanner_IOE.h b/src/Scanner_IOE.h index 057c893..3350edf 100644 --- a/src/Scanner_IOE.h +++ b/src/Scanner_IOE.h @@ -22,9 +22,9 @@ class Scanner_IOE : public ScannerInterface PortInterface& refPortRead; //the IC's read port public: Scanner_IOE(const bool strobeOn, - PortInterface &refPortWrite, PortInterface& refPortRead) + PortInterface &refPortWrite, PortInterface& refPortRead) : strobeOn(strobeOn), strobeOff(!strobeOn), - refPortWrite(refPortWrite), refPortRead(refPortRead) {} + refPortWrite(refPortWrite), refPortRead(refPortRead) {} void init(const uint8_t strobePin); void begin(); read_pins_t scan(const uint8_t strobePin); diff --git a/src/Scanner_ShiftRegsPISOMultiRow.cpp b/src/Scanner_ShiftRegsPISOMultiRow.cpp index 81f703d..6255a87 100644 --- a/src/Scanner_ShiftRegsPISOMultiRow.cpp +++ b/src/Scanner_ShiftRegsPISOMultiRow.cpp @@ -5,7 +5,7 @@ Scanner_ShiftRegsPISOMultiRow::Scanner_ShiftRegsPISOMultiRow(const bool strobeOn, const uint8_t slaveSelect, const uint8_t byte_count) : strobeOn(strobeOn), strobeOff(!strobeOn), - slaveSelect(slaveSelect), byte_count(byte_count) + slaveSelect(slaveSelect), byte_count(byte_count) { pinMode(slaveSelect, OUTPUT); } @@ -39,8 +39,8 @@ read_pins_t Scanner_ShiftRegsPISOMultiRow::scan(const uint8_t strobePin) delayMicroseconds(3); //time to stablize voltage //read all the column pins - digitalWrite(slaveSelect, LOW); //load parallel inputs to the register - digitalWrite(slaveSelect, HIGH); //shift the data toward a serial output + digitalWrite(slaveSelect, LOW); //load parallel inputs to the register + digitalWrite(slaveSelect, HIGH); //shift the data toward a serial output SPI.transfer(&readState, byte_count); //strobe row off diff --git a/src/Scanner_ShiftRegsPISOMultiRow.h b/src/Scanner_ShiftRegsPISOMultiRow.h index c8c6c75..be37bc5 100644 --- a/src/Scanner_ShiftRegsPISOMultiRow.h +++ b/src/Scanner_ShiftRegsPISOMultiRow.h @@ -43,12 +43,11 @@ class Scanner_ShiftRegsPISOMultiRow : public ScannerInterface private: const bool strobeOn; //logic level of strobe on, active state HIGH or LOW const bool strobeOff; //logic level of strobe off, complement of strobeOn - const uint8_t slaveSelect; //controller's pin number that is - // connected to shift register's SHIFT-LOAD pin + const uint8_t slaveSelect;//controller pin number connected to shift register SHIFT-LOAD pin const uint8_t byte_count; //number of bytes to read from shift registers public: Scanner_ShiftRegsPISOMultiRow(const bool strobeOn, - const uint8_t slaveSelect, const uint8_t byte_count); + const uint8_t slaveSelect, const uint8_t byte_count); virtual void init(const uint8_t strobePin); virtual void begin(); virtual read_pins_t scan(const uint8_t strobePin); diff --git a/src/Scanner_ShiftRegsPISOSingleRow.h b/src/Scanner_ShiftRegsPISOSingleRow.h index 362fdcd..fe75f22 100644 --- a/src/Scanner_ShiftRegsPISOSingleRow.h +++ b/src/Scanner_ShiftRegsPISOSingleRow.h @@ -45,12 +45,11 @@ Controller's MISO pin is connected to shift register's serial output (QH) pin class Scanner_ShiftRegsPISOSingleRow : public ScannerInterface { private: - const uint8_t slaveSelect; //controller's pin number that is - // connected to shift register's SHIFT-LOAD pin + const uint8_t slaveSelect;//controller pin number connected to shift register SHIFT-LOAD pin const uint8_t byte_count; //number of bytes to read from shift registers public: Scanner_ShiftRegsPISOSingleRow(const bool strobeOn, - const uint8_t slaveSelect, const uint8_t byte_count); + const uint8_t slaveSelect, const uint8_t byte_count); void init(const uint8_t strobePin); void begin(); virtual read_pins_t scan(const uint8_t strobePin); diff --git a/tutorials/keybrd_3a_multi-layerHold/keybrd_3a_multi-layerHold.ino b/tutorials/keybrd_3a_multi-layerHold/keybrd_3a_multi-layerHold.ino index b677d26..13162d9 100644 --- a/tutorials/keybrd_3a_multi-layerHold/keybrd_3a_multi-layerHold.ino +++ b/tutorials/keybrd_3a_multi-layerHold/keybrd_3a_multi-layerHold.ino @@ -13,7 +13,7 @@ Each cell in the table's body represents a key. Each element in a cell represents a scancode or layer code. The keys in row 0 have two characters each, one character for each layer. Letters 'a' and 'b' are on the normal layer. Symbols '-' and '=' are on the fn layer. -"fn" is a layer key. Holding the fn key down makes it the active layer. +"fn" is a layer key. Holding the fn key down makes it the active layer. Releasing the fn key restores the normal layer. */ // ################## GLOBAL ################### diff --git a/tutorials/keybrd_4b_split_keyboard_with_shift_registers/keybrd_4b_split_keyboard_with_shift_registers.ino b/tutorials/keybrd_4b_split_keyboard_with_shift_registers/keybrd_4b_split_keyboard_with_shift_registers.ino index 0391cd0..0a34fd7 100644 --- a/tutorials/keybrd_4b_split_keyboard_with_shift_registers/keybrd_4b_split_keyboard_with_shift_registers.ino +++ b/tutorials/keybrd_4b_split_keyboard_with_shift_registers/keybrd_4b_split_keyboard_with_shift_registers.ino @@ -68,7 +68,8 @@ Row row_L1(scanner_L, 1, ptrsKeys_L1, KEY_COUNT_L1); Key* ptrsKeys_R0[] = { &s_6, &s_5, &s_4, &s_3, //shift register on right &s_c, &s_d, &s_e, &s_f, &s_2, &s_1, &s_0, &s_g, //shift register on left - &s_a, &s_b }; //unused input pins are grounded + &s_a, &s_b + }; //unused input pins are grounded Row row_R0(scanner_R, 0, ptrsKeys_R0, sizeof(ptrsKeys_R0)/sizeof(*ptrsKeys_R0)); // ################### MAIN ####################