Skip to content

Commit

Permalink
keyboard firmware update
Browse files Browse the repository at this point in the history
  • Loading branch information
m40-dev committed Jan 25, 2024
1 parent b7468f4 commit 04d3916
Show file tree
Hide file tree
Showing 29 changed files with 1,192 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keyboards/m40/5x5_macropad/5x5_macropad.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright 2022 Tomek (@m40)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "5x5_macropad.h"
27 changes: 27 additions & 0 deletions keyboards/m40/5x5_macropad/5x5_macropad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2022 Tomek (@m40)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "quantum.h"

/* This is a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT( \
K000, K001, K002, K003, K004, \
K100, K101, K102, K103, K104, \
K200, K201, K202, K203, K204, \
K300, K301, K302, K303, K304, \
K400, K401, K402, K403, K404 ) { \
{ K000, K001, K002, K003, K004 }, \
{ K100, K101, K102, K103, K104 }, \
{ K200, K201, K202, K203, K204 }, \
{ K300, K301, K302, K303, K304 }, \
{ K400, K401, K402, K403, K404 } \
}
94 changes: 94 additions & 0 deletions keyboards/m40/5x5_macropad/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright 2022 Tomek (@m40)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER m40
#define PRODUCT macropad

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

/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { B5, B4, E6, D7, C6 }
#define MATRIX_COL_PINS { B6, B2, B3, B1, F7 }
#define UNUSED_PINS

/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW


/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is useful for the Windows task manager shortcut (ctrl+shift+esc).
*/
//#define GRAVE_ESC_CTRL_OVERRIDE

/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION

/* Bootmagic Lite key configuration */
//#define BOOTMAGIC_LITE_ROW 0
//#define BOOTMAGIC_LITE_COLUMN 0
41 changes: 41 additions & 0 deletions keyboards/m40/5x5_macropad/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"keyboard_name": "5x5_macropad",
"url": "https://www.thingiverse.com/thing:5239739",
"maintainer": "m40",
"layouts": {
"LAYOUT": {
"layout": [
{"label":"K000", "x":0, "y":0},
{"label":"K001", "x":1, "y":0},
{"label":"K002", "x":2, "y":0},
{"label":"K003", "x":3, "y":0},
{"label":"K004", "x":4, "y":0},

{"label":"K100", "x":0, "y":1},
{"label":"K101", "x":1, "y":1},
{"label":"K102", "x":2, "y":1},
{"label":"K103", "x":3, "y":1},
{"label":"K104", "x":4, "y":1},

{"label":"K200", "x":0, "y":2},
{"label":"K201", "x":1, "y":2},
{"label":"K202", "x":2, "y":2},
{"label":"K203", "x":3, "y":2},
{"label":"K204", "x":4, "y":2},

{"label":"K300", "x":0, "y":3},
{"label":"K301", "x":1, "y":3},
{"label":"K302", "x":2, "y":3},
{"label":"K303", "x":3, "y":3},
{"label":"K304", "x":4, "y":3},

{"label":"K400", "x":0, "y":4},
{"label":"K401", "x":1, "y":4},
{"label":"K402", "x":2, "y":4},
{"label":"K403", "x":3, "y":4},
{"label":"K404", "x":4, "y":4}

]
}
}
}
26 changes: 26 additions & 0 deletions keyboards/m40/5x5_macropad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2022 Tomek (@m40)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

// Defines names for use in layer keycodes and the keymap
enum layer_names {
_BASE,
_FN
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base */
[_BASE] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┐
KC_ESC, KC_1, KC_2, KC_3, RESET,
//├────────┼────────┼────────┼────────┬────────┤
KC_1, KC_2, KC_3, KC_4, KC_5,
//├────────┼────────┼────────┼────────┼────────┤
KC_1, KC_2, KC_3, KC_4, KC_5,
//├────────┼────────┼────────┼────────┼────────┤
KC_1, KC_2, KC_3, KC_4, KC_5,
//├────────┼────────┼────────┼────────┼────────┤
KC_1, KC_2, KC_3, KC_4, KC_5 )
//└────────┴────────┴────────┴─────────────────┘
};
1 change: 1 addition & 0 deletions keyboards/m40/5x5_macropad/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for m40
27 changes: 27 additions & 0 deletions keyboards/m40/5x5_macropad/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# m40

![m40](https://imgur.com/bWXH3FV)

*This is very simple 5x5 macropad for general use. It does not come with any particular layout, it is assumed that layouts will be built on the qmk configurator site. Row and column pins start on the edge of Arduino, if smaller board is required, you can simply connect only first x row/column pairs to the board and get the size of the board you need.*

* Keyboard Maintainer: [Tomek](https://github.com/m40-dev)
* Hardware Supported: *3D Printed, handwired, using Arduino Pro-Micro (Atmega32U4) for controller*
* Hardware Availability: *https://www.thingiverse.com/thing:5239739*

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

make handwired/m40/5x5_macropad:default

Flashing example for this keyboard:

make handwired/m40/5x5_macropad: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 `RESET` if it is available. In default layout (if you flashed it already once) it is the top-right button.
22 changes: 22 additions & 0 deletions keyboards/m40/5x5_macropad/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = caterina

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = no # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.

# Disable unsupported hardware
AUDIO_SUPPORTED = no
BACKLIGHT_SUPPORTED = no
Loading

0 comments on commit 04d3916

Please sign in to comment.