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

[Keymap] Drashna updates for 0.19 #19175

Merged
merged 31 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
858d032
Fix dilemma keymap
drashna Aug 28, 2022
9030247
Update autocorrect related code
drashna Sep 17, 2022
556fb63
Make oneshot lock of shift trigger caps word
drashna Aug 14, 2022
79de232
Move around charybdis keys
drashna Oct 4, 2022
aa35194
Drop usart speed due to handshake timeouts
drashna Oct 6, 2022
e7d8ba8
Remove split watchdog list
drashna Oct 6, 2022
d145a6b
Custom bootmagic toggle
drashna Oct 14, 2022
26cb732
Enable split watchdog
drashna Oct 21, 2022
94ae7b5
Fix compilation issues on 4x6 TM
drashna Oct 28, 2022
75c43e6
Reduce size for 5x6 TM AVR controllers
drashna Oct 28, 2022
0c371df
Update Charybdis 4x6 config to always compile
drashna Oct 31, 2022
da2e971
Update Charybdis 3x5 config to always compile
drashna Oct 31, 2022
e582162
fix oled codes
drashna Nov 6, 2022
f6a5734
Disable split watchdog on pointing device boards
drashna Nov 6, 2022
4647140
Fix Kyria Logo rendering
drashna Nov 8, 2022
f958d33
Include secrets config if present
drashna Nov 9, 2022
d0c6b97
Enable 12 layers for XAP
drashna Nov 10, 2022
00e1b63
Update sensor config
drashna Nov 12, 2022
5bdcf16
Update charybdis keymap config
drashna Nov 15, 2022
f9054f7
Fix drashna split_3x6_3 config
drashna Nov 16, 2022
aad7e1a
Cleanup charybdis keymap config
drashna Nov 18, 2022
754c8cd
Fix up dilema issues
drashna Nov 15, 2022
5a4b6d4
Fix Compliation error with charybdis
drashna Nov 26, 2022
2a5046c
Add fun comic unicode
drashna Nov 26, 2022
ea4c81a
remove as much from matrix_init_* as possible
drashna Nov 27, 2022
072221f
Remove as much of matrix_scan_* as possible
drashna Nov 27, 2022
352e22c
Don't apply autocorrect on game layer
drashna Nov 27, 2022
e715a90
Fix up unicode typing mode and oled render of
drashna Nov 27, 2022
b4f9fbc
Do not set default RGB Light mode
drashna Nov 27, 2022
402155e
Fix compilation issues shown by multibuild
drashna Nov 27, 2022
06baec7
Remove elite c hacky config from charybdis keymaps
drashna Nov 27, 2022
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
119 changes: 61 additions & 58 deletions keyboards/bastardkb/charybdis/3x5/keymaps/drashna/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,87 +18,90 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#undef PRODUCT
#define PRODUCT "Charybdis Nano (Blackpill)"

#undef MATRIX_ROW_PINS
#define MATRIX_ROW_PINS \
{ B12, B13, B14, B15 }
#undef MATRIX_COL_PINS
#define MATRIX_COL_PINS \
{ A15, B3, B4, B5, B6 }


#undef MATRIX_ROW_PINS_RIGHT
#define MATRIX_ROW_PINS_RIGHT \
{ B12, B13, B14, B15 }
#undef MATRIX_COL_PINS_RIGHT
#define MATRIX_COL_PINS_RIGHT \
{ A15, B3, B4, B5, B6 }

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

# undef MATRIX_ROW_PINS
# define MATRIX_ROW_PINS \
{ B12, B13, B14, B15 }
# undef MATRIX_COL_PINS
# define MATRIX_COL_PINS \
{ A15, B3, B4, B5, B6 }

# undef MATRIX_ROW_PINS_RIGHT
# define MATRIX_ROW_PINS_RIGHT \
{ B12, B13, B14, B15 }
# undef MATRIX_COL_PINS_RIGHT
# define MATRIX_COL_PINS_RIGHT \
{ A15, B3, B4, B5, B6 }

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

// WS2812 RGB LED strip input and number of LEDs
#undef RGB_DI_PIN
#define RGB_DI_PIN A1
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
#define WS2812_PWM_CHANNEL 2 // default: 2
#define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
#define WS2812_EXTERNAL_PULLUP
# undef RGB_DI_PIN
# define RGB_DI_PIN A1
# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
# define WS2812_PWM_CHANNEL 2 // default: 2
# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
# define WS2812_EXTERNAL_PULLUP
//#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_STREAM7 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_PWM_TARGET_PERIOD 800000
# undef WS2812_DMA_STREAM
# define WS2812_DMA_STREAM STM32_DMA1_STREAM7 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_PWM_TARGET_PERIOD 800000

#define DEBUG_LED_PIN C13
# define DEBUG_LED_PIN C13

/* Audio config */
#define AUDIO_PIN B1
#define AUDIO_PWM_DRIVER PWMD3
#define AUDIO_PWM_CHANNEL 4
#define AUDIO_PWM_PAL_MODE 2
# define AUDIO_PIN B1
# define AUDIO_PWM_DRIVER PWMD3
# define AUDIO_PWM_CHANNEL 4
# define AUDIO_PWM_PAL_MODE 2

/* serial.c configuration for split keyboard */
#undef SOFT_SERIAL_PIN
#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
#define SERIAL_USART_SPEED 921600
# undef SOFT_SERIAL_PIN
# define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
# undef SERIAL_USART_TX_PIN
# define SERIAL_USART_TX_PIN A2
# undef SERIAL_USART_RX_PIN
# 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
# define SERIAL_USART_SPEED 921600
// #define SERIAL_USART_PIN_SWAP // swap RX and TX pins on master
// To use the highest possible baudrate (3.75Mbit/s) uncomment the following
// line, this can result in dropped communications so lower the speed if there
// are many timeouts.
// #define SERIAL_USART_SPEED (STM32_PCLK2 >> 4)

#define CRC8_USE_TABLE
#define CRC8_OPTIMIZE_SPEED
# define CRC8_USE_TABLE
# define CRC8_OPTIMIZE_SPEED

/* spi config for eeprom and pmw3360 sensor */
#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 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

/* eeprom config */
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
# 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

/* pmw3360 config */
#undef PMW33XX_CS_PIN
#define PMW33XX_CS_PIN B0
# undef PMW33XX_CS_PIN
# define PMW33XX_CS_PIN B0
#endif

#define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200
#define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 400
Expand Down
14 changes: 8 additions & 6 deletions keyboards/bastardkb/charybdis/3x5/keymaps/drashna/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
*/
#pragma once

#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#define HAL_USE_I2C TRUE
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill)
# define HAL_USE_PWM TRUE
# define HAL_USE_SERIAL TRUE
# define HAL_USE_I2C TRUE
# define HAL_USE_SPI TRUE
# define SPI_USE_WAIT TRUE
# define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#endif

#include_next <halconf.h>
12 changes: 8 additions & 4 deletions keyboards/bastardkb/charybdis/3x5/keymaps/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

void matrix_init_keyemap(void) { setPinInputHigh(A0); }
#if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill)
void keyboard_pre_init_keymap(void) {
setPinInputHigh(A0);
}

void matrix_scan_keymap(void) {
void housekeeping_task_keymap(void) {
if (!readPin(A0)) {
reset_keyboard();
}
}

#ifdef USB_VBUS_PIN
# ifdef USB_VBUS_PIN
bool usb_vbus_state(void) {
setPinInputLow(USB_VBUS_PIN);
wait_us(5);
return readPin(USB_VBUS_PIN);
}
#endif
# endif

void matrix_output_unselect_delay(uint8_t line, bool key_pressed) {
for (int32_t i = 0; i < 40; i++) {
__asm__ volatile("nop" ::: "memory");
}
}
#endif
30 changes: 16 additions & 14 deletions keyboards/bastardkb/charybdis/3x5/keymaps/drashna/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@

#include_next "mcuconf.h"

#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE
#if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill)
# undef STM32_I2C_USE_I2C1
# define STM32_I2C_USE_I2C1 TRUE

// #undef STM32_I2C_I2C1_RX_DMA_STREAM
// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
#undef STM32_I2C_I2C1_TX_DMA_STREAM
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
# undef STM32_I2C_I2C1_TX_DMA_STREAM
# define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)

#undef STM32_PWM_USE_TIM2
#define STM32_PWM_USE_TIM2 TRUE
# undef STM32_PWM_USE_TIM2
# define STM32_PWM_USE_TIM2 TRUE

#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE
# undef STM32_PWM_USE_TIM3
# define STM32_PWM_USE_TIM3 TRUE

#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
# undef STM32_SPI_USE_SPI1
# define STM32_SPI_USE_SPI1 TRUE

#undef STM32_SERIAL_USE_USART2
#define STM32_SERIAL_USE_USART2 TRUE
# undef STM32_SERIAL_USE_USART2
# define STM32_SERIAL_USE_USART2 TRUE

#undef STM32_ST_USE_TIMER
#define STM32_ST_USE_TIMER 5
# undef STM32_ST_USE_TIMER
# define STM32_ST_USE_TIMER 5
#endif
59 changes: 38 additions & 21 deletions keyboards/bastardkb/charybdis/3x5/keymaps/drashna/rules.mk
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
# MCU name
MCU = STM32F411
BOARD = BLACKPILL_STM32_F411
RGB_MATRIX_ENABLE = no
CUSTOM_UNICODE_ENABLE = no
CUSTOM_POINTING_DEVICE = no
CUSTOM_SPLIT_TRANSPORT_SYNC = no

# Bootloader selection
# BOOTLOADER = stm32-dfu
BOOTLOADER := tinyuf2

LTO_ENABLE := no
ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/3x5/blackpill)
# Bootloader selection
BOOTLOADER := tinyuf2

BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
KEYBOARD_SHARED_EP = yes
MOUSE_SHARED_EP = yes
LTO_ENABLE := no

EEPROM_DRIVER = spi
WS2812_DRIVER = pwm
SERIAL_DRIVER = usart
AUDIO_DRIVER = pwm_hardware
AUDIO_SUPPORTED = yes
AUDIO_ENABLE = yes
AUDIO_DRIVER = pwm_hardware

AUDIO_SUPPORTED = yes
AUDIO_ENABLE = yes
MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes
CONSOLE_ENABLE = yes
OVERLOAD_FEATURES = yes
endif

AUTOCORRECT_ENABLE = yes
ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/3x5/v2/stemcell)
OVERLOAD_FEATURES = yes
endif
ifeq ($(strip $(KEYBOARD)), bastardkb/charybdis/3x5/v2/splinky)
OVERLOAD_FEATURES = yes
endif

DEBOUNCE_TYPE = asym_eager_defer_pk

ifeq ($(strip $(OVERLOAD_FEATURES)), yes)
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
KEYBOARD_SHARED_EP = yes
MOUSE_SHARED_EP = yes

MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes
CONSOLE_ENABLE = yes
RGB_MATRIX_ENABLE = yes

AUTOCORRECT_ENABLE = yes

CUSTOM_UNICODE_ENABLE = yes
CUSTOM_POINTING_DEVICE = yes
CUSTOM_SPLIT_TRANSPORT_SYNC = yes

DEBOUNCE_TYPE = asym_eager_defer_pk
endif
Loading