diff options
Diffstat (limited to 'keyboards/rgbkb/mun/rev1')
-rw-r--r-- | keyboards/rgbkb/mun/rev1/config.h | 62 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/halconf.h | 18 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/keyboard.json | 13 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/mcuconf.h | 21 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/rev1.c | 15 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/rev1.h | 2 | ||||
-rw-r--r-- | keyboards/rgbkb/mun/rev1/rules.mk | 8 |
7 files changed, 138 insertions, 1 deletions
diff --git a/keyboards/rgbkb/mun/rev1/config.h b/keyboards/rgbkb/mun/rev1/config.h new file mode 100644 index 0000000000..38314e13cd --- /dev/null +++ b/keyboards/rgbkb/mun/rev1/config.h @@ -0,0 +1,62 @@ +/* + * ---------------------------------------------------------------------------- + * "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 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 + +/* CRC Configuration */ +#define CRC8_OPTIMIZE_SPEED +#define CRC8_USE_TABLE + +/* Split Keyboard Configuration */ +#define EE_HANDS +#define SPLIT_USB_DETECT +#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_TRANSACTION_IDS_KB TOUCH_ENCODER_SYNC, RGB_MENU_SYNC + +#if RGB_UNLIMITED_POWER + #define RGBLIGHT_LIMIT_VAL 255 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 +#else + #define RGBLIGHT_LIMIT_VAL 127 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 127 +#endif + +#define WS2812_PWM_DRIVER PWMD3 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM3 +#define WS2812_PWM_DMA_CHANNEL 3 + +#define TOUCH_UPDATE_INTERVAL 33 +#define OLED_UPDATE_INTERVAL 33 +#define OLED_FONT_H "keyboards/rgbkb/common/glcdfont.c" diff --git a/keyboards/rgbkb/mun/rev1/halconf.h b/keyboards/rgbkb/mun/rev1/halconf.h new file mode 100644 index 0000000000..f5b97499dd --- /dev/null +++ b/keyboards/rgbkb/mun/rev1/halconf.h @@ -0,0 +1,18 @@ +/* + * ---------------------------------------------------------------------------- + * "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_I2C TRUE + +#define HAL_USE_PWM TRUE + +#define HAL_USE_SERIAL TRUE + +#include_next <halconf.h> diff --git a/keyboards/rgbkb/mun/rev1/keyboard.json b/keyboards/rgbkb/mun/rev1/keyboard.json index 98265c6dd9..daed72b4d2 100644 --- a/keyboards/rgbkb/mun/rev1/keyboard.json +++ b/keyboards/rgbkb/mun/rev1/keyboard.json @@ -8,6 +8,19 @@ "pid": "0x3505", "device_version": "0.0.1" }, + "build": { + "lto": true + }, + "features": { + "bootmagic": false, + "encoder": true, + "extrakey": true, + "mousekey": false, + "nkro": true, + "oled": true, + "rgb_matrix": true, + "rgblight": false + }, "rgblight": { "led_count": 98, "split_count": [49, 49], diff --git a/keyboards/rgbkb/mun/rev1/mcuconf.h b/keyboards/rgbkb/mun/rev1/mcuconf.h new file mode 100644 index 0000000000..dd6e38509c --- /dev/null +++ b/keyboards/rgbkb/mun/rev1/mcuconf.h @@ -0,0 +1,21 @@ +/* + * ---------------------------------------------------------------------------- + * "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_next <mcuconf.h> + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE + +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/rgbkb/mun/rev1/rev1.c b/keyboards/rgbkb/mun/rev1/rev1.c index 986916b4a9..206a30d654 100644 --- a/keyboards/rgbkb/mun/rev1/rev1.c +++ b/keyboards/rgbkb/mun/rev1/rev1.c @@ -8,6 +8,9 @@ */ #include "rev1.h" +#include "touch_encoder.h" +#include "common_oled.h" +#include "transactions.h" #define NUMBER_OF_TOUCH_ENCODERS 2 #define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2 @@ -85,3 +88,15 @@ led_config_t g_led_config = { { } }; // clang-format on #endif + +void keyboard_post_init_kb(void) { + touch_encoder_init(); + transaction_register_rpc(TOUCH_ENCODER_SYNC, touch_encoder_slave_sync); + transaction_register_rpc(RGB_MENU_SYNC, rgb_menu_slave_sync); + keyboard_post_init_user(); +} + +void housekeeping_task_kb(void) { + touch_encoder_update(TOUCH_ENCODER_SYNC); + rgb_menu_update(RGB_MENU_SYNC); +} diff --git a/keyboards/rgbkb/mun/rev1/rev1.h b/keyboards/rgbkb/mun/rev1/rev1.h index 291428c0fb..51e6f2140f 100644 --- a/keyboards/rgbkb/mun/rev1/rev1.h +++ b/keyboards/rgbkb/mun/rev1/rev1.h @@ -9,5 +9,5 @@ #pragma once -#include "mun.h" +#include "quantum.h" #include "touch_encoder.h" diff --git a/keyboards/rgbkb/mun/rev1/rules.mk b/keyboards/rgbkb/mun/rev1/rules.mk new file mode 100644 index 0000000000..dad85ac483 --- /dev/null +++ b/keyboards/rgbkb/mun/rev1/rules.mk @@ -0,0 +1,8 @@ +# Touch encoder needs +VPATH += keyboards/rgbkb/common +SRC += touch_encoder.c +SRC += common_oled.c +I2C_DRIVER_REQUIRED = yes + +SERIAL_DRIVER = usart +OPT = 3 |