Browse Source

update keybrd_DH to new names, IOE does not scan

tags/v0.5.0
wolfv6 8 years ago
parent
commit
cd22ac0fe7
7 changed files with 7 additions and 13 deletions
  1. 0
    2
      src/ReadPort.cpp
  2. 0
    1
      src/Row_ShiftRegisters.cpp
  3. 0
    1
      src/Row_uC.cpp
  4. 2
    1
      src/Row_uC.h
  5. 3
    5
      src/Scanner_Port.h
  6. 0
    1
      src/Scanner_ShiftRegs74HC165.h
  7. 2
    2
      src/config_keybrd.h

+ 0
- 2
src/ReadPort.cpp View File

uint8_t ReadPort::getPortState() uint8_t ReadPort::getPortState()
{ {
//todo Keyboard.print(" portState=");
//Keyboard.print(portState);
return portState; return portState;
} }

+ 0
- 1
src/Row_ShiftRegisters.cpp View File

{ {
//these variables are all bitwise, one bit per key //these variables are all bitwise, one bit per key
read_pins_t rowState; //1 means pressed, 0 means released read_pins_t rowState; //1 means pressed, 0 means released
//uint8_t readPinCount;
read_pins_t debouncedChanged; //1 means debounced changed read_pins_t debouncedChanged; //1 means debounced changed


rowState = scanner.scan(); rowState = scanner.scan();

+ 0
- 1
src/Row_uC.cpp View File

{ {
//these variables are all bitwise, one bit per key //these variables are all bitwise, one bit per key
read_pins_t rowState; //1 means pressed, 0 means released read_pins_t rowState; //1 means pressed, 0 means released
//uint8_t readPinCount;
read_pins_t debouncedChanged; //1 means debounced changed read_pins_t debouncedChanged; //1 means debounced changed


rowState = scanner.scan(); rowState = scanner.scan();

+ 2
- 1
src/Row_uC.h View File

public: public:
Row_uC(const uint8_t strobePin, const uint8_t READ_PINS[], const uint8_t READ_PIN_COUNT, Row_uC(const uint8_t strobePin, const uint8_t READ_PINS[], const uint8_t READ_PIN_COUNT,
Key *const ptrsKeys[]) Key *const ptrsKeys[])
: Row(ptrsKeys), scanner(strobePin, READ_PINS, READ_PIN_COUNT), READ_PIN_COUNT(READ_PIN_COUNT) { }
: Row(ptrsKeys), scanner(strobePin, READ_PINS, READ_PIN_COUNT),
READ_PIN_COUNT(READ_PIN_COUNT) { }
void process(); void process();
}; };
#endif #endif

+ 3
- 5
src/Scanner_Port.h View File

class Scanner_Port class Scanner_Port
{ {
private: private:
static const bool STROBE_ON; //HIGH or LOW logic level of strobe on, active state
StrobePort& refStrobePort; //this row's IC port StrobePort& refStrobePort; //this row's IC port
const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row
ReadPort& refReadPort; ReadPort& refReadPort;
public: public:
Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin,
ReadPort& refReadPort)
: refStrobePort(refStrobePort), strobePin(strobePin),
refReadPort(refReadPort) {}
static const bool STROBE_ON; //logic level of strobe on, active state, HIGH or LOW
Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, ReadPort& refReadPort)
: refStrobePort(refStrobePort), strobePin(strobePin), refReadPort(refReadPort) {}
virtual ReadPort* const scan(); virtual ReadPort* const scan();
}; };
#endif #endif

+ 0
- 1
src/Scanner_ShiftRegs74HC165.h View File

static const bool STROBE_OFF; //logic level of strobe off, complement of active state static const bool STROBE_OFF; //logic level of strobe off, complement of active state
const uint8_t STROBE_PIN; //Arduino pin number connected to this row const uint8_t STROBE_PIN; //Arduino pin number connected to this row
const uint8_t BYTE_COUNT; //number of bytes to read from shift registers const uint8_t BYTE_COUNT; //number of bytes to read from shift registers
//uint8_t READ_PIN_COUNT;
public: public:
Scanner_ShiftRegs74HC165(const uint8_t STROBE_PIN, uint8_t READ_PIN_COUNT); Scanner_ShiftRegs74HC165(const uint8_t STROBE_PIN, uint8_t READ_PIN_COUNT);
virtual read_pins_t scan(); virtual read_pins_t scan();

+ 2
- 2
src/config_keybrd.h View File

For Scanner_ShiftRegs74HC165, Scanner_ShiftRegs74HC165::READ_PIN_COUNT For Scanner_ShiftRegs74HC165, Scanner_ShiftRegs74HC165::READ_PIN_COUNT
For Scanner_Port, cover the last 1 bit in Scanner_Port::strobePin For Scanner_Port, cover the last 1 bit in Scanner_Port::strobePin
*/ */
//typedef uint8_t read_pins_t;
typedef uint8_t read_pins_t;
//typedef uint16_t read_pins_t; //typedef uint16_t read_pins_t;
typedef uint32_t read_pins_t;
//typedef uint32_t read_pins_t;


/* SAMPLE_COUNT = 4 is very reliable for a keyboard. /* SAMPLE_COUNT = 4 is very reliable for a keyboard.
Split keyboards with a long connecting wire or in environment with Split keyboards with a long connecting wire or in environment with