This commit is contained in:
topicchi
2026-04-15 15:40:36 +00:00
parent 6c80c7f4f5
commit ef805b494a
5 changed files with 255 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
{
"keyboard_name": "cbm2pc",
"manufacturer": "Pennuto",
"processor": "RP2040",
"bootloader": "rp2040",
"url": "",
"maintainer": "Pennuto",
"features": {
"bootmagic": true
},
"bootmagic": {
"matrix": [0, 1]
},
"usb": {
"vid": "0xFEED",
"pid": "0x0004",
"device_version": "0.0.1"
},
"matrix_pins": {
"cols": ["GP9", "GP8", "GP7", "GP6", "GP5", "GP4", "GP3", "GP2"],
"rows": ["GP0", "GP1", "GP15", "GP14", "GP13", "GP12", "GP11", "GP10"]
},
"diode_direction": "COL2ROW",
"layouts": {
"LAYOUT": {
"layout": [
{"label": "INST/DEL", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "RETURN", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "CRSR RIGHT", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "CRSR DOWN", "matrix": [0, 3], "x": 3, "y": 0},
{"label": "F1/F4", "matrix": [0, 4], "x": 4, "y": 0},
{"label": "F2/F5", "matrix": [0, 5], "x": 5, "y": 0},
{"label": "F3/F6", "matrix": [0, 6], "x": 6, "y": 0},
{"label": "@", "matrix": [0, 7], "x": 7, "y": 0},
{"label": "3", "matrix": [1, 0], "x": 0, "y": 1},
{"label": "W", "matrix": [1, 1], "x": 1, "y": 1},
{"label": "A", "matrix": [1, 2], "x": 2, "y": 1},
{"label": "4", "matrix": [1, 3], "x": 3, "y": 1},
{"label": "Z", "matrix": [1, 4], "x": 4, "y": 1},
{"label": "S", "matrix": [1, 5], "x": 5, "y": 1},
{"label": "E", "matrix": [1, 6], "x": 6, "y": 1},
{"label": "LSHIFT", "matrix": [1, 7], "x": 7, "y": 1},
{"label": "5", "matrix": [2, 0], "x": 0, "y": 2},
{"label": "R", "matrix": [2, 1], "x": 1, "y": 2},
{"label": "D", "matrix": [2, 2], "x": 2, "y": 2},
{"label": "6", "matrix": [2, 3], "x": 3, "y": 2},
{"label": "C", "matrix": [2, 4], "x": 4, "y": 2},
{"label": "F", "matrix": [2, 5], "x": 5, "y": 2},
{"label": "T", "matrix": [2, 6], "x": 6, "y": 2},
{"label": "X", "matrix": [2, 7], "x": 7, "y": 2},
{"label": "7", "matrix": [3, 0], "x": 0, "y": 3},
{"label": "Y", "matrix": [3, 1], "x": 1, "y": 3},
{"label": "G", "matrix": [3, 2], "x": 2, "y": 3},
{"label": "8", "matrix": [3, 3], "x": 3, "y": 3},
{"label": "B", "matrix": [3, 4], "x": 4, "y": 3},
{"label": "H", "matrix": [3, 5], "x": 5, "y": 3},
{"label": "U", "matrix": [3, 6], "x": 6, "y": 3},
{"label": "V", "matrix": [3, 7], "x": 7, "y": 3},
{"label": "9", "matrix": [4, 0], "x": 0, "y": 4},
{"label": "I", "matrix": [4, 1], "x": 1, "y": 4},
{"label": "J", "matrix": [4, 2], "x": 2, "y": 4},
{"label": "0", "matrix": [4, 3], "x": 3, "y": 4},
{"label": "M", "matrix": [4, 4], "x": 4, "y": 4},
{"label": "K", "matrix": [4, 5], "x": 5, "y": 4},
{"label": "O", "matrix": [4, 6], "x": 6, "y": 4},
{"label": "N", "matrix": [4, 7], "x": 7, "y": 4},
{"label": "PLUS", "matrix": [5, 0], "x": 0, "y": 5},
{"label": "P", "matrix": [5, 1], "x": 1, "y": 5},
{"label": "L", "matrix": [5, 2], "x": 2, "y": 5},
{"label": "MINUS", "matrix": [5, 3], "x": 3, "y": 5},
{"label": "DOT", "matrix": [5, 4], "x": 4, "y": 5},
{"label": "COLON", "matrix": [5, 5], "x": 5, "y": 5},
{"label": "BRACKET L", "matrix": [5, 6], "x": 6, "y": 5},
{"label": "COMMA", "matrix": [5, 7], "x": 7, "y": 5},
{"label": "POUND", "matrix": [6, 0], "x": 0, "y": 6},
{"label": "BRACKET R", "matrix": [6, 1], "x": 1, "y": 6},
{"label": "SEMICOLON", "matrix": [6, 2], "x": 2, "y": 6},
{"label": "HOME", "matrix": [6, 3], "x": 3, "y": 6},
{"label": "RSHIFT", "matrix": [6, 4], "x": 4, "y": 6},
{"label": "EQUAL", "matrix": [6, 5], "x": 5, "y": 6},
{"label": "UP-ARROW", "matrix": [6, 6], "x": 6, "y": 6},
{"label": "SLASH", "matrix": [6, 7], "x": 7, "y": 6},
{"label": "1", "matrix": [7, 0], "x": 0, "y": 7},
{"label": "LEFT-ARROW", "matrix": [7, 1], "x": 1, "y": 7},
{"label": "CTRL", "matrix": [7, 2], "x": 2, "y": 7},
{"label": "2", "matrix": [7, 3], "x": 3, "y": 7},
{"label": "SPACE", "matrix": [7, 4], "x": 4, "y": 7},
{"label": "COMMODORE", "matrix": [7, 5], "x": 5, "y": 7},
{"label": "Q", "matrix": [7, 6], "x": 6, "y": 7},
{"label": "RUN/STOP", "matrix": [7, 7], "x": 7, "y": 7}
]
}
}
}

View File

@@ -0,0 +1,125 @@
/* *************************************************************** *
* Tastiera QMK on Commodore Plus/4 HW for BMC and other emulators *
* --------------------------------------------------------------- *
* (C)13.04.2026 - Paolo Iocco *
* *************************************************************** */
#include QMK_KEYBOARD_H
#define L_GREEN GP27
#define L_RED GP28
#define PC 0 /* PC Compatible Mode */
#define CKEY 1 /* PC Commodore Key (Control)*/
#define SHIFT 2 /* PC shift mode */
#define C64 3 /* Commodore mode */
#define CSHIFT 4 /* Commodore-Shift mode */
#define CBM 15 /* Commodore Key pressed in Emulation mode. Allows to go back to PC Mode pressing C= & Control. */
/* **************** *
* Inizializzazione *
* **************** */
void keyboard_post_init_user(void) {
// Imposta GP28/27/26 come output
palSetPadMode(PAL_PORT(L_GREEN), PAL_PAD(L_GREEN), PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(PAL_PORT(L_RED), PAL_PAD(L_RED), PAL_MODE_OUTPUT_PUSHPULL);
// Stato iniziale: Accendi GREEN, Spegni RED
palSetLine(L_GREEN);
palClearLine(L_RED);
}
/* ************************************ *
* Gestione LED in base al Layer attivo *
* ************************************ */
layer_state_t layer_state_set_user(layer_state_t state) {
// Controlla quale layer è attivo
switch (get_highest_layer(state)) {
case C64:
case CSHIFT:
palClearLine(L_GREEN); // Spegni LED GREEN
palSetLine(L_RED); // Accendi LED RED
break;
case CKEY:
case CBM:
palSetLine(L_GREEN); // Accendi LED GREEN)
palSetLine(L_RED); // Accendi LED RED
break;
default:
palSetLine(L_GREEN); // Accendi LED GREEN)
palClearLine(L_RED); // Spegni LED RED
break;
}
return state;
}
/* ******* *
* Layouts *
* ******* */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[PC] = LAYOUT(
KC_1, KC_HOME, KC_TAB, KC_LALT, KC_SPC, LT(CKEY,KC_LCTL), KC_Q, KC_2,
KC_3, KC_W, KC_A, MO(SHIFT), KC_Z, KC_S, KC_E, KC_4,
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8,
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0,
KC_DOWN, KC_P, KC_L, KC_COMM, KC_DOT, KC_COLON, KC_MINS, KC_UP,
KC_LEFT, KC_ASTR, KC_SCLN, KC_SLSH, KC_ESC, KC_EQL, KC_PLUS, KC_RGHT,
KC_BSPC, KC_ENT, KC_BSLS, S(KC_2), KC_F1, KC_F2, KC_F3, KC_F4
),
[CKEY] = LAYOUT(
_______, _______, TO(C64), LCTL(KC_F8), _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, LCTL(KC_D), LCTL(KC_X), LCTL(KC_C), _______, _______, _______,
_______, _______, _______, LCTL(KC_V), _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
MS_DOWN, _______, _______, _______, MS_BTN1, S(KC_LBRC), KC_TILD, MS_UP,
MS_LEFT, _______, S(KC_RBRC), MS_BTN2, _______, _______, _______, MS_RGHT,
_______, _______, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12
),
[SHIFT] = LAYOUT(
KC_EXLM, KC_TILD, _______, _______, S(KC_SPC), _______, S(KC_Q), KC_DQUO,
KC_HASH, S(KC_W), S(KC_A), _______, S(KC_Z), S(KC_S), S(KC_E), KC_DLR,
KC_PERC, S(KC_R), S(KC_D), S(KC_X), S(KC_C), S(KC_F), S(KC_T), KC_AMPR,
KC_QUOT, S(KC_Y), S(KC_G), S(KC_V), S(KC_B), S(KC_H), S(KC_U), KC_LPRN,
KC_RPRN, S(KC_I), S(KC_J), S(KC_N), S(KC_M), S(KC_K), S(KC_O), KC_CIRC,
_______, S(KC_P), S(KC_L), KC_LABK, KC_RABK, KC_LBRC, S(KC_MINS), _______,
KC_PIPE, _______, KC_RBRC, KC_QUES, _______, _______, _______, _______,
S(KC_DEL), S(KC_ENT), _______, _______, KC_F5, KC_F6, KC_F7, KC_F8
),
[C64] = LAYOUT(
KC_1, KC_HOME, KC_TAB, KC_LALT, KC_SPC, LM(CBM,MOD_LCTL), KC_Q, KC_2,
KC_3, KC_W, KC_A, LM(CSHIFT,MOD_LSFT), KC_Z, KC_S, KC_E, KC_4,
KC_5, KC_R, KC_D, KC_X, KC_C, KC_F, KC_T, KC_6,
KC_7, KC_Y, KC_G, KC_V, KC_B, KC_H, KC_U, KC_8,
KC_9, KC_I, KC_J, KC_N, KC_M, KC_K, KC_O, KC_0,
KC_DOWN, KC_P, KC_L, KC_COMM, KC_DOT, KC_COLON, KC_MINS, KC_UP,
KC_LEFT, KC_ASTR, KC_SCLN, KC_SLSH, KC_ESC, KC_EQL, KC_PLUS, KC_RGHT,
KC_BSPC, KC_ENT, KC_BSLS, KC_AT, KC_F1, KC_F2, KC_F3, KC_F7
),
[CSHIFT] = LAYOUT(
KC_EXLM, S(KC_HOME), _______, _______, S(KC_SPC), _______, S(KC_Q), KC_DQUO,
KC_HASH, S(KC_W), S(KC_A), _______, S(KC_Z), S(KC_S), S(KC_E), KC_DLR,
KC_PERC, S(KC_R), S(KC_D), S(KC_X), S(KC_C), S(KC_F), S(KC_T), KC_AMPR,
KC_QUOT, S(KC_Y), S(KC_G), S(KC_V), S(KC_B), S(KC_H), S(KC_U), KC_LPRN,
KC_RPRN, S(KC_I), S(KC_J), S(KC_N), S(KC_M), S(KC_K), S(KC_O), KC_CIRC,
_______, S(KC_P), S(KC_L), KC_LABK, KC_RABK, KC_LBRC, _______, _______,
KC_PIPE, _______, KC_RBRC, KC_QUES, _______, _______, _______, _______,
S(KC_DEL), S(KC_ENT), _______, _______, KC_F5, KC_F6, KC_F7, KC_F8
),
[CBM] = LAYOUT(
_______, _______, TO(PC), _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_PGUP, _______, _______, KC_F12
)
};

View File

@@ -0,0 +1,27 @@
# cbm2pc
![cbm2pc](imgur.com image replace me!)
*A short description of the keyboard/project*
* Keyboard Maintainer: [Pennuto](https://github.com/Pennuto)
* Hardware Supported: *The PCBs, controllers supported*
* Hardware Availability: *Links to where you can find this hardware*
Make example for this keyboard (after setting up your build environment):
make cbm2pc:default
Flashing example for this keyboard:
make cbm2pc:default:flash
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).
## Bootloader
Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@@ -0,0 +1 @@
MOUSEKEY_ENABLE = yes

Binary file not shown.