Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
Drashna Jael're 2023-09-05 00:56:56 -07:00
commit e69909cc53
No known key found for this signature in database
GPG key ID: DBA1FD3A860D1B11
162 changed files with 5215 additions and 717 deletions

4
.github/labeler.yml vendored
View file

@ -40,3 +40,7 @@ translation:
- docs/ru-ru/**/*
CI:
- .github/**/*
dd:
- data/constants/**/*
- data/mappings/**/*
- data/schemas/**/*

1
.gitignore vendored
View file

@ -96,6 +96,7 @@ secrets.tar
__pycache__
.python-version
*.egg-info
.venv
# Prerequisites for updating ChibiOS
/util/fmpp*

View file

@ -49,6 +49,10 @@
"DYNAMIC_KEYMAP_EEPROM_MAX_ADDR": {"info_key": "dynamic_keymap.eeprom_max_addr", "value_type": "int"},
"DYNAMIC_KEYMAP_LAYER_COUNT": {"info_key": "dynamic_keymap.layer_count", "value_type": "int"},
// EEPROM
"WEAR_LEVELING_BACKING_SIZE": {"info_key": "eeprom.wear_leveling.backing_size", "value_type": "int", "to_json": false},
"WEAR_LEVELING_LOGICAL_SIZE": {"info_key": "eeprom.wear_leveling.logical_size", "value_type": "int", "to_json": false},
// Indicators
"LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"},
"LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"},

View file

@ -42,6 +42,7 @@
"STENO_ENABLE": {"info_key": "stenography.enabled", "value_type": "bool"},
"STENO_PROTOCOL": {"info_key": "stenography.protocol"},
"WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"},
"WEAR_LEVELING_DRIVER": {"info_key": "eeprom.wear_leveling.driver"},
"WS2812_DRIVER": {"info_key": "ws2812.driver"},
// Items we want flagged in lint

View file

@ -247,7 +247,19 @@
},
"eeprom": {
"properties": {
"driver": {"type": "string"}
"driver": {"type": "string"},
"wear_leveling": {
"type": "object",
"additionalProperties": false,
"properties": {
"driver": {
"type": "string",
"enum": ["custom", "embedded_flash", "legacy", "rp2040_flash", "spi_flash"]
},
"backing_size": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"logical_size": {"$ref": "qmk.definitions.v1#/unsigned_int"}
}
}
}
},
"encoder": {

View file

@ -39,6 +39,7 @@ Add the following to your `config.h`:
|`BACKLIGHT_LIMIT_VAL` |`255` |The maximum duty cycle of the backlight -- `255` allows for full brightness, any lower will decrease the maximum.|
|`BACKLIGHT_DEFAULT_LEVEL` |`BACKLIGHT_LEVELS`|The default backlight level to use upon clearing the EEPROM |
|`BACKLIGHT_DEFAULT_BREATHING`|*Not defined* |Whether to enable backlight breathing upon clearing the EEPROM |
|`BACKLIGHT_PWM_PERIOD` |2048Hz |Defaults to `BACKLIGHT_PWM_COUNTER_FREQUENCY / 2048`, which results in a PWM frequency of 2048Hz. |
Unless you are designing your own keyboard, you generally should not need to change the `BACKLIGHT_PIN` or `BACKLIGHT_ON_STATE`.

View file

@ -370,9 +370,9 @@ If you need to change your RGB lighting in code, for example in a macro to chang
Example:
```c
sethsv(HSV_WHITE, (LED_TYPE *)&led[0]); // led 0
sethsv(HSV_RED, (LED_TYPE *)&led[1]); // led 1
sethsv(HSV_GREEN, (LED_TYPE *)&led[2]); // led 2
sethsv(HSV_WHITE, (rgb_led_t *)&led[0]); // led 0
sethsv(HSV_RED, (rgb_led_t *)&led[1]); // led 1
sethsv(HSV_GREEN, (rgb_led_t *)&led[2]); // led 2
rgblight_set(); // Utility functions do not call rgblight_set() automatically, so they need to be called explicitly.
```

View file

@ -202,6 +202,13 @@ Configures the [EEPROM](eeprom_driver.md) driver.
* `driver`
* The EEPROM backend to use. Must be one of `custom`, `i2c`, `legacy_stm32_flash`, `spi`, `transient`, `vendor`, `wear_leveling`.
* Default: `"vendor"`
* `wear_leveling`
* `driver`
* The driver to use. Must be one of `embedded_flash`, `legacy`, `rp2040_flash`, `spi_flash`, `custom`.
* `backing_size`
* Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size.
* `logical_size`
* Number of bytes “exposed” to the rest of QMK and denotes the size of the usable EEPROM.
## Encoder :id=encoder

View file

@ -61,18 +61,18 @@ void static apa102_end_frame(uint16_t num_leds);
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
void static apa102_send_byte(uint8_t byte);
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) {
LED_TYPE *end = start_led + num_leds;
void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds) {
rgb_led_t *end = start_led + num_leds;
apa102_start_frame();
for (LED_TYPE *led = start_led; led < end; led++) {
for (rgb_led_t *led = start_led; led < end; led++) {
apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness);
}
apa102_end_frame(num_leds);
}
// Overwrite the default rgblight_call_driver to use apa102 driver
void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) {
void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds) {
apa102_setleds(start_led, num_leds);
}

View file

@ -37,5 +37,5 @@ extern uint8_t apa102_led_brightness;
* - Set the data-out pin as output
* - Send out the LED data
*/
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds);
void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds);
void apa102_set_brightness(uint8_t brightness);

View file

@ -17,17 +17,17 @@
#include "i2c_master.h"
// This is the full 8-bit address
#define ISSI_ADDRESS 0b10101000
#define IS31FL3218_I2C_ADDRESS 0xA8
// These are the register addresses
#define ISSI_REG_SHUTDOWN 0x00
#define ISSI_REG_PWM 0x01
#define ISSI_REG_CONTROL 0x13
#define ISSI_REG_UPDATE 0x16
#define ISSI_REG_RESET 0x17
#define IS31FL3218_REG_SHUTDOWN 0x00
#define IS31FL3218_REG_PWM 0x01
#define IS31FL3218_REG_CONTROL 0x13
#define IS31FL3218_REG_UPDATE 0x16
#define IS31FL3218_REG_RESET 0x17
// Default timeout if no I2C response
#define ISSI_TIMEOUT 100
#define IS31FL3218_I2C_TIMEOUT 100
// Reusable buffer for transfers
uint8_t g_twi_transfer_buffer[20];
@ -40,35 +40,35 @@ bool g_pwm_buffer_update_required = false;
void is31fl3218_write_register(uint8_t reg, uint8_t data) {
g_twi_transfer_buffer[0] = reg;
g_twi_transfer_buffer[1] = data;
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
i2c_transmit(IS31FL3218_I2C_ADDRESS, g_twi_transfer_buffer, 2, IS31FL3218_I2C_TIMEOUT);
}
void is31fl3218_write_pwm_buffer(uint8_t *pwm_buffer) {
g_twi_transfer_buffer[0] = ISSI_REG_PWM;
g_twi_transfer_buffer[0] = IS31FL3218_REG_PWM;
memcpy(g_twi_transfer_buffer + 1, pwm_buffer, 18);
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT);
i2c_transmit(IS31FL3218_I2C_ADDRESS, g_twi_transfer_buffer, 19, IS31FL3218_I2C_TIMEOUT);
}
void is31fl3218_init(void) {
// In case we ever want to reinitialize (?)
is31fl3218_write_register(ISSI_REG_RESET, 0x00);
is31fl3218_write_register(IS31FL3218_REG_RESET, 0x00);
// Turn off software shutdown
is31fl3218_write_register(ISSI_REG_SHUTDOWN, 0x01);
is31fl3218_write_register(IS31FL3218_REG_SHUTDOWN, 0x01);
// Set all PWM values to zero
for (uint8_t i = 0; i < 18; i++) {
is31fl3218_write_register(ISSI_REG_PWM + i, 0x00);
is31fl3218_write_register(IS31FL3218_REG_PWM + i, 0x00);
}
// Enable all channels
for (uint8_t i = 0; i < 3; i++) {
is31fl3218_write_register(ISSI_REG_CONTROL + i, 0b00111111);
is31fl3218_write_register(IS31FL3218_REG_CONTROL + i, 0b00111111);
}
// Load PWM registers and LED Control register data
is31fl3218_write_register(ISSI_REG_UPDATE, 0x01);
is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01);
}
void is31fl3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
@ -91,7 +91,7 @@ void is31fl3218_update_pwm_buffers(void) {
if (g_pwm_buffer_update_required) {
is31fl3218_write_pwm_buffer(g_pwm_buffer);
// Load PWM registers and LED Control register data
is31fl3218_write_register(ISSI_REG_UPDATE, 0x01);
is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01);
}
g_pwm_buffer_update_required = false;
}

View file

@ -73,4 +73,4 @@
* - Send out the LED data
* - Wait 50us to reset the LEDs
*/
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
void ws2812_setleds(rgb_led_t *ledarray, uint16_t number_of_leds);

View file

@ -7,7 +7,7 @@
#include "color.h"
static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
rgb_led_t leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}

View file

@ -7,7 +7,7 @@
#include "color.h"
static inline void rgblite_setrgb(RGB rgb) {
LED_TYPE leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
rgb_led_t leds[RGBLED_NUM] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
ws2812_setleds(leds, RGBLED_NUM);
}

View file

@ -0,0 +1,22 @@
/* Copyright 2023 ziptyze
*
* 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 RGB_MATRIX_LED_COUNT 48
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS

View file

@ -0,0 +1,164 @@
{
"manufacturer": "1upkeyboards",
"keyboard_name": "1upsuper16v3",
"maintainer": "ziptyze",
"bootloader": "rp2040",
"dynamic_keymap": {
"layer_count": 10
},
"encoder": {
"rotary": [
{"pin_a": "GP20", "pin_b": "GP21"},
{"pin_a": "GP25", "pin_b": "GP26"},
{"pin_a": "GP2", "pin_b": "GP3"},
{"pin_a": "GP6", "pin_b": "GP7"}
]
},
"features": {
"bootmagic": true,
"command": false,
"console": false,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": false,
"rgb_matrix": true
},
"matrix_pins": {
"direct": [
["GP23", "GP24", "GP4", "GP5"],
["GP19", "GP27", "GP1", "GP8"],
["GP18", "GP28", "GP0", "GP9"],
["GP17", "GP16", "GP15", "GP11"]
]
},
"processor": "RP2040",
"rgb_matrix": {
"animations": {
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_sat": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"band_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"digital_rain": true,
"dual_beacon": true,
"gradient_left_right": true,
"gradient_up_down": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"jellybean_raindrops": true,
"multisplash": true,
"pixel_flow": true,
"pixel_rain": true,
"rainbow_beacon": true,
"rainbow_moving_chevron": true,
"rainbow_pinwheels": true,
"raindrops": true,
"solid_multisplash": true,
"solid_reactive": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_multinexus": true,
"solid_reactive_multiwide": true,
"solid_reactive_nexus": true,
"solid_reactive_simple": true,
"solid_reactive_wide": true,
"solid_splash": true,
"splash": true,
"typing_heatmap": true
},
"driver": "ws2812",
"layout": [
{"x": 99, "y": 1, "flags": 2},
{"x": 70, "y": 1, "flags": 2},
{"x": 42, "y": 1, "flags": 2},
{"x": 14, "y": 1, "flags": 2},
{"x": 4, "y": 4, "flags": 2},
{"x": 4, "y": 12, "flags": 2},
{"matrix": [0, 0], "x": 28, "y": 8, "flags": 4},
{"matrix": [0, 1], "x": 84, "y": 8, "flags": 4},
{"x": 4, "y": 20, "flags": 2},
{"x": 4, "y": 28, "flags": 2},
{"matrix": [1, 0], "x": 28, "y": 24, "flags": 4},
{"matrix": [1, 1], "x": 84, "y": 24, "flags": 4},
{"x": 4, "y": 36, "flags": 2},
{"x": 4, "y": 44, "flags": 2},
{"matrix": [2, 0], "x": 28, "y": 40, "flags": 4},
{"matrix": [2, 1], "x": 84, "y": 40, "flags": 4},
{"x": 4, "y": 52, "flags": 2},
{"x": 4, "y": 60, "flags": 2},
{"x": 14, "y": 63, "flags": 2},
{"matrix": [3, 0], "x": 28, "y": 56, "flags": 4},
{"x": 42, "y": 63, "flags": 2},
{"x": 70, "y": 63, "flags": 2},
{"matrix": [3, 1], "x": 84, "y": 56, "flags": 4},
{"x": 99, "y": 63, "flags": 2},
{"x": 126, "y": 63, "flags": 2},
{"matrix": [3, 2], "x": 140, "y": 56, "flags": 4},
{"x": 154, "y": 63, "flags": 2},
{"x": 182, "y": 63, "flags": 2},
{"matrix": [3, 3], "x": 196, "y": 56, "flags": 4},
{"x": 210, "y": 63, "flags": 2},
{"x": 220, "y": 60, "flags": 2},
{"x": 220, "y": 52, "flags": 2},
{"x": 220, "y": 44, "flags": 2},
{"matrix": [2, 3], "x": 196, "y": 40, "flags": 4},
{"matrix": [2, 2], "x": 140, "y": 40, "flags": 4},
{"x": 220, "y": 36, "flags": 2},
{"x": 220, "y": 28, "flags": 2},
{"matrix": [1, 3], "x": 196, "y": 24, "flags": 4},
{"matrix": [1, 2], "x": 140, "y": 24, "flags": 4},
{"x": 220, "y": 20, "flags": 2},
{"x": 220, "y": 12, "flags": 2},
{"matrix": [0, 3], "x": 196, "y": 8, "flags": 4},
{"matrix": [0, 2], "x": 140, "y": 8, "flags": 4},
{"x": 220, "y": 4, "flags": 2},
{"x": 210, "y": 1, "flags": 2},
{"x": 182, "y": 1, "flags": 2},
{"x": 154, "y": 1, "flags": 2},
{"x": 126, "y": 1, "flags": 2}
]
},
"usb": {
"device_version": "1.0.0",
"pid": "0x5610",
"vid": "0x6F75"
},
"ws2812": {
"driver": "vendor",
"pin": "GP29"
},
"community_layouts": ["ortho_4x4"],
"layouts": {
"LAYOUT_ortho_4x4": {
"layout": [
{"label": "00", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "01", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "02", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "03", "matrix": [0, 3], "x": 3, "y": 0},
{"label": "10", "matrix": [1, 0], "x": 0, "y": 1},
{"label": "11", "matrix": [1, 1], "x": 1, "y": 1},
{"label": "12", "matrix": [1, 2], "x": 2, "y": 1},
{"label": "13", "matrix": [1, 3], "x": 3, "y": 1},
{"label": "20", "matrix": [2, 0], "x": 0, "y": 2},
{"label": "21", "matrix": [2, 1], "x": 1, "y": 2},
{"label": "22", "matrix": [2, 2], "x": 2, "y": 2},
{"label": "23", "matrix": [2, 3], "x": 3, "y": 2},
{"label": "30", "matrix": [3, 0], "x": 0, "y": 3},
{"label": "31", "matrix": [3, 1], "x": 1, "y": 3},
{"label": "32", "matrix": [3, 2], "x": 2, "y": 3},
{"label": "33", "matrix": [3, 3], "x": 3, "y": 3}
]
}
}
}

View file

@ -0,0 +1,39 @@
/* Copyright 2023 ziptyze
*
* 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 QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PSLS,
MO(1), KC_P0, KC_PDOT, KC_PENT
),
[1] = LAYOUT_ortho_4x4(
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }
};
#endif

View file

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View file

@ -0,0 +1,39 @@
/* Copyright 2023 ziptyze
*
* 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 QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PSLS,
MO(1), KC_P0, KC_PDOT, KC_PENT
),
[1] = LAYOUT_ortho_4x4(
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }
};
#endif

View file

@ -0,0 +1,4 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

Some files were not shown because too many files have changed in this diff Show more