Skip to content

Commit

Permalink
add bs 28 and CUSTOM_MATRIX
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 12, 2021
1 parent 0d7451b commit 65e50fc
Show file tree
Hide file tree
Showing 25 changed files with 819 additions and 84 deletions.
6 changes: 3 additions & 3 deletions keyboards/yandrstudio/nlhhkb/info-via.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "HHKB (Biu)",
"vendorId": "0xFEED",
"productId": "0x6066",
"name": "HHKB_Y&R",
"vendorId": "0xAA96",
"productId": "0xAAA0",
"lighting": {
"extends": "none",
"keycodes": "qmk"
Expand Down
6 changes: 3 additions & 3 deletions keyboards/yandrstudio/r65ble/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#define MATRIX_ROWS 5
#define MATRIX_COLS 15

#define MATRIX_ROW_PINS { B5, B4, A3, A2, B9 }
#define MATRIX_COL_PINS { A10, A9, A8, B14, B13, B12, B11, B10, B1, B0, A7, A6, A5, A4, B8 }
#define MATRIX_ROW_PINS { B5, C13, A3, A2, B9 }
#define MATRIX_COL_PINS { C14, B4, A8, B14, B13, B12, B11, B10, B1, B0, A7, A6, A5, A4, B8 }


#define DIODE_DIRECTION COL2ROW
Expand Down Expand Up @@ -99,6 +99,6 @@
#define TAP_HOLD_CAPS_DELAY 20
#define TAP_CODE_DELAY 10
#ifdef CONSOLE_ENABLE
# define DEBUG_MATRIX_SCAN_RATE
// # define DEBUG_MATRIX_SCAN_RATE
#endif

45 changes: 24 additions & 21 deletions keyboards/yandrstudio/r65ble/keymaps/test_uart/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#include QMK_KEYBOARD_H
#include <stdio.h>
// #include <stdio.h>
#include "print.h"
#include "dynamic_keymap.h"
#include "uart.h"

Expand Down Expand Up @@ -123,30 +124,32 @@ void oled_task_user(void) {


void keyboard_post_init_user(void) {
uart_init(115200);
// uart_init(115200);
debug_enable=true;
// debug_matrix=true;
debug_keyboard=true;
}



// bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// uart_putchar(0xff);
// uart_putchar(keycode >> 8);
// uart_putchar(keycode & 0xff);
// uart_putchar(0xfe);
// uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
// return false;
// // switch (keycode) {
// // case KC_N:
// // if (record->event.pressed) {
// // uart_putchar('#');
// // } else {
// // // Do something else when release
// // }
// // return false; // Skip all further processing of this key
// // default:
// // return true; // Process all other keycodes normally
// // }
// }
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
uart_putchar(0xff);
uart_putchar(keycode >> 8);
uart_putchar(keycode & 0xff);
uart_putchar(0xfe);
uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
}
return true;
// switch (keycode) {
// case KC_N:
// if (record->event.pressed) {
// uart_putchar('#');
// } else {
// // Do something else when release
// }
// return false; // Skip all further processing of this key
// default:
// return true; // Process all other keycodes normally
// }
}
41 changes: 35 additions & 6 deletions keyboards/yandrstudio/r65ble/keymaps/test_uart/readme.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
# BLE_UART SUPPORT FOR ARM

## send source support

## uart support
1. add biu_ble5 support in your $(keymap)/rules.mk
## method 1


### send source support
1. move host_driver declarations from "qmk_firmware/tmk_core/protocol/chibios/main.c" to "qmk_firmware/tmk_core/protocol/chibios/usb_main.h"
```c++
#include "host_driver.h"
/* declarations */
uint8_t keyboard_leds(void);
void send_keyboard(report_keyboard_t *report);
void send_mouse(report_mouse_t *report);
void send_system(uint16_t data);
void send_consumer(uint16_t data);
```
### set no usb check
```shell
NO_USB_STARTUP_CHECK = yes
```

### uart support

1. add biu_ble5 support in your $(keymap)/relus.mk
```shell
BIU_BLE5_ENABLE = yes
```

2. add uart.c to src (in file qmk_firmware/tmk_core/protocol/chibios.mk)
2. add uart.c to src (in file "qmk_firmware/tmk_core/protocol/chibios.mk")
```shell
# into end of the chibios.mk
ifeq ($(strip $(BIU_BLE5_ENABLE)), yes)
SRC += uart.c
VPATH += $(DRIVER_PATH)/chibios
# VPATH += $(DRIVER_PATH)/chibios #optional. For stability, it is recommended to add this line.
OPT_DEFS += -DBIU_BLE5_ENABLE
endif
```
3. add uart support in the main function (in file qmk_firmware/tmk_core/protocol/chibios/main.c)
3. add uart support in the main function (in file "qmk_firmware/tmk_core/protocol/chibios/main.c")
```c++
// head of the main.c file
#ifdef BIU_BLE5_ENABLE
Expand All @@ -29,3 +49,12 @@ endif
uart_init(9600);
#endif
```

4. copy outputselect.h and outputselect.c into "qmk_firmware/tmk_core/protocol/chibios/"


## method 2


## some important file
1. chibios usb state: "qmk_firmware/lib/chibios/os/hal/include/hal_usb.h"
4 changes: 2 additions & 2 deletions keyboards/yandrstudio/r65ble/keymaps/test_uart/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ VIA_ENABLE = yes
OPT_ENABLE = yes
WPM_ENABLE = yes
OLED_DRIVER_ENABLE = yes
CONSOLE_ENABLE = no
CONSOLE_ENABLE = yes
# QUANTUM_LIB_SRC += uart.c

BIU_BLE5_ENABLE = yes

NO_USB_STARTUP_CHECK = yes
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/r65ble/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
r65ble
rainbow65
===

A 65% keyboard with rgb oled and encoder with nrf52840 ble chip supported by using the uart driver.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/r65ble/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
COMMAND_ENABLE = yes # Commands for debug and configuration
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
# NKRO_ENABLE = yes # USB Nkey Rollover
#RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
Expand Down
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/rainbow65/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
COMMAND_ENABLE = yes # Commands for debug and configuration
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
#RGBLIGHT_ENABLE = yes
# RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
WS2812_DRIVER = spi
Expand Down
6 changes: 3 additions & 3 deletions keyboards/yandrstudio/sb65p/info-via.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SP65",
"vendorId": "0xFEED",
"productId": "0x6060",
"name": "SP65_Y&R",
"vendorId": "0xAA96",
"productId": "0xAA02",
"lighting": "none",
"matrix": { "rows": 10, "cols": 9 },
"layouts": {
Expand Down
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/tdcq64_2s/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* USB Device descriptor parameter */
#define VENDOR_ID 0xAA96
#define PRODUCT_ID 0xAA04
#define PRODUCT_ID 0xAAA2
#define DEVICE_VER 0x0001
#define MANUFACTURER JasonRen biu
#define PRODUCT tdcq64_2s
Expand Down
Loading

0 comments on commit 65e50fc

Please sign in to comment.