diff options
Diffstat (limited to 'keyboard')
30 files changed, 914 insertions, 295 deletions
diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index 0d5baa9fa1..ed1d331766 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -39,7 +39,7 @@ #---------------------------------------------------------------------------- # Target file name (without extension). -TARGET = atomic_lufa +TARGET = planck_lufa # Directory common source filess exist TOP_DIR = ../.. @@ -47,20 +47,47 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . -# project specific files -SRC = keymap_common.c \ - matrix.c \ +# # project specific files +ifdef COMMON + + SRC = keymap_common.c \ led.c \ backlight.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC) else - SRC := keymap_vlad.c $(SRC) + SRC := common_keymaps/keymap_jack.c $(SRC) endif -CONFIG_H = config.h +ifdef MATRIX + SRC := matrix_$(MATRIX).c $(SRC) +else + SRC := matrix_pcb.c $(SRC) +endif + +else + +SRC = extended_keymap_common.c \ + analog.c \ + led.c \ + backlight.c + +ifdef KEYMAP + SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC) +else + SRC := extended_keymaps/extended_keymap_default.c $(SRC) +endif + +ifdef MATRIX + SRC := matrix_$(MATRIX).c $(SRC) +else + SRC := matrix_pcb.c $(SRC) +endif +endif + +CONFIG_H = config.h # MCU name #MCU = at90usb1287 @@ -120,11 +147,11 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality - # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/keyboard/atomic/Makefile.pjrc b/keyboard/atomic/Makefile.pjrc index 9655ff65a9..be83ba18b1 100644 --- a/keyboard/atomic/Makefile.pjrc +++ b/keyboard/atomic/Makefile.pjrc @@ -55,7 +55,7 @@ SRC = keymap_common.c \ ifdef KEYMAP SRC := keymap_$(KEYMAP).c $(SRC) else - SRC := keymap_poker.c $(SRC) + SRC := keymap_jack.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/atomic/README 2.md b/keyboard/atomic/README 2.md deleted file mode 100644 index 510cb5c8b6..0000000000 --- a/keyboard/atomic/README 2.md +++ /dev/null @@ -1,141 +0,0 @@ -GH60 keyboard firmware -====================== -DIY compact keyboard designed and run by komar007 and Geekhack community. - -- Both Rev.A and Rev.B PCB are supported by one firmware binary(issue #64) - -## GH60 Resources -- [KOMAR's project page](http://blog.komar.be/projects/gh60-programmable-keyboard/) -- [Prototyping](http://geekhack.org/index.php?topic=34959.0) -- [Rev.A PCB test](http://geekhack.org/index.php?topic=37570.0) -- [Rev.B PCB test](http://geekhack.org/index.php?topic=50685.0) -- [Group buy](http://geekhack.org/index.php?topic=41464.0) - - -## Build -Move to this directory then just run `make` like: - - $ make - -Use `make -f Makefile.pjrc` if you want to use PJRC stack but I find no reason to do so now. - - -## Keymap -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in top README.md) and existent keymap files. - -To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: - - $ make KEYMAP=[poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>] - - -### 1 Poker -[keymap_poker.c](keymap_poker.c) emulates original Poker layers -while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. - - Fn + Esc = ` - Fn + {left, down, up, right} = {home, pgdown, pgup, end} - -#### 1.0 Default layer - ,-----------------------------------------------------------. - | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl| - `-----------------------------------------------------------' -#### 1.1 Poker Fn layer - ,-----------------------------------------------------------. - |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | - |-----------------------------------------------------------| - | |FnQ| Up| | | | | | |Cal| |Hom|Ins| | - |-----------------------------------------------------------| - | |Lef|Dow|Rig| | |Psc|Slk|Pau| |Tsk|End| | - |-----------------------------------------------------------| - | |Del| |Web|Mut|VoU|VoD| |PgU|PgD|Del| Up | - |-----------------------------------------------------------| - | | | | FnS |Fn |Left|Down|Righ| - `-----------------------------------------------------------' - - -### 2. Plain -Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. -See [keymap_plain.c](keymap_plain.c) for detail. - -#### 1.0 Plain Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl| - `-----------------------------------------------------------' - - -### 3. Hasu -This is my favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. - - -### 4. SpaceFN -This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). - -#### 4.0 Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |App |Ctrl| - `-----------------------------------------------------------' -#### 4.1 SpaceFN layer - ,-----------------------------------------------------------. - |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - |-----------------------------------------------------------| - | | | | | | | |Hom|Up |End|Psc|Slk|Pau|Ins | - |-----------------------------------------------------------| - | | | | | | |PgU|Lef|Dow|Rig| | | | - |-----------------------------------------------------------| - | | | | | |Spc|PgD|` |~ | | | | - |-----------------------------------------------------------| - | | | | Fn | | | | | - `-----------------------------------------------------------' - - -### 5. HHKB -[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. -#### 5.0: Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | - |-----------------------------------------------------------| - |Ctrl | A| S| D| F| G| H| J| K| L|Fn3| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn | - |-----------------------------------------------------------| - | |Gui |Alt | Space | |Alt |Gui | | - `-----------------------------------------------------------' -#### 5.1: HHKB Fn layer - ,-----------------------------------------------------------. - |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - |-----------------------------------------------------------| - |Caps | | | | | | | |Psc|Slk|Pus|Up | | | - |-----------------------------------------------------------| - | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter | - |-----------------------------------------------------------| - | | | | | | | +| -|End|PgD|Dow| | | - |-----------------------------------------------------------| - | | | | | | | | | - `-----------------------------------------------------------' - diff --git a/keyboard/atomic/config.h b/keyboard/atomic/config.h index 41f7bd8b9f..fd286bb992 100644 --- a/keyboard/atomic/config.h +++ b/keyboard/atomic/config.h @@ -24,8 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 #define MANUFACTURER Ortholinear Keyboards -#define PRODUCT Atomic Keyboard -#define DESCRIPTION t.m.k. keyboard firmware for Atomic +#define PRODUCT Atomic +#define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboard/atomic/keymap_common.h b/keyboard/atomic/keymap_common.h index cfb0cb3611..7c167eb51a 100644 --- a/keyboard/atomic/keymap_common.h +++ b/keyboard/atomic/keymap_common.h @@ -33,52 +33,82 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint16_t fn_actions[]; -// JCK: Semi-Standard layout -#define KEYMAP_JCK( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, K3E, \ - K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ -} -// ASK: Short Space layout -#define KEYMAP_ASK_MESSY( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, K3E, \ - K40, K41, K43, K44, K46, K48, K49, K4A, K4B, K4C, K4D, K4E \ +// MIT Layout +/* + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_##K44, KC_NO, KC_##K46, KC_NO, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ } -#define KEYMAP_ASK( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K43, K44, K46, K47, K48, K4A, K4B, K4C, K4D, K4E \ +// Grid Layout +/* + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ +#define KEYMAP_GRID( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_NO, KC_##K0E }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_NO, KC_##K2E }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_##K3D, KC_##K3E }, \ - { KC_##K40, KC_##K41, KC_NO, KC_##K43, KC_##K44, KC_NO, KC_##K46, KC_##K47, KC_##K48, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ } +#define KEYMAP_REVERSE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ + ) { \ + { KC_##K0B, KC_##K0A, KC_##K09, KC_##K08, KC_##K07, KC_##K06, KC_##K05, KC_##K04, KC_##K03, KC_##K02, KC_##K01, KC_##K00 }, \ + { KC_##K1B, KC_##K1A, KC_##K19, KC_##K18, KC_##K17, KC_##K16, KC_##K15, KC_##K14, KC_##K13, KC_##K12, KC_##K11, KC_##K10 }, \ + { KC_##K2B, KC_##K2A, KC_##K29, KC_##K28, KC_##K27, KC_##K26, KC_##K25, KC_##K24, KC_##K23, KC_##K22, KC_##K21, KC_##K20 }, \ + { KC_##K3B, KC_##K3A, KC_##K39, KC_##K38, KC_##K37, KC_##K35, KC_##K35, KC_##K34, KC_##K33, KC_##K32, KC_##K31, KC_##K30 }, \ + } + +#define KEYMAP_AND_REVERSE(args...) KEYMAP(args), KEYMAP_REVERSE(args) + +#define KEYMAP_SWAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ + ) { \ + { KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05 }, \ + { KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15 }, \ + { KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25 }, \ + { KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K35, KC_##K35, KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34 }, \ +} -// MLO: Semi-Grid layout +#define KEYMAP_AND_SWAP(args...) KEYMAP(args), KEYMAP_SWAP(args) // GRD: Grid layout @@ -97,7 +127,4 @@ extern const uint16_t fn_actions[]; } - -// PKR: Standard layout - #endif diff --git a/keyboard/atomic/keymap_plain.c b/keyboard/atomic/keymap_plain.c deleted file mode 100644 index e7f53649f0..0000000000 --- a/keyboard/atomic/keymap_plain.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "keymap_common.h" - -// JCK: Semi-Standard layout - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - [0] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, \ - ESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, MPLY, \ - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \ - LCTL, LALT, LGUI, SPC, FN1, LEFT, DOWN, UP, RGHT), - [1] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \ - TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, DEL, \ - ESC, A, R, S, T, D, H, N, E, I, O, QUOT, ENT, MPLY, \ - LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \ - LCTL, LALT, LGUI, SPC, FN1, LEFT, DOWN, UP, RGHT), - [2] = KEYMAP_JCK(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \ - TAB, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, BSLS, DEL, \ - ESC, FN3, FN4, TRNS, TRNS, TRNS, TRNS, MINS, EQL, LBRC, RBRC, BSLS, ENT, MPLY, \ - LSFT, FN9, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, VOLD, VOLU, \ - LCTL, LALT, LGUI, SPC, TRNS, MNXT, VOLD, VOLU, MPLY), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - - [9] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), - - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; diff --git a/keyboard/atomic/keymap_ricky.c b/keyboard/atomic/keymap_ricky.c deleted file mode 100644 index fcc91a1fa5..0000000000 --- a/keyboard/atomic/keymap_ricky.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "keymap_common.h" - -// JCK: Semi-Standard layout - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - [0] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, PSCR, \ - CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, INS, \ - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, DEL, \ - LCTL, LGUI, LALT, SPC, RALT, RCTL, LEFT, DOWN, RGHT) -}; -const uint16_t PROGMEM fn_actions[] = { -}; - diff --git a/keyboard/atomic/keymap_vlad.c b/keyboard/atomic/keymap_vlad.c deleted file mode 100644 index e56bcf1618..0000000000 --- a/keyboard/atomic/keymap_vlad.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "keymap_common.h" - -// JCK: Semi-Standard layout - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - [0] = KEYMAP_ASK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, \ - CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, VOLU, \ - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, VOLD, \ - LCTL, LGUI, LALT, LGUI, SPC, RGUI, RALT, RGUI, RCTL, LEFT, DOWN, RGHT) -}; -const uint16_t PROGMEM fn_actions[] = { -};
\ No newline at end of file diff --git a/keyboard/atomic/led.c b/keyboard/atomic/led.c index 2d52fbf1c3..2c05746607 100644 --- a/keyboard/atomic/led.c +++ b/keyboard/atomic/led.c @@ -22,4 +22,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void led_set(uint8_t usb_led) { + // // Using PE6 Caps Lock LED + // if (usb_led & (1<<USB_LED_CAPS_LOCK)) + // { + // // Output high. + // DDRE |= (1<<6); + // PORTE |= (1<<6); + // } + // else + // { + // // Output low. + // DDRE &= ~(1<<6); + // PORTE &= ~(1<<6); + // } } diff --git a/keyboard/atomic/matrix.c b/keyboard/atomic/matrix.c index fd233ff53f..01f66e90fb 100644 --- a/keyboard/atomic/matrix.c +++ b/keyboard/atomic/matrix.c @@ -1,5 +1,6 @@ /* -Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2012 Jun Wako +Generated by planckkeyboard.com (2014 Jack Humbert) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdbool.h> #include <avr/io.h> #include <util/delay.h> -#include "action_layer.h" #include "print.h" #include "debug.h" #include "util.h" @@ -43,7 +43,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); - inline uint8_t matrix_rows(void) { @@ -56,7 +55,6 @@ uint8_t matrix_cols(void) return MATRIX_COLS; } - void matrix_init(void) { // To use PORTF disable JTAG with writing JTD bit twice within four cycles. @@ -106,7 +104,6 @@ uint8_t matrix_scan(void) } } - return 1; } @@ -119,7 +116,7 @@ bool matrix_is_modified(void) inline bool matrix_is_on(uint8_t row, uint8_t col) { - return (matrix[row] & ((matrix_row_t)1<<col)); + return (matrix[row] & ((matrix_row_t)1<col)); } inline diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index ad25854e6d..81c9be1e4b 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -60,7 +60,8 @@ ifdef COMMON SRC = keymap_common.c \ $(MATRIX) \ led.c \ - backlight.c + backlight.c \ + beeps.c ifdef KEYMAP SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC) @@ -68,12 +69,19 @@ else SRC := common_keymaps/keymap_jack.c $(SRC) endif +ifdef MATRIX + SRC := matrix_$(MATRIX).c $(SRC) +else + SRC := matrix_pcb.c $(SRC) +endif + else SRC = extended_keymap_common.c \ $(MATRIX) \ led.c \ - backlight.c + backlight.c \ + beeps.c ifdef KEYMAP SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC) @@ -81,6 +89,12 @@ else SRC := extended_keymaps/extended_keymap_default.c $(SRC) endif +ifdef MATRIX + SRC := matrix_$(MATRIX).c $(SRC) +else + SRC := matrix_pcb.c $(SRC) +endif + endif CONFIG_H = config.h diff --git a/keyboard/planck/analog.c b/keyboard/planck/analog.c new file mode 100644 index 0000000000..49b84ee0e8 --- /dev/null +++ b/keyboard/planck/analog.c @@ -0,0 +1,53 @@ +// Simple analog to digitial conversion + +#include <avr/io.h> +#include <avr/pgmspace.h> +#include <stdint.h> +#include "analog.h" + + +static uint8_t aref = (1<<REFS0); // default to AREF = Vcc + + +void analogReference(uint8_t mode) +{ + aref = mode & 0xC0; +} + + +// Arduino compatible pin input +int16_t analogRead(uint8_t pin) +{ +#if defined(__AVR_ATmega32U4__) + static const uint8_t PROGMEM pin_to_mux[] = { + 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, + 0x25, 0x24, 0x23, 0x22, 0x21, 0x20}; + if (pin >= 12) return 0; + return adc_read(pgm_read_byte(pin_to_mux + pin)); +#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) + if (pin >= 8) return 0; + return adc_read(pin); +#else + return 0; +#endif +} + +// Mux input +int16_t adc_read(uint8_t mux) +{ +#if defined(__AVR_AT90USB162__) + return 0; +#else + uint8_t low; + + ADCSRA = (1<<ADEN) | ADC_PRESCALER; // enable ADC + ADCSRB = (1<<ADHSM) | (mux & 0x20); // high speed mode + ADMUX = aref | (mux & 0x1F); // configure mux input + ADCSRA = (1<<ADEN) | ADC_PRESCALER | (1<<ADSC); // start the conversion + while (ADCSRA & (1<<ADSC)) ; // wait for result + low = ADCL; // must read LSB first + return (ADCH << 8) | low; // must read MSB only once! +#endif +} + + diff --git a/keyboard/planck/analog.h b/keyboard/planck/analog.h new file mode 100644 index 0000000000..9b95a93bef --- /dev/null +++ b/keyboard/planck/analog.h @@ -0,0 +1,36 @@ +#ifndef _analog_h_included__ +#define _analog_h_included__ + +#include <stdint.h> + +void analogReference(uint8_t mode); +int16_t analogRead(uint8_t pin); +int16_t adc_read(uin |