Skip to content

Commit

Permalink
[Keyboard] Add MachKeyboards Mach3 (#14791)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan <[email protected]>
  • Loading branch information
etiennelepagel and fauxpark committed Oct 12, 2021
1 parent 2d8dcf0 commit a0b7c16
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 0 deletions.
45 changes: 45 additions & 0 deletions keyboards/machkeyboards/mach3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Copyright 2021 Mach Keyboards
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:https://www.gnu.org/licenses/>.
*/

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D41
#define PRODUCT_ID 0x4D33
#define DEVICE_VER 0x0001
#define MANUFACTURER MachKeyboard
#define PRODUCT Mach33

/* key matrix size */
#define MATRIX_ROWS 3
#define MATRIX_COLS 3

/* key pins */
#define MATRIX_ROW_PINS { D1, D0, D4 }
#define MATRIX_COL_PINS { E6, B4, B5 }

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

/* backlight */
#define BACKLIGHT_PIN B6
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5

/* debounce */
#define DEBOUNCE 5
47 changes: 47 additions & 0 deletions keyboards/machkeyboards/mach3/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"keyboard_name": "Mach 3",
"url": "https://machkeyboards.com",
"maintainer": "etiennelepagel",
"layouts": {
"LAYOUT_3x3": {
"layout": [
{
"x": 0,
"y": 0
},
{
"x": 1,
"y": 0
},
{
"x": 2,
"y": 0
},
{
"x": 0,
"y": 1
},
{
"x": 1,
"y": 1
},
{
"x": 2,
"y": 1
},
{
"x": 0,
"y": 2
},
{
"x": 1,
"y": 2
},
{
"x": 2,
"y": 2
}
]
}
}
}
24 changes: 24 additions & 0 deletions keyboards/machkeyboards/mach3/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright 2021 Mach Keyboards
*
* 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:https://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_3x3(
BL_INC, BL_DEC, BL_BRTG,
BL_INC, BL_DEC, BL_BRTG,
BL_INC, BL_DEC, BL_BRTG
)
};
4 changes: 4 additions & 0 deletions keyboards/machkeyboards/mach3/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default Mach 3 Keymap

This is the default layout that comes with the Mach 3.
The keys are set to only control the backlight.
24 changes: 24 additions & 0 deletions keyboards/machkeyboards/mach3/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright 2021 Mach Keyboards
*
* 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:https://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_3x3(
BL_INC, BL_DEC, BL_BRTG,
BL_INC, BL_DEC, BL_BRTG,
BL_INC, BL_DEC, BL_BRTG
)
};
2 changes: 2 additions & 0 deletions keyboards/machkeyboards/mach3/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
42 changes: 42 additions & 0 deletions keyboards/machkeyboards/mach3/mach3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Copyright 2021 Mach Keyboards
*
* 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:https://www.gnu.org/licenses/>.
*/
#include "mach3.h"

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
// Key Matrix to LED Index
{ 0, 1, 2 },
{ 7, 6, 5 },
{ 8, 9, 10 },
}, {
// LED Index to Physical Position
{ 0, 0 }, { 112, 0 }, { 224, 0 },
{ 0, 112 }, { 112, 112 }, { 224, 112 },
{ 0, 224 }, { 112, 224 }, { 224, 224 },
}, {
// LED Index to Flag
4, 4, 4,
4, 4, 4,
4, 4, 4
} };
#endif

void keyboard_pre_init_kb(void) {
setPinOutput(F5);
writePinHigh(F5);

keyboard_pre_init_user();
}
29 changes: 29 additions & 0 deletions keyboards/machkeyboards/mach3/mach3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Copyright 2021 Mach Keyboards
*
* 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:https://www.gnu.org/licenses/>.
*/
#pragma once

#include "quantum.h"

#define LAYOUT_3x3( \
K00, K01, K02, \
K10, K11, K12, \
K20, K21, K22 \
) \
{ \
{ K00, K01, K02 }, \
{ K10, K11, K12 }, \
{ K20, K21, K22 } \
}
22 changes: 22 additions & 0 deletions keyboards/machkeyboards/mach3/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Mach 3

A 3x3 macropad with RGB underglow.
Note: It sets an output pin to high, which is the alimentation of the backlight circuit.

* Keyboard Maintainer: [etiennelepagel](https://github.com/etiennelepagel)
* Hardware Supported: Mach 3 from Mach Keyboards
* Hardware Availability: [Mach Keyboards Official Website](https://machkeyboards.com/)

## 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
* **Keycode in layout**: Press the key mapped to `RESET` if it is available

Make example for this keyboard (after setting up your build environment):

make machkeyboards/mach3:default

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).
23 changes: 23 additions & 0 deletions keyboards/machkeyboards/mach3/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = caterina

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
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 = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = yes
BACKLIGHT_DRIVER = pwm
7 changes: 7 additions & 0 deletions keyboards/machkeyboards/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mach Keyboards

Mach Keyboards focus itself on selling the best macropad in the world.

[Mach Keyboards Official Website](https://machkeyboards.com)
[Discord](https://discord.gg/ukFKFc7eXy)
[Instagram](https://www.instagram.com/machkeyboards)

0 comments on commit a0b7c16

Please sign in to comment.