#define CODE_LEDLOCK_H | #define CODE_LEDLOCK_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include <LEDInterface.h> | |||||
#include "Code.h" | |||||
#include "LEDInterface.h" | |||||
extern volatile uint8_t keyboard_leds; | extern volatile uint8_t keyboard_leds; | ||||
#define CODE_LAYERHOLD_H | #define CODE_LAYERHOLD_H | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include <LayerState.h> | |||||
#include "Code.h" | |||||
#include "LayerState.h" | |||||
/* Code_LayerHold calls LayerState when pressed to change activeLayer. | /* Code_LayerHold calls LayerState when pressed to change activeLayer. | ||||
*/ | */ |
#define CODE_LAYERHOLDSHIFT_H | #define CODE_LAYERHOLDSHIFT_H | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include <LayerState.h> | |||||
#include <Code_Shift.h> | |||||
#include "Code.h" | |||||
#include "LayerState.h" | |||||
#include "Code_Shift.h" | |||||
/* Code_LayerHoldShift calls LayerState when pressed to change activeLayer. | /* Code_LayerHoldShift calls LayerState when pressed to change activeLayer. | ||||
When a Code_LayerHoldShift object is pressed or released, it: | When a Code_LayerHoldShift object is pressed or released, it: |
#define CODE_LAYERLOCK_H | #define CODE_LAYERLOCK_H | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include "Code.h" | |||||
#include "LayerState.h" | #include "LayerState.h" | ||||
/* Code_LayerLock calls LayerState when pressed to change activeLayer. | /* Code_LayerLock calls LayerState when pressed to change activeLayer. |
#ifndef CODE_NULL_H | #ifndef CODE_NULL_H | ||||
#define CODE_NULL_H | #define CODE_NULL_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <Code.h> | |||||
#include "Code.h" | |||||
/* Class Code_Null doesn't do anything. It is useful for blank codes. | /* Class Code_Null doesn't do anything. It is useful for blank codes. | ||||
*/ | */ |
#define CODE_SC_H | #define CODE_SC_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include "Code.h" | |||||
/* Class Code_Sc_LED sends a scancode when press() or release() is called. | /* Class Code_Sc_LED sends a scancode when press() or release() is called. | ||||
"S" stands for Scancode. | "S" stands for Scancode. |
#define CODE_SCNS_H | #define CODE_SCNS_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code_AutoShift.h> | |||||
#include "Code_AutoShift.h" | |||||
/* Class Code_ScNS is composed of one scancode, which it sends when press() or release() is called. | /* Class Code_ScNS is composed of one scancode, which it sends when press() or release() is called. | ||||
autoShift insures that all MODIFIERKEY_SHIFTs are released. | autoShift insures that all MODIFIERKEY_SHIFTs are released. |
#define CODE_ScS_H | #define CODE_ScS_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code_AutoShift.h> | |||||
#include "Code_AutoShift.h" | |||||
/* Class Code_ScS contains one scancode, which it sends when press() or release() is called. | /* Class Code_ScS contains one scancode, which it sends when press() or release() is called. | ||||
autoShift insures that MODIFIERKEY_LEFT_SHIFT is pressed. | autoShift insures that MODIFIERKEY_LEFT_SHIFT is pressed. |
#define CODE_SHIFT_H | #define CODE_SHIFT_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Code.h> | |||||
#include "Code.h" | |||||
/* Class Code_Shift sends shift scancode for multi-layered keybrds. | /* Class Code_Shift sends shift scancode for multi-layered keybrds. | ||||
Explanation in Code_AutoShift.h | Explanation in Code_AutoShift.h |
#ifndef DEBOUNCERINTERFACE_H | #ifndef DEBOUNCERINTERFACE_H | ||||
#define DEBOUNCERINTERFACE_H | #define DEBOUNCERINTERFACE_H | ||||
#include <config_keybrd.h> | |||||
#include "config_keybrd.h" | |||||
/* | /* | ||||
debounce() takes rawSignal and returns debounced signal. Signals are bit paterns. | debounce() takes rawSignal and returns debounced signal. Signals are bit paterns. |
#define DEBOUNCER_NOT_H | #define DEBOUNCER_NOT_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <config_keybrd.h> | |||||
#include <DebouncerInterface.h> | |||||
#include "config_keybrd.h" | |||||
#include "DebouncerInterface.h" | |||||
/* Debouncer_Not does not debounce. | /* Debouncer_Not does not debounce. | ||||
debounce() returns raw signal, no debouncing is performed. | debounce() returns raw signal, no debouncing is performed. |
#ifndef DEBUG_H | #ifndef DEBUG_H | ||||
#define DEBUG_H | #define DEBUG_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <LEDInterface.h> | |||||
#include "LEDInterface.h" | |||||
class Debug | class Debug | ||||
{ | { |
#define KEY_LAYEREDCODESC_H | #define KEY_LAYEREDCODESC_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Key_LayeredCodeScBase.h> | |||||
#include <LayerStateInterface.h> | |||||
#include "Key_LayeredCodeScBase.h" | |||||
#include "LayerStateInterface.h" | |||||
/* Class Key_LayeredCodeSc is a 2-layer code, one object for each layer e.g. | /* Class Key_LayeredCodeSc is a 2-layer code, one object for each layer e.g. | ||||
layer0: ms_up //mouse up | layer0: ms_up //mouse up |
#define KEY_LAYEREDKEYS_H | #define KEY_LAYEREDKEYS_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerStateInterface.h> | |||||
#include <Key.h> | |||||
#include <Key_LayeredKeysBase.h> | |||||
#include "LayerStateInterface.h" | |||||
#include "Key.h" | |||||
#include "Key_LayeredKeysBase.h" | |||||
/* Most of the Key_LayeredKeys functionality is in Key_LayeredKeysBase. | /* Most of the Key_LayeredKeys functionality is in Key_LayeredKeysBase. | ||||
*/ | */ |
#define KEY_LAYEREDKEYS1_H | #define KEY_LAYEREDKEYS1_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerStateInterface.h> | |||||
#include <Key.h> | |||||
#include <Key_LayeredKeysBase.h> | |||||
#include "LayerStateInterface.h" | |||||
#include "Key.h" | |||||
#include "Key_LayeredKeysBase.h" | |||||
/* Most of the Key_LayeredKeys1 functionality is in Key_LayeredKeysBase. | /* Most of the Key_LayeredKeys1 functionality is in Key_LayeredKeysBase. | ||||
Key_LayeredKeys1 is just like Key_LayeredKeys, but with a distinct refLayerState. | Key_LayeredKeys1 is just like Key_LayeredKeys, but with a distinct refLayerState. |
#define KEY_LAYEREDKEYSBASE_H | #define KEY_LAYEREDKEYSBASE_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerStateInterface.h> | |||||
#include <Key.h> | |||||
#include "LayerStateInterface.h" | |||||
#include "Key.h" | |||||
/* Class Key_LayeredKeysBase contains an array of Key pointers, one pointer per layer. | /* Class Key_LayeredKeysBase contains an array of Key pointers, one pointer per layer. | ||||
Codes are a kind of Key, so the Key pointers can point to Codes or Keys. | Codes are a kind of Key, so the Key pointers can point to Codes or Keys. |
#define KEY_LAYEREDSCSC_H | #define KEY_LAYEREDSCSC_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerStateInterface.h> | |||||
#include <Key_LayeredScScBase.h> | |||||
#include "LayerStateInterface.h" | |||||
#include "Key_LayeredScScBase.h" | |||||
/* Class Key_LayeredScSc is composed of two scancodes; "S" stands for Scancode. | /* Class Key_LayeredScSc is composed of two scancodes; "S" stands for Scancode. | ||||
layerId is retreived from refLayerState. | layerId is retreived from refLayerState. |
#define LED_PORT_H | #define LED_PORT_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LEDInterface.h> | |||||
#include <PortWriteInterface.h> | |||||
#include "LEDInterface.h" | |||||
#include "PortWriteInterface.h" | |||||
/* An LED_Port object is an I/O expander output pin that is connected to an LED indicator light. | /* An LED_Port object is an I/O expander output pin that is connected to an LED indicator light. | ||||
LED_Port functions turn LED on and off. | LED_Port functions turn LED on and off. |
#define LED_PORT_H | #define LED_PORT_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LEDInterface.h> | |||||
#include <PortWriteInterface.h> | |||||
#include "LEDInterface.h" | |||||
#include "PortWriteInterface.h" | |||||
/* An LED_PortOpenDrain object is an I/O expander ouput pin that is connected to an LED. | /* An LED_PortOpenDrain object is an I/O expander ouput pin that is connected to an LED. | ||||
LED_PortOpenDrain functions turn LED on and off. | LED_PortOpenDrain functions turn LED on and off. |
#define LED_UC_H | #define LED_UC_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LEDInterface.h> | |||||
#include "LEDInterface.h" | |||||
/* A LED_uC turns LED on and off. | /* A LED_uC turns LED on and off. | ||||
*/ | */ |
#define LAYERSTATE_H | #define LAYERSTATE_H | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerStateInterface.h> | |||||
#include "LayerStateInterface.h" | |||||
/* Basic LayerState for keyboard. | /* Basic LayerState for keyboard. | ||||
When pressed, Code_Layer objects call LayerState functions lock() or hold(). | When pressed, Code_Layer objects call LayerState functions lock() or hold(). |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <LayerState.h> | |||||
#include <LEDInterface.h> | |||||
#include "LayerState.h" | |||||
#include "LEDInterface.h" | |||||
/* Basic LayerState with layer LED indictor lights. | /* Basic LayerState with layer LED indictor lights. | ||||
begin() should be called once to turn on LED for initial active layer. | begin() should be called once to turn on LED for initial active layer. |
#define PORTINTERFACE_H | #define PORTINTERFACE_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <PortWriteInterface.h> | |||||
#include "PortWriteInterface.h" | |||||
/* | /* | ||||
Port classes are the keybrd library's interface to microcontroller ports or I/O expander ports. | Port classes are the keybrd library's interface to microcontroller ports or I/O expander ports. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <PortInterface.h> | |||||
#include "PortInterface.h" | |||||
/* Port_MCP23017 | /* Port_MCP23017 | ||||
write pins are connected to matrix Row (strobe pin) or LED. | write pins are connected to matrix Row (strobe pin) or LED. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <SPI.h> | #include <SPI.h> | ||||
#include <PortInterface.h> | |||||
#include "PortInterface.h" | |||||
/* Port_MCP23S17 | /* Port_MCP23S17 | ||||
write pins are connected to matrix Row (strobe pin) or LED. | write pins are connected to matrix Row (strobe pin) or LED. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <PortInterface.h> | |||||
#include "PortInterface.h" | |||||
/* Port_PCA9655E | /* Port_PCA9655E | ||||
write pins are connected to matrix Row (strobe pin) or LED. | write pins are connected to matrix Row (strobe pin) or LED. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <SPI.h> | #include <SPI.h> | ||||
#include <PortWriteInterface.h> | |||||
#include "PortWriteInterface.h" | |||||
/* Port_ShiftRegs | /* Port_ShiftRegs | ||||
slaveSelect is Arduino-pin number connected to shift register RCLK pin a.k.a. SS or ST | slaveSelect is Arduino-pin number connected to shift register RCLK pin a.k.a. SS or ST |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <config_keybrd.h> | |||||
#include <Key.h> | |||||
#include <ScannerInterface.h> | |||||
#include <Debouncer_Samples.h> | |||||
#include <Debouncer_Not.h> | |||||
#include "config_keybrd.h" | |||||
#include "Key.h" | |||||
#include "ScannerInterface.h" | |||||
#include "Debouncer_Samples.h" | |||||
#include "Debouncer_Not.h" | |||||
/* | /* | ||||
strobePin has one of two formats: | strobePin has one of two formats: |
#ifndef SCANNERINTERFACE_H | #ifndef SCANNERINTERFACE_H | ||||
#define SCANNERINTERFACE_H | #define SCANNERINTERFACE_H | ||||
#include <config_keybrd.h> | |||||
#include "config_keybrd.h" | |||||
/* scan() retuns state of readPins. | /* scan() retuns state of readPins. | ||||
*/ | */ |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <ScannerInterface.h> | |||||
#include <PortInterface.h> | |||||
#include "ScannerInterface.h" | |||||
#include "PortInterface.h" | |||||
/* Scanner_IOE uses bit manipulation to read all pins of one port. | /* Scanner_IOE uses bit manipulation to read all pins of one port. | ||||
The maximum keys per row is 8, because ports have a maximum of 8 pins each. | The maximum keys per row is 8, because ports have a maximum of 8 pins each. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <config_keybrd.h> | |||||
#include <SPI.h> | #include <SPI.h> | ||||
#include <ScannerInterface.h> | |||||
#include "config_keybrd.h" | |||||
#include "ScannerInterface.h" | |||||
/* Scanner_ShiftRegsRead reads shift registers. | /* Scanner_ShiftRegsRead reads shift registers. | ||||
Upto 4 shift registers can be in a daisy chained for a total of 32 read pins. | Upto 4 shift registers can be in a daisy chained for a total of 32 read pins. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <config_keybrd.h> | |||||
#include <SPI.h> | #include <SPI.h> | ||||
#include <ScannerInterface.h> | |||||
#include "config_keybrd.h" | |||||
#include "ScannerInterface.h" | |||||
/* Scanner_ShiftRegsReadStrobed reads shift registers. | /* Scanner_ShiftRegsReadStrobed reads shift registers. | ||||
Shift registers can be daisy chained for a total of 32 read pins. | Shift registers can be daisy chained for a total of 32 read pins. |
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <config_keybrd.h> | |||||
#include <ScannerInterface.h> | |||||
#include "config_keybrd.h" | |||||
#include "ScannerInterface.h" | |||||
/* Scanner_uC class uses Arduino pin numbers (not port pin numbers). | /* Scanner_uC class uses Arduino pin numbers (not port pin numbers). | ||||
Limit number of readPins to size of read_pins_t, which is defined in config_keybrd.h | Limit number of readPins to size of read_pins_t, which is defined in config_keybrd.h |
Arduino\hardware\teensy\cores\teensy\keylayouts.h which is intended for use in "normal" programs. | Arduino\hardware\teensy\cores\teensy\keylayouts.h which is intended for use in "normal" programs. | ||||
This has been tested on teensy2.0. | This has been tested on teensy2.0. | ||||
*/ | */ | ||||
#include <Code_Null.h> | |||||
#include <Code_Sc.h> | |||||
#include <Code_ScS.h> | |||||
#include <Code_Shift.h> | |||||
#include "Code_Null.h" | |||||
#include "Code_Sc.h" | |||||
#include "Code_ScS.h" | |||||
#include "Code_Shift.h" | |||||
// ********** SCANCODES ********* | // ********** SCANCODES ********* | ||||
Code_Shift s_shift(MODIFIERKEY_LEFT_SHIFT); | Code_Shift s_shift(MODIFIERKEY_LEFT_SHIFT); |
Arduino\hardware\teensy\cores\teensy\keylayouts.h which is intended for use in "normal" programs. | Arduino\hardware\teensy\cores\teensy\keylayouts.h which is intended for use in "normal" programs. | ||||
This has been tested on teensy2.0. | This has been tested on teensy2.0. | ||||
*/ | */ | ||||
#include <Code_ScNS.h> | |||||
#include <Code_ScNS_00.h> | |||||
#include "Code_ScNS.h" | |||||
#include "Code_ScNS_00.h" | |||||
// ********** SCANCODES NOT SHIFTED ********* | // ********** SCANCODES NOT SHIFTED ********* | ||||
Code_ScNS_00 ns_00; //double zero | Code_ScNS_00 ns_00; //double zero |