@@ -6,6 +6,27 @@ This project adheres to [Semantic Versioning 2.0.0](http://semver.org/). | |||
keybrd version 0.x.x is for initial development. | |||
keybrd version 1.0.0 will be released when the public API is stable. | |||
0.6.4 (2016-11-16) | |||
------------------ | |||
* Enhancements | |||
* add Port_MCP23018 | |||
* add Port_MCP23S18 | |||
* add Port_ShiftRegs | |||
* add PortWriteInterface | |||
* add add LED_PortOpenDrain | |||
* add examples/IOE_PCA9655E_development/ | |||
* rename strobeOn to activeState | |||
* move strobe logic from Port_*::write() to Scanner_IOE::scan() | |||
* Backward incompatible changes | |||
* rename print_microseconds_per_scan() to printMicrosecondsPerScan() | |||
* rename print_scans_per_second() to printScansPerSecond() | |||
* rename Scanner_ShiftRegsPISOSingleRow to Scanner_ShiftRegsRead | |||
* rename Scanner_ShiftRegsPISOMultiRow to Scanner_ShiftRegsReadStrobed | |||
* in Scanner_ShiftRegsReadStrobed, reverse slaveSelect HIGH/LOW for SPI compatible tri-state | |||
* in Port_MCP23S17, add slaveSelect to constructor parameter | |||
* in Port_*, replace write() with writeHigh() and writeLow() | |||
0.6.3 (2016-10-06) | |||
------------------ | |||
* Enhancements |
@@ -1,4 +1,4 @@ | |||
The series of sketches in this folder where used to develope the Port_PCA9655E class. | |||
The series of sketches in this folder where used to develop the Port_PCA9655E class in stages. | |||
The folder numbers are ordered from fundamental to practical. | |||
Each sketch was tested on a breadboard. Breadboards hold: |
@@ -19,13 +19,13 @@ void Port_MCP23017::begin(const uint8_t activeState) | |||
{ | |||
uint8_t pullUp; //bits, GPPU 0=pull-up disabled, 1=pull-up enabled | |||
if (activeState == LOW) //if active low | |||
if (activeState == LOW) //if active low | |||
{ | |||
pullUp = readPins; //0=pull-up disabled (for LED), 1=pull-up enabled (for read) | |||
} | |||
else //if active high | |||
{ | |||
pullUp = 0; //0=pull-up disabled (for external pull-down resistors) | |||
pullUp = 0; //0=pull-up disabled (external pull-down resistors) | |||
} | |||
Wire.beginTransmission(deviceAddr); | |||
@@ -44,7 +44,7 @@ pin is bit pattern, where pin being set is 1. | |||
*/ | |||
void Port_MCP23017::writeLow(const uint8_t pin) | |||
{ | |||
outputVal &= ~pin; //set pin output to low | |||
outputVal &= ~pin; //set pin output to low | |||
Wire.beginTransmission(deviceAddr); | |||
Wire.write(portNum + 0x12); //GPIO | |||
@@ -72,7 +72,7 @@ uint8_t Port_MCP23017::read() | |||
{ | |||
Wire.beginTransmission(deviceAddr); | |||
Wire.write(portNum + 0x12); //GPIO | |||
Wire.endTransmission(false); //MCP23017 needs false to send a restart ??todo really? | |||
Wire.endTransmission(false); //MCP23017 needs false to send a restart | |||
Wire.requestFrom(deviceAddr, 1u); //request one byte from input port | |||
@@ -47,7 +47,7 @@ LED_uC LED_capsLck(21); | |||
// --------------- RIGHT SCANNER --------------- | |||
const uint8_t IOE_ADDR = 0x20; //MCP23S17 address, all 3 ADDR pins are grounded | |||
const uint8_t slaveSelect = 10; | |||
const uint8_t slaveSelect = 10; //Arduino-pin number connected to MCP23S17 CS or SS | |||
Port_MCP23S17 portA(slaveSelect , IOE_ADDR, 0, 1<<0 | 1<<1 ); //for read | |||
Port_MCP23S17 portB(slaveSelect , IOE_ADDR, 1, 0); //for strobe | |||
@@ -136,7 +136,7 @@ so that scanner's ports can turn on LayerState_LED's default-layer LED. | |||
void setup() | |||
{ | |||
scanner_R.begin(); | |||
layerState.begin(); //todo call LayerState_LED::begin() after Scanner_IOE::begin() | |||
layerState.begin(); //call LayerState_LED::begin() after Scanner_IOE::begin() | |||
} | |||
void loop() |
@@ -19,7 +19,9 @@ Steps to writing a new port class: | |||
5. Study other keybrd port classes. | |||
* SPI I/O expander port classes: Port_MCP23S17 | |||
* I2C I/O expander port classes: Port_PCA9655E | |||
6. Write the port classes for your I/O expander. Debugging I/O expander code is hard because | |||
6. Write the port classes for your I/O expander. | |||
* [Example](../examples/IOE_PCA9655E_development/) shows how Port_PCA9655E was developed in stages, from fundamental to practical | |||
* Debugging I/O expander code is hard because | |||
SPI or I2C protocol, expander configuration, and expander commands. | |||
<br> |