From 4a92dd327c7df11f10cbe85c5eb5868330062f2b Mon Sep 17 00:00:00 2001
From: MechMerlin <30334081+mechmerlin@users.noreply.github.com>
Date: Thu, 16 Apr 2020 12:28:49 -0700
Subject: [PATCH] [Keyboard] Botanical Keyboards FM2U (#8819)
* initial commit for fm2u keyboard
* add fm2u keyboard along with VIA keymap
* add meme LAYOUT support
* minor cleanups
* fixup layout macro names
---
keyboards/botanicalkeyboards/fm2u/config.h | 55 ++++++++++++++++++
keyboards/botanicalkeyboards/fm2u/fm2u.c | 17 ++++++
keyboards/botanicalkeyboards/fm2u/fm2u.h | 46 +++++++++++++++
keyboards/botanicalkeyboards/fm2u/info.json | 56 +++++++++++++++++++
.../fm2u/keymaps/default/keymap.c | 25 +++++++++
.../fm2u/keymaps/via/keymap.c | 37 ++++++++++++
.../fm2u/keymaps/via/rules.mk | 4 ++
keyboards/botanicalkeyboards/fm2u/readme.md | 13 +++++
keyboards/botanicalkeyboards/fm2u/rules.mk | 32 +++++++++++
9 files changed, 285 insertions(+)
create mode 100644 keyboards/botanicalkeyboards/fm2u/config.h
create mode 100644 keyboards/botanicalkeyboards/fm2u/fm2u.c
create mode 100644 keyboards/botanicalkeyboards/fm2u/fm2u.h
create mode 100644 keyboards/botanicalkeyboards/fm2u/info.json
create mode 100644 keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c
create mode 100644 keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c
create mode 100644 keyboards/botanicalkeyboards/fm2u/keymaps/via/rules.mk
create mode 100644 keyboards/botanicalkeyboards/fm2u/readme.md
create mode 100644 keyboards/botanicalkeyboards/fm2u/rules.mk
diff --git a/keyboards/botanicalkeyboards/fm2u/config.h b/keyboards/botanicalkeyboards/fm2u/config.h
new file mode 100644
index 0000000000..944b7b3b2a
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/config.h
@@ -0,0 +1,55 @@
+/*
+Copyright 2020 mechmerlin
+
+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 .
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0x6969
+#define PRODUCT_ID 0x0001
+#define DEVICE_VER 0x0001
+#define MANUFACTURER botanicalkeyboards
+#define PRODUCT fm2u
+#define DESCRIPTION A 1 key macropad
+
+/* key matrix size */
+#define MATRIX_ROWS 1
+#define MATRIX_COLS 1
+
+/* Keyboard Matrix Assignments */
+#define DIRECT_PINS { \
+ { C4 } \
+}
+
+/*
+ * 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 UNUSED_PINS
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION COL2ROW
+
+
+
diff --git a/keyboards/botanicalkeyboards/fm2u/fm2u.c b/keyboards/botanicalkeyboards/fm2u/fm2u.c
new file mode 100644
index 0000000000..9729e5eec0
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/fm2u.c
@@ -0,0 +1,17 @@
+/* Copyright 2020 mechmerlin
+ *
+ * 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 .
+ */
+
+#include "fm2u.h"
diff --git a/keyboards/botanicalkeyboards/fm2u/fm2u.h b/keyboards/botanicalkeyboards/fm2u/fm2u.h
new file mode 100644
index 0000000000..eb5564afc3
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/fm2u.h
@@ -0,0 +1,46 @@
+/* Copyright 2020 mechmerlin
+ *
+ * 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 .
+ */
+
+#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_100u( \
+ k00 \
+) \
+{ \
+ { k00 } \
+}
+
+#define LAYOUT_125u LAYOUT_100u
+#define LAYOUT_150u LAYOUT_100u
+#define LAYOUT_175u LAYOUT_100u
+#define LAYOUT_200u LAYOUT_100u
+#define LAYOUT_225u LAYOUT_100u
+#define LAYOUT_275u LAYOUT_100u
+#define LAYOUT_300u LAYOUT_100u
+#define LAYOUT_600u LAYOUT_100u
+#define LAYOUT_625u LAYOUT_100u
+#define LAYOUT_700u LAYOUT_100u
+#define LAYOUT_iso LAYOUT_100u
diff --git a/keyboards/botanicalkeyboards/fm2u/info.json b/keyboards/botanicalkeyboards/fm2u/info.json
new file mode 100644
index 0000000000..6831dad944
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/info.json
@@ -0,0 +1,56 @@
+{
+ "keyboard_name": "fm2u",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 1,
+ "height": 1,
+ "layouts": {
+ "LAYOUT_100u": {
+ "layout": [{"x":0, "y":0}]
+ },
+
+ "LAYOUT_125u": {
+ "layout": [{"x":0, "y":0, "w":1.25}]
+ },
+
+ "LAYOUT_150u": {
+ "layout": [{"x":0, "y":0, "w":1.50}]
+ },
+
+ "LAYOUT_175u": {
+ "layout": [{"x":0, "y":0, "w":1.75}]
+ },
+
+ "LAYOUT_200u": {
+ "layout": [{"x":0, "y":0, "w":2.00}]
+ },
+
+ "LAYOUT_225u": {
+ "layout": [{"x":0, "y":0, "w":2.25}]
+ },
+
+ "LAYOUT_275u": {
+ "layout": [{"x":0, "y":0, "w":2.75}]
+ },
+
+ "LAYOUT_300u": {
+ "layout": [{"x":0, "y":0, "w":3.00}]
+ },
+
+ "LAYOUT_600u": {
+ "layout": [{"x":0, "y":0, "w":6.00}]
+ },
+
+ "LAYOUT_625u": {
+ "layout": [{"x":0, "y":0, "w":6.25}]
+ },
+
+ "LAYOUT_700u": {
+ "layout": [{"x":0, "y":0, "w":7.00}]
+ },
+
+ "LAYOUT_iso": {
+ "layout": [{"x":0.25, "y":0, "w":1.25, "h":2}]
+ }
+ }
+}
diff --git a/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c b/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c
new file mode 100644
index 0000000000..afefa35334
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c
@@ -0,0 +1,25 @@
+/* Copyright 2020 mechmerlin
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* Base */
+ [0] = LAYOUT_100u(
+ KC_B
+ )
+};
+
diff --git a/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c b/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c
new file mode 100644
index 0000000000..01b00f1878
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c
@@ -0,0 +1,37 @@
+/* Copyright 2020 mechmerlin
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* Base */
+ [0] = LAYOUT_100u(
+ KC_B
+ ),
+
+ [1] = LAYOUT_100u(
+ KC_TRNS
+ ),
+
+ [2] = LAYOUT_100u(
+ KC_TRNS
+ ),
+
+ [3] = LAYOUT_100u(
+ KC_TRNS
+ ),
+};
+
diff --git a/keyboards/botanicalkeyboards/fm2u/keymaps/via/rules.mk b/keyboards/botanicalkeyboards/fm2u/keymaps/via/rules.mk
new file mode 100644
index 0000000000..7d47e6b726
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/keymaps/via/rules.mk
@@ -0,0 +1,4 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
+
+EXTRAKEY_ENABLE = no
diff --git a/keyboards/botanicalkeyboards/fm2u/readme.md b/keyboards/botanicalkeyboards/fm2u/readme.md
new file mode 100644
index 0000000000..511c09214f
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/readme.md
@@ -0,0 +1,13 @@
+# fm2u
+
+A 1 key macropad with USB C and atmega32u2 microcontroller.
+
+* Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
+* Hardware Supported: fm2u PCB
+* Hardware Availability: TBD
+
+Make example for this keyboard (after setting up your build environment):
+
+ make botanicalkeyboards/fm2u: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).
diff --git a/keyboards/botanicalkeyboards/fm2u/rules.mk b/keyboards/botanicalkeyboards/fm2u/rules.mk
new file mode 100644
index 0000000000..4f7f9b2864
--- /dev/null
+++ b/keyboards/botanicalkeyboards/fm2u/rules.mk
@@ -0,0 +1,32 @@
+# MCU name
+MCU = atmega32u2
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = atmel-dfu
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
+MOUSEKEY_ENABLE = no # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = yes # Console for debug
+COMMAND_ENABLE = yes # 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 = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs