diff options
Diffstat (limited to 'keyboards/1upkeyboards/sweet16')
18 files changed, 841 insertions, 0 deletions
diff --git a/keyboards/1upkeyboards/sweet16/config.h b/keyboards/1upkeyboards/sweet16/config.h new file mode 100644 index 0000000000..20d99651da --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/config.h @@ -0,0 +1,55 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1up Keyboards +#define PRODUCT Sweet16 +#define DESCRIPTION 4x4 grid + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D1, D0, D4, C6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGB_DI_PIN B1 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 1 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/1upkeyboards/sweet16/info.json b/keyboards/1upkeyboards/sweet16/info.json new file mode 100644 index 0000000000..445a5909ec --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Sweet 16", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + }, + + "LAYOUT_numpad_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] + } + } +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c new file mode 100644 index 0000000000..899afaba17 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +#include "sweet16.h" + +enum custom_keycodes { + UP_URL = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_4x4( + KC_7, KC_8, KC_9, KC_ASTR, + KC_4, KC_5, KC_6, KC_SLSH, + KC_1, KC_2, KC_3, KC_MINS, + KC_0, KC_ENT, KC_DOT, KC_EQL + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case UP_URL: + if (record->event.pressed) { + SEND_STRING("http://1upkeyboards.com"); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + #ifndef CONVERT_TO_PROTON_C + /* Map RXLED to USB_LED_NUM_LOCK */ + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + /* Map TXLED to USB_LED_CAPS_LOCK */ + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + #endif +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c new file mode 100644 index 0000000000..b42c34edb7 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c @@ -0,0 +1,38 @@ +#include "sweet16.h" + +enum layers { + num, + extra, + mouse +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [num] = LAYOUT_numpad_4x4( + KC_P7, KC_P8, KC_P9, LT(extra, KC_PPLS), + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, KC_PENT, + LT(mouse, KC_P0), KC_DOT + ), + + [extra] = LAYOUT_numpad_4x4( + KC_PSLS, KC_PAST, KC_PMNS, KC_TRNS, + KC_BSPC, KC_EXECUTE, KC_DEL, + KC_LPRN, KC_RPRN, KC_PEQL, KC_PENT, + KC_TAB, KC_NLCK + ), + + +[mouse] = LAYOUT_numpad_4x4( + KC_WH_D, KC_MS_U, KC_WH_U, LT(extra, KC_PPLS), + KC_MS_L, KC_MS_D, KC_MS_R, + KC_BTN1, KC_BTN2, KC_BTN3, KC_PENT, + KC_TRNS, KC_DOT + ) + + + + +}; + diff --git a/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md new file mode 100644 index 0000000000..aabcf82c61 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md @@ -0,0 +1,3 @@ +# Dale's keymap for the Sweet16 + +I wanted to reuse a standard numpad keyset and have the full functionality of an larger numpad with a nod to Excel functionality. diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h new file mode 100644 index 0000000000..c835440076 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h @@ -0,0 +1,15 @@ +#pragma once + +/* tap dance stuff*/ +#undef TAPPING_TERM +#define TAPPING_TERM 500 + +#define TAPPING_TOGGLE 2 + +#define EXAMPLESTRING1 "tapdance_1" +#define EXAMPLESTRING2 "tapdance_2" +#define EXAMPLESTRING3 "tapdance_3" +#define EXAMPLESTRING4 "tapdance_4" + +#undef RGBLED_NUM +#define RGBLED_NUM 16
\ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c new file mode 100644 index 0000000000..ad9786ba7f --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c @@ -0,0 +1,215 @@ +/* +tap danc eis turned on in the rules now... +*/ +#include QMK_KEYBOARD_H + +#define _EMOJI 0 +#define _TAPLAND 1 +#define _LEDCNTL 2 + +enum custom_keycodes { + SHRUG, + DISFACE, + FU, + TFLIP, + TFLIP2, + SAD_EYES, + TPUT, + HAPPYFACE, + HEARTFACE, + CLOUD, + CHANFACE, + CMDCLEAR +}; +//Tap Dance Declarations +enum { + TD_EXAMPLE1 = 0, + TD_EXAMPLE2, + TD_EXAMPLE3, + TD_EXAMPLE4 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* EMOJI Pad + * ,-------------------------------. + * |TFLIP | TFlIP2|DISFACE| FU | + * |------+-------+-------+--------| + * | CLOUD| | | CLEAR | + * |------+-------+-------+--------| + * |SHRUG |DISFACE| HRTFAC| HAPPYF | + * |------+-------+-------+--------| + * | ENTER| |LEDCNTR| tapland| + * `-------------------------------' + */ + //purple + [_EMOJI] = LAYOUT_ortho_4x4( + TFLIP, TFLIP2, KC_NO, FU , + CLOUD, KC_NO, KC_NO, CMDCLEAR, + SHRUG, DISFACE, HEARTFACE, HAPPYFACE, + KC_ENT, RGB_TOG, MO(_LEDCNTL), MO(_TAPLAND) + ), + + /* TapLand // + * ,-------------------------------. + * | str1 | str2 | str3 | str4 | + * |------+-------+-------+--------| + * | | | | | + * |------+-------+-------+--------| + * | | | | | + * |------+-------+-------+--------| + * | | | | | + * `-------------------------------' + */ + //blue + [_TAPLAND] = LAYOUT_ortho_4x4( + TD(TD_EXAMPLE1), TD(TD_EXAMPLE2), TD(TD_EXAMPLE3), TD(TD_EXAMPLE4), + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ), + /* LEDControl Pad + * ,-------------------------------. + * | snake|breathe|rainbow|gradient| + * |------+-------+-------+--------| + * | xmas | Val+ | Sat+ | HUE+ | + * |------+-------+-------+--------| + * |kngrdr| Val- | Sat- | HUE- | + * |------+-------+-------+--------| + * | swirl| PLAIN | | ON/OFF | + * `-------------------------------' + */ + //blue + [_LEDCNTL] = LAYOUT_ortho_4x4( + RGB_M_SN, RGB_M_B, RGB_M_R, RGB_M_G, + RGB_M_X, RGB_VAI, RGB_SAI, RGB_HUI, + RGB_M_K, RGB_VAD, RGB_SAD, RGB_HUD, + RGB_M_SW, RGB_M_P, KC_NO, RGB_TOG + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case CLOUD: // (っ◕‿◕)っ + if(record->event.pressed){ + send_unicode_hex_string("0028 3063 25D5 203F 25D5 0029 3063"); + } + return false; + break; + case FU: // t(-_-t) + if(record->event.pressed){ + SEND_STRING("t(-_-t)"); + } + return false; + break; + case HAPPYFACE: // ʘ‿ʘ + if(record->event.pressed){ + send_unicode_hex_string("0298 203F 0298"); + } + return false; + break; + case CMDCLEAR: + if (record->event.pressed) { + register_code(KC_LGUI); + tap_code(KC_A); + unregister_code(KC_LGUI); + tap_code(KC_DEL); + } + return false; + break; + case SHRUG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + return false; + break; + case HEARTFACE: // ♥‿♥ + if(record->event.pressed){ + send_unicode_hex_string("2665 203F 2665"); + } + return false; + break; + case DISFACE: // ಠ_ಠ + if(record->event.pressed){ + send_unicode_hex_string("0CA0 005F 0CA0"); + } + return false; + break; + case TFLIP: // (╯°□°)╯ ︵ ┻━┻ + if(record->event.pressed){ + send_unicode_hex_string("0028 256F 00B0 25A1 00B0 0029 256F 0020 FE35 0020 253B 2501 253B"); + } + return false; + break; + case TFLIP2: // ┻━┻︵ \(°□°)/ ︵ ┻━┻ + if(record->event.pressed){ + send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + } + return false; + break; + } + } + return true; +} + + +/* tap dance time */ +void tdexample1(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING1); + reset_tap_dance (state); + } +} +void tdexample2(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING2); + reset_tap_dance (state); + } +} +void tdexample3(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING3); + reset_tap_dance (state); + } +} +void tdexample4(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING4); + reset_tap_dance (state); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1), + [TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2), + [TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3), + [TD_EXAMPLE4] = ACTION_TAP_DANCE_FN(tdexample4) +}; + +// Runs just one time when the keyboard initializes. +void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + rgblight_setrgb (16, 0, 16); + } +} +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _TAPLAND: + rgblight_setrgb(0, 16, 0); //green + break; + case _LEDCNTL: + rgblight_setrgb(0, 0, 16); //blue + break; + case _EMOJI: + rgblight_setrgb (16, 0, 16); //purple + break; + + default: // for any other layers, or the default layer + rgblight_setrgb (16, 0, 16); //purple + break; + } + return state; +}
\ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md new file mode 100644 index 0000000000..7a3b8c8e44 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md @@ -0,0 +1,10 @@ +# Ridingtraffic's examples +=== +This keymap has many features: +3 layers +Momentary layer switching +16 pixel neopixel +Unicode Enabled +Tap dance enabled + +The rgb also updates depending on what layer you are on, and then flips back when done. diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk new file mode 100644 index 0000000000..de44175531 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk @@ -0,0 +1,5 @@ +# turning on tap dance +TAP_DANCE_ENABLE = yes +RGBLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = no +UNICODE_ENABLE = yes
\ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c new file mode 100644 index 0000000000..caab5b343a --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H +#include "switches.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_4x4( + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ) +}; + +struct mechswitch switches[MATRIX_ROWS][MATRIX_COLS] = { + {CHERRY_MX_BLUE, CHERRY_MX_RED, CHERRY_MX_BLACK, CHERRY_MX_BROWN}, + {GATERON_BLUE, GATERON_RED, GATERON_BLACK, GATERON_BROWN}, + {KAILH_BLUE, KAILH_RED, KAILH_BLACK, KAILH_BROWN}, + {HAKO_CLEAR, HAKO_TRUE, HAKO_VIOLET, HAKO_ROYAL_TRUE} +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t col = record->event.key.col; + uint8_t row = record->event.key.row; + + if (record->event.pressed) { + char name[MAX_SWITCH_NAME_LENGTH]; + switch_name(switches[row][col], name); + send_string(name); + SEND_STRING("\n"); + } + return false; +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md new file mode 100644 index 0000000000..9edb4e1813 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/readme.md @@ -0,0 +1,5 @@ +# Sweet16 as a switch tester + +This keymap uses the Sweet16 as a switch tester. The functionality outputs the switch name of whatever key the user pressed. + +the `switches` two-dimensional (4x4) array contains the switches attached to the macropad. The switches supported are defined as macros in the `switches.h` header file. diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk new file mode 100644 index 0000000000..c0f2d0182d --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/rules.mk @@ -0,0 +1,12 @@ +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no + +SRC += switches.c diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c new file mode 100644 index 0000000000..ae37995448 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.c @@ -0,0 +1,99 @@ +#include <stdio.h> +#include <string.h> +#include "switches.h" + +static const char *BRAND_NAMES[] = { + "Kailh", + "Kailh Low Profile Choc", + "Gateron", + "Cherry MX", + "Cherry ML", + "Outemu", + "Greetech", + "Varmilo", + "MOD", + "Hako" +}; + +static const char *COLOR_NAMES[] = { + "", + "White", + "Black", + "Blue", + "Red", + "Yellow", + "Brown", + "Green", + "Clear", + "Silver", + "Nature White", + "Grey", + "Jade", + "Navy", + "Burnt Orange", + "Pale Blue", + "Dark Yellow", + "Gold", + "Chocolate White", + "Burgundy", + "Purple", + "Light Green", + "True", + "Berry", + "Plum", + "Sage", + "Violet", + "L", + "M", + "H", + "SH" +}; + +static const char *VARIANT_NAMES[] = { + "", + "BOX", + "BOX Thick", + "BOX Heavy", + "Silent", + "Tactile", + "Linear", + "Speed", + "Speed Heavy", + "Speed Thick Click", + "Pro", + "Pro Heavy", + "Royal", + "Thick Click", + "Heavy" +}; + +const char *brand_name(struct mechswitch ms) { + return BRAND_NAMES[ms.brand - 1]; +} + +const char *variant_name(struct mechswitch ms) { + return VARIANT_NAMES[ms.variant]; +} + +const char *color_name(struct mechswitch ms) { + return COLOR_NAMES[ms.color]; +} + +void switch_name(struct mechswitch ms, char *buf) { + const char *v_name = variant_name(ms); + const char *c_name = color_name(ms); + + snprintf(buf, MAX_SWITCH_NAME_LENGTH, "%s", brand_name(ms)); + strncat(buf, " ", MAX_SWITCH_NAME_LENGTH - strlen(buf)); + if (strlen(v_name) > 0) { + strncat(buf, v_name, MAX_SWITCH_NAME_LENGTH - strlen(buf)); + strncat(buf, " ", MAX_SWITCH_NAME_LENGTH - strlen(buf)); + } + if (strlen(c_name) > 0) { + strncat(buf, c_name, MAX_SWITCH_NAME_LENGTH - strlen(buf)); + } +} + +int bitfieldtoi(struct mechswitch ms) { + return ((ms.brand << 9) | (ms.variant << 5) | ms.color); +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h new file mode 100644 index 0000000000..6e58068bf5 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/switchtester/switches.h @@ -0,0 +1,189 @@ +#pragma once + +struct mechswitch +{ + unsigned int brand: 4; + unsigned int variant: 4; + unsigned int color: 5; +}; + +#define MAX_SWITCH_NAME_LENGTH 256 + +#define BRAND_KAILH 1 +#define BRAND_KAILH_LOW 2 +#define BRAND_GATERON 3 +#define BRAND_CHERRY_MX 4 +#define BRAND_CHERRY_ML 5 +#define BRAND_OUTEMU 6 +#define BRAND_GREETECH 7 +#define BRAND_VARMILO 8 +#define BRAND_MOD 9 +#define BRAND_HAKO 10 + +#define COLOR_NO 0 +#define COLOR_WHITE 1 +#define COLOR_BLACK 2 +#define COLOR_BLUE 3 +#define COLOR_RED 4 +#define COLOR_YELLOW 5 +#define COLOR_BROWN 6 +#define COLOR_GREEN 7 +#define COLOR_CLEAR 8 +#define COLOR_SILVER 9 +#define COLOR_NATURE_WHITE 10 +#define COLOR_GREY 11 +#define COLOR_JADE 12 +#define COLOR_NAVY 13 +#define COLOR_BURNT_ORANGE 14 +#define COLOR_PALE_BLUE 15 +#define COLOR_DARK_YELLOW 16 +#define COLOR_GOLD 17 +#define COLOR_CHOCOLATE_WHITE 18 +#define COLOR_BURGUNDY 19 +#define COLOR_PURPLE 20 +#define COLOR_LIGHT_GREEN 21 +#define COLOR_TRUE 22 +#define COLOR_BERRY 23 +#define COLOR_PLUM 24 +#define COLOR_SAGE 25 +#define COLOR_VIOLET 26 +#define COLOR_L 27 +#define COLOR_M 28 +#define COLOR_H 29 +#define COLOR_SH 30 + +#define VARIANT_NO 0 +#define VARIANT_BOX 1 +#define VARIANT_BOX_THICK 2 +#define VARIANT_BOX_HEAVY 3 +#define VARIANT_SILENT 4 +#define VARIANT_TACTILE 5 +#define VARIANT_LINEAR 6 +#define VARIANT_SPEED 7 +#define VARIANT_SPEED_HEAVY 8 +#define VARIANT_SPEED_CLICK_THICK 9 +#define VARIANT_PRO 10 +#define VARIANT_PRO_HEAVY 11 +#define VARIANT_ROYAL 12 +#define VARIANT_CLICK_THICK 13 + +#define CHERRY_MX_BLUE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BLUE} +#define CHERRY_MX_RED {BRAND_CHERRY_MX, VARIANT_NO, COLOR_RED} +#define CHERRY_MX_BROWN {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BROWN} +#define CHERRY_MX_BLACK {BRAND_CHERRY_MX, VARIANT_NO, COLOR_BLACK} +#define CHERRY_MX_GREEN {BRAND_CHERRY_MX, VARIANT_NO, COLOR_GREEN} +#define CHERRY_MX_CLEAR {BRAND_CHERRY_MX, VARIANT_NO, COLOR_CLEAR} +#define CHERRY_MX_WHITE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_WHITE} +#define CHERRY_MX_SILVER {BRAND_CHERRY_MX, VARIANT_NO, COLOR_SILVER} +#define CHERRY_MX_NATURE_WHITE {BRAND_CHERRY_MX, VARIANT_NO, COLOR_NATURE_WHITE} +#define CHERRY_MX_SILENT_BLACK {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_BLACK} +#define CHERRY_MX_SILENT_RED {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_RED} +#define CHERRY_MX_TACTILE_BLACK {BRAND_CHERRY_MX, VARIANT_SILENT, COLOR_GREY} +#define CHERRY_MX_LINEAR_BLACK {BRAND_CHERRY_MX, VARIANT_LINEAR, COLOR_GREY} + +#define CHERRY_ML {BRAND_CHERRY_ML, VARIANT_NO, COLOR_NO} + +#define GATERON_BLUE {BRAND_GATERON, VARIANT_NO, COLOR_BLUE} +#define GATERON_BROWN {BRAND_GATERON, VARIANT_NO, COLOR_BROWN} +#define GATERON_BLACK {BRAND_GATERON, VARIANT_NO, COLOR_BLACK} +#define GATERON_RED {BRAND_GATERON, VARIANT_NO, COLOR_RED} +#define GATERON_CLEAR {BRAND_GATERON, VARIANT_NO, COLOR_CLEAR} +#define GATERON_GREEN {BRAND_GATERON, VARIANT_NO, COLOR_GREEN} +#define GATERON_YELLOW {BRAND_GATERON, VARIANT_NO, COLOR_YELLOW} + +#define GATERON_SILENT_CLEAR {BRAND_GATERON, VARIANT_SILENT, COLOR_CLEAR} +#define GATERON_SILENT_RED {BRAND_GATERON, VARIANT_SILENT, COLOR_RED} +#define GATERON_SILENT_YELLOW {BRAND_GATERON, VARIANT_SILENT, COLOR_YELLOW} +#define GATERON_SILENT_BLACK {BRAND_GATERON, VARIANT_SILENT, COLOR_BLACK} +#define GATERON_SILENT_BROWN {BRAND_GATERON, VARIANT_SILENT, COLOR_BROWN} + +#define GREETECH_BLUE {BRAND_GREETECH, VARIANT_NO, COLOR_BLUE} +#define GREETECH_BROWN {BRAND_GREETECH, VARIANT_NO, COLOR_BROWN} +#define GREETECH_BLACK {BRAND_GREETECH, VARIANT_NO, COLOR_BLACK} +#define GREETECH_RED {BRAND_GREETECH, VARIANT_NO, COLOR_RED} + +#define OUTEMU_BLUE {BRAND_OUTEMU, VARIANT_NO, COLOR_BLUE} +#define OUTEMU_BROWN {BRAND_OUTEMU, VARIANT_NO, COLOR_BROWN} +#define OUTEMU_BLACK {BRAND_OUTEMU, VARIANT_NO, COLOR_BLACK} +#define OUTEMU_RED {BRAND_OUTEMU, VARIANT_NO, COLOR_RED} + +#define KAILH_BLUE {BRAND_KAILH, VARIANT_NO, COLOR_BLUE} +#define KAILH_BROWN {BRAND_KAILH, VARIANT_NO, COLOR_BROWN} +#define KAILH_BLACK {BRAND_KAILH, VARIANT_NO, COLOR_BLACK} +#define KAILH_RED {BRAND_KAILH, VARIANT_NO, COLOR_RED} +#define KAILH_GREEN {BRAND_KAILH, VARIANT_NO, COLOR_GREEN} + +#define KAILH_BOX_WHITE {BRAND_KAILH, VARIANT_BOX, COLOR_WHITE} +#define KAILH_BOX_RED {BRAND_KAILH, VARIANT_BOX, COLOR_RED} +#define KAILH_BOX_BLACK {BRAND_KAILH, VARIANT_BOX, COLOR_BLACK} +#define KAILH_BOX_BROWN {BRAND_KAILH, VARIANT_BOX, COLOR_BROWN} +#define KAILH_BOX_ROYAL {BRAND_KAILH, VARIANT_BOX, COLOR_ROYAL} + +#define KAILH_BOX_THICK_JADE {BRAND_KAILH, VARIANT_BOX_THICK, COLOR_JADE} +#define KAILH_BOX_THICK_NAVY {BRAND_KAILH, VARIANT_BOX_THICK, COLOR_NAVY} +#define KAILH_BOX_HEAVY_BURNT_ORANGE {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_BOX_HEAVY_PALE_BLUE {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_PALE_BLUE} +#define KAILH_BOX_HEAVY_DARK_YELLOW {BRAND_KAILH, VARIANT_BOX_HEAVY, COLOR_DARK_YELLOW} + +#define KAILH_SPEED_BRONZE {BRAND_KAILH, VARIANT_SPEED, COLOR_BRONZE} +#define KAILH_SPEED_COPPER {BRAND_KAILH, VARIANT_SPEED, COLOR_COPPER} +#define KAILH_SPEED_GOLD {BRAND_KAILH, VARIANT_SPEED, COLOR_GOLD} +#define KAILH_SPEED_SILVER {BRAND_KAILH, VARIANT_SPEED, COLOR_SILVER} + +#define KAILH_SPEED_HEAVY_BURNT_ORANGE {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_SPEED_HEAVY_PALE_BLUE {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_PALE_BLUE} +#define KAILH_SPEED_HEAVY_DARK_YELLOW {BRAND_KAILH, VARIANT_SPEED_HEAVY, COLOR_DARK_YELLOW} + +#define KAILH_SPEED_THICK_CLICK_NAVY {BRAND_KAILH, VARIANT_SPEED_CLICK_THICK, COLOR_NAVY} + +#define KAILH_PRO_BURGUNDY {BRAND_KAILH, VARIANT_PRO, COLOR_BURGUNDY} +#define KAILH_PRO_PURPLE {BRAND_KAILH, VARIANT_PRO, COLOR_PURPLE} +#define KAILH_PRO_LIGHT_GREEN {BRAND_KAILH, VARIANT_PRO, COLOR_LIGHT_GREEN} + +#define KAILH_PRO_HEAVY_BERRY {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_BERRY} +#define KAILH_PRO_HEAVY_PLUM {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_PLUM} +#define KAILH_PRO_GEAVY_SAGE {BRAND_KAILH, VARIANT_PRO_HEAVY, COLOR_SAGE} + +#define KAILH_LOW_WHITE {BRAND_KAILH_LOW, VARIANT_NO, COLOR_WHITE} +#define KAILH_LOW_BROWN {BRAND_KAILH_LOW, VARIANT_NO, COLOR_BROWN} +#define KAILH_LOW_RED {BRAND_KAILH_LOW, VARIANT_NO, COLOR_RED} +#define KAILH_LOW_CHOCOLATE_WHITE {BRAND_KAILH_LOW, VARIANT_NO, COLOR_CHOCOLATE_WHITE} +#define KAILH_LOW_THICK_CLICK_NAVY {BRAND_KAILH_LOW, VARIANT_THICK_CLICK, COLOR_NAVY} +#define KAILH_LOW_THICK_CLICK_JADE {BRAND_KAILH_LOW, VARIANT_THICK_CLICK, COLOR_JADE} +#define KAILH_LOW_HEAVY_DARK_YELLOW {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_DARK_YELLOW} +#define KAILH_LOW_HEAVY_BURNT_ORANGE {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_BURNT_ORANGE} +#define KAILH_LOW_HEAVY_PALE_BLUE {BRAND_KAILH_LOW, VARIANT_HEAVY, COLOR_PALE_BLUE} + +#define HAKO_ROYAL_CLEAR {BRAND_HAKO, VARIANT_ROYAL, COLOR_CLEAR} +#define HAKO_ROYAL_TRUE {BRAND_HAKO, VARIANT_ROYAL, COLOR_TRUE} + +#define HAKO_CLEAR {BRAND_HAKO, VARIANT_NO, COLOR_CLEAR} +#define HAKO_TRUE {BRAND_HAKO, VARIANT_NO, COLOR_TRUE} +#define HAKO_VIOLET {BRAND_HAKO, VARIANT_NO, COLOR_VIOLET} + +#define MOD_L_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_L} +#define MOD_M_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_M} +#define MOD_H_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_H} +#define MOD_SH_TACTILE {BRAND_MOD, VARIANT_TACTILE, COLOR_SH} + +#define MOD_L_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_L} +#define MOD_M_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_M} +#define MOD_H_LINEAR {BRAND_MOD, VARIANT_LINEAR, COLOR_H} + +#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" +#define BYTE_TO_BINARY(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ + (byte & 0x01 ? '1' : '0') + + +const char *brand_name(struct mechswitch ms); +const char *variant_name(struct mechswitch ms); +const char *color_name(struct mechswitch ms); +void switch_name(struct mechswitch ms, char *buf); +int bitfieldtoi(struct mechswitch ms); diff --git a/keyboards/1upkeyboards/sweet16/readme.md b/keyboards/1upkeyboards/sweet16/readme.md new file mode 100644 index 0000000000..3b7b1d6f0b --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/readme.md @@ -0,0 +1,14 @@ +Sweet16 +=== + +A 4x4 numpad/macro pad sold by 1up Keyboards - designed by Bishop Keyboards + +Keyboard Maintainer: QMK Community +Hardware Supported: Sweet16 Keyboard PCB +Hardware Availability: [1up Keyboards](https://1upkeyboards.com/) + +Make example for this keyboard (after setting up your build environment): + + make 1upkeyboards/sweet16: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/1upkeyboards/sweet16/rules.mk b/keyboards/1upkeyboards/sweet16/rules.mk new file mode 100644 index 0000000000..212e74059e --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/rules.mk @@ -0,0 +1,56 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options |