Skip to content

Commit

Permalink
[Keymap] Drashna's Improve OLEDs and custom Split code (#14063)
Browse files Browse the repository at this point in the history
* Fill the oleds with right mods

* Enable double mods on x32 oleds

* Disable forced NKRO

* Make oleds fancy only on good MCUs

* Overhaul oled display

* Further enhance oled, with kitty!

* Final oled form

* Not working transport

* Transport id of woring

* Add acceleration

* fix button placement for accel macro

* Fix accelartion location and behavior

* Remove OLED sync code

* Fix alignment issue

* Remove audio hack

* Fix up zima keymap

* Add matrix slave scan function and cleanup drashna.h

* Clean up user space

* Allow userspace sync to be disable-able

* Fix weird issue with audio

* Fix alignment issue with user split sync

* Disable second rgb matrix task

* Disable additional animations

* Change dynamic keymap settings

* Hacky fix for borked corne

* Add Blackpill (F411) support to tractyl manuform

* remove manual via eeprom reset

* Remove all references to rgblight twinkle

* Fix issues with config processing
  • Loading branch information
drashna authored Aug 21, 2021
1 parent da1c011 commit 58a5030
Show file tree
Hide file tree
Showing 42 changed files with 936 additions and 521 deletions.
5 changes: 5 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/5x6_right.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#pragma once

#include "tractyl_manuform.h"
#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right_f411)
# include "f411.h"
#elif defined(KEYBOARD_handwired_tractyl_manuform_5x6_right_teensy2pp)
# include "teensy2pp.h"
#endif
#include "quantum.h"

#define ___ KC_NO
Expand Down
51 changes: 7 additions & 44 deletions keyboards/handwired/tractyl_manuform/5x6_right/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#include "config_common.h"

#define PRODUCT_ID 0x3536
#define DEVICE_VER 0x0001
#define PRODUCT Tractyl Manuform(5x6)
#define PRODUCT_ID 0x3536
#define DEVICE_VER 0x0001

/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 12
#define MATRIX_COLS 6
#define MATRIX_ROWS 12
#define MATRIX_COLS 6

// wiring of each half
#define MATRIX_COL_PINS \
{ C0, C1, C2, C3, C4, C5 }
#define MATRIX_ROW_PINS \
{ F7, F6, F5, F4, F3, F2 }

#define DIODE_DIRECTION COL2ROW

// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN E7
#define RGBLED_NUM 20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }
#define RGBLIGHT_SLEEP
// #define RGBW
#define RGBLIGHT_LIMIT_VAL 100
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3

#define DEBUG_LED_PIN D6
#define DIODE_DIRECTION COL2ROW

#define ROTATIONAL_TRANSFORM_ANGLE -25

Expand All @@ -62,24 +38,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BOOTMAGIC_LITE_ROW_RIGHT 6
#define BOOTMAGIC_LITE_COLUMN_RIGHT 5

#define AUDIO_PIN C6
#define AUDIO_PIN_ALT B7

#define DYNAMIC_KEYMAP_LAYER_COUNT 16
#define LAYER_STATE_16BIT

/* serial.c configuration for split keyboard */
#define SOFT_SERIAL_PIN D2
#define EE_HANDS

#define ENCODERS_PAD_A \
{ D5 }
#define ENCODERS_PAD_B \
{ D4 }
#define ENCODER_RESOLUTION 4

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define DEBOUNCE 5

/* disable action features */
//#define NO_ACTION_LAYER
Expand All @@ -89,7 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define NO_ACTION_FUNCTION

#define SERIAL_USE_MULTI_TRANSACTION
#define SPLIT_TRANSACTION_IDS_KB RPC_ID_STATE_SYNC, RPC_ID_SLAVE_STATE
#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC, RPC_ID_POINTER_STATE_SYNC

/* PMW3360 Settings */
#define PMW3360_CS_PIN B0
38 changes: 38 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright 2020 QMK
*
* 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/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f411/chconf.h -r platforms/chibios/common/configs/chconf.h`
*/

#pragma once

#define CH_CFG_ST_FREQUENCY 10000

#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE

#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE

#define CH_CFG_FACTORY_SEMAPHORES TRUE

#define CH_CFG_FACTORY_MAILBOXES TRUE

#define CH_CFG_FACTORY_OBJ_FIFOS TRUE

#define CH_CFG_FACTORY_PIPES TRUE

#include_next <chconf.h>
98 changes: 98 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
Copyright 2012 Jun Wako <[email protected]>
Copyright 2015 Jack Humbert
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

#define PRODUCT Tractyl Manuform(5x6) BlackPill

// wiring of each half
#define MATRIX_COL_PINS \
{ A15, B3, B4, B5, B6, B7 }
#define MATRIX_ROW_PINS \
{ B12, B13, B14, B15, A8, A9 }

#define DIODE_DIRECTION COL2ROW

#define USB_VBUS_PIN B10
#define SPLIT_HAND_PIN C14 // high = left, low = right

// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN A1
#define WS2812_PWM_DRIVER PWMD5 // default: PWMD2
#define WS2812_PWM_CHANNEL 2 // default: 2
#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
#define WS2812_DMA_STREAM STM32_DMA1_STREAM0 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.

#define RGBLED_NUM 20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }

#define DEBUG_LED_PIN C13

#define AUDIO_PIN A0
#define AUDIO_PWM_DRIVER PWMD5
#define AUDIO_PWM_CHANNEL 1
#define AUDIO_STATE_TIMER GPTD4

/* serial.c configuration for split keyboard */
#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
#define SERIAL_USART_TX_PIN A2
#define SERIAL_USART_RX_PIN A3
#define SERIAL_USART_DRIVER SD2
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
#undef SOFT_SERIAL_PIN

// #define EE_HANDS

#define I2C_DRIVER I2CD1
#define I2C1_SCL_BANK GPIOB
#define I2C1_SDA_BANK GPIOB
#define I2C1_SCL 8
#define I2C1_SDA 9
#define I2C1_SCL_PAL_MODE 4
#define I2C1_SDA_PAL_MODE 4
#define I2C1_CLOCK_SPEED 400000

#define ENCODERS_PAD_A \
{ B1 }
#define ENCODERS_PAD_B \
{ B2 }

#define SPI_DRIVER SPID1
#define SPI_SCK_PIN A5
#define SPI_SCK_PAL_MODE 5
#define SPI_MOSI_PIN A7
#define SPI_MOSI_PAL_MODE 5
#define SPI_MISO_PIN A6
#define SPI_MISO_PAL_MODE 5

#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
// #define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
// #define EXTERNAL_EEPROM_BYTE_COUNT 8196
// #define EXTERNAL_EEPROM_PAGE_SIZE 32
// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
#define DEBUG_EEPROM_OUTPUT

#define PMW_CS_PIN B0
#define SPI_MODE 0
#define SPI_DIVISOR 64
26 changes: 26 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
*
* 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 "f411.h"

void matrix_init_sub_kb(void) { setPinInputHigh(A0); }

void matrix_scan_sub_kb(void) {
if (!readPin(A0)) {
reset_keyboard();
}
matrix_scan_user();
}
19 changes: 19 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <[email protected]>
*
* 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 "5x6_right.h"
25 changes: 25 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#pragma once

// #define HAL_USE_DAC TRUE
#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#define HAL_USE_I2C TRUE
#define HAL_USE_SPI TRUE
#define HAL_USE_GPT TRUE

#include_next <halconf.h>
34 changes: 34 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* 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 3 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 <https://www.gnu.org/licenses/>.
*/

#pragma once

#include_next "mcuconf.h"

#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE

#undef STM32_PWM_USE_TIM5
#define STM32_PWM_USE_TIM5 TRUE

#undef STM32_GPT_USE_TIM4
#define STM32_GPT_USE_TIM4 TRUE

#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE

#undef STM32_SERIAL_USE_USART2
#define STM32_SERIAL_USE_USART2 TRUE
13 changes: 13 additions & 0 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MCU name
MCU = STM32F411

# Bootloader selection
BOOTLOADER = stm32-dfu

KEYBOARD_SHARED_EP = yes
CONSOLE_ENABLE = yes

EEPROM_DRIVER = spi
WS2812_DRIVER = pwm
SERIAL_DRIVER = usart
AUDIO_DRIVER = pwm_hardware
Loading

0 comments on commit 58a5030

Please sign in to comment.