diff --git a/keyboards/stonehenge30_ble/board/custom_board.h b/keyboards/stonehenge30_ble/board/custom_board.h new file mode 100644 index 000000000000..e79d0d0a32ea --- /dev/null +++ b/keyboards/stonehenge30_ble/board/custom_board.h @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA + * Copyright (c) 2018, Sekigon + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef CUSTOM_BOARD_H +#define CUSTOM_BOARD_H + +#ifdef __cplusplus +extern "C" { +#endif + +//#include "nrf_gpio.h" + +#define GPIO(port, pin) ((port << 6) | pin) +#define PIN1 GPIO(0,8) +#define PIN2 GPIO(0,11) +#define PIN5 GPIO(0,18) +#define PIN6 GPIO(0,16) +#define PIN7 GPIO(0,19) +#define PIN8 GPIO(0,20) +#define PIN9 GPIO(0,22) +#define PIN10 GPIO(0,23) +#define PIN11 GPIO(1,0) +#define PIN12 GPIO(1,3) + +#define PIN13 GPIO(0,9) +#define PIN14 GPIO(0,10) +#define PIN15 GPIO(1,15) +#define PIN16 GPIO(1,14) +#define PIN17 GPIO(0,3) +#define PIN18 GPIO(0,30) +#define PIN19 GPIO(0,0) +#define PIN20 GPIO(0,5) +//#define NRF_LOG_ENABLED 0 +//#define NRF_LOG_BACKEND_SERIAL_USES_UART 0 +//#define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 5 +#define NRF_LOG_BACKEND_UART_TX_PIN 8 +//#define DEBUG +// Low frequency clock source to be used by the SoftDevice +#ifdef S210 +// #define NRF_CLOCK_LFCLKSRC NRF_CLOCK_LFCLKSRC_XTAL_20_PPM +#else +#define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_RC, \ + .rc_ctiv = 16, \ + .rc_temp_ctiv = 2, \ + .xtal_accuracy = 0} +#endif + +#ifdef __cplusplus +} +#endif + +#endif // CUSTOM_BOARD_H diff --git a/keyboards/stonehenge30_ble/config.h b/keyboards/stonehenge30_ble/config.h new file mode 100644 index 000000000000..2ca2e3e6fe09 --- /dev/null +++ b/keyboards/stonehenge30_ble/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2018 Marksard +Copyright 2019 Sekigon + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xDFA4 +#define DEVICE_VER 0x0010 +#define MANUFACTURER marksard +#define PRODUCT stonehenge30 BLE +#define DESCRIPTION Minimal Symmetrical Staggerd 30 Keys Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 6 + +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 1 + +/* 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 TAPPING_TERM 200 +#define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT +//#define DEBUG_ACTION + +//#define RGBLIGHT_ANIMATIONS +//#define RGB_DI_PIN 8 // The pin the LED strip is connected to +//#define RGBLED_NUM 5 // Number of LEDs in your strip + +/* + * 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 +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/stonehenge30_ble/keymaps/like_jis/keymap.c b/keyboards/stonehenge30_ble/keymaps/like_jis/keymap.c new file mode 100644 index 000000000000..7a275fdd1ab1 --- /dev/null +++ b/keyboards/stonehenge30_ble/keymaps/like_jis/keymap.c @@ -0,0 +1,303 @@ +/* +Copyright 2018 Sekigon + +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 +#include "app_ble_func.h" + +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + KANJI, + RGBRST, + AD_WO_L, /* Start advertising without whitelist */ + BLE_DIS, /* Disable BLE HID sending */ + BLE_EN, /* Enable BLE HID sending */ + USB_DIS, /* Disable USB HID sending */ + USB_EN, /* Enable USB HID sending */ + DELBNDS, /* Delete all bonding */ + ADV_ID0, /* Start advertising to PeerID 0 */ + ADV_ID1, /* Start advertising to PeerID 1 */ + ADV_ID2, /* Start advertising to PeerID 2 */ + ADV_ID3, /* Start advertising to PeerID 3 */ + ADV_ID4, /* Start advertising to PeerID 4 */ + BATT_LV, /* Display battery level in milli volts */ + DEL_ID0, /* Delete bonding of PeerID 0 */ + DEL_ID1, /* Delete bonding of PeerID 1 */ + DEL_ID2, /* Delete bonding of PeerID 2 */ + DEL_ID3, /* Delete bonding of PeerID 3 */ + DEL_ID4, /* Delete bonding of PeerID 4 */ + ENT_DFU, /* Start bootloader */ + ENT_SLP, /* Deep sleep mode */ +}; + + +enum tapdances{ + TD_CODO = 0, +}; + +// Layer Mode aliases +// #define KC_LOWER LOWER +// #define KC_RAISE RAISE +#define KC_MLAD MO(_ADJUST) + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_KANJI KANJI + +// #define KC_RST RESET +// #define KC_LRST RGBRST +// #define KC_LTOG RGB_TOG +// #define KC_LHUI RGB_HUI +// #define KC_LHUD RGB_HUD +// #define KC_LSAI RGB_SAI +// #define KC_LSAD RGB_SAD +// #define KC_LVAI RGB_VAI +// #define KC_LVAD RGB_VAD +// #define KC_LMOD RGB_MOD +#define KC_KNRM AG_NORM +#define KC_KSWP AG_SWAP +#define KC_DEBUG DEBUG + +#define KC_RST ENT_DFU +#define KC_BATT BATT_LV +#define KC_BTON BLE_EN +#define KC_BTOF BLE_DIS +#define KC_USBON USB_EN +#define KC_USBOF USB_DIS +#define KC_BTNEW AD_WO_L +#define KC_BTID0 ADV_ID0 +#define KC_BTID1 ADV_ID1 +#define KC_BTID2 ADV_ID2 +#define KC_BTID3 ADV_ID3 +#define KC_BTID4 ADV_ID4 + +// Base layer mod tap +#define KC_A_SF LSFT_T(KC_A) +#define KC_Z_CT LCTL_T(KC_Z) +#define KC_X_AL LALT_T(KC_X) +#define KC_C_GU LGUI_T(KC_C) +#define KC_M_CT LCTL_T(KC_M) +#define KC_ENSF LSFT_T(KC_ENT) + +// Lower layer mod tap +#define KC_MNCT LCTL_T(KC_MINS) + +// Raise layer mod tap +#define KC_F6SF LSFT_T(KC_F6) +#define KC_BSSF LSFT_T(KC_BSLS) +#define KC_11CT LCTL_T(KC_F11) +#define KC_SSCT LCTL_T(KC_SLSH) +#define KC_12AL LALT_T(KC_F12) + +// Layer tap +#define KC_SPLO LT(_LOWER, KC_SPC) +#define KC_BSRA LT(_RAISE, KC_BSPC) + +// Tap dance +#define KC_CODO TD(TD_CODO) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_kc( \ + //,----------------------------------------------------------------------------. + Q, W, E, R, T, BSRA, Y, U, I, O, P,\ + //|------+------+------+------+------|------|------+------+------+------+------| + A_SF, S, D, F, G, H, J, K, L, ENSF,\ + //|------+------+------+------+------|------|------+------+------+------+------| + Z_CT, X_AL, C_GU, V, B, SPLO, N, M_CT, CODO \ + //|------+------+------+------+------|------|------+------+------| + ), + + [_LOWER] = LAYOUT_kc( \ + //,----------------------------------------------------------------------------. + 1, 2, 3, 4, 5, _____, 6, 7, 8, 9, 0,\ + //|------+------+------+------+------|------|------+------+------+------+------| + LSFT, _____, _____, _____, _____, LEFT, DOWN, UP, RGHT, LSFT,\ + //|------+------+------+------+------|------|------+------+------+------+------| + LCTL, LALT, LGUI, _____, _____, _____, LGUI, MNCT, DOT \ + //|------+------+------+------+------|------|------+------+------| + ), + + [_RAISE] = LAYOUT_kc( \ + //,----------------------------------------------------------------------------. + F1, F2, F3, F4, F5, _____, MINS, EQL, JYEN, LBRC, RBRC,\ + //|------+------+------+------+------|------|------+------+------+------+------| + F6SF, F7, F8, F9, F10, DEL, XXXXX, SCLN, QUOT, BSSF,\ + //|------+------+------+------+------|------|------+------+------+------+------| + 11CT, 12AL, ESC, TAB, KANJI, MLAD, LGUI, SSCT, RO \ + //|------+------+------+------+------|------|------+------+------| + ), + + [_ADJUST] = LAYOUT_kc( \ + //,----------------------------------------------------------------------------. + RST, BATT, KNRM, KSWP, XXXXX, _____, XXXXX, XXXXX, XXXXX, HOME, PGUP, \ + //|------+------+------+------+------|------|------+------+------+------+------| + BTON, USBON, BTID0, BTID2, BTID4, BTN1, MS_U, BTN2, END, PGDN, \ + //|------+------+------+------+------|------|------+------+------+------+------| + BTOF, USBOF, BTID1, BTID3, BTNEW, _____, MS_L, MS_D, MS_R \ + //|------+------+------+------+------|------|------+------+------| + ) +}; + +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { + + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); +} + +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + char str[16]; + + bool result = true; + + switch (keycode) { + // case LOWER: + // update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + // result = false; + // break; + // case RAISE: + // update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + // result = false; + // break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + result = false; + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + result = false; + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + result = false; + break; +#endif + } + + if (record->event.pressed) { + switch (keycode) { + case DELBNDS: + delete_bonds(); + result = false; + break; + case AD_WO_L: + restart_advertising_wo_whitelist(); + result = false; + break; + case USB_EN: + set_usb_enabled(true); + result = false; + break; + case USB_DIS: + set_usb_enabled(false); + result = false; + break; + case BLE_EN: + set_ble_enabled(true); + result = false; + break; + case BLE_DIS: + set_ble_enabled(false); + result = false; + break; + case ADV_ID0: + restart_advertising_id(0); + result = false; + break; + case ADV_ID1: + restart_advertising_id(1); + result = false; + break; + case ADV_ID2: + restart_advertising_id(2); + result = false; + break; + case ADV_ID3: + restart_advertising_id(3); + result = false; + break; + case ADV_ID4: + restart_advertising_id(4); + result = false; + break; + case DEL_ID0: + delete_bond_id(0); + result = false; + break; + case DEL_ID1: + delete_bond_id(1); + result = false; + break; + case DEL_ID2: + delete_bond_id(2); + result = false; + break; + case DEL_ID3: + delete_bond_id(3); + result = false; + break; + case BATT_LV: + sprintf(str, "%4dmV", get_vcc()); + send_string(str); + result = false; + break; + case ENT_DFU: + bootloader_jump(); + result = false; + break; + } + } + else if (!record->event.pressed) { + switch (keycode) { + case ENT_SLP: + sleep_mode_enter(); + result = false; + break; + } + } + + return result; +} diff --git a/keyboards/stonehenge30_ble/keymaps/like_jis/rule.mk b/keyboards/stonehenge30_ble/keymaps/like_jis/rule.mk new file mode 100644 index 000000000000..653c1f32b22c --- /dev/null +++ b/keyboards/stonehenge30_ble/keymaps/like_jis/rule.mk @@ -0,0 +1,2 @@ + +TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/stonehenge30_ble/ld/nrf52840.ld b/keyboards/stonehenge30_ble/ld/nrf52840.ld new file mode 100644 index 000000000000..8ce665c0f546 --- /dev/null +++ b/keyboards/stonehenge30_ble/ld/nrf52840.ld @@ -0,0 +1,117 @@ +/* Linker script to configure memory regions. */ + +SEARCH_DIR(.) +GROUP(-lgcc -lc -lnosys) + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000 + RAM (rwx) : ORIGIN = 0x2000BC70, LENGTH = 0x34390 +} + +SECTIONS +{ +} + +SECTIONS +{ + . = ALIGN(16); + .mem_section_dummy_ram : + { + } + .log_dynamic_data : + { + PROVIDE(__start_log_dynamic_data = .); + KEEP(*(SORT(.log_dynamic_data*))) + PROVIDE(__stop_log_dynamic_data = .); + } > RAM + .fs_data : + { + PROVIDE(__start_fs_data = .); + KEEP(*(.fs_data)) + PROVIDE(__stop_fs_data = .); + } > RAM + .cli_sorted_cmd_ptrs : + { + PROVIDE(__start_cli_sorted_cmd_ptrs = .); + KEEP(*(.cli_sorted_cmd_ptrs)) + PROVIDE(__stop_cli_sorted_cmd_ptrs = .); + } > RAM + +} INSERT AFTER .data; + +SECTIONS +{ + .mem_section_dummy_rom : + { + } + .sdh_soc_observers : + { + PROVIDE(__start_sdh_soc_observers = .); + KEEP(*(SORT(.sdh_soc_observers*))) + PROVIDE(__stop_sdh_soc_observers = .); + } > FLASH + .sdh_ble_observers : + { + PROVIDE(__start_sdh_ble_observers = .); + KEEP(*(SORT(.sdh_ble_observers*))) + PROVIDE(__stop_sdh_ble_observers = .); + } > FLASH + .pwr_mgmt_data : + { + PROVIDE(__start_pwr_mgmt_data = .); + KEEP(*(SORT(.pwr_mgmt_data*))) + PROVIDE(__stop_pwr_mgmt_data = .); + } > FLASH + .log_const_data : + { + PROVIDE(__start_log_const_data = .); + KEEP(*(SORT(.log_const_data*))) + PROVIDE(__stop_log_const_data = .); + } > FLASH + .nrf_balloc : + { + PROVIDE(__start_nrf_balloc = .); + KEEP(*(.nrf_balloc)) + PROVIDE(__stop_nrf_balloc = .); + } > FLASH + .sdh_state_observers : + { + PROVIDE(__start_sdh_state_observers = .); + KEEP(*(SORT(.sdh_state_observers*))) + PROVIDE(__stop_sdh_state_observers = .); + } > FLASH + .sdh_stack_observers : + { + PROVIDE(__start_sdh_stack_observers = .); + KEEP(*(SORT(.sdh_stack_observers*))) + PROVIDE(__stop_sdh_stack_observers = .); + } > FLASH + .sdh_req_observers : + { + PROVIDE(__start_sdh_req_observers = .); + KEEP(*(SORT(.sdh_req_observers*))) + PROVIDE(__stop_sdh_req_observers = .); + } > FLASH + .nrf_queue : + { + PROVIDE(__start_nrf_queue = .); + KEEP(*(.nrf_queue)) + PROVIDE(__stop_nrf_queue = .); + } > FLASH + .cli_command : + { + PROVIDE(__start_cli_command = .); + KEEP(*(.cli_command)) + PROVIDE(__stop_cli_command = .); + } > FLASH + .crypto_data : + { + PROVIDE(__start_crypto_data = .); + KEEP(*(SORT(.crypto_data*))) + PROVIDE(__stop_crypto_data = .); + } > FLASH + +} INSERT AFTER .text + +INCLUDE "nrf_common.ld" diff --git a/keyboards/stonehenge30_ble/rev1/config.h b/keyboards/stonehenge30_ble/rev1/config.h new file mode 100644 index 000000000000..da5985fe2604 --- /dev/null +++ b/keyboards/stonehenge30_ble/rev1/config.h @@ -0,0 +1,9 @@ +#ifndef MASTER_CONFIG_H_ +#define MASTER_CONFIG_H_ + +#include "custom_board.h" + +#define ENABLE_STARTUP_ADV_NOLIST +#define IS_LEFT_HAND true + +#endif /* MASTER_CONFIG_H_ */ diff --git a/keyboards/stonehenge30_ble/rev1/pin_assign.h b/keyboards/stonehenge30_ble/rev1/pin_assign.h new file mode 100644 index 000000000000..20e024c55ee4 --- /dev/null +++ b/keyboards/stonehenge30_ble/rev1/pin_assign.h @@ -0,0 +1,60 @@ +/* + * pin_assign.h + * + * Created on: 2019/01/01 + * Author: sekigon + */ + +#ifndef KEYBOARDS_stonehenge30_BLE_REV1_PIN_ASSIGN_H_ +#define KEYBOARDS_stonehenge30_BLE_REV1_PIN_ASSIGN_H_ + + +#include "custom_board.h" + + +#undef B0 +#undef B1 +#undef B2 +#undef B3 +#undef B4 +#undef B5 +#undef B6 +#undef C6 +#undef D0 +#undef D1 +#undef D2 +#undef D3 +#undef D4 +#undef D7 +#undef E6 +#undef F4 +#undef F5 +#undef F6 +#undef F7 + +#define D3 PIN1 +#define D2 PIN2 +#define D1 PIN5 +#define D0 PIN6 +#define D4 PIN7 +#define C6 PIN8 +#define D7 PIN9 +#define E6 PIN10 +#define B4 PIN11 +#define B5 PIN12 +#define B6 PIN13 +#define B2 PIN14 +#define B3 PIN15 +#define B1 PIN16 +#define F7 PIN17 +#define F6 PIN18 +#define F5 PIN19 +#define F4 PIN20 + +#define THIS_DEVICE_ROWS 6 +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3 } + +#define THIS_DEVICE_COLS 6 +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +#endif /* KEYBOARDS_stonehenge30_BLE_REV1_PIN_ASSIGN_H_ */ diff --git a/keyboards/stonehenge30_ble/rev1/rev1.c b/keyboards/stonehenge30_ble/rev1/rev1.c new file mode 100644 index 000000000000..1abce1a1dacc --- /dev/null +++ b/keyboards/stonehenge30_ble/rev1/rev1.c @@ -0,0 +1,18 @@ +/* + * pro_v1.c + * + * Created on: 2018/11/02 + * Author: Sekigon + */ + + + +#include "matrix.h" +#include "quantum.h" +#include "nrf.h" +#include "app_ble_func.h" + +void matrix_init_user() { + set_usb_enabled(true); + debug_enable = true; +} diff --git a/keyboards/stonehenge30_ble/rev1/rev1.h b/keyboards/stonehenge30_ble/rev1/rev1.h new file mode 100644 index 000000000000..3bbe8fff4798 --- /dev/null +++ b/keyboards/stonehenge30_ble/rev1/rev1.h @@ -0,0 +1,49 @@ +/* + * rev1.h + * + * Created on: 2019/02/25 + * Author: Sekigon + */ + +#ifndef KEYBOARDS_stonehenge30_BLE_REV1_REV1_H_ +#define KEYBOARDS_stonehenge30_BLE_REV1_REV1_H_ + +#include "quantum.h" + +#define K_N KC_NO + +/* This 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( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, \ + L10, L11, L12, L13, L14, L16, L17, L18, L19, L1A, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L25 }, \ + { L20, L21, L22, L23, L24, K_N }, \ + { L06, L07, L08, L09, L0A, K_N }, \ + { L16, L17, L18, L19, L1A, K_N }, \ + { L26, L27, L28, K_N, K_N, K_N }, \ + } + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, L07, L08, L09, L0A, \ + L10, L11, L12, L13, L14, L16, L17, L18, L19, L1A, \ + L20, L21, L22, L23, L24, L25, L26, L27, L28 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##L07, KC_##L08, KC_##L09, KC_##L0A, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L16, KC_##L17, KC_##L18, KC_##L19, KC_##L1A, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##L28 \ + ) + +#endif /* KEYBOARDS_stonehenge30_BLE_REV1_REV1_H_ */ diff --git a/keyboards/stonehenge30_ble/rev1/rules.mk b/keyboards/stonehenge30_ble/rev1/rules.mk new file mode 100644 index 000000000000..bb059a9880cb --- /dev/null +++ b/keyboards/stonehenge30_ble/rev1/rules.mk @@ -0,0 +1,13 @@ + +RGBLIGHT_ENABLE = no + +# it should exist either in /ld/ +MCU_LDSCRIPT = nrf52840 +MCU_SERIES = NRF52840 +NRFSDK_ROOT := $(NRFSDK15_ROOT) #Path to nRF SDK v15.0.0 + +# project specific files +#SRC = matrix.c + +# NRF_SEPARATE = master +#CFLAGS += -DNRF_XTAL_32MHZ \ No newline at end of file diff --git a/keyboards/stonehenge30_ble/rules.mk b/keyboards/stonehenge30_ble/rules.mk new file mode 100644 index 000000000000..b53cd6fa988e --- /dev/null +++ b/keyboards/stonehenge30_ble/rules.mk @@ -0,0 +1,36 @@ + +DEFAULT_FOLDER = stonehenge30_ble/rev1 + +NRF_DEBUG = no + +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover +CUSTOM_MATRIX = yes # This flag should be on for nrf52 +TAP_DANCE_ENABLE = yes + +## chip/board settings +MCU_FAMILY = NRF52 +# linker script to use +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# \ No newline at end of file diff --git a/keyboards/stonehenge30_ble/stonehenge30_ble.h b/keyboards/stonehenge30_ble/stonehenge30_ble.h new file mode 100644 index 000000000000..7542de7a2fae --- /dev/null +++ b/keyboards/stonehenge30_ble/stonehenge30_ble.h @@ -0,0 +1,8 @@ +#ifndef KEYBOARDS_stonehenge30_BLE_H_ +#define KEYBOARDS_stonehenge30_BLE_H_ + +#include "quantum.h" +#include "rev1.h" + + +#endif /* KEYBOARDS_stonehenge30_BLE_H_ */