Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] frobiac custom boards and layout #19883

Merged
merged 6 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions keyboards/frobiac/blackbowl/blackbowl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2023 @frobiac
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "quantum.h"
#include <stdint.h>
#include <stdbool.h>
#include "i2c_master.h"
#include <util/delay.h>
frobiac marked this conversation as resolved.
Show resolved Hide resolved

extern uint8_t expander_status;
extern uint8_t expander_input_pin_mask;
extern bool i2c_initialized;

void init_blackbowl(void);
void init_expander(void);

// clang-format off
#define I2C_TIMEOUT 100
#define IODIRA 0x00 // i/o direction register
#define IODIRB 0x01
#define GPPUA 0x0C // GPIO pull-up resistor register
#define GPPUB 0x0D
#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
#define GPIOB 0x13
#define OLATA 0x14 // output latch register
#define OLATB 0x15

#define xxx KC_NO

// clang-format on
61 changes: 61 additions & 0 deletions keyboards/frobiac/blackbowl/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2012 Jun Wako <[email protected]>
// Copyright 2013 Oleg Kostyuk <[email protected]>
// Copyright 2017 Erin Call <[email protected]>
// Copyright 2023 @frobiac
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define MATRIX_ROWS 10
#define MATRIX_COLS 4
#define EXPANDER_COL_REGISTER GPIOA
#define EXPANDER_ROW_REGISTER GPIOB
// clang-format off

/* Set 0 if debouncing isn't needed. Was 15 */
#define DEBOUNCE 0

#define USB_MAX_POWER_CONSUMPTION 500
frobiac marked this conversation as resolved.
Show resolved Hide resolved

#ifdef PS2_MOUSE_ENABLE
# define PS2_MOUSE_USE_REMOTE_MODE
# define PS2_MOUSE_INIT_DELAY 1000
#endif

#ifdef PS2_DRIVER_USART

# define PS2_CLOCK_PIN D5
# define PS2_DATA_PIN D2

/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
/* set DDR of CLOCK as input to be slave */
#define PS2_USART_INIT() do { \
PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
UCSR1C = ((1 << UMSEL10) | \
(3 << UPM10) | \
(0 << USBS1) | \
(3 << UCSZ10) | \
(0 << UCPOL1)); \
UCSR1A = 0; \
UBRR1H = 0; \
UBRR1L = 0; \
} while (0)
#define PS2_USART_RX_INT_ON() do { \
UCSR1B = ((1 << RXCIE1) | \
(1 << RXEN1)); \
} while (0)
#define PS2_USART_RX_POLL_ON() do { \
UCSR1B = (1 << RXEN1); \
} while (0)
#define PS2_USART_OFF() do { \
UCSR1C = 0; \
UCSR1B &= ~((1 << RXEN1) | \
(1 << TXEN1)); \
} while (0)
#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
#define PS2_USART_RX_DATA UDR1
#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
#define PS2_USART_RX_VECT USART1_RX_vect
#endif

84 changes: 84 additions & 0 deletions keyboards/frobiac/blackbowl/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"manufacturer": "frobiac",
"keyboard_name": "blackbowl",
"url": "https://www.github.com/frobiac/adnw",
"maintainer": "frobiac",
"bootloader": "halfkay",
"processor": "atmega32u4",
"diode_direction": "ROW2COL",
"features": {
"audio": false,
"backlight": false,
"bootmagic": false,
"command": false,
"console": false,
"dynamic_macro": true,
"extrakey": true,
"lto": true,
frobiac marked this conversation as resolved.
Show resolved Hide resolved
"mousekey": true,
"nkro": false,
"unicode": false,
"rgblight": false,
"sleep_led": false
frobiac marked this conversation as resolved.
Show resolved Hide resolved
},
"usb": {
"device_version": "1.0.0",
"pid": "0x1D50",
"vid": "0x6033"
},
"matrix_pins": {
"cols": [ null, null, null, null ],
"rows": [ null, null, null, null, null, null, null, null, null, null ]
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [5, 3], "label":"K", "x":0, "y":1.00},
{"matrix": [6, 3], "label":"U", "x":1, "y":0.50},
{"matrix": [7, 3], "label":"Q", "x":2, "y":0.00},
{"matrix": [8, 3], "label":".", "x":3, "y":0.00},
{"matrix": [9, 3], "label":"J", "x":4, "y":0.00},

{"matrix": [0, 3], "label":"P", "x":6, "y":0.00},
{"matrix": [1, 3], "label":"C", "x":7, "y":0.00},
{"matrix": [2, 3], "label":"L", "x":8, "y":0.00},
{"matrix": [3, 3], "label":"M", "x":9, "y":0.50},
{"matrix": [4, 3], "label":"F", "x":10, "y":1.00},

{"matrix": [5, 2], "label":"H", "x":0, "y":2.00},
{"matrix": [6, 2], "label":"I", "x":1, "y":1.50},
{"matrix": [7, 2], "label":"E", "x":2, "y":1.00},
{"matrix": [8, 2], "label":"A", "x":3, "y":1.00},
{"matrix": [9, 2], "label":"O", "x":4, "y":1.00},

{"matrix": [0, 2], "label":"D", "x":6, "y":1.00},
{"matrix": [1, 2], "label":"T", "x":7, "y":1.00},
{"matrix": [2, 2], "label":"R", "x":8, "y":1.00},
{"matrix": [3, 2], "label":"N", "x":9, "y":1.50},
{"matrix": [4, 2], "label":"S", "x":10, "y":2.00},

{"matrix": [5, 1], "label":"X", "x":0, "y":3.00},
{"matrix": [6, 1], "label":"Y", "x":1, "y":2.50},
{"matrix": [7, 1], "label":"-", "x":2, "y":2.00},
{"matrix": [8, 1], "label":",", "x":3, "y":2.00},
{"matrix": [9, 1], "label":"/", "x":4, "y":2.00},

{"matrix": [0, 1], "label":"B", "x":6, "y":2.00},
{"matrix": [1, 1], "label":"G", "x":7, "y":2.00},
{"matrix": [2, 1], "label":"W", "x":8, "y":2.00},
{"matrix": [3, 1], "label":"V", "x":9, "y":2.50},
{"matrix": [4, 1], "label":"Z", "x":10, "y":3.00},

{"matrix": [5, 0], "label":" ", "x":0, "y":0.00},
{"matrix": [7, 0], "label":"Gui", "x":2, "y":3.00},
{"matrix": [8, 0], "label":"tab", "x":3, "y":3.00},
{"matrix": [9, 0], "label":"spc", "x":4, "y":3.00},

{"matrix": [0, 0], "label":"L2", "x":6, "y":3.00},
{"matrix": [1, 0], "label":"Sh", "x":7, "y":3.00},
{"matrix": [2, 0], "label":"L3", "x":8, "y":3.00},
{"matrix": [4, 0], "label":"Fx", "x":10, "y":0.00}
]
}
}
}
85 changes: 85 additions & 0 deletions keyboards/frobiac/blackbowl/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright 2023 @frobiac
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

#include "keymap_german.h"

enum layer_number {
_ADNW = 0,
_QWERTZ,
_NAVNUM,
_SYMBOL,
_FUNC,
_MOUSE,
};

#define CTL_TAB LCTL_T(KC_TAB)
#define ALT_SPC LALT_T(KC_SPC)
#define NAV_ESC LT(_NAVNUM, KC_ESC)
#define SFT_BSP LSFT_T(KC_BSPC)
#define SYM_ENT LT(_SYMBOL, KC_ENT)
#define MOUSE_X LT(_MOUSE, KC_X)
#define MOUSE_Y LT(_MOUSE, KC_Y)

/*
* ┌───┐ ┌───┬───┬───┐ ┌───┬───┬───┐ ┌───┐
* │MOU├───┤ Q │ . │ J │ │ P │ C │ L ├───┤Fx │
* ├───┤ U ├───┼───┼───┤ ├─[TP]──┼───┤ M ├───┤
* │ K ├───┤ E │ A │ O │ │ D │ T │ R ├───R F │
* ├───┤ I ├───┼───┼───┤ ├───┼───┼───┤ N ├───┤
* │ H ├───┤ - │ ; │ / │ │ D │ G │ W ├───┤ S │
* ├───┤ Y ├───┼───┼───┤ ├───┼───┼───┤ V ├───┤
* │ X ├───┤ │Tab│Spc│ │Esc│Bsp│Ret├───┤ Z │
* └───┘ └───┴───┴───┘ └───┴───┴───┘ └───┘
*
*/

// clang-format off

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADNW] = LAYOUT(
KC_K, KC_U, KC_Q, KC_DOT, KC_J, KC_P, KC_C, KC_L, KC_M, KC_F,
KC_H, KC_I, KC_E, KC_A, KC_O, KC_D, KC_T, KC_R, KC_N, KC_S,
MOUSE_X, DE_Y, DE_MINS, KC_COMM, DE_SLSH, KC_B, KC_G, KC_W, KC_V, RSFT_T(DE_Z),
XXXXXXX, KC_LGUI, CTL_TAB, ALT_SPC, NAV_ESC, SFT_BSP, SYM_ENT, MO(_FUNC)
),

[_QWERTZ] = LAYOUT(
KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
MOUSE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH),
XXXXXXX, KC_LGUI, CTL_TAB, ALT_SPC, NAV_ESC, SFT_BSP, SYM_ENT, MO(_FUNC)
),

[_SYMBOL] = LAYOUT(
DE_AT, DE_DEG, DE_LBRC, DE_RBRC, DE_HASH, DE_EXLM, DE_LABK, DE_RABK, DE_EQL, DE_AMPR,
DE_BSLS, DE_EURO, DE_LCBR, DE_RCBR, DE_ASTR, DE_QUES, DE_LPRN, DE_RPRN, DE_PLUS, KC_ENT,
XXXXXXX, DE_DLR, DE_PIPE, DE_TILD, DE_GRV, DE_CIRC, DE_PERC, DE_DQUO, DE_QUOT, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______
),

[_NAVNUM] = LAYOUT(
KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, DE_SS, KC_7, KC_8, KC_9, DE_ADIA,
KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_DOT, KC_4, KC_5, KC_6, DE_ODIA,
XXXXXXX, XXXXXXX, KC_INS, XXXXXXX, XXXXXXX, KC_0, KC_1, KC_2, KC_3, DE_UDIA,
_______, _______, _______, _______, _______, _______, _______, _______
),

[_FUNC] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, DF(_QWERTZ),DF(_ADNW), XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10,
DM_REC1, DM_RSTP, DM_PLY1, XXXXXXX, QK_RBT, XXXXXXX, KC_F4, KC_F5, KC_F6, KC_F11,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QK_BOOT, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F12,
_______, _______, _______, _______, _______, _______, _______, _______
),

[_MOUSE] = LAYOUT(
KC_WH_L, XXXXXXX, KC_MS_U, XXXXXXX, XXXXXXX, KC_ACL0, XXXXXXX, KC_BTN3, XXXXXXX, KC_BTN5,
KC_WH_R, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, KC_ACL1, XXXXXXX, KC_BTN1, KC_BTN2, KC_BTN4,
MOUSE_X, KC_BTN1, KC_BTN3, KC_BTN2, KC_WH_D, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______
),

};

// clang-format on
1 change: 1 addition & 0 deletions keyboards/frobiac/blackbowl/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DYNAMIC_MACRO_ENABLE = yes
Loading