Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions keyboards/ibm/model_m/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2024 Richard George

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

/*
* Arduino Pro Micro Pin Mapping
* ---------------------------
* Physical pin locations preserved from original design:
* D5 (Arduino Pin 5) -> PC6 -> QMK: C6 (CS1 - Expander A, address 0x01, long 16-pin connector, columns)
* D6 (Arduino Pin 6) -> PD7 -> QMK: D7 (CS2 - Expander B, address 0x00, short 8-pin connector, rows)
* D14 (Arduino Pin 14) -> PB3 -> QMK: B3 (MISO)
* D15 (Arduino Pin 15) -> PB1 -> QMK: B1 (SCK)
* D16 (Arduino Pin 16) -> PB2 -> QMK: B2 (MOSI)
*
* MCP23S17 Configuration:
* - Expander A (CS1): Connected to long 16-pin connector, handles columns, address 0x01
* GPA0->pin1, GPA1->pin2, ..., GPA7->pin8, GPB0->pin9, ..., GPB7->pin16
* - Expander B (CS2): Connected to short 8-pin connector, handles rows, address 0x00
* GPA0->pin1, GPA1->pin2, ..., GPA7->pin8
*/

/* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 16

/* SPI for MCP23S17 - mapped to Arduino Pro Micro physical pins */
#define SPI_DRIVER SPID1 /* Using hardware SPI on pins D14-D16 */
#define MCP23S17_CS1_PIN C6 /* D5 -> PC6 (CS1 - Expander A for columns) */
#define MCP23S17_CS2_PIN D7 /* D6 -> PD7 (CS2 - Expander B for rows) */
Comment on lines +43 to +44

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt really add value as the only file thats ever going to use it is the keyboards matrix.c

Suggested change
#define MCP23S17_CS1_PIN C6 /* D5 -> PC6 (CS1 - Expander A for columns) */
#define MCP23S17_CS2_PIN D7 /* D6 -> PD7 (CS2 - Expander B for rows) */

143 changes: 143 additions & 0 deletions keyboards/ibm/model_m/keyboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"manufacturer": "rgeorge",
"keyboard_name": "model_m",
"maintainer": "rgeorge",
"bootmagic": {
"matrix": [0, 5]
},
"development_board": "promicro",
"features": {
"bootmagic": true,
"command": true,
"extrakey": true,
"mousekey": true
},
"indicators": {
"caps_lock": "E6",
"num_lock": "B5",
"on_state": 0,
"scroll_lock": "B4"
},
"matrix_pins": {
"ghost": true
},
"qmk": {
"locking": {
"enabled": true,
"resync": true
}
},
"usb": {
"device_version": "0.0.1",
"pid": "0x0001",
"vid": "0x5247"
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "Esc", "matrix": [0, 5], "x": 0, "y": 0},
{"label": "F1", "matrix": [2, 4], "x": 2, "y": 0},
{"label": "F2", "matrix": [2, 3], "x": 3, "y": 0},
{"label": "F3", "matrix": [1, 3], "x": 4, "y": 0},
{"label": "F4", "matrix": [0, 3], "x": 5, "y": 0},
{"label": "F5", "matrix": [0, 1], "x": 6.5, "y": 0},
{"label": "F6", "matrix": [0, 8], "x": 7.5, "y": 0},
{"label": "F7", "matrix": [1, 9], "x": 8.5, "y": 0},
{"label": "F8", "matrix": [2, 9], "x": 9.5, "y": 0},
{"label": "F9", "matrix": [2, 1], "x": 11, "y": 0},
{"label": "F10", "matrix": [3, 1], "x": 12, "y": 0},
{"label": "F11", "matrix": [3, 11], "x": 13, "y": 0},
{"label": "F12", "matrix": [3, 12], "x": 14, "y": 0},
{"label": "Print Screen", "matrix": [3, 15], "x": 15.5, "y": 0},
{"label": "Scroll Lock", "matrix": [4, 15], "x": 16.5, "y": 0},
{"label": "Pause", "matrix": [6, 14], "x": 17.5, "y": 0},
{"label": "`", "matrix": [2, 5], "x": 0, "y": 1.5},
{"label": "1", "matrix": [3, 5], "x": 1, "y": 1.5},
{"label": "2", "matrix": [3, 4], "x": 2, "y": 1.5},
{"label": "3", "matrix": [3, 3], "x": 3, "y": 1.5},
{"label": "4", "matrix": [3, 2], "x": 4, "y": 1.5},
{"label": "5", "matrix": [2, 2], "x": 5, "y": 1.5},
{"label": "6", "matrix": [2, 0], "x": 6, "y": 1.5},
{"label": "7", "matrix": [3, 0], "x": 7, "y": 1.5},
{"label": "8", "matrix": [3, 8], "x": 8, "y": 1.5},
{"label": "9", "matrix": [3, 9], "x": 9, "y": 1.5},
{"label": "0", "matrix": [3, 10], "x": 10, "y": 1.5},
{"label": "-", "matrix": [2, 10], "x": 11, "y": 1.5},
{"label": "=", "matrix": [2, 8], "x": 12, "y": 1.5},
{"label": "Backspace", "matrix": [1, 1], "x": 14, "y": 1.5, "w": 2},
{"label": "Insert", "matrix": [2, 12], "x": 15.5, "y": 1.5},
{"label": "Home", "matrix": [2, 14], "x": 16.5, "y": 1.5},
{"label": "Page Up", "matrix": [2, 13], "x": 17.5, "y": 1.5},
{"label": "Num Lock", "matrix": [6, 11], "x": 19, "y": 1.5},
{"label": "/", "matrix": [6, 12], "x": 20, "y": 1.5},
{"label": "*", "matrix": [6, 13], "x": 21, "y": 1.5},
{"label": "-", "matrix": [7, 13], "x": 22, "y": 1.5},
{"label": "Tab", "matrix": [1, 5], "x": 0, "y": 2.5, "w": 1.5},
{"label": "Q", "matrix": [4, 5], "x": 1.5, "y": 2.5},
{"label": "W", "matrix": [4, 4], "x": 2.5, "y": 2.5},
{"label": "E", "matrix": [4, 3], "x": 3.5, "y": 2.5},
{"label": "R", "matrix": [4, 2], "x": 4.5, "y": 2.5},
{"label": "T", "matrix": [1, 2], "x": 5.5, "y": 2.5},
{"label": "Y", "matrix": [1, 0], "x": 6.5, "y": 2.5},
{"label": "U", "matrix": [4, 0], "x": 7.5, "y": 2.5},
{"label": "I", "matrix": [4, 8], "x": 8.5, "y": 2.5},
{"label": "O", "matrix": [4, 9], "x": 9.5, "y": 2.5},
{"label": "P", "matrix": [4, 10], "x": 10.5, "y": 2.5},
{"label": "[", "matrix": [1, 10], "x": 11.5, "y": 2.5},
{"label": "]", "matrix": [1, 8], "x": 12.5, "y": 2.5},
{"label": "Enter", "matrix": [6, 1], "x": 13.5, "y": 2.5, "w": 1.5},
{"label": "Delete", "matrix": [2, 11], "x": 15.5, "y": 2.5},
{"label": "End", "matrix": [3, 14], "x": 16.5, "y": 2.5},
{"label": "Page Down", "matrix": [3, 13], "x": 17.5, "y": 2.5},
{"label": "7", "matrix": [4, 11], "x": 19, "y": 2.5},
{"label": "8", "matrix": [4, 12], "x": 20, "y": 2.5},
{"label": "9", "matrix": [4, 13], "x": 21, "y": 2.5},
{"label": "+", "matrix": [4, 14], "x": 22, "y": 2.5, "h": 2},
{"label": "Caps Lock", "matrix": [1, 4], "x": 0, "y": 3.5, "w": 1.25},
{"label": "A", "matrix": [5, 5], "x": 1.75, "y": 3.5},
{"label": "S", "matrix": [5, 4], "x": 2.75, "y": 3.5},
{"label": "D", "matrix": [5, 3], "x": 3.75, "y": 3.5},
{"label": "F", "matrix": [5, 2], "x": 4.75, "y": 3.5},
{"label": "G", "matrix": [0, 2], "x": 5.75, "y": 3.5},
{"label": "H", "matrix": [0, 0], "x": 6.75, "y": 3.5},
{"label": "J", "matrix": [5, 0], "x": 7.75, "y": 3.5},
{"label": "K", "matrix": [5, 8], "x": 8.75, "y": 3.5},
{"label": "L", "matrix": [5, 9], "x": 9.75, "y": 3.5},
{"label": ";", "matrix": [5, 10], "x": 10.75, "y": 3.5},
{"label": "'", "matrix": [0, 10], "x": 11.75, "y": 3.5},
{"label": "#", "matrix": [5, 1], "x": 12.75, "y": 3.5},
{"label": "4", "matrix": [1, 11], "x": 19, "y": 3.5},
{"label": "5", "matrix": [1, 12], "x": 20, "y": 3.5},
{"label": "6", "matrix": [1, 13], "x": 21, "y": 3.5},
{"label": "Shift", "matrix": [1, 6], "x": 0, "y": 4.5, "w": 1.25},
{"label": "\\", "matrix": [7, 4], "x": 1.25, "y": 4.5},
{"label": "Z", "matrix": [6, 5], "x": 2.25, "y": 4.5},
{"label": "X", "matrix": [6, 4], "x": 3.25, "y": 4.5},
{"label": "C", "matrix": [6, 3], "x": 4.25, "y": 4.5},
{"label": "V", "matrix": [6, 2], "x": 5.25, "y": 4.5},
{"label": "B", "matrix": [7, 2], "x": 6.25, "y": 4.5},
{"label": "N", "matrix": [7, 0], "x": 7.25, "y": 4.5},
{"label": "M", "matrix": [6, 0], "x": 8.25, "y": 4.5},
{"label": ",", "matrix": [6, 8], "x": 9.25, "y": 4.5},
{"label": ".", "matrix": [6, 9], "x": 10.25, "y": 4.5},
{"label": "/", "matrix": [7, 10], "x": 11.25, "y": 4.5},
{"label": "Shift", "matrix": [6, 6], "x": 12.25, "y": 4.5, "w": 2.75},
{"label": "Up", "matrix": [0, 14], "x": 16.5, "y": 4.5},
{"label": "1", "matrix": [5, 11], "x": 19, "y": 4.5},
{"label": "2", "matrix": [5, 12], "x": 20, "y": 4.5},
{"label": "3", "matrix": [5, 13], "x": 21, "y": 4.5},
{"label": "Enter", "matrix": [5, 14], "x": 22, "y": 4.5, "h": 2},
{"label": "Ctrl", "matrix": [2, 7], "x": 0, "y": 5.5, "w": 1.5},
{"label": "Alt", "matrix": [0, 15], "x": 2.5, "y": 5.5, "w": 1.5},
{"label": "Space", "matrix": [7, 1], "x": 4, "y": 5.5, "w": 7},
{"label": "AltGr", "matrix": [7, 15], "x": 11, "y": 5.5, "w": 1.5},
{"label": "Menu", "matrix": [6, 7], "x": 13.5, "y": 5.5, "w": 1.5},
{"label": "Left", "matrix": [7, 14], "x": 15.5, "y": 5.5},
{"label": "Down", "matrix": [7, 11], "x": 16.5, "y": 5.5},
{"label": "Right", "matrix": [7, 12], "x": 17.5, "y": 5.5},
{"label": "0", "matrix": [0, 12], "x": 19, "y": 5.5, "w": 2},
{"label": ".", "matrix": [0, 13], "x": 21, "y": 5.5}
]
}
}
}
Loading
Loading