diff --git a/keyboards/amptrics/0422/keyboard.json b/keyboards/amptrics/0422/keyboard.json new file mode 100644 index 000000000000..74040b4cfe0c --- /dev/null +++ b/keyboards/amptrics/0422/keyboard.json @@ -0,0 +1,48 @@ +{ + "manufacturer": "Amptrics Technologies", + "keyboard_name": "Amptrics 0422", + "maintainer": "vchowl", + "bootloader": "stm32-dfu", + "diode_direction": "COL2ROW", + "eeprom": { + "driver": "wear_leveling", + "wear_leveling": { + "backing_size": 20480, + "driver": "embedded_flash", + "logical_size": 10240 + } + }, + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["C8", "C7", "C6"], + "rows": ["A14", "A13", "A10", "A9"] + }, + "processor": "STM32F072", + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x01A6", + "vid": "0x616D" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3} + ] + } + } +} diff --git a/keyboards/amptrics/0422/keymaps/default/keymap.c b/keyboards/amptrics/0422/keymaps/default/keymap.c new file mode 100644 index 000000000000..c6bb85504c76 --- /dev/null +++ b/keyboards/amptrics/0422/keymaps/default/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2024 Vinod Chowl (@vchowl) + * + * 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.0 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 . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ + * │Tog│ + * ├───┼───┬───┐ + * │ 7 │ 8 │ 9 │ + * ├───┼───┼───┤ + * │ 4 │ 5 │ 6 │ + * ├───┼───┼───┤ + * │ 1 │ 2 │ 3 │ + * └───┴───┴───┘ + */ + [0] = LAYOUT( + LT(0, KC_NO), + KC_7, KC_8, KC_9, + KC_4, KC_5, KC_6, + KC_1, KC_2, KC_3 + ), + + [1] = LAYOUT( + LT(0, KC_NO), + KC_A, KC_B, KC_C, + KC_D, KC_E, KC_F, + KC_G, KC_H, KC_I + ), + + [2] = LAYOUT( + LT(0, KC_NO), + KC_J, KC_K, KC_L, + KC_M, KC_N, KC_O, + KC_P, KC_Q, KC_R + ), + + [3] = LAYOUT( + LT(0, KC_NO), + KC_S, KC_T, KC_U, + KC_V, KC_W, KC_X, + KC_Y, KC_Z, KC_ENT + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + switch (keycode) { + case LT(0, KC_NO): + if (record -> event.pressed) { + // Move to next layer on tap + uint8_t current_layer = get_highest_layer(layer_state); + if (current_layer < 3) { + layer_move(current_layer + 1); + } else { + layer_move(0); // Wrap around to first layer + } + return false; // Prevent further processing of this key + } + break; + } + return true; // Allow other keycodes to be processed normally +} diff --git a/keyboards/amptrics/0422/readme.md b/keyboards/amptrics/0422/readme.md new file mode 100644 index 000000000000..fcf9593348b0 --- /dev/null +++ b/keyboards/amptrics/0422/readme.md @@ -0,0 +1,25 @@ +# Amptrics 0422 Programmable Keypad +![magtray4x3](https://i.imgur.com/G5QMlpn_d.jpeg) + + +* Keyboard Maintainer: [vchowl](https://github.com/vchowl) +* Hardware Supported: STM32F072RBT6 +* Hardware Availability: Not yet available. + +Make example for this keyboard (after setting up your build environment): + + make amptrics/0422:default + +Flashing example for this keyboard: + + make amptrics/0422: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