add Port_MCP23S18
This commit is contained in:
parent
45674eb9b9
commit
ad1b3b2289
@ -5,7 +5,7 @@
|
|||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <PortInterface.h>
|
#include <PortInterface.h>
|
||||||
|
|
||||||
/*
|
/* Port_MCP23017
|
||||||
write pins are connected to matrix Row (strobe pin) or LED.
|
write pins are connected to matrix Row (strobe pin) or LED.
|
||||||
readPins are connected to matrix column to read which keys are pressed.
|
readPins are connected to matrix column to read which keys are pressed.
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#ifndef PORT_MCP23018_H
|
#ifndef PORT_MCP23018_H
|
||||||
#define PORT_MCP23018_H
|
#define PORT_MCP23018_H
|
||||||
#include "Port_MCP23017.h"
|
#include "Port_MCP23017.h"
|
||||||
/*
|
|
||||||
|
/* Port_MCP23018
|
||||||
write pins are connected to matrix Row (strobe pin) or LED.
|
write pins are connected to matrix Row (strobe pin) or LED.
|
||||||
readPins are connected to matrix column to read which keys are pressed.
|
readPins are connected to matrix column to read which keys are pressed.
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <PortInterface.h>
|
#include <PortInterface.h>
|
||||||
|
|
||||||
/*
|
/* Port_MCP23S17
|
||||||
write pins are connected to matrix Row (strobe pin) or LED.
|
write pins are connected to matrix Row (strobe pin) or LED.
|
||||||
readPins are connected to matrix column to read which keys are pressed.
|
readPins are connected to matrix column to read which keys are pressed.
|
||||||
|
|
||||||
|
31
src/Port_MCP23S18.h
Normal file
31
src/Port_MCP23S18.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef PORT_MCP23S18_H
|
||||||
|
#define PORT_MCP23S18_H
|
||||||
|
#include "Port_MCP23S17.h"
|
||||||
|
|
||||||
|
/* Port_MCP23S18 has not been tested.
|
||||||
|
write pins are connected to matrix Row (strobe pin) or LED.
|
||||||
|
readPins are connected to matrix column to read which keys are pressed.
|
||||||
|
|
||||||
|
Port_MCP23S18 can only be active low (Scanner_IOE::activeState = LOW).
|
||||||
|
Open-drain active high would not work because pull down resistors have no effect on sink.
|
||||||
|
https://en.wikipedia.org/wiki/Open_collector
|
||||||
|
|
||||||
|
Use LED_PortOpenDrain class for indicator LEDs.
|
||||||
|
|
||||||
|
Example instantiation:
|
||||||
|
const uint8_t IOE_ADDR = 0x20; //MCP23S18 address pin grounded
|
||||||
|
Port_MCP23S18 portB(IOE_ADDR, 1, 0); //all pins are set to output for strobes and LEDs
|
||||||
|
Port_MCP23S18 portA(IOE_ADDR, 0, 1<<0 | 1<<1 ); //pin 0 and pin 1 are set to input for reading,
|
||||||
|
//remaining pins can be used for LEDs
|
||||||
|
Diode orientation
|
||||||
|
----------------
|
||||||
|
Diode orientation is explained in keybrd_library_user_guide.md > Diode orientation
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Port_MCP23S18 : public Port_MCP23S17
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Port_MCP23S18(const uint8_t deviceAddr, const uint8_t portNum, const uint8_t readPins)
|
||||||
|
: Port_MCP23S17(deviceAddr, portNum, readPins) {}
|
||||||
|
};
|
||||||
|
#endif
|
@ -5,7 +5,7 @@
|
|||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <PortInterface.h>
|
#include <PortInterface.h>
|
||||||
|
|
||||||
/*
|
/* Port_PCA9655E
|
||||||
write pins are connected to matrix Row (strobe pin) or LED.
|
write pins are connected to matrix Row (strobe pin) or LED.
|
||||||
readPins are connected to matrix column to read which keys are pressed.
|
readPins are connected to matrix column to read which keys are pressed.
|
||||||
|
|
||||||
@ -29,9 +29,6 @@ Diode orientation
|
|||||||
----------------
|
----------------
|
||||||
Diode orientation is explained in keybrd_library_user_guide.md > Diode orientation
|
Diode orientation is explained in keybrd_library_user_guide.md > Diode orientation
|
||||||
|
|
||||||
PCA9655E data sheet
|
|
||||||
----------------
|
|
||||||
http://www.onsemi.com/pub_link/Collateral/PCA9655E-D.PDF
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Port_PCA9655E : public PortInterface
|
class Port_PCA9655E : public PortInterface
|
||||||
|
Reference in New Issue
Block a user