Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amptrics 0420 keyboard addition #24744

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
48 changes: 48 additions & 0 deletions keyboards/amptrics/0422/keyboard.json
vchowl marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -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,
vchowl marked this conversation as resolved.
Show resolved Hide resolved
"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}
]
}
}
}
76 changes: 76 additions & 0 deletions keyboards/amptrics/0422/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

#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(
vchowl marked this conversation as resolved.
Show resolved Hide resolved
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
)
vchowl marked this conversation as resolved.
Show resolved Hide resolved
};

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
}
25 changes: 25 additions & 0 deletions keyboards/amptrics/0422/readme.md
Original file line number Diff line number Diff line change
@@ -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
Loading