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

Sol 3 Keyboard from RGBKB #15687

Merged
merged 10 commits into from
Jan 22, 2022
6 changes: 3 additions & 3 deletions keyboards/rgbkb/common/touch_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,16 @@ void touch_encoder_calibrate(void) {
write_register8(QT_CALIBRATE, 0x01);
}

bool touch_encoder_calibrating(void) {
bool touch_encoder_is_calibrating(void) {
return touch_raw[0] & CALIBRATION_BIT;
}

void touch_encoder_toggle(void) {
touch_disabled = !touch_disabled;
}

bool touch_encoder_toggled(void) {
return touch_disabled;
bool touch_encoder_is_on(void) {
return !touch_disabled;
}

void touch_encoder_slave_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
Expand Down
4 changes: 2 additions & 2 deletions keyboards/rgbkb/common/touch_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void touch_encoder_init(void);
void touch_encoder_update(int8_t transaction_id);

void touch_encoder_calibrate(void);
bool touch_encoder_calibrating(void);
bool touch_encoder_is_calibrating(void);

void touch_encoder_toggle(void);
bool touch_encoder_toggled(void);
bool touch_encoder_is_on(void);

// Called when touch encoder is tapped, weak function overridable by the kb
bool touch_encoder_tapped_kb(uint8_t index, uint8_t section);
Expand Down
6 changes: 3 additions & 3 deletions keyboards/rgbkb/mun/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

/* Matrix Configuration - Rows are doubled up */
#define MATRIX_ROWS 14
// B1, A2 reserved for encoder / touch encoder support
#define MATRIX_ROW_PINS { A1, A3, B3, A13, B15, B1, A2 }
// Last pins reserved for encoder / touch encoder support
#define MATRIX_ROW_PINS { A1, A3, B3, A13, B15, NO_PIN, NO_PIN }
#define MATRIX_COLS 7
#define MATRIX_COL_PINS { A0, B11, B0, B10, B12, B2, A8 }
#define MATRIX_IO_DELAY 5
Expand All @@ -35,11 +35,11 @@
#define TOUCH_DEADZONE 50 // width of a "button", wider inputs will be interpreted as a swipe
#define TOUCH_TERM 350 // time of a "button" touch, longer inputs will be a swipe
#define TOUCH_RESOLUTION 25 // sensitivity of swipes, lower=faster
#define TOUCH_SEGMENTS 3

/* Encoder Configuration */
#define ENCODERS_PAD_A { B8, B9 }
#define ENCODERS_PAD_B { A14, A15 }
#define TOUCH_SEGMENTS 3

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
Expand Down
4 changes: 2 additions & 2 deletions keyboards/rgbkb/mun/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ static void render_leds(void)
static void render_touch(void)
{
// Host Touch LED Status
oled_write_P(!touch_encoder_toggled() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
oled_write_P(touch_encoder_is_on() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_is_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
}

bool oled_task_user(void) {
Expand Down
4 changes: 2 additions & 2 deletions keyboards/rgbkb/mun/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ static void render_leds(void)
static void render_touch(void)
{
// Host Touch LED Status
oled_write_P(!touch_encoder_toggled() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
oled_write_P(touch_encoder_is_on() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_is_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
}

bool oled_task_user(void) {
Expand Down
4 changes: 2 additions & 2 deletions keyboards/rgbkb/mun/keymaps/xulkal2/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ static void render_leds(void)
static void render_touch(void)
{
// Host Touch LED Status
oled_write_P(!touch_encoder_toggled() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
oled_write_P(touch_encoder_is_on() ? PSTR("TOUCH") : PSTR(" "), false);
oled_write_P(touch_encoder_is_calibrating() ? PSTR("CLBRT") : PSTR(" "), false);
}
#else
static uint32_t scan_counter = 0;
Expand Down
Empty file added keyboards/rgbkb/sol3/.noci
Empty file.
182 changes: 182 additions & 0 deletions keyboards/rgbkb/sol3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <https://github.com/Legonut> wrote this file. As long as you retain this
* notice you can do whatever you want with this stuff. If we meet some day, and
* you think this stuff is worth it, you can buy me a beer in return. David Rauseo
* ----------------------------------------------------------------------------
*/

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x3535
#define PRODUCT_ID 0x3505
#define MANUFACTURER RGBKB
#define PRODUCT Sol 3

#define USB_POLLING_INTERVAL_MS 1

/* Matrix Configuration - Rows are doubled up */
#define MATRIX_ROWS 12
// Last pins reserved for encoder / touch encoder support
#define MATRIX_ROW_PINS { B15, A8, A15, B12, A3, NO_PIN }
#define MATRIX_ROW_PINS_RIGHT { B15, B14, A8, A13, A7, NO_PIN }
#define MATRIX_COLS 8
// Empty matrix entries used for encoder / touch encoder support
#define MATRIX_COL_PINS { A6, A7, B0, B2, B1, B9, B3, B4 }
#define MATRIX_COL_PINS_RIGHT { B9, B8, B4, A6, A3, B10, B12, B11 }
#define MATRIX_IO_DELAY 5

#define BUSY_WAIT
#define BUSY_WAIT_INSTRUCTIONS 35 // Increase if two rows are pressed at the same time.
#define GPIO_INPUT_PIN_DELAY 10

/* Touchbar adjustments */
#define TOUCH_DEADZONE 50 // width of a "button", wider inputs will be interpreted as a swipe
#define TOUCH_TERM 350 // time of a "button" touch, longer inputs will be a swipe
#define TOUCH_RESOLUTION 25 // sensitivity of swipes, lower=faster
#define TOUCH_SEGMENTS 3

/* Encoder Configuration */
// Matrix Entries k36/k35(E1SW>B13), k33/k32, k7/k28
#define ENCODERS_PAD_A { A1, B10, A13 }
#define ENCODERS_PAD_B { A2, B11, B14 }
// Matrix Entries k72/k71(E5SW>B0), k69/k68, k43/k64
#define ENCODERS_PAD_A_RIGHT { A1, C15, B3 }
#define ENCODERS_PAD_B_RIGHT { A2, C14, B13 }

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* CRC Configuration */
#define CRC8_OPTIMIZE_SPEED
#define CRC8_USE_TABLE

/* Split Keyboard Configuration */
#define SPLIT_HAND_PIN C13
#define SPLIT_USB_DETECT
// also handles the SERIAL_USART_TX_PIN define
#define SOFT_SERIAL_PIN A9
#define SERIAL_USART_TX_PAL_MODE 7
#define SERIAL_USART_TIMEOUT 5
#define SERIAL_USART_DRIVER SD1
//#define SERIAL_USART_FULL_DUPLEX - Waiting on reunification pr
#if SERIAL_USART_FULL_DUPLEX
#define SERIAL_USART_RX_PIN A10
#define SERIAL_USART_RX_PAL_MODE 7
// Mun connects TX to TX and RX to RX as we were planning on i2c split, so we need pin swap for full duplex
#define SERIAL_USART_PIN_SWAP
#define SERIAL_USART_SPEED (2 * 1024 * 1024)
#else
#define SERIAL_USART_SPEED (1 * 1024 * 1024)
#endif

/* Split Transport Features */
#define SPLIT_TRANSPORT_MIRROR
#define SPLIT_LAYER_STATE_ENABLE
#define SPLIT_LED_STATE_ENABLE
#define SPLIT_TRANSACTION_IDS_KB TOUCH_ENCODER_SYNC, RGB_MENU_SYNC

/* LED Turbo DIP Switch */
#define DIP_SWITCH_PINS { A14, B13 }
#define DIP_SWITCH_PINS_RIGHT { A14, B0 }

/* RGB LED Configuration */
#define RGB_DI_PIN B5
#define RGBLED_NUM 156
#define RGBLED_SPLIT { 78, 78 }
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE

#define DRIVER_LED_TOTAL RGBLED_NUM
#define RGB_MATRIX_SPLIT RGBLED_SPLIT
#define RGB_MATRIX_CENTER { 81, 28 }
#define RGB_MATRIX_LED_FLUSH_LIMIT 33
#define RGB_MATRIX_LED_PROCESS_LIMIT 10
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_WHEN_USB_SUSPENDED
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH

#if RGB_UNLIMITED_POWER
#define RGBLIGHT_LIMIT_VAL 255
#else
#define RGBLIGHT_LIMIT_VAL 127
#endif
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL

#define WS2812_PWM_DRIVER PWMD3
#define WS2812_PWM_CHANNEL 2
#define WS2812_PWM_PAL_MODE 2
#define WS2812_DMA_STREAM STM32_DMA1_STREAM3
#define WS2812_DMA_CHANNEL 3

#define TOUCH_UPDATE_INTERVAL 33
#define OLED_UPDATE_INTERVAL 33
#define TAP_CODE_DELAY 5

/* Audio Configuration */
#define AUDIO_PIN A4
#define AUDIO_PIN_ALT A5
#define AUDIO_PIN_ALT_AS_NEGATIVE
#define AUDIO_CLICKY
#define AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE
#define AUDIO_DAC_OFF_VALUE 0
22 changes: 22 additions & 0 deletions keyboards/rgbkb/sol3/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <https://github.com/Legonut> wrote this file. As long as you retain this
* notice you can do whatever you want with this stuff. If we meet some day, and
* you think this stuff is worth it, you can buy me a beer in return. David Rauseo
* ----------------------------------------------------------------------------
*/

#pragma once

#define HAL_USE_DAC TRUE

#define HAL_USE_GPT TRUE

#define HAL_USE_I2C TRUE

#define HAL_USE_PWM TRUE

#define HAL_USE_SERIAL TRUE

#include_next <halconf.h>
24 changes: 24 additions & 0 deletions keyboards/rgbkb/sol3/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <https://github.com/Legonut> wrote this file. As long as you retain this
* notice you can do whatever you want with this stuff. If we meet some day, and
* you think this stuff is worth it, you can buy me a beer in return. David Rauseo
* ----------------------------------------------------------------------------
*/

#pragma once

// No need for the single versions when multi performance isn't a problem =D
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#undef ENABLE_RGB_MATRIX_SPLASH
#undef ENABLE_RGB_MATRIX_SOLID_SPLASH

// 20m timeout (20m * 60s * 1000mil)
// #define RGB_DISABLE_TIMEOUT 1200000
#define RGB_DISABLE_WHEN_USB_SUSPENDED

#define STM32_ONBOARD_EEPROM_SIZE 2048

Loading