~ruther/qmk_firmware

31e4583f4a171823cfa639cc6a9795e892c0455f — Yatara 5 years ago 17a089d
[Keyboard] Add support for Drink Me (#8039)

* Add initial configuration and keymaps for Yatara Drink Me.

* Apply suggestions from code review

* Apply suggestions from code review

* Add transparent layers in VIA layout so there are four layers in total. Amend closing bracket indentation in keymap.c files.
A keyboards/yatara/drink_me/config.h => keyboards/yatara/drink_me/config.h +37 -0
@@ 0,0 1,37 @@
/* Copyright 2020 Yatara
 *
 * 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://www.gnu.org/licenses/>.
 */

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID       0xFEED
#define PRODUCT_ID      0x1470
#define DEVICE_VER      0x0001
#define MANUFACTURER    Yatara
#define PRODUCT         Drink Me
#define DESCRIPTION     4% Ergo Macropad

/* Key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 4

/* Pinout */
#define DIRECT_PINS { \
    {B4, B5, B6, B7} \
}
#define UNUSED_PINS

A keyboards/yatara/drink_me/drink_me.c => keyboards/yatara/drink_me/drink_me.c +17 -0
@@ 0,0 1,17 @@
/* Copyright 2020 Yatara
 *
 * 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://www.gnu.org/licenses/>.
 */

#include "drink_me.h"

A keyboards/yatara/drink_me/drink_me.h => keyboards/yatara/drink_me/drink_me.h +25 -0
@@ 0,0 1,25 @@
/* Copyright 2020 Yatara
 *
 * 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://www.gnu.org/licenses/>.
 */

#pragma once

#include "quantum.h"

#define LAYOUT( \
    K00, K01, K02, K03 \
) { \
    { K00, K01, K02, K03 } \
}

A keyboards/yatara/drink_me/info.json => keyboards/yatara/drink_me/info.json +34 -0
@@ 0,0 1,34 @@
{
  "keyboard_name": "Drink Me",
  "url": "https://github.com/yatara-cc",
  "maintainer": "yatara-cc",
  "width": 4,
  "height": 1,
  "layouts": {
    "LAYOUT": {
      "key_count": 4,
      "layout": [
        {
          "label": "K0",
          "x": 0,
          "y": 0
        },
        {
          "label": "K1",
          "x": 1,
          "y": 0
        },
        {
          "label": "K2",
          "x": 2,
          "y": 0
        },
        {
          "label": "K3",
          "x": 3,
          "y": 0
        }
      ]
    }
  }
}

A keyboards/yatara/drink_me/keymaps/caterpillar/keymap.c => keyboards/yatara/drink_me/keymaps/caterpillar/keymap.c +10 -0
@@ 0,0 1,10 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        LSFT(KC_O),
        LSFT(KC_R),
        LSFT(KC_U),
        LSFT(KC_SLSH)
    )
};

A keyboards/yatara/drink_me/keymaps/caterpillar/readme.md => keyboards/yatara/drink_me/keymaps/caterpillar/readme.md +9 -0
@@ 0,0 1,9 @@
# Drink Me - Caterpillar layout

> ‘Who are you?’ said the Caterpillar.

![Drink Me - Default layout](https://i.imgur.com/BHWNATB.png)

```
O, R, U, ?
```

A keyboards/yatara/drink_me/keymaps/cheshire_cat/keymap.c => keyboards/yatara/drink_me/keymaps/cheshire_cat/keymap.c +10 -0
@@ 0,0 1,10 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_LEFT,
        KC_DOWN,
        KC_UP,
        KC_RIGHT
    )
};

A keyboards/yatara/drink_me/keymaps/cheshire_cat/readme.md => keyboards/yatara/drink_me/keymaps/cheshire_cat/readme.md +13 -0
@@ 0,0 1,13 @@
# Drink Me - Cheshire Cat layout

> ‘Would you tell me, please, which way I ought to go from here?’
>
> ‘That depends a good deal on where you want to get to,’ said the Cat.

Cursor keys in VI layout.

![Drink Me - Default layout](https://i.imgur.com/E4cScrK.png)

```
Left, Down, Up, Right
```

A keyboards/yatara/drink_me/keymaps/default/keymap.c => keyboards/yatara/drink_me/keymaps/default/keymap.c +10 -0
@@ 0,0 1,10 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        LCTL(KC_Z),
        LCTL(KC_X),
        LCTL(KC_C),
        LCTL(KC_V)
    )
};

A keyboards/yatara/drink_me/keymaps/default/readme.md => keyboards/yatara/drink_me/keymaps/default/readme.md +11 -0
@@ 0,0 1,11 @@
# Drink Me - Default layout

> It was so long since she had been anything near the right size, that it felt quite strange at first; but she got used to it in a few minutes

Common shortcut keys.

![Drink Me - Default layout](https://i.imgur.com/JLEEhHk.png)

```
Undo, Cut, Copy, Paste
```

A keyboards/yatara/drink_me/keymaps/dormouse/keymap.c => keyboards/yatara/drink_me/keymaps/dormouse/keymap.c +10 -0
@@ 0,0 1,10 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_SLEP,
        KC_MUTE,
        KC_VOLD,
        KC_VOLU
    )
};

A keyboards/yatara/drink_me/keymaps/dormouse/readme.md => keyboards/yatara/drink_me/keymaps/dormouse/readme.md +11 -0
@@ 0,0 1,11 @@
# Drink Me - Dormouse layout

> The Dormouse slowly opened his eyes. ‘I wasn’t asleep,’ he said in a hoarse, feeble voice: ‘I heard every word you fellows were saying.’

Sleep and volume control.

![Drink Me - Default layout](https://i.imgur.com/VQXH512.png)

```
Sleep, Mute, Volume down, Volume up
```

A keyboards/yatara/drink_me/keymaps/dormouse/rules.mk => keyboards/yatara/drink_me/keymaps/dormouse/rules.mk +1 -0
@@ 0,0 1,1 @@
EXTRAKEY_ENABLE = yes

A keyboards/yatara/drink_me/keymaps/queen/config.h => keyboards/yatara/drink_me/keymaps/queen/config.h +1 -0
@@ 0,0 1,1 @@
#define UNICODE_SELECTED_MODES UC_LNX, UC_OSX, UC_WIN, UC_WINC

A keyboards/yatara/drink_me/keymaps/queen/keymap.c => keyboards/yatara/drink_me/keymaps/queen/keymap.c +67 -0
@@ 0,0 1,67 @@
#include QMK_KEYBOARD_H


enum td_keys {
    TD_K0,
    TD_K1,
    TD_K2,
    TD_K3
};


void td_spade_lnx (qk_tap_dance_state_t *state, void *user_data) {
    if (state->count == 1) {
        send_unicode_hex_string("2660");
    } else {
        set_unicode_input_mode(UC_LNX);
    }
    reset_tap_dance(state);
}


void td_diamond_osx (qk_tap_dance_state_t *state, void *user_data) {
    if (state->count == 1) {
        send_unicode_hex_string("2666");
    } else {
        set_unicode_input_mode(UC_OSX);
    }
    reset_tap_dance(state);
}


void td_club_win (qk_tap_dance_state_t *state, void *user_data) {
    if (state->count == 1) {
        send_unicode_hex_string("2663");
    } else {
        set_unicode_input_mode(UC_WIN);
    }
    reset_tap_dance(state);
}


void td_heart_winc (qk_tap_dance_state_t *state, void *user_data) {
    if (state->count == 1) {
        send_unicode_hex_string("2665");
    } else {
        set_unicode_input_mode(UC_WINC);
    }
    reset_tap_dance(state);
}


qk_tap_dance_action_t tap_dance_actions[] = {
    [TD_K0] = ACTION_TAP_DANCE_FN(td_spade_lnx),
    [TD_K1] = ACTION_TAP_DANCE_FN(td_diamond_osx),
    [TD_K2] = ACTION_TAP_DANCE_FN(td_club_win),
    [TD_K3] = ACTION_TAP_DANCE_FN(td_heart_winc)
};


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        TD(TD_K0),
        TD(TD_K1),
        TD(TD_K2),
        TD(TD_K3)
    )
};

A keyboards/yatara/drink_me/keymaps/queen/readme.md => keyboards/yatara/drink_me/keymaps/queen/readme.md +20 -0
@@ 0,0 1,20 @@
# Drink Me - Queen layout

> ‘Off with her head!’ the Queen shouted at the top of her voice. Nobody moved.
>
> ‘Who cares for you?’ said Alice, (she had grown to her full size by this time.) ‘You’re nothing but a pack of cards!’

Single tap for unicode symbols for playing card suits:

![Drink Me - Queen layout single tap](https://i.imgur.com/xwHicLJ.png)

```
Spade, Diamond, Club, Heart
```

Double tap to change operating system unicode input method:

![Drink Me - Queen layout double tap](https://i.imgur.com/fBbzq55.png)
```
Linux, OSX, Windows, Wincompose
```

A keyboards/yatara/drink_me/keymaps/queen/rules.mk => keyboards/yatara/drink_me/keymaps/queen/rules.mk +2 -0
@@ 0,0 1,2 @@
UNICODE_ENABLE = yes
TAP_DANCE_ENABLE = yes

A keyboards/yatara/drink_me/keymaps/via/keymap.c => keyboards/yatara/drink_me/keymaps/via/keymap.c +28 -0
@@ 0,0 1,28 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_0,
        KC_1,
        KC_2,
        KC_3
    ),
    [1] = LAYOUT(
        KC_TRNS,
        KC_TRNS,
        KC_TRNS,
        KC_TRNS
    ),
    [2] = LAYOUT(
        KC_TRNS,
        KC_TRNS,
        KC_TRNS,
        KC_TRNS
    ),
    [3] = LAYOUT(
        KC_TRNS,
        KC_TRNS,
        KC_TRNS,
        KC_TRNS
    )
};

A keyboards/yatara/drink_me/keymaps/via/readme.md => keyboards/yatara/drink_me/keymaps/via/readme.md +7 -0
@@ 0,0 1,7 @@
# Drink Me - VIA layout

> ‘But what am I to do?’ said Alice.
>
> ‘Anything you like,’ said the Footman, and began whistling.

Flash with this layout to use [VIA](https://caniusevia.com/) for customising layout.

A keyboards/yatara/drink_me/keymaps/via/rules.mk => keyboards/yatara/drink_me/keymaps/via/rules.mk +2 -0
@@ 0,0 1,2 @@
EXTRAKEY_ENABLE = yes
VIA_ENABLE = yes

A keyboards/yatara/drink_me/readme.md => keyboards/yatara/drink_me/readme.md +17 -0
@@ 0,0 1,17 @@
# Drink Me

![Drink Me](https://i.imgur.com/iz56Er0.jpg)

A 4% ergo macropad.

* Keyboard Maintainer: [Yatara](https://github.com/yatara-cc)
* Hardware Supported: Drink Me PCB (ATmega32U2)
* Hardware Availability: [Interest Check on Reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/evu429/ic_drink_me_4_ergo_interest_check_giveaway/)

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

```
make yatara/drink_me: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).

A keyboards/yatara/drink_me/rules.mk => keyboards/yatara/drink_me/rules.mk +32 -0
@@ 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 = no        # 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 = 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