diff options
author | yiancar <yiangosyiangou@cytanet.com.cy> | 2020-08-25 04:37:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 20:37:01 -0700 |
commit | 5460489b5177245371d23b84b94673951866d003 (patch) | |
tree | de427ab289da564e53fd03870eb5a4bae71741ab | |
parent | ecb212106950d4ffc5dca64fc06f031b6b12fcc1 (diff) | |
download | qmk_firmware-5460489b5177245371d23b84b94673951866d003.tar.gz qmk_firmware-5460489b5177245371d23b84b94673951866d003.zip |
[Keyboard] Barleycorn (#10118)
* Initial commit
* Barleycorn rename
* Update readme.md
* PR checklist fixes
* Update info.json
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/config.h
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/config.h
* Update keyboards/barleycorn/info.json
* Update keyboards/barleycorn/info.json
* Update keyboards/barleycorn/readme.md
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/rules.mk
* PR review
* Update keyboards/barleycorn/readme.md
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/keymaps/default/readme.md
* Update keyboards/barleycorn/keymaps/iso/readme.md
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/readme.md
* Update keyboards/barleycorn/rules.mk
* Update keyboards/barleycorn/matrix.c
* Update keyboards/barleycorn/barleycorn.c
* added ansi/iso keymaps!
* Update keyboards/barleycorn/info.json
-rw-r--r-- | keyboards/barleycorn/barleycorn.c | 37 | ||||
-rw-r--r-- | keyboards/barleycorn/barleycorn.h | 63 | ||||
-rw-r--r-- | keyboards/barleycorn/config.h | 103 | ||||
-rw-r--r-- | keyboards/barleycorn/info.json | 283 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/default/keymap.c | 34 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/default/readme.md | 11 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/iso/keymap.c | 35 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/iso/readme.md | 11 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/via/keymap.c | 48 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/via/readme.md | 3 | ||||
-rw-r--r-- | keyboards/barleycorn/keymaps/via/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/barleycorn/matrix.c | 138 | ||||
-rw-r--r-- | keyboards/barleycorn/readme.md | 23 | ||||
-rw-r--r-- | keyboards/barleycorn/rules.mk | 27 |
14 files changed, 819 insertions, 0 deletions
diff --git a/keyboards/barleycorn/barleycorn.c b/keyboards/barleycorn/barleycorn.c new file mode 100644 index 0000000000..4d555de195 --- /dev/null +++ b/keyboards/barleycorn/barleycorn.c @@ -0,0 +1,37 @@ +/* Copyright 2020 Yiancar + * + * 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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "barleycorn.h" + +void keyboard_pre_init_kb(void) { + // Set our LED pins as output + setPinOutput(B5); + setPinOutput(C0); + keyboard_pre_init_user(); +} + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + // writePin sets the pin high for 1 and low for 0. + // In this example the pins are inverted, setting + // it low/0 turns it on, and high/1 turns the LED off. + // This behavior depends on whether the LED is between the pin + // and VCC or the pin and GND. + writePin(B5, led_state.caps_lock); + writePin(C0, led_state.num_lock); + } + return res; +} diff --git a/keyboards/barleycorn/barleycorn.h b/keyboards/barleycorn/barleycorn.h new file mode 100644 index 0000000000..0b266feaed --- /dev/null +++ b/keyboards/barleycorn/barleycorn.h @@ -0,0 +1,63 @@ +/* Copyright 2020 Yiancar + * + * 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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#define XXX KC_NO + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, K1F, K1G, K1H, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, K2F, K2G, K2H, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \ +} + +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, K1F, K1G, K1H, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, K2F, K2G, K2H, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, K1G, K1H, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \ +} diff --git a/keyboards/barleycorn/config.h b/keyboards/barleycorn/config.h new file mode 100644 index 0000000000..77714a87fc --- /dev/null +++ b/keyboards/barleycorn/config.h @@ -0,0 +1,103 @@ +/* +Copyright 2020 Yiancar + +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 +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x8968 +#define PRODUCT_ID 0x4749 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar-Designs +#define PRODUCT Barleycorn + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 18 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ + +/* A Custom matrix.c is used to poll the port expander C6 shows that the pins are hardwired there */ +#define MATRIX_ROW_PINS { B4, B3, B2, B1, C1 } +#define MATRIX_COL_PINS { B0, D7, D6, D4, D1, D0, C3, C2, D5, D5, D5, D5, D5, D5, D5, D5, D5, D5 } +#define UNUSED_PINS +#define PORT_EXPANDER_ADDRESS 0x20 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define USB_MAX_POWER_CONSUMPTION 100 + + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/barleycorn/info.json b/keyboards/barleycorn/info.json new file mode 100644 index 0000000000..4334f383f0 --- /dev/null +++ b/keyboards/barleycorn/info.json @@ -0,0 +1,283 @@ +{ + "keyboard_name": "Barleycorn", + "maintainer": "Yiancar", + "width": 19.5, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"0,0", "x":0, "y":0}, + {"label":"0,1", "x":1, "y":0}, + {"label":"0,2", "x":2, "y":0}, + {"label":"0,3", "x":3, "y":0}, + {"label":"0,4", "x":4, "y":0}, + {"label":"0,5", "x":5, "y":0}, + {"label":"0,6", "x":6, "y":0}, + {"label":"0,7", "x":7, "y":0}, + {"label":"0,8", "x":8, "y":0}, + {"label":"0,9", "x":9, "y":0}, + {"label":"0,10", "x":10, "y":0}, + {"label":"0,11", "x":11, "y":0}, + {"label":"0,12", "x":12, "y":0}, + {"label":"0,13", "x":13, "y":0}, + {"label":"1,13", "x":14, "y":0}, + {"label":"0,14", "x":15.5, "y":0}, + {"label":"0,15", "x":16.5, "y":0}, + {"label":"0,16", "x":17.5, "y":0}, + {"label":"0,17", "x":18.5, "y":0}, + + {"label":"1,0", "x":0, "y":1, "w":1.5}, + {"label":"1,1", "x":1.5, "y":1}, + {"label":"1,2", "x":2.5, "y":1}, + {"label":"1,3", "x":3.5, "y":1}, + {"label":"1,4", "x":4.5, "y":1}, + {"label":"1,5", "x":5.5, "y":1}, + {"label":"1,6", "x":6.5, "y":1}, + {"label":"1,7", "x":7.5, "y":1}, + {"label":"1,8", "x":8.5, "y":1}, + {"label":"1,9", "x":9.5, "y":1}, + {"label":"1,10", "x":10.5, "y":1}, + {"label":"1,11", "x":11.5, "y":1}, + {"label":"1,12", "x":12.5, "y":1}, + {"label":"2,12", "x":13.5, "y":1, "w":1.5}, + {"label":"1,14", "x":15.5, "y":1}, + {"label":"1,15", "x":16.5, "y":1}, + {"label":"1,16", "x":17.5, "y":1}, + {"label":"1,17", "x":18.5, "y":1}, + + {"label":"2,0", "x":0, "y":2, "w":1.75}, + {"label":"2,1", "x":1.75, "y":2}, + {"label":"2,2", "x":2.75, "y":2}, + {"label":"2,3", "x":3.75, "y":2}, + {"label":"2,4", "x":4.75, "y":2}, + {"label":"2,5", "x":5.75, "y":2}, + {"label":"2,6", "x":6.75, "y":2}, + {"label":"2,7", "x":7.75, "y":2}, + {"label":"2,8", "x":8.75, "y":2}, + {"label":"2,9", "x":9.75, "y":2}, + {"label":"2,10", "x":10.75, "y":2}, + {"label":"2,11", "x":11.75, "y":2}, + {"label":"2,13", "x":12.75, "y":2, "w":2.25}, + {"label":"2,14", "x":15.5, "y":2}, + {"label":"2,15", "x":16.5, "y":2}, + {"label":"2,16", "x":17.5, "y":2}, + {"label":"2,17", "x":18.5, "y":2}, + + {"label":"3,0", "x":0, "y":3, "w":1.25}, + {"label":"3,1", "x":1.25, "y":3}, + {"label":"3,2", "x":2.25, "y":3}, + {"label":"3,3", "x":3.25, "y":3}, + {"label":"3,4", "x":4.25, "y":3}, + {"label":"3,5", "x":5.25, "y":3}, + {"label":"3,6", "x":6.25, "y":3}, + {"label":"3,7", "x":7.25, "y":3}, + {"label":"3,8", "x":8.25, "y":3}, + {"label":"3,9", "x":9.25, "y":3}, + {"label":"3,10", "x":10.25, "y":3}, + {"label":"3,11", "x":11.25, "y":3}, + {"label":"3,12", "x":12.25, "y":3, "w":1.75}, + {"label":"3,13", "x":14.25, "y":3.25}, + {"label":"3,14", "x":15.5, "y":3}, + {"label":"3,15", "x":16.5, "y":3}, + {"label":"3,16", "x":17.5, "y":3}, + {"label":"3,17", "x":18.5, "y":3}, + + {"label":"4,0", "x":0, "y":4, "w":1.25}, + {"label":"4,1", "x":1.25, "y":4, "w":1.25}, + {"label":"4,2", "x":2.5, "y":4, "w":1.25}, + {"label":"4,6", "x":3.75, "y":4, "w":6.25}, + {"label":"4,10", "x":10, "y":4, "w":1.5}, + {"label":"4,11", "x":11.5, "y":4, "w":1.5}, + {"label":"4,12", "x":13.25, "y":4.25}, + {"label":"4,13", "x":14.25, "y":4.25}, + {"label":"4,14", "x":15.25, "y":4.25}, + {"label":"4,15", "x":16.5, "y":4}, + {"label":"4,16", "x":17.5, "y":4}, + {"label":"4,17", "x":18.5, "y":4} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"0,0", "x":0, "y":0}, + {"label":"0,1", "x":1, "y":0}, + {"label":"0,2", "x":2, "y":0}, + {"label":"0,3", "x":3, "y":0}, + {"label":"0,4", "x":4, "y":0}, + {"label":"0,5", "x":5, "y":0}, + {"label":"0,6", "x":6, "y":0}, + {"label":"0,7", "x":7, "y":0}, + {"label":"0,8", "x":8, "y":0}, + {"label":"0,9", "x":9, "y":0}, + {"label":"0,10", "x":10, "y":0}, + {"label":"0,11", "x":11, "y":0}, + {"label":"0,12", "x":12, "y":0}, + {"label":"0,13", "x":13, "y":0}, + {"label":"1,13", "x":14, "y":0}, + {"label":"0,14", "x":15.5, "y":0}, + {"label":"0,15", "x":16.5, "y":0}, + {"label":"0,16", "x":17.5, "y":0}, + {"label":"0,17", "x":18.5, "y":0}, + + {"label":"1,0", "x":0, "y":1, "w":1.5}, + {"label":"1,1", "x":1.5, "y":1}, + {"label":"1,2", "x":2.5, "y":1}, + {"label":"1,3", "x":3.5, "y":1}, + {"label":"1,4", "x":4.5, "y":1}, + {"label":"1,5", "x":5.5, "y":1}, + {"label":"1,6", "x":6.5, "y":1}, + {"label":"1,7", "x":7.5, "y":1}, + {"label":"1,8", "x":8.5, "y":1}, + {"label":"1,9", "x":9.5, "y":1}, + {"label":"1,10", "x":10.5, "y":1}, + {"label":"1,11", "x":11.5, "y":1}, + {"label":"1,12", "x":12.5, "y":1}, + {"label":"2,12", "x":13.5, "y":1, "w":1.5}, + {"label":"1,14", "x":15.5, "y":1}, + {"label":"1,15", "x":16.5, "y":1}, + {"label":"1,16", "x":17.5, "y":1}, + {"label":"1,17", "x":18.5, "y":1}, + + {"label":"2,0", "x":0, "y":2, "w":1.75}, + {"label":"2,1", "x":1.75, "y":2}, + {"label":"2,2", "x":2.75, "y":2}, + {"label":"2,3", "x":3.75, "y":2}, + {"label":"2,4", "x":4.75, "y":2}, + {"label":"2,5", "x":5.75, "y":2}, + {"label":"2,6", "x":6.75, "y":2}, + {"label":"2,7", "x":7.75, "y":2}, + {"label":"2,8", "x":8.75, "y":2}, + {"label":"2,9", "x":9.75, "y":2}, + {"label":"2,10", "x":10.75, "y":2}, + {"label":"2,11", "x":11.75, "y":2}, + {"label":"2,13", "x":12.75, "y":2, "w":2.25}, + {"label":"2,14", "x":15.5, "y":2}, + {"label":"2,15", "x":16.5, "y":2}, + {"label":"2,16", "x":17.5, "y":2}, + {"label":"2,17", "x":18.5, "y":2}, + + {"label":"3,0", "x":0, "y":3, "w":2.25}, + {"label":"3,2", "x":2.25, "y":3}, + {"label":"3,3", "x":3.25, "y":3}, + {"label":"3,4", "x":4.25, "y":3}, + {"label":"3,5", "x":5.25, "y":3}, + {"label":"3,6", "x":6.25, "y":3}, + {"label":"3,7", "x":7.25, "y":3}, + {"label":"3,8", "x":8.25, "y":3}, + {"label":"3,9", "x":9.25, "y":3}, + {"label":"3,10", "x":10.25, "y":3}, + {"label":"3,11", "x":11.25, "y":3}, + {"label":"3,12", "x":12.25, "y":3, "w":1.75}, + {"label":"3,13", "x":14.25, "y":3.25}, + {"label":"3,14", "x":15.5, "y":3}, + {"label":"3,15", "x":16.5, "y":3}, + {"label":"3,16", "x":17.5, "y":3}, + {"label":"3,17", "x":18.5, "y":3}, + + {"label":"4,0", "x":0, "y":4, "w":1.25}, + {"label":"4,1", "x":1.25, "y":4, "w":1.25}, + {"label":"4,2", "x":2.5, "y":4, "w":1.25}, + {"label":"4,6", "x":3.75, "y":4, "w":6.25}, + {"label":"4,10", "x":10, "y":4, "w":1.5}, + {"label":"4,11", "x":11.5, "y":4, "w":1.5}, + {"label":"4,12", "x":13.25, "y":4.25}, + {"label":"4,13", "x":14.25, "y":4.25}, + {"label":"4,14", "x":15.25, "y":4.25}, + {"label":"4,15", "x":16.5, "y":4}, + {"label":"4,16", "x":17.5, "y":4}, + {"label":"4,17", "x":18.5, "y":4} + ] + }, + "LAYOUT_iso": { + "layout": [ + {"label":"0,0", "x":0, "y":0}, + {"label":"0,1", "x":1, "y":0}, + {"label":"0,2", "x":2, "y":0}, + {"label":"0,3", "x":3, "y":0}, + {"label":"0,4", "x":4, "y":0}, + {"label":"0,5", "x":5, "y":0}, + {"label":"0,6", "x":6, "y":0}, + {"label":"0,7", "x":7, "y":0}, + {"label":"0,8", "x":8, "y":0}, + {"label":"0,9", "x":9, "y":0}, + {"label":"0,10", "x":10, "y":0}, + {"label":"0,11", "x":11, "y":0}, + {"label":"0,12", "x":12, "y":0}, + {"label":"0,13", "x":13, "y":0}, + {"label":"1,13", "x":14, "y":0}, + {"label":"0,14", "x":15.5, "y":0}, + {"label":"0,15", "x":16.5, "y":0}, + {"label":"0,16", "x":17.5, "y":0}, + {"label":"0,17", "x":18.5, "y":0}, + + {"label":"1,0", "x":0, "y":1, "w":1.5}, + {"label":"1,1", "x":1.5, "y":1}, + {"label":"1,2", "x":2.5, "y":1}, + {"label":"1,3", "x":3.5, "y":1}, + {"label":"1,4", "x":4.5, "y":1}, + {"label":"1,5", "x":5.5, "y":1}, + {"label":"1,6", "x":6.5, "y":1}, + {"label":"1,7", "x":7.5, "y":1}, + {"label":"1,8", "x":8.5, "y":1}, + {"label":"1,9", "x":9.5, "y":1}, + {"label":"1,10", "x":10.5, "y":1}, + {"label":"1,11", "x":11.5, "y":1}, + {"label":"1,12", "x":12.5, "y":1}, + {"label":"1,14", "x":15.5, "y":1}, + {"label":"1,15", "x":16.5, "y":1}, + {"label":"1,16", "x":17.5, "y":1}, + {"label":"1,17", "x":18.5, "y":1}, + + {"label":"2,0", "x":0, "y":2, "w":1.75}, + {"label":"2,1", "x":1.75, "y":2}, + {"label":"2,2", "x":2.75, "y":2}, + {"label":"2,3", "x":3.75, "y":2}, + {"label":"2,4", "x":4.75, "y":2}, + {"label":"2,5", "x":5.75, "y":2}, + {"label":"2,6", "x":6.75, "y":2}, + {"label":"2,7", "x":7.75, "y":2}, + {"label":"2,8", "x":8.75, "y":2}, + {"label":"2,9", "x":9.75, "y":2}, + {"label":"2,10", "x":10.75, "y":2}, + {"label":"2,11", "x":11.75, "y":2}, + {"label":"2,12", "x":12.75, "y":2}, + {"label":"2,13", "x":13.75, "y":1, "w":1.25, "h":2}, + {"label":"2,14", "x":15.5, "y":2}, + {"label":"2,15", "x":16.5, "y":2}, + {"label":"2,16", "x":17.5, "y":2}, + {"label":"2,17", "x":18.5, "y":2}, + + {"label":"3,0", "x":0, "y":3, "w":1.25}, + {"label":"3,1", "x":1.25, "y":3}, + {"label":"3,2", "x":2.25, "y":3}, + {"label":"3,3", "x":3.25, "y":3}, + {"label":"3,4", "x":4.25, "y":3}, + {"label":"3,5", "x":5.25, "y":3}, + {"label":"3,6", "x":6.25, "y":3}, + {"label":"3,7", "x":7.25, "y":3}, + {"label":"3,8", "x":8.25, "y":3}, + {"label":"3,9", "x":9.25, "y":3}, + {"label":"3,10", "x":10.25, "y":3}, + {"label":"3,11", "x":11.25, "y":3}, + {"label":"3,12", "x":12.25, "y":3, "w":1.75}, + {"label":"3,13", "x":14.25, "y":3.25}, + {"label":"3,14", "x":15.5, "y":3}, + {"label":"3,15", "x":16.5, "y":3}, + {"label":"3,16", "x":17.5, "y":3}, + {"label":"3,17", "x":18.5, "y":3}, + + {"label":"4,0", "x":0, "y":4, "w":1.25}, + {"label":"4,1", "x":1.25, "y":4, "w":1.25}, + {"label":"4,2", "x":2.5, "y":4, "w":1.25}, + {"label":"4,6", "x":3.75, "y":4, "w":6.25}, + {"label":"4,10", "x":10, "y":4, "w":1.5}, + {"label":"4,11", "x":11.5, "y":4, "w":1.5}, + {"label":"4,12", "x":13.25, "y":4.25}, + {"label":"4,13", "x":14.25, "y":4.25}, + {"label":"4,14", "x":15.25, "y":4.25}, + {"label":"4,15", "x":16.5, "y":4}, + {"label":"4,16", "x":17.5, "y":4}, + {"label":"4,17", "x":18.5, "y":4} + ] + } + } + } diff --git a/keyboards/barleycorn/keymaps/default/keymap.c b/keyboards/barleycorn/keymaps/default/keymap.c new file mode 100644 index 0000000000..230b78e991 --- /dev/null +++ b/keyboards/barleycorn/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +/* Copyright 2020 Yiancar + * + * 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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +//This is the ANSI version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ansi( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + +[1] = LAYOUT_ansi( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/barleycorn/keymaps/default/readme.md b/keyboards/barleycorn/keymaps/default/readme.md new file mode 100644 index 0000000000..04903f8cc9 --- /dev/null +++ b/keyboards/barleycorn/keymaps/default/readme.md @@ -0,0 +1,11 @@ +# The default keymap for Barleycorn + +![Layer 0](https://i.imgur.com/cU9lzz3.png) + +![Layer 1](https://i.imgur.com/0G3e1K3.png) + +Default layer is normal ANSI and Fn layer is used for Volume control and arrow cluster. + +Alternative ANSI layouts: + +![Alt Keymap](https://i.imgur.com/6uAx8jZ.png) diff --git a/keyboards/barleycorn/keymaps/iso/keymap.c b/keyboards/barleycorn/keymaps/iso/keymap.c new file mode 100644 index 0000000000..7fd4d06969 --- /dev/null +++ b/keyboards/barleycorn/keymaps/iso/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2020 Yiancar + * + * 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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +//This is the ISO version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_iso( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PEQL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + +[1] = LAYOUT_iso( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/barleycorn/keymaps/iso/readme.md b/keyboards/barleycorn/keymaps/iso/readme.md new file mode 100644 index 0000000000..492abfcecc --- /dev/null +++ b/keyboards/barleycorn/keymaps/iso/readme.md @@ -0,0 +1,11 @@ +# The default keymap for ISO Barleycorn + +![Layer 0](https://i.imgur.com/llZlVHt.png) + +![Layer 1](https://i.imgur.com/hrYtMQk.png) + +Default layer is normal ISO and Fn layer is used for Volume control and arrow cluster + +Alternative ISO layouts: + +![Alt Keymap](https://i.imgur.com/2cL0IGQ.png) diff --git a/keyboards/barleycorn/keymaps/via/keymap.c b/keyboards/barleycorn/keymaps/via/keymap.c new file mode 100644 index 0000000000..90ce60d1ea --- /dev/null +++ b/keyboards/barleycorn/keymaps/via/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2020 Yiancar + * + * 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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +// This keymaps is used for VIA, it reflects the default keymap. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_all( /* Base */ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + +[1] = LAYOUT_all( /* FN */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[2] = LAYOUT_all( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[3] = LAYOUT_all( /* Empty for dynamic keymaps */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/barleycorn/keymaps/via/readme.md b/keyboards/barleycorn/keymaps/via/readme.md new file mode 100644 index 0000000000..a49e2c0568 --- /dev/null +++ b/keyboards/barleycorn/keymaps/via/readme.md @@ -0,0 +1,3 @@ +# Compile with this keymap to use VIA + +Sadly right now when using VIA, extrakeys is disabled. This means volume control will not work. diff --git a/keyboards/barleycorn/keymaps/via/rules.mk b/keyboards/barleycorn/keymaps/via/rules.mk new file mode 100644 index 0000000000..930e3552ad --- /dev/null +++ b/keyboards/barleycorn/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = no diff --git a/keyboards/barleycorn/matrix.c b/keyboards/barleycorn/matrix.c new file mode 100644 index 0000000000..99366d6098 --- /dev/null +++ b/keyboards/barleycorn/matrix.c @@ -0,0 +1,138 @@ +/* +Copyright 2012-2020 Jun Wako, Jack Humbert, Yiancar + +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 +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ +#include <stdint.h> +#include <stdbool.h> +#include "wait.h" +#include "quantum.h" +#include "i2c_master.h" + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static void unselect_rows(void) { + for(uint8_t x = 0; x < MATRIX_ROWS; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); +} + +static void unselect_row(uint8_t row) { + setPinInputHigh(row_pins[row]); +} + +static void init_pins(void) { + unselect_rows(); + // Set I/O + uint8_t send_data[2] = { 0xFF, 0x03}; + i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x00, &send_data[0], 2, 20); + // Set Pull-up + i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x0C, &send_data[0], 2, 20); + + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + if ( x < 8 ) { + setPinInputHigh(col_pins[x]); + } + } +} + +void matrix_init_custom(void) { + // TODO: initialize hardware here + // Initialize I2C + i2c_init(); + + // initialize key pins + init_pins(); + wait_ms(50); +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + matrix_io_delay(); + + uint8_t port_expander_col_buffer[2]; + i2c_readReg((PORT_EXPANDER_ADDRESS << 1), 0x12, &port_expander_col_buffer[0], 2, 20); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + uint8_t pin_state; + // Select the col pin to read (active low) + switch (col_index) { + case 8 : + pin_state = port_expander_col_buffer[0] & (1 << 0); + break; + case 9 : + pin_state = port_expander_col_buffer[0] & (1 << 1); + break; + case 10 : + pin_state = port_expander_col_buffer[0] & (1 << 2); + break; + case 11 : + pin_state = port_expander_col_buffer[0] & (1 << 3); + break; + case 12 : + pin_state = port_expander_col_buffer[0] & (1 << 4); + break; + case 13 : + pin_state = port_expander_col_buffer[0] & (1 << 5); + break; + case 14 : + pin_state = port_expander_col_buffer[0] & (1 << 6); + break; + case 15 : + pin_state = port_expander_col_buffer[0] & (1 << 7); + break; + case 16 : + pin_state = port_expander_col_buffer[1] & (1 << 0); + break; + case 17 : + pin_state = port_expander_col_buffer[1] & (1 << 1); + break; + default : + pin_state = readPin(col_pins[col_index]); + } + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + bool matrix_has_changed = false; + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + matrix_has_changed |= read_cols_on_row(current_matrix, current_row); + } + + return matrix_has_changed; +} diff --git a/keyboards/barleycorn/readme.md b/keyboards/barleycorn/readme.md new file mode 100644 index 0000000000..775d259681 --- /dev/null +++ b/keyboards/barleycorn/readme.md @@ -0,0 +1,23 @@ +# Barleycorn + +![Barleycorn](https://i.imgur.com/vi3L1HYl.png) + +An f-row less compact 1800 kit with only through hole components. + +* Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [GitHub](https://github.com/yiancar) +* Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/yiancar/gingham_pcb) +* Hardware Availability: https://mykeyboard.eu/, https://novelkeys.xyz + +Make example for this keyboard (after setting up your build environment): + + make barleycorn:default + +Flashing example for this keyboard: + + make barleycorn:default:flash + +Bootloader: +use usbasploader from HSGW's repository. +https://github.com/hsgw/USBaspLoader/tree/plaid + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/barleycorn/rules.mk b/keyboards/barleycorn/rules.mk new file mode 100644 index 0000000000..be005ab297 --- /dev/null +++ b/keyboards/barleycorn/rules.mk @@ -0,0 +1,27 @@ +# MCU name +MCU = atmega328p + +# Bootloader selection +BOOTLOADER = USBasp + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output + +CUSTOM_MATRIX = lite + +SRC += matrix.c +QUANTUM_LIB_SRC += i2c_master.c |