diff --git a/.github/ISSUE_TEMPLATE/blank.md b/.github/ISSUE_TEMPLATE/zzz_blank.md similarity index 100% rename from .github/ISSUE_TEMPLATE/blank.md rename to .github/ISSUE_TEMPLATE/zzz_blank.md diff --git a/build_json.mk b/build_json.mk index e04786144ca..087944cc418 100644 --- a/build_json.mk +++ b/build_json.mk @@ -23,4 +23,4 @@ endif # Generate the keymap.c $(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON) - bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON) + bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON) diff --git a/common_features.mk b/common_features.mk index fe65974e7a7..b71dbc77e28 100644 --- a/common_features.mk +++ b/common_features.mk @@ -141,6 +141,10 @@ else SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F072xB OPT_DEFS += -DSTM32_EEPROM_ENABLE + else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) + OPT_DEFS += -DEEPROM_DRIVER + COMMON_VPATH += $(DRIVER_PATH)/eeprom + SRC += eeprom_driver.c eeprom_stm32_L0_L1.c else # This will effectively work the same as "transient" if not supported by the chip SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c diff --git a/docs/adc_driver.md b/docs/adc_driver.md index 26e148adddf..d808a82158a 100644 --- a/docs/adc_driver.md +++ b/docs/adc_driver.md @@ -2,7 +2,7 @@ QMK can leverage the Analog-to-Digital Converter (ADC) on supported MCUs to measure voltages on certain pins. This can be useful for implementing things such as battery level indicators for Bluetooth keyboards, or volume controls using a potentiometer, as opposed to a [rotary encoder](feature_encoders.md). -This driver is currently AVR-only. The values returned are 10-bit integers (0-1023) mapped between 0V and VCC (usually 5V or 3.3V). +This driver currently supports both AVR and a limited selection of ARM devices. On AVR devices, the values returned are 10-bit integers (0-1023) mapped between 0V and VCC (usually 5V or 3.3V). On supported ARM devices, there is more flexibility in control of operation through `#define`s, but by default the values returned are 12-bit integers (0-4095) mapped between 0V and VCC (usually 3.3V). ## Usage @@ -20,6 +20,8 @@ Then place this include at the top of your code: ## Channels +### AVR + |Channel|AT90USB64/128|ATmega16/32U4|ATmega32A|ATmega328P| |-------|-------------|-------------|---------|----------| |0 |`F0` |`F0` |`A0` |`C0` | @@ -39,8 +41,84 @@ Then place this include at the top of your code: \* The ATmega328P possesses two extra ADC channels; however, they are not present on the DIP pinout, and are not shared with GPIO pins. You can use `adc_read()` directly to gain access to these. +### ARM + +Note that some of these pins are doubled-up on ADCs with the same channel. This is because the pins can be used for either ADC. + +Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-based, whereas the F3 has 4 ADCs and the channels are 1 based. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation. + +|ADC|Channel|STM32F0XX|STM32F3XX| +|---|-------|---------|---------| +|1 |0 |`A0` | | +|1 |1 |`A1` |`A0` | +|1 |2 |`A2` |`A1` | +|1 |3 |`A3` |`A2` | +|1 |4 |`A4` |`A3` | +|1 |5 |`A5` |`F4` | +|1 |6 |`A6` |`C0` | +|1 |7 |`A7` |`C1` | +|1 |8 |`B0` |`C2` | +|1 |9 |`B1` |`C3` | +|1 |10 |`C0` |`F2` | +|1 |11 |`C1` | | +|1 |12 |`C2` | | +|1 |13 |`C3` | | +|1 |14 |`C4` | | +|1 |15 |`C5` | | +|1 |16 | | | +|2 |1 | |`A4` | +|2 |2 | |`A5` | +|2 |3 | |`A6` | +|2 |4 | |`A7` | +|2 |5 | |`C4` | +|2 |6 | |`C0` | +|2 |7 | |`C1` | +|2 |8 | |`C2` | +|2 |9 | |`C3` | +|2 |10 | |`F2` | +|2 |11 | |`C5` | +|2 |12 | |`B2` | +|2 |13 | | | +|2 |14 | | | +|2 |15 | | | +|2 |16 | | | +|3 |1 | |`B1` | +|3 |2 | |`E9` | +|3 |3 | |`E13` | +|3 |4 | | | +|3 |5 | | | +|3 |6 | |`E8` | +|3 |7 | |`D10` | +|3 |8 | |`D11` | +|3 |9 | |`D12` | +|3 |10 | |`D13` | +|3 |11 | |`D14` | +|3 |12 | |`B0` | +|3 |13 | |`E7` | +|3 |14 | |`E10` | +|3 |15 | |`E11` | +|3 |16 | |`E12` | +|4 |1 | |`E14` | +|4 |2 | |`B12` | +|4 |3 | |`B13` | +|4 |4 | |`B14` | +|4 |5 | |`B15` | +|4 |6 | |`E8` | +|4 |7 | |`D10` | +|4 |8 | |`D11` | +|4 |9 | |`D12` | +|4 |10 | |`D13` | +|4 |11 | |`D14` | +|4 |12 | |`D8` | +|4 |13 | |`D9` | +|4 |14 | | | +|4 |15 | | | +|4 |16 | | | + ## Functions +### AVR + |Function |Description | |----------------------------|-------------------------------------------------------------------------------------------------------------------| |`analogReference(mode)` |Sets the analog voltage reference source. Must be one of `ADC_REF_EXTERNAL`, `ADC_REF_POWER` or `ADC_REF_INTERNAL`.| @@ -48,3 +126,28 @@ Then place this include at the top of your code: |`analogReadPin(pin)` |Reads the value from the specified QMK pin, eg. `F6` for ADC6 on the ATmega32U4. | |`pinToMux(pin)` |Translates a given QMK pin to a mux value. If an unsupported pin is given, returns the mux value for "0V (GND)". | |`adc_read(mux)` |Reads the value from the ADC according to the specified mux. See your MCU's datasheet for more information. | + +### ARM + +Note that care was taken to match all of the functions used for AVR devices, however complications in the ARM platform prevent that from always being possible. For example, the `STM32` chips do not have assigned Arduino pins. We could use the default pin numbers, but those numbers change based on the package type of the device. For this reason, please specify your target pins with their identifiers (`A0`, `F3`, etc.). Also note that there are some variants of functions that accept the target ADC for the pin. Some pins can be used for multiple ADCs, and this specified can help you pick which ADC will be used to interact with that pin. + +|Function |Description | +|----------------------------|--------------------------------------------------------------------------------------------------------------------| +|`analogReadPin(pin)` |Reads the value from the specified QMK pin, eg. `A0` for channel 0 on the STM32F0 and ADC1 channel 1 on the STM32F3. Note that if a pin can be used for multiple ADCs, it will pick the lower numbered ADC for this function. eg. `C0` will be channel 6 of ADC 1 when it could be used for ADC 2 as well.| +|`analogReadPinAdc(pin, adc)`|Reads the value from the specified QMK pin and ADC, eg. `C0, 1` will read from channel 6, ADC 2 instead of ADC 1. Note that the ADCs are 0-indexed for this function.| +|`pinToMux(pin)` |Translates a given QMK pin to a channel and ADC combination. If an unsupported pin is given, returns the mux value for "0V (GND)".| +|`adc_read(mux)` |Reads the value from the ADC according to the specified pin and adc combination. See your MCU's datasheet for more information.| + +## Configuration + +## ARM + +The ARM implementation of the ADC has a few additional options that you can override in your own keyboards and keymaps to change how it operates. + +|`#define` |Type |Default |Description| +|-------------------|------|---------------------|-----------| +|ADC_CIRCULAR_BUFFER|`bool`|`false` |If `TRUE`, then the implementation will use a circular buffer.| +|ADC_NUM_CHANNELS |`int` |`1` |Sets the number of channels that will be scanned as part of an ADC operation. The current implementation only supports `1`.| +|ADC_BUFFER_DEPTH |`int` |`2` |Sets the depth of each result. Since we are only getting a 12-bit result by default, we set this to `2` bytes so we can contain our one value. This could be set to 1 if you opt for a 8-bit or lower result.| +|ADC_SAMPLING_RATE |`int` |`ADC_SMPR_SMP_1P5` |Sets the sampling rate of the ADC. By default, it is set to the fastest setting. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options.| +|ADC_RESOLUTION |`int` |`ADC_CFGR1_RES_12BIT`|The resolution of your result. We choose 12 bit by default, but you can opt for 12, 10, 8, or 6 bit. Please consult the corresponding `hal_adc_lld.h` in ChibiOS for your specific microcontroller for further documentation on your available options.| diff --git a/docs/cli.md b/docs/cli.md index eda365d87b2..61f838536eb 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -231,14 +231,14 @@ Check your environment and report problems only: qmk doctor -n -## `qmk json-keymap` +## `qmk json2c` Creates a keymap.c from a QMK Configurator export. **Usage**: ``` -qmk json-keymap [-o OUTPUT] filename +qmk json2c [-o OUTPUT] filename ``` ## `qmk kle2json` diff --git a/docs/config_options.md b/docs/config_options.md index f19df022af5..661cfccce6d 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -190,6 +190,8 @@ If you define these options you will enable the associated feature, which may in * pin the DI on the WS2812 is hooked-up to * `#define RGBLIGHT_ANIMATIONS` * run RGB animations +* `#define RGBLIGHT_LAYERS` + * Lets you define [lighting layers](feature_rgblight.md) that can be toggled on or off. Great for showing the current keyboard layer or caps lock state. * `#define RGBLED_NUM 12` * number of LEDs * `#define RGBLIGHT_SPLIT` diff --git a/docs/eeprom_driver.md b/docs/eeprom_driver.md index dd12d8ec7b0..5a91a7c2dab 100644 --- a/docs/eeprom_driver.md +++ b/docs/eeprom_driver.md @@ -2,14 +2,16 @@ The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present. -Driver | Description ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -`EEPROM_DRIVER = vendor` | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. Other chips will generally act as "transient" below. -`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below. -`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost. +Driver | Description +-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below. +`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below. +`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost. ## Vendor Driver Configuration +!> Resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used. + No configurable options are available. ## I2C Driver Configuration diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 69a6aaaed6b..a000241f8bd 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -172,6 +172,62 @@ const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64}; ``` +## Lighting Layers + +By including `#define RGBLIGHT_LAYERS` in your `config.h` file you can enable lighting layers. These make +it easy to use your underglow LEDs as status indicators to show which keyboard layer is currently active, or the state of caps lock, all without disrupting any animations. [Here's a video](https://youtu.be/uLGE1epbmdY) showing an example of what you can do. + +To define a layer, we modify `keymap.c` to list out LED ranges and the colors we want to overlay on them using an array of `rgblight_segment_t` using the `RGBLIGHT_LAYER_SEGMENTS` macro. We can define multiple layers and enable/disable them independently: + +```c +// Light LEDs 6 to 9 and 12 to 15 red when caps lock is active. Hard to ignore! +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {6, 4, HSV_RED}, // Light 4 LEDs, starting with LED 6 + {12, 4, HSV_RED} // Light 4 LEDs, starting with LED 12 +); +// Light LEDs 9 & 10 in cyan when keyboard layer 1 is active +const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {9, 2, HSV_CYAN} +); +// Light LEDs 11 & 12 in purple when keyboard layer 2 is active +const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {11, 2, HSV_PURPLE}, +); +// etc.. +``` + +We combine these layers into an array using the `RGBLIGHT_LAYERS_LIST` macro, and assign it to the `rgblight_layers` variable during keyboard setup. Note that you can only define up to 8 lighting layers. Any extra layers will be ignored. Since the different lighting layers overlap, the order matters in the array, with later layers taking precedence: + +```c +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_capslock_layer, + my_layer1_layer, // Overrides caps lock layer + my_layer2_layer // Overrides other layers +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} +``` + +Finally, we enable and disable the lighting layers whenever the state of the keyboard changes: + +```c +layer_state_t layer_state_set_user(layer_state_t state) { + // Both layers will light up if both kb layers are active + rgblight_set_layer_state(1, layer_state_cmp(state, 1)); + rgblight_set_layer_state(2, layer_state_cmp(state, 2)); + return state; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(0, led_state.caps_lock); + return true; +} +``` + ## Functions If you need to change your RGB lighting in code, for example in a macro to change the color whenever you switch layers, QMK provides a set of functions to assist you. See [`rgblight.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight.h) for the full list, but the most commonly used functions include: @@ -263,6 +319,12 @@ rgblight_sethsv(HSV_GREEN, 2); // led 2 |`rgblight_sethsv(h, s, v)` |Set effect range LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 | |`rgblight_sethsv_noeeprom(h, s, v)` |Set effect range LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) | +#### layer functions +|Function |Description | +|--------------------------------------------|-------------| +|`rgblight_get_layer_state(i)` |Returns `true` if lighting layer `i` is enabled | +|`rgblight_set_layer_state(i, is_on)` |Enable or disable lighting layer `i` based on value of `bool is_on` | + #### query |Function |Description | |-----------------------|-----------------| diff --git a/docs/index.html b/docs/index.html index 4351ce1dd4d..ec92de4950c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,7 +16,8 @@ - + +
diff --git a/docs/ja/cli.md b/docs/ja/cli.md index 4b1f5da365c..e0bee35a6f5 100644 --- a/docs/ja/cli.md +++ b/docs/ja/cli.md @@ -215,14 +215,14 @@ qmk doctor [-y] [-n] qmk doctor -n -## `qmk json-keymap` +## `qmk json2c` QMK Configurator からエクスポートしたものから keymap.c を生成します。 **使用法**: ``` -qmk json-keymap [-o OUTPUT] filename +qmk json2c [-o OUTPUT] filename ``` ## `qmk kle2json` diff --git a/docs/qmk_custom_dark.css b/docs/qmk_custom_dark.css new file mode 100644 index 00000000000..a7feb159c80 --- /dev/null +++ b/docs/qmk_custom_dark.css @@ -0,0 +1,29 @@ +.sidebar li.active { + background-color: #555; +} + +.markdown-section p.tip, +.markdown-section tr:nth-child(2n) { + background-color:#444; +} + +.markdown-section tr { + border-top: 1px solid #555; +} + +.markdown-section td, .markdown-section th { + border: 1px solid #555; +} + +.markdown-section p.tip code { + background-color: #555; + color: #fff; +} + +.page_toc code { + background-color: #555; +} + +.markdown-section hr, .search { + border-bottom: 1px solid #777 !important; +} diff --git a/docs/sidebar.css b/docs/qmk_custom_light.css similarity index 100% rename from docs/sidebar.css rename to docs/qmk_custom_light.css diff --git a/drivers/arm/analog.c b/drivers/arm/analog.c new file mode 100644 index 00000000000..427381f281b --- /dev/null +++ b/drivers/arm/analog.c @@ -0,0 +1,207 @@ +/* Copyright 2019 Drew Mills + * + * 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 . + */ + +#include "analog.h" +#include "quantum.h" + +/* User configurable ADC options */ +#ifndef ADC_CIRCULAR_BUFFER +# define ADC_CIRCULAR_BUFFER FALSE +#endif + +#ifndef ADC_NUM_CHANNELS +# define ADC_NUM_CHANNELS 1 +#elif ADC_NUM_CHANNELS != 1 +# error "The ARM ADC implementation currently only supports reading one channel at a time." +#endif + +#ifndef ADC_BUFFER_DEPTH +# define ADC_BUFFER_DEPTH 2 +#endif + +// For more sampling rate options, look at hal_adc_lld.h in ChibiOS +#ifndef ADC_SAMPLING_RATE +# define ADC_SAMPLING_RATE ADC_SMPR_SMP_1P5 +#endif + +// Options are 12, 10, 8, and 6 bit. +#ifndef ADC_RESOLUTION +# define ADC_RESOLUTION ADC_CFGR1_RES_12BIT +#endif + +static ADCConfig adcCfg = {}; +static adcsample_t sampleBuffer[ADC_NUM_CHANNELS * ADC_BUFFER_DEPTH]; + +// Initialize to max number of ADCs, set to empty object to initialize all to false. +#if defined(STM32F0XX) +static bool adcInitialized[1] = {}; +#elif defined(STM32F3XX) +static bool adcInitialized[4] = {}; +#else +# error "adcInitialized has not been implemented for this ARM microcontroller." +#endif + +static ADCConversionGroup adcConversionGroup = { + ADC_CIRCULAR_BUFFER, + (uint16_t)(ADC_NUM_CHANNELS), + NULL, // No end callback + NULL, // No error callback +#if defined(STM32F0XX) + ADC_CFGR1_CONT | ADC_RESOLUTION, + ADC_TR(0, 0).ADC_SAMPLING_RATE, + NULL, // Doesn't specify a default channel +#elif defined(STM32F3XX) + ADC_CFGR_CONT | ADC_RESOLUTION, + ADC_TR(0, 4095), + { + ADC_SAMPLING_RATE, + ADC_SAMPLING_RATE, + }, + { + 0, // Doesn't specify a default channel + 0, + 0, + 0, + }, +#endif +}; + +static inline ADCDriver* intToADCDriver(uint8_t adcInt) { + ADCDriver* target; + + switch (adcInt) { + // clang-format off +#if STM32_ADC_USE_ADC1 + case 0: target = &ADCD1; break; +#endif +#if STM32_ADC_USE_ADC2 + case 1: target = &ADCD2; break; +#endif +#if STM32_ADC_USE_ADC3 + case 2: target = &ADCD3; break; +#endif +#if STM32_ADC_USE_ADC4 + case 3: target = &ADCD4; break; +#endif + default: target = NULL; break; + // clang-format on + } + + return target; +} + +static inline void manageAdcInitializationDriver(uint8_t adc, ADCDriver* adcDriver) { + if (!adcInitialized[adc]) { + adcStart(adcDriver, &adcCfg); + adcInitialized[adc] = true; + } +} + +static inline void manageAdcInitialization(uint8_t adc) { manageAdcInitializationDriver(adc, intToADCDriver(adc)); } + +pin_and_adc pinToMux(pin_t pin) { + switch (pin) { + // clang-format off +#if defined(STM32F0XX) + case A0: return (pin_and_adc){ ADC_CHANNEL_IN0, 0 }; + case A1: return (pin_and_adc){ ADC_CHANNEL_IN1, 0 }; + case A2: return (pin_and_adc){ ADC_CHANNEL_IN2, 0 }; + case A3: return (pin_and_adc){ ADC_CHANNEL_IN3, 0 }; + case A4: return (pin_and_adc){ ADC_CHANNEL_IN4, 0 }; + case A5: return (pin_and_adc){ ADC_CHANNEL_IN5, 0 }; + case A6: return (pin_and_adc){ ADC_CHANNEL_IN6, 0 }; + case A7: return (pin_and_adc){ ADC_CHANNEL_IN7, 0 }; + case B0: return (pin_and_adc){ ADC_CHANNEL_IN8, 0 }; + case B1: return (pin_and_adc){ ADC_CHANNEL_IN9, 0 }; + case C0: return (pin_and_adc){ ADC_CHANNEL_IN10, 0 }; + case C1: return (pin_and_adc){ ADC_CHANNEL_IN11, 0 }; + case C2: return (pin_and_adc){ ADC_CHANNEL_IN12, 0 }; + case C3: return (pin_and_adc){ ADC_CHANNEL_IN13, 0 }; + case C4: return (pin_and_adc){ ADC_CHANNEL_IN14, 0 }; + case C5: return (pin_and_adc){ ADC_CHANNEL_IN15, 0 }; +#elif defined(STM32F3XX) + case A0: return (pin_and_adc){ ADC_CHANNEL_IN1, 0 }; + case A1: return (pin_and_adc){ ADC_CHANNEL_IN2, 0 }; + case A2: return (pin_and_adc){ ADC_CHANNEL_IN3, 0 }; + case A3: return (pin_and_adc){ ADC_CHANNEL_IN4, 0 }; + case A4: return (pin_and_adc){ ADC_CHANNEL_IN1, 1 }; + case A5: return (pin_and_adc){ ADC_CHANNEL_IN2, 1 }; + case A6: return (pin_and_adc){ ADC_CHANNEL_IN3, 1 }; + case A7: return (pin_and_adc){ ADC_CHANNEL_IN4, 1 }; + case B0: return (pin_and_adc){ ADC_CHANNEL_IN12, 2 }; + case B1: return (pin_and_adc){ ADC_CHANNEL_IN1, 2 }; + case B2: return (pin_and_adc){ ADC_CHANNEL_IN12, 1 }; + case B12: return (pin_and_adc){ ADC_CHANNEL_IN2, 3 }; + case B13: return (pin_and_adc){ ADC_CHANNEL_IN3, 3 }; + case B14: return (pin_and_adc){ ADC_CHANNEL_IN4, 3 }; + case B15: return (pin_and_adc){ ADC_CHANNEL_IN5, 3 }; + case C0: return (pin_and_adc){ ADC_CHANNEL_IN6, 0 }; // Can also be ADC2 + case C1: return (pin_and_adc){ ADC_CHANNEL_IN7, 0 }; // Can also be ADC2 + case C2: return (pin_and_adc){ ADC_CHANNEL_IN8, 0 }; // Can also be ADC2 + case C3: return (pin_and_adc){ ADC_CHANNEL_IN9, 0 }; // Can also be ADC2 + case C4: return (pin_and_adc){ ADC_CHANNEL_IN5, 1 }; + case C5: return (pin_and_adc){ ADC_CHANNEL_IN11, 1 }; + case D8: return (pin_and_adc){ ADC_CHANNEL_IN12, 3 }; + case D9: return (pin_and_adc){ ADC_CHANNEL_IN13, 3 }; + case D10: return (pin_and_adc){ ADC_CHANNEL_IN7, 2 }; // Can also be ADC4 + case D11: return (pin_and_adc){ ADC_CHANNEL_IN8, 2 }; // Can also be ADC4 + case D12: return (pin_and_adc){ ADC_CHANNEL_IN9, 2 }; // Can also be ADC4 + case D13: return (pin_and_adc){ ADC_CHANNEL_IN10, 2 }; // Can also be ADC4 + case D14: return (pin_and_adc){ ADC_CHANNEL_IN11, 2 }; // Can also be ADC4 + case E7: return (pin_and_adc){ ADC_CHANNEL_IN13, 2 }; + case E8: return (pin_and_adc){ ADC_CHANNEL_IN6, 2 }; // Can also be ADC4 + case E9: return (pin_and_adc){ ADC_CHANNEL_IN2, 2 }; + case E10: return (pin_and_adc){ ADC_CHANNEL_IN14, 2 }; + case E11: return (pin_and_adc){ ADC_CHANNEL_IN15, 2 }; + case E12: return (pin_and_adc){ ADC_CHANNEL_IN16, 2 }; + case E13: return (pin_and_adc){ ADC_CHANNEL_IN3, 2 }; + case E14: return (pin_and_adc){ ADC_CHANNEL_IN1, 3 }; + case E15: return (pin_and_adc){ ADC_CHANNEL_IN2, 3 }; + case F2: return (pin_and_adc){ ADC_CHANNEL_IN10, 0 }; // Can also be ADC2 + case F4: return (pin_and_adc){ ADC_CHANNEL_IN5, 0 }; +#else +#error "An ADC pin-to-mux configuration has not been specified for this microcontroller." +#endif + default: return (pin_and_adc){ 0, 0 }; + // clang-format on + } +} + +adcsample_t analogReadPin(pin_t pin) { return adc_read(pinToMux(pin)); } + +adcsample_t analogReadPinAdc(pin_t pin, uint8_t adc) { + pin_and_adc target = pinToMux(pin); + target.adc = adc; + return adc_read(target); +} + +adcsample_t adc_read(pin_and_adc mux) { +#if defined(STM32F0XX) + adcConversionGroup.sqr = ADC_CHSELR_CHSEL1; +#elif defined(STM32F3XX) + adcConversionGroup.sqr[0] = ADC_SQR1_SQ1_N(mux.pin); +#else +# error "adc_read has not been updated to support this ARM microcontroller." +#endif + + ADCDriver* targetDriver = intToADCDriver(mux.adc); + manageAdcInitializationDriver(mux.adc, targetDriver); + + adcConvert(targetDriver, &adcConversionGroup, &sampleBuffer[0], ADC_BUFFER_DEPTH); + adcsample_t* result = sampleBuffer; + + return *result; +} diff --git a/drivers/arm/analog.h b/drivers/arm/analog.h new file mode 100644 index 00000000000..ab592ada334 --- /dev/null +++ b/drivers/arm/analog.h @@ -0,0 +1,57 @@ +/* Copyright 2019 Drew Mills + * + * 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 . + */ + +#pragma once + +#include "quantum.h" +#include "ch.h" +#include + +#if !defined(STM32F0XX) && !defined(STM32F3XX) +# error "Only STM23F0 and STM32F3 devices have ADC support in QMK at this time." +#endif + +#if !HAL_USE_ADC +# error "You need to set HAL_USE_ADC to TRUE in your halconf.h to use the ADC." +#endif + +#if !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 +# error "You need to set one of the 'STM32_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC." +#endif + +#if STM32_ADC_DUAL_MODE +# error "STM32 ADC Dual Mode is not supported at this time." +#endif + +#if STM32_ADCV3_OVERSAMPLING +# error "STM32 ADCV3 Oversampling is not supported at this time." +#endif + +typedef struct { + pin_t pin; + uint8_t adc; +} pin_and_adc; +#define PIN_AND_ADC(p, a) \ + (pin_and_adc) { p, a } + +// analogReference has been left un-defined for ARM devices. +// void analogReference(uint8_t mode); + +adcsample_t analogReadPin(pin_t pin); +adcsample_t analogReadPinAdc(pin_t pin, uint8_t adc); +pin_and_adc pinToMux(pin_t pin); + +adcsample_t adc_read(pin_and_adc mux); diff --git a/drivers/eeprom/eeprom_stm32_L0_L1.c b/drivers/eeprom/eeprom_stm32_L0_L1.c new file mode 100644 index 00000000000..b62e6ffd76c --- /dev/null +++ b/drivers/eeprom/eeprom_stm32_L0_L1.c @@ -0,0 +1,96 @@ +/* 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 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 . + */ + +#include +#include + +#include "hal.h" +#include "eeprom_driver.h" +#include "eeprom_stm32_L0_L1.h" + +#define EEPROM_BASE_ADDR 0x08080000 +#define EEPROM_ADDR(offset) (EEPROM_BASE_ADDR + (offset)) +#define EEPROM_PTR(offset) ((__IO uint8_t *)EEPROM_ADDR(offset)) +#define EEPROM_BYTE(location, offset) (*(EEPROM_PTR(((uint32_t)location) + ((uint32_t)offset)))) + +#define BUFFER_BYTE(buffer, offset) (*(((uint8_t *)buffer) + offset)) + +#define FLASH_PEKEY1 0x89ABCDEF +#define FLASH_PEKEY2 0x02030405 + +static inline void STM32_L0_L1_EEPROM_WaitNotBusy(void) { + while (FLASH->SR & FLASH_SR_BSY) { + __WFI(); + } +} + +static inline void STM32_L0_L1_EEPROM_Unlock(void) { + STM32_L0_L1_EEPROM_WaitNotBusy(); + if (FLASH->PECR & FLASH_PECR_PELOCK) { + FLASH->PEKEYR = FLASH_PEKEY1; + FLASH->PEKEYR = FLASH_PEKEY2; + } +} + +static inline void STM32_L0_L1_EEPROM_Lock(void) { + STM32_L0_L1_EEPROM_WaitNotBusy(); + FLASH->PECR |= FLASH_PECR_PELOCK; +} + +void eeprom_driver_init(void) {} + +void eeprom_driver_erase(void) { + STM32_L0_L1_EEPROM_Unlock(); + + for (size_t offset = 0; offset < STM32_ONBOARD_EEPROM_SIZE; offset += sizeof(uint32_t)) { + FLASH->PECR |= FLASH_PECR_ERASE | FLASH_PECR_DATA; + + *(__IO uint32_t *)EEPROM_ADDR(offset) = (uint32_t)0; + + STM32_L0_L1_EEPROM_WaitNotBusy(); + FLASH->PECR &= ~(FLASH_PECR_ERASE | FLASH_PECR_DATA); + } + + STM32_L0_L1_EEPROM_Lock(); +} + +void eeprom_read_block(void *buf, const void *addr, size_t len) { + for (size_t offset = 0; offset < len; ++offset) { + // Drop out if we've hit the limit of the EEPROM + if ((((uint32_t)addr) + offset) >= STM32_ONBOARD_EEPROM_SIZE) { + break; + } + + STM32_L0_L1_EEPROM_WaitNotBusy(); + BUFFER_BYTE(buf, offset) = EEPROM_BYTE(addr, offset); + } +} + +void eeprom_write_block(const void *buf, void *addr, size_t len) { + STM32_L0_L1_EEPROM_Unlock(); + + for (size_t offset = 0; offset < len; ++offset) { + // Drop out if we've hit the limit of the EEPROM + if ((((uint32_t)addr) + offset) >= STM32_ONBOARD_EEPROM_SIZE) { + break; + } + + STM32_L0_L1_EEPROM_WaitNotBusy(); + EEPROM_BYTE(addr, offset) = BUFFER_BYTE(buf, offset); + } + + STM32_L0_L1_EEPROM_Lock(); +} diff --git a/drivers/eeprom/eeprom_stm32_L0_L1.h b/drivers/eeprom/eeprom_stm32_L0_L1.h new file mode 100644 index 00000000000..a35defca8bf --- /dev/null +++ b/drivers/eeprom/eeprom_stm32_L0_L1.h @@ -0,0 +1,33 @@ +/* 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 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 . + */ + +#pragma once + +/* + The size used by the STM32 L0/L1 EEPROM driver. +*/ +#ifndef STM32_ONBOARD_EEPROM_SIZE +# ifdef VIA_ENABLE +# define STM32_ONBOARD_EEPROM_SIZE 1024 +# else +# include "eeconfig.h" +# define STM32_ONBOARD_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO and EEPROM page sizing +# endif +#endif + +#if STM32_ONBOARD_EEPROM_SIZE > 128 +# pragma message("Please note: resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used.") +#endif diff --git a/keyboards/ai03/equinox/keymaps/proto_via/keymap.c b/keyboards/ai03/equinox/keymaps/proto_via/keymap.c deleted file mode 100644 index ff88c354120..00000000000 --- a/keyboards/ai03/equinox/keymaps/proto_via/keymap.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2019 Ryota Goto - * - * 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 . - */ -#include QMK_KEYBOARD_H -/* - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ - K300, K301, K302, K304, K306, K308, K309, K310, K311 \ -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_all( /* Base */ - MO(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_GRV, KC_RGUI, KC_DEL - ), - [1] = LAYOUT_all( /* Extra Keys */ - _______, _______, KC_PGUP, _______, _______, KC_LBRC, KC_RBRC, _______, KC_UP, _______, _______, _______, - _______, KC_HOME, KC_PGDN, KC_END, _______, KC_BSLS, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, - _______, _______, _______, _______, _______, KC_PSCR, KC_ESC, KC_QUOT, _______, KC_DOT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [2] = LAYOUT_all( /* Num and FN */ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, - _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [3] = LAYOUT_all( /* Other */ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/ai03/equinox/keymaps/proto_via/readme.md b/keyboards/ai03/equinox/keymaps/proto_via/readme.md deleted file mode 100644 index 07ef0f533cd..00000000000 --- a/keyboards/ai03/equinox/keymaps/proto_via/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# The proto via keymap for equinox - -Has the necessary tweaks to run on early prototype PCBs. -Not to be used for production run PCBs. \ No newline at end of file diff --git a/keyboards/ai03/equinox/keymaps/proto_via/rules.mk b/keyboards/ai03/equinox/keymaps/proto_via/rules.mk deleted file mode 100644 index 9aa34bbdad8..00000000000 --- a/keyboards/ai03/equinox/keymaps/proto_via/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -VIA_ENABLE = yes - -# Fix for prototype missing COL0, COL1, using backlight and RGB underglow I/O pins -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow diff --git a/keyboards/ai03/equinox/keymaps/proto_via/config.h b/keyboards/ai03/equinox/rev0/config.h similarity index 80% rename from keyboards/ai03/equinox/keymaps/proto_via/config.h rename to keyboards/ai03/equinox/rev0/config.h index 4637a3748c1..be599c12258 100644 --- a/keyboards/ai03/equinox/keymaps/proto_via/config.h +++ b/keyboards/ai03/equinox/rev0/config.h @@ -21,3 +21,7 @@ along with this program. If not, see . #undef MATRIX_COL_PINS #define MATRIX_COL_PINS { C4, B7, C6, C7, B6, B5, B4, B3, B2, B1, B0, D6 } +// This directs backlight code to use a disconnected pin, so the firwmare still has +// backlight code and VIA support even though it doesn't do anything. +#undef BACKLIGHT_PIN +#define BACKLIGHT_PIN D1 \ No newline at end of file diff --git a/keyboards/ai03/equinox/rev0/rules.mk b/keyboards/ai03/equinox/rev0/rules.mk new file mode 100644 index 00000000000..1408fb702b3 --- /dev/null +++ b/keyboards/ai03/equinox/rev0/rules.mk @@ -0,0 +1 @@ +# Dummy rules.mk, rev0 uses parent rules.mk as is \ No newline at end of file diff --git a/keyboards/ai03/equinox/rev1/config.h b/keyboards/ai03/equinox/rev1/config.h new file mode 100644 index 00000000000..dfaa2d36897 --- /dev/null +++ b/keyboards/ai03/equinox/rev1/config.h @@ -0,0 +1,18 @@ +/* +Copyright 2019 Ryota Goto + +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 . +*/ + +#pragma once diff --git a/keyboards/ai03/equinox/rev1/rules.mk b/keyboards/ai03/equinox/rev1/rules.mk new file mode 100644 index 00000000000..5e226fb5090 --- /dev/null +++ b/keyboards/ai03/equinox/rev1/rules.mk @@ -0,0 +1 @@ +# Dummy rules.mk, rev1 uses parent rules.mk as is \ No newline at end of file diff --git a/keyboards/ares/config.h b/keyboards/ares/config.h index e298dfc959d..4bfe0867b17 100644 --- a/keyboards/ares/config.h +++ b/keyboards/ares/config.h @@ -42,8 +42,6 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ // #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h index ef7a866d3db..86faba21d0a 100644 --- a/keyboards/bfake/config.h +++ b/keyboards/bfake/config.h @@ -41,5 +41,3 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c deleted file mode 100644 index 7c09bd997cb..00000000000 --- a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * This file has been automatically generated using ChibiStudio board - * generator plugin. Do not edit manually. - */ - -#include "hal.h" -#include "stm32_gpio.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver exported variables. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver local variables and types. */ -/*===========================================================================*/ - -/** - * @brief Type of STM32 GPIO port setup. - */ -typedef struct { - uint32_t moder; - uint32_t otyper; - uint32_t ospeedr; - uint32_t pupdr; - uint32_t odr; - uint32_t afrl; - uint32_t afrh; -} gpio_setup_t; - -/** - * @brief Type of STM32 GPIO initialization data. - */ -typedef struct { -#if STM32_HAS_GPIOA || defined(__DOXYGEN__) - gpio_setup_t PAData; -#endif -#if STM32_HAS_GPIOB || defined(__DOXYGEN__) - gpio_setup_t PBData; -#endif -#if STM32_HAS_GPIOC || defined(__DOXYGEN__) - gpio_setup_t PCData; -#endif -#if STM32_HAS_GPIOD || defined(__DOXYGEN__) - gpio_setup_t PDData; -#endif -#if STM32_HAS_GPIOE || defined(__DOXYGEN__) - gpio_setup_t PEData; -#endif -#if STM32_HAS_GPIOF || defined(__DOXYGEN__) - gpio_setup_t PFData; -#endif -#if STM32_HAS_GPIOG || defined(__DOXYGEN__) - gpio_setup_t PGData; -#endif -#if STM32_HAS_GPIOH || defined(__DOXYGEN__) - gpio_setup_t PHData; -#endif -#if STM32_HAS_GPIOI || defined(__DOXYGEN__) - gpio_setup_t PIData; -#endif -#if STM32_HAS_GPIOJ || defined(__DOXYGEN__) - gpio_setup_t PJData; -#endif -#if STM32_HAS_GPIOK || defined(__DOXYGEN__) - gpio_setup_t PKData; -#endif -} gpio_config_t; - -/** - * @brief STM32 GPIO static initialization data. - */ -static const gpio_config_t gpio_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}, -#endif -#if STM32_HAS_GPIOJ - {VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR, - VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH}, -#endif -#if STM32_HAS_GPIOK - {VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR, - VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH} -#endif -}; - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - gpiop->OSPEEDR = config->ospeedr; - gpiop->PUPDR = config->pupdr; - gpiop->ODR = config->odr; - gpiop->AFRL = config->afrl; - gpiop->AFRH = config->afrh; - gpiop->MODER = config->moder; -} - -static void stm32_gpio_init(void) { - - /* Enabling GPIO-related clocks, the mask comes from the - registry header file.*/ - rccResetAHB(STM32_GPIO_EN_MASK); - rccEnableAHB(STM32_GPIO_EN_MASK, true); - - /* Initializing all the defined GPIO ports.*/ -#if STM32_HAS_GPIOA - gpio_init(GPIOA, &gpio_default_config.PAData); -#endif -#if STM32_HAS_GPIOB - gpio_init(GPIOB, &gpio_default_config.PBData); -#endif -#if STM32_HAS_GPIOC - gpio_init(GPIOC, &gpio_default_config.PCData); -#endif -#if STM32_HAS_GPIOD - gpio_init(GPIOD, &gpio_default_config.PDData); -#endif -#if STM32_HAS_GPIOE - gpio_init(GPIOE, &gpio_default_config.PEData); -#endif -#if STM32_HAS_GPIOF - gpio_init(GPIOF, &gpio_default_config.PFData); -#endif -#if STM32_HAS_GPIOG - gpio_init(GPIOG, &gpio_default_config.PGData); -#endif -#if STM32_HAS_GPIOH - gpio_init(GPIOH, &gpio_default_config.PHData); -#endif -#if STM32_HAS_GPIOI - gpio_init(GPIOI, &gpio_default_config.PIData); -#endif -#if STM32_HAS_GPIOJ - gpio_init(GPIOJ, &gpio_default_config.PJData); -#endif -#if STM32_HAS_GPIOK - gpio_init(GPIOK, &gpio_default_config.PKData); -#endif -} - -/*===========================================================================*/ -/* Driver interrupt handlers. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/** - * @brief Early initialization code. - * @details GPIO ports and system clocks are initialized before everything - * else. - */ -void __early_init(void) { - extern void enter_bootloader_mode_if_requested(void); - enter_bootloader_mode_if_requested(); - stm32_gpio_init(); - stm32_clock_init(); -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief SDC card write protection detection. - */ -bool sdc_lld_is_write_protected(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { - SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP; - SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP); -} diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h deleted file mode 100644 index 173f7b60542..00000000000 --- a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.h +++ /dev/null @@ -1,923 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * This file has been automatically generated using ChibiStudio board - * generator plugin. Do not edit manually. - */ - -#ifndef BOARD_H -#define BOARD_H - -/* - * Setup for ST STM32F072B-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32F072B_DISCOVERY -#define BOARD_NAME "ST STM32F072B-Discovery" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - * NOTE: HSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 0U -#endif - -#define STM32_HSE_BYPASS - -/* - * MCU type as defined in the ST header. - */ -#define STM32F072xB - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_USB_DM 11U -#define GPIOA_USB_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_SPI2_SCK 13U -#define GPIOB_SPI2_MISO 14U -#define GPIOB_SPI2_MOSI 15U - -#define GPIOC_MEMS_CS 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_LED_RED 6U -#define GPIOC_LED_BLUE 7U -#define GPIOC_LED_ORANGE 8U -#define GPIOC_LED_GREEN 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_OSC32_IN 14U -#define GPIOC_OSC32_OUT 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOE_PIN0 0U -#define GPIOE_PIN1 1U -#define GPIOE_PIN2 2U -#define GPIOE_PIN3 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_OSC_IN 0U -#define GPIOF_OSC_OUT 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -/* - * IO lines assignments. - */ -#define LINE_BUTTON PAL_LINE(GPIOA, 0U) -#define LINE_USB_DM PAL_LINE(GPIOA, 11U) -#define LINE_USB_DP PAL_LINE(GPIOA, 12U) -#define LINE_SWDIO PAL_LINE(GPIOA, 13U) -#define LINE_SWCLK PAL_LINE(GPIOA, 14U) - -#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) -#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) -#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) - -#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) -#define LINE_LED_RED PAL_LINE(GPIOC, 6U) -#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) -#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) -#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) -#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) -#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) - - - -#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) -#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - BUTTON (input floating). - * PA1 - PIN1 (input pullup). - * PA2 - PIN2 (input pullup). - * PA3 - PIN3 (input pullup). - * PA4 - PIN4 (input pullup). - * PA5 - PIN5 (input pullup). - * PA6 - PIN6 (input pullup). - * PA7 - PIN7 (input pullup). - * PA8 - PIN8 (input pullup). - * PA9 - PIN9 (input pullup). - * PA10 - PIN10 (input pullup). - * PA11 - USB_DM (input floating). - * PA12 - USB_DP (input floating). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - PIN15 (input pullup). - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_INPUT(GPIOA_USB_DM) | \ - PIN_MODE_INPUT(GPIOA_USB_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ - PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ - PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ - PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ - PIN_OSPEED_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_USB_DM) | \ - PIN_ODR_HIGH(GPIOA_USB_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN7, 0U)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ - PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0U)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (input pullup). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 (input pullup). - * PB7 - PIN7 (input pullup). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - SPI2_SCK (alternate 0). - * PB14 - SPI2_MISO (alternate 0). - * PB15 - SPI2_MOSI (alternate 0). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_INPUT(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_INPUT(GPIOB_PIN6) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ - PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ - PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ - PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ - PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ - PIN_OSPEED_HIGH(GPIOB_PIN2) | \ - PIN_OSPEED_HIGH(GPIOB_PIN3) | \ - PIN_OSPEED_HIGH(GPIOB_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ - PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ - PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ - PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ - PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ - PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ - PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0U)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ - PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ - PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ - PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) - -/* - * GPIOC setup: - * - * PC0 - MEMS_CS (output pushpull maximum). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - LED_RED (output pushpull maximum). - * PC7 - LED_BLUE (output pushpull maximum). - * PC8 - LED_ORANGE (output pushpull maximum). - * PC9 - LED_GREEN (output pushpull maximum). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - OSC32_IN (input floating). - * PC15 - OSC32_OUT (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ - PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ - PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ - PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ - PIN_MODE_INPUT(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ - PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ - PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ - PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ - PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ - PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ - PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ - PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ - PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ - PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_LOW(GPIOC_LED_RED) | \ - PIN_ODR_LOW(GPIOC_LED_BLUE) | \ - PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ - PIN_ODR_LOW(GPIOC_LED_GREEN) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ - PIN_ODR_HIGH(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ - PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ - PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ - PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ - PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD10 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0U)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0U)) - -/* - * GPIOE setup: - * - * PE0 - PIN0 (input pullup). - * PE1 - PIN1 (input pullup). - * PE2 - PIN2 (input pullup). - * PE3 - PIN3 (input pullup). - * PE4 - PIN4 (input pullup). - * PE5 - PIN5 (input pullup). - * PE6 - PIN6 (input pullup). - * PE7 - PIN7 (input pullup). - * PE8 - PIN8 (input pullup). - * PE9 - PIN9 (input pullup). - * PE10 - PIN10 (input pullup). - * PE11 - PIN11 (input pullup). - * PE12 - PIN12 (input pullup). - * PE13 - PIN13 (input pullup). - * PE14 - PIN14 (input pullup). - * PE15 - PIN15 (input pullup). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_PIN2) | \ - PIN_MODE_INPUT(GPIOE_PIN3) | \ - PIN_MODE_INPUT(GPIOE_PIN4) | \ - PIN_MODE_INPUT(GPIOE_PIN5) | \ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_INPUT(GPIOE_PIN8) | \ - PIN_MODE_INPUT(GPIOE_PIN9) | \ - PIN_MODE_INPUT(GPIOE_PIN10) | \ - PIN_MODE_INPUT(GPIOE_PIN11) | \ - PIN_MODE_INPUT(GPIOE_PIN12) | \ - PIN_MODE_INPUT(GPIOE_PIN13) | \ - PIN_MODE_INPUT(GPIOE_PIN14) | \ - PIN_MODE_INPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_PIN3) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_HIGH(GPIOE_PIN8) | \ - PIN_ODR_HIGH(GPIOE_PIN9) | \ - PIN_ODR_HIGH(GPIOE_PIN10) | \ - PIN_ODR_HIGH(GPIOE_PIN11) | \ - PIN_ODR_HIGH(GPIOE_PIN12) | \ - PIN_ODR_HIGH(GPIOE_PIN13) | \ - PIN_ODR_HIGH(GPIOE_PIN14) | \ - PIN_ODR_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0U)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0U)) - -/* - * GPIOF setup: - * - * PF0 - OSC_IN (input floating). - * PF1 - OSC_OUT (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ - PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ - PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ - PIN_OSPEED_VERYLOW(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ - PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ - PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0U)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0U)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* BOARD_H */ diff --git a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk deleted file mode 100644 index b98dcdd26c6..00000000000 --- a/keyboards/candybar/boards/ST_STM32F072B_DISCOVERY/board.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List of all the board related files. -BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c - -# Required include directories -BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY diff --git a/keyboards/candybar/config.h b/keyboards/candybar/lefty/config.h similarity index 100% rename from keyboards/candybar/config.h rename to keyboards/candybar/lefty/config.h diff --git a/keyboards/candybar/info.json b/keyboards/candybar/lefty/info.json similarity index 51% rename from keyboards/candybar/info.json rename to keyboards/candybar/lefty/info.json index 9cf4216aa19..1ef3dcd54a8 100644 --- a/keyboards/candybar/info.json +++ b/keyboards/candybar/lefty/info.json @@ -6,13 +6,6 @@ "height": 4, "layouts": { "LAYOUT": { - "layout": [ - {"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0}, - {"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1}, - {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2}, - {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}] - }, - "LAYOUT_lefty": { "layout": [ {"label":"7", "x":0, "y":0}, {"label":"8", "x":1, "y":0}, {"label":"9", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"Esc", "x":4, "y":0}, {"label":"Q", "x":5, "y":0}, {"label":"W", "x":6, "y":0}, {"label":"E", "x":7, "y":0}, {"label":"R", "x":8, "y":0}, {"label":"T", "x":9, "y":0}, {"label":"Y", "x":10, "y":0}, {"label":"U", "x":11, "y":0}, {"label":"I", "x":12, "y":0}, {"label":"O", "x":13, "y":0}, {"label":"P", "x":14, "y":0}, {"label":"{", "x":15, "y":0}, {"label":"}", "x":16, "y":0}, {"label":"4", "x":0, "y":1}, {"label":"5", "x":1, "y":1}, {"label":"6", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"Tab", "x":4, "y":1, "w":1.25}, {"label":"A", "x":5.25, "y":1}, {"label":"S", "x":6.25, "y":1}, {"label":"D", "x":7.25, "y":1}, {"label":"F", "x":8.25, "y":1}, {"label":"G", "x":9.25, "y":1}, {"label":"H", "x":10.25, "y":1}, {"label":"J", "x":11.25, "y":1}, {"label":"K", "x":12.25, "y":1}, {"label":"L", "x":13.25, "y":1}, {"label":":", "x":14.25, "y":1}, {"label":"Enter", "x":15.25, "y":1, "w":1.75}, diff --git a/keyboards/candybar/keymaps/lefty/keymap.c b/keyboards/candybar/lefty/keymaps/default/keymap.c similarity index 97% rename from keyboards/candybar/keymaps/lefty/keymap.c rename to keyboards/candybar/lefty/keymaps/default/keymap.c index 34cb55be350..153fd99c507 100644 --- a/keyboards/candybar/keymaps/lefty/keymap.c +++ b/keyboards/candybar/lefty/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ -[_BL] = LAYOUT_lefty( +[_BL] = LAYOUT( KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \ KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \ KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \ @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _FL: Function Layer */ - [_FL] = LAYOUT_lefty( + [_FL] = LAYOUT( KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \ KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \ KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \ diff --git a/keyboards/candybar/candybar.c b/keyboards/candybar/lefty/lefty.c similarity index 97% rename from keyboards/candybar/candybar.c rename to keyboards/candybar/lefty/lefty.c index c79e536ccc3..920811b8336 100644 --- a/keyboards/candybar/candybar.c +++ b/keyboards/candybar/lefty/lefty.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "candybar.h" +#include "lefty.h" void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/candybar/candybar.h b/keyboards/candybar/lefty/lefty.h similarity index 64% rename from keyboards/candybar/candybar.h rename to keyboards/candybar/lefty/lefty.h index b7a9ef4565e..07af4b31bd3 100644 --- a/keyboards/candybar/candybar.h +++ b/keyboards/candybar/lefty/lefty.h @@ -17,19 +17,8 @@ #pragma once #include "quantum.h" -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \ - k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ - k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \ -) { \ - { k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \ - { k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \ - { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ - { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ -} -#define LAYOUT_lefty( \ +#define LAYOUT( \ k0d, k0e, k0f, k0g, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ k1d, k1e, k1f, k1g, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, \ k2d, k2e, k2f, k2g, k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ @@ -40,5 +29,3 @@ { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ } - -#define LAYOUT_righty LAYOUT diff --git a/keyboards/candybar/lefty/readme.md b/keyboards/candybar/lefty/readme.md new file mode 100644 index 00000000000..5954720679b --- /dev/null +++ b/keyboards/candybar/lefty/readme.md @@ -0,0 +1,15 @@ +# The Key Company Candybar + +![Candybar](https://cdn.shopify.com/s/files/1/1679/2319/articles/CandyBar_Promo_400x225_1000x.jpg?v=1538150501) + +The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. + +* Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) +* Hardware Supported: TKC Candybar +* Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar) + +Make example for this keyboard (after setting up your build environment): + + make candybar/lefty:default:dfu-util + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/candybar/rules.mk b/keyboards/candybar/lefty/rules.mk similarity index 96% rename from keyboards/candybar/rules.mk rename to keyboards/candybar/lefty/rules.mk index 4e89dbf477b..cb1b832886a 100644 --- a/keyboards/candybar/rules.mk +++ b/keyboards/candybar/lefty/rules.mk @@ -1,6 +1,5 @@ # MCU name MCU = STM32F072 -BOARD = ST_STM32F072B_DISCOVERY # Build Options # comment out to disable the options. diff --git a/keyboards/candybar/readme.md b/keyboards/candybar/readme.md deleted file mode 100644 index 6e0fa028571..00000000000 --- a/keyboards/candybar/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -The Key Company Candybar -=== - -![Candybar](https://cdn.shopify.com/s/files/1/1679/2319/articles/CandyBar_Promo_400x225_1000x.jpg?v=1538150501) - - -The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. - -Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) -Hardware Supported: TKC Candybar -Hardware Availability: Via GB - - -Make example for this keyboard (after setting up your build environment): - - make candybar:default:dfu-util - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/candybar/righty/config.h b/keyboards/candybar/righty/config.h new file mode 100644 index 00000000000..c1539671301 --- /dev/null +++ b/keyboards/candybar/righty/config.h @@ -0,0 +1,115 @@ +/* Copyright 2018 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 . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0006 +#define MANUFACTURER The Key Company +#define PRODUCT Candybar +#define DESCRIPTION A compact staggered 40% keyboard with attached numpad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 17 +#define DIODE_DIRECTION COL2ROW +#define MATRIX_ROW_PINS { A8, A9, A10, A13 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B10, B11, B12, B13, B14, B15 } + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// #define WS2812_LED_N 2 +// #define RGBLED_NUM WS2812_LED_N +// #define WS2812_TIM_N 2 +// #define WS2812_TIM_CH 2 +// #define PORT_WS2812 GPIOA +// #define PIN_WS2812 1 +// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP diff --git a/keyboards/candybar/righty/info.json b/keyboards/candybar/righty/info.json new file mode 100644 index 00000000000..81dc4f8ec56 --- /dev/null +++ b/keyboards/candybar/righty/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "TKC Candybar", + "url": "", + "maintainer": "terrymathews", + "width": 17, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2}, + {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}] + } + } +} diff --git a/keyboards/candybar/keymaps/default/keymap.c b/keyboards/candybar/righty/keymaps/default/keymap.c similarity index 100% rename from keyboards/candybar/keymaps/default/keymap.c rename to keyboards/candybar/righty/keymaps/default/keymap.c diff --git a/keyboards/candybar/righty/readme.md b/keyboards/candybar/righty/readme.md new file mode 100644 index 00000000000..d3aa867303b --- /dev/null +++ b/keyboards/candybar/righty/readme.md @@ -0,0 +1,15 @@ +# The Key Company Candybar + +![Candybar](https://cdn.shopify.com/s/files/1/1679/2319/articles/CandyBar_Promo_400x225_1000x.jpg?v=1538150501) + +The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller. + +* Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/) +* Hardware Supported: TKC Candybar +* Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar) + +Make example for this keyboard (after setting up your build environment): + + make candybar/righty:default:dfu-util + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/candybar/righty/righty.c b/keyboards/candybar/righty/righty.c new file mode 100644 index 00000000000..c3b61157471 --- /dev/null +++ b/keyboards/candybar/righty/righty.c @@ -0,0 +1,17 @@ +/* Copyright 2018 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 . + */ + +#include "righty.h" diff --git a/keyboards/candybar/righty/righty.h b/keyboards/candybar/righty/righty.h new file mode 100644 index 00000000000..67e02388390 --- /dev/null +++ b/keyboards/candybar/righty/righty.h @@ -0,0 +1,30 @@ +/* Copyright 2018 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 . + */ + +#pragma once +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \ + k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \ +) { \ + { k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \ + { k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \ + { k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \ + { k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \ +} diff --git a/keyboards/candybar/righty/rules.mk b/keyboards/candybar/righty/rules.mk new file mode 100644 index 00000000000..cb1b832886a --- /dev/null +++ b/keyboards/candybar/righty/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = STM32F072 + +# Build Options +# comment out to disable the options. +# +# EXTRAFLAGS+=-flto +LINK_TIME_OPTIMIZATION_ENABLE = yes +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +SERIAL_LINK_ENABLE = no + + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/coseyfannitutti/discipad/config.h b/keyboards/coseyfannitutti/discipad/config.h index 7fe09158243..55033bd9d06 100644 --- a/keyboards/coseyfannitutti/discipad/config.h +++ b/keyboards/coseyfannitutti/discipad/config.h @@ -49,7 +49,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* diff --git a/keyboards/coseyfannitutti/discipline/config.h b/keyboards/coseyfannitutti/discipline/config.h index 46dd49c51f6..0a005ab0ddc 100644 --- a/keyboards/coseyfannitutti/discipline/config.h +++ b/keyboards/coseyfannitutti/discipline/config.h @@ -47,7 +47,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* diff --git a/keyboards/coseyfannitutti/mysterium/config.h b/keyboards/coseyfannitutti/mysterium/config.h index 6357926483f..1d0094b8b88 100644 --- a/keyboards/coseyfannitutti/mysterium/config.h +++ b/keyboards/coseyfannitutti/mysterium/config.h @@ -47,8 +47,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 - /* * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. */ diff --git a/keyboards/crkbd/keymaps/rpbaptist/config.h b/keyboards/crkbd/keymaps/rpbaptist/config.h index da47524a89e..6bd16725f54 100644 --- a/keyboards/crkbd/keymaps/rpbaptist/config.h +++ b/keyboards/crkbd/keymaps/rpbaptist/config.h @@ -25,88 +25,115 @@ along with this program. If not, see . /* Select hand configuration */ #define EE_HANDS -#undef SSD1306OLED - -#define USE_SERIAL_PD2 - -#define FORCE_NKRO - -#define QMK_ESC_OUTPUT F4 // usually COL -#define QMK_ESC_INPUT D4 // usually ROW -#define QMK_LED B0 - -#ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 - - #define RGB_MATRIX_HUE_STEP 10 - #define RGB_MATRIX_SAT_STEP 15 - #define RGB_MATRIX_VAL_STEP 16 - #define RGB_MATRIX_SPD_STEP 10 - - #define DISABLE_RGB_MATRIX_ALPHAS_MODS - #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN - #define DISABLE_RGB_MATRIX_BREATHING - #define DISABLE_RGB_MATRIX_BAND_SAT - #define DISABLE_RGB_MATRIX_BAND_VAL - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL - #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT - #define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL - // #define DISABLE_RGB_MATRIX_CYCLE_ALL - #define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT - #define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN - #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN - #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL - #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON - #define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL - #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL - // #define DISABLE_RGB_MATRIX_DUAL_BEACON - #define DISABLE_RGB_MATRIX_RAINBOW_BEACON - #define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS - #define DISABLE_RGB_MATRIX_RAINDROPS - #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS - - #define RGB_MATRIX_FRAMEBUFFER_EFFECTS - // #define DISABLE_RGB_MATRIX_TYPING_HEATMAP - #define DISABLE_RGB_MATRIX_DIGITAL_RAIN - - #define RGB_MATRIX_KEYPRESSES // reacts to keypresses - - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS - // #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS - - // #define DISABLE_RGB_MATRIX_SPLASH - #define DISABLE_RGB_MATRIX_MULTISPLASH - #define DISABLE_RGB_MATRIX_SOLID_SPLASH - #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH - - #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_TYPING_HEATMAP +#ifdef OLED_DRIVER_ENABLE +# undef SSD1306OLED +# define OLED_TIMEOUT 600000 #endif -#define TAPPING_TERM 150 -// #define PERMISSIVE_HOLD +#undef USE_I2C +#define USE_SERIAL_PD2 + +// #define FORCE_NKRO + +#define QMK_ESC_OUTPUT F4 // usually COL +#define QMK_ESC_INPUT D4 // usually ROW +#define QMK_LED B0 + +#define NO_ACTION_ONESHOT + +#ifdef RGB_MATRIX_ENABLE +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 + +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 12 +# define RGB_MATRIX_VAL_STEP 10 +# define RGB_MATRIX_SPD_STEP 10 + +# define DISABLE_RGB_MATRIX_ALPHAS_MODS +# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define DISABLE_RGB_MATRIX_BREATHING +# define DISABLE_RGB_MATRIX_BAND_SAT +# define DISABLE_RGB_MATRIX_BAND_VAL +# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL + +// #define DISABLE_RGB_MATRIX_CYCLE_ALL +// # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define DISABLE_RGB_MATRIX_CYCLE_SPIRAL +# define DISABLE_RGB_MATRIX_DUAL_BEACON +# define DISABLE_RGB_MATRIX_RAINBOW_BEACON +// #define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define DISABLE_RGB_MATRIX_RAINDROPS +# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS + +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP +# define DISABLE_RGB_MATRIX_DIGITAL_RAIN + +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses + +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + +# define DISABLE_RGB_MATRIX_SPLASH +# define DISABLE_RGB_MATRIX_MULTISPLASH +# define DISABLE_RGB_MATRIX_SOLID_SPLASH +# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +# define RGB_MATRIX_ANIMATION_SPEED_DEFAULT UINT8_MAX / 2 +# define RGB_MATRIX_ANIMATION_SPEED_SLOW RGB_MATRIX_ANIMATION_SPEED_DEFAULT / 4 +# define RGB_MATRIX_ANIMATION_SPEED_SLOWER RGB_MATRIX_ANIMATION_SPEED_SLOW / 3 +#endif + +#define TAPPING_TERM 140 +#define PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT -// #define RETRO_TAPPING #define TAPPING_TOGGLE 2 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_MAX_SPEED 6 -#define MOUSEKEY_TIME_TO_MAX 32 -#define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 +#ifdef MOUSEKEY_ENABLE +# define MOUSEKEY_DELAY 0 +# define MOUSEKEY_INTERVAL 16 +# define MOUSEKEY_MAX_SPEED 6 +# define MOUSEKEY_TIME_TO_MAX 36 +# define MOUSEKEY_WHEEL_MAX_SPEED 4 +# define MOUSEKEY_WHEEL_TIME_TO_MAX 100 +#endif -#define OLED_FONT_H "keyboards/crkbd/keymaps/rpbaptist/glcdfont.c" +#ifdef THEME_GODSPEED +# define OLED_FONT_H "keyboards/crkbd/keymaps/rpbaptist/glcdfont_godspeed.c" +# define THEME_HSV 132, 255, 125 +#endif + +#ifdef THEME_PULSE +# define OLED_FONT_H "keyboards/crkbd/keymaps/rpbaptist/glcdfont_pulse.c" +# define THEME_HSV 123, 255, 125 +#endif + +#ifdef THEME_LASER +# define OLED_FONT_H "keyboards/crkbd/keymaps/rpbaptist/glcdfont_laser.c" +# define THEME_HSV HSV_MAGENTA +#endif #define NO_ACTION_ONESHOT #undef PRODUCT #define PRODUCT Corne Keyboard + +#define LCPC_KEYS KC_LCTL, KC_LSFT, KC_9 +#define RCPC_KEYS KC_RCTL, KC_RSFT, KC_0 diff --git a/keyboards/crkbd/keymaps/rpbaptist/glcdfont_godspeed.c b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_godspeed.c new file mode 100644 index 00000000000..ac1f11dbbe2 --- /dev/null +++ b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_godspeed.c @@ -0,0 +1,231 @@ +#include "progmem.h" + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, +0x38, 0x1C, 0x0C, 0x06, 0x03, 0x03, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x03, 0x03, 0x82, 0x86, 0xCC, 0xF8, +0xF0, 0xF0, 0x38, 0x1C, 0x0C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, +0xF8, 0x0C, 0x04, 0xC6, 0xA2, 0xB3, +0x9F, 0x87, 0x01, 0x01, 0x1F, 0x66, +0x66, 0x44, 0x4C, 0x58, 0x70, 0xE0, +0x80, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, +0xE0, 0x78, 0x18, 0x8C, 0xC6, 0xE6, +0xE3, 0xE3, 0xC3, 0x83, 0x03, 0x03, +0x73, 0x76, 0x76, 0x0C, 0x18, 0xF8, +0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0xC0, 0x40, 0x7F, 0xF3, +0x60, 0x20, 0x30, 0x30, 0x38, 0x18, +0x9C, 0xCC, 0x6C, 0x6E, 0x3E, 0x3E, +0x1F, 0x0F, 0x0F, 0x03, 0x03, 0x01, +0xC0, 0xFF, 0x3E, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x7F, 0xC1, 0x00, +0x1D, 0x67, 0xC0, 0x80, 0x01, 0x00, +0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, +0x0C, 0x1A, 0x32, 0xC2, 0x01, 0xC1, +0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7E, 0xFF, +0x80, 0x00, 0x00, 0xC3, 0xC7, 0xC7, +0x8F, 0x0F, 0x07, 0x03, 0x80, 0xC0, +0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x07, +0x0F, 0xFF, 0x7F, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x40, 0x60, 0x31, +0x3B, 0x1E, 0x0C, 0x1E, 0x36, 0x23, +0x61, 0x60, 0x60, 0x60, 0x60, 0x60, +0x60, 0x30, 0x1C, 0x3E, 0x3E, 0x3F, +0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x07, +0x0C, 0x18, 0x10, 0x33, 0x3E, 0x38, +0x6E, 0x67, 0x60, 0x60, 0x60, 0x20, +0x30, 0x18, 0x08, 0x0F, 0x06, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x03, 0x06, 0x0C, 0x19, 0x31, 0x21, +0x60, 0x60, 0x60, 0x60, 0x61, 0x63, +0x67, 0x67, 0x33, 0x39, 0x18, 0x0E, +0x07, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/rpbaptist/glcdfont_laser.c b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_laser.c new file mode 100644 index 00000000000..612b7123b09 --- /dev/null +++ b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_laser.c @@ -0,0 +1,231 @@ +#include "progmem.h" + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +0xE0, 0xF8, 0x3E, 0x0F, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xF0, 0xF8, 0xFC, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xE0, 0xF0, 0x7C, +0x3F, 0x0F, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x1B, 0x1F, 0x1F, 0x07, +0x03, 0xC0, 0xE0, 0xFC, 0x1C, 0x0F, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0xE7, 0xFF, 0xFF, 0x0F, 0x03, 0x03, +0x03, 0x03, 0x83, 0x83, 0xE3, 0xE7, +0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x80, 0xC0, 0xF0, 0x7C, 0x1F, 0x07, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +0x80, 0x90, 0x98, 0x9C, 0x8C, 0x80, +0x80, 0x80, 0x9C, 0x9C, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x10, +0x10, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x1C, 0x9C, 0x9C, 0x1C, 0x1C, +0x0C, 0x0C, 0x80, 0x90, 0x90, 0x10, +0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x0C, +0x00, 0x00, 0x90, 0x90, 0x9C, 0x9C, +0x1C, 0x1C, 0x1C, 0x1C, 0x9C, 0x9C, +0x9C, 0x0C, 0x0C, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x70, 0x7C, 0x7E, +0x6F, 0x63, 0x60, 0x60, 0x60, 0x60, +0x60, 0x60, 0x60, 0x60, 0x60, 0x60, +0x60, 0x70, 0x78, 0x3C, 0x1E, 0x0F, +0x07, 0x03, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x7F, 0x7F, 0x00, 0x00, +0x60, 0x70, 0x7C, 0x7C, 0x6C, 0x60, +0x60, 0x60, 0x60, 0x60, 0x60, 0x78, +0x3E, 0x0F, 0x03, 0x01, 0x00, 0x60, +0x78, 0x7E, 0x67, 0x61, 0x60, 0x60, +0x60, 0x60, 0x60, 0x60, 0x60, 0x60, +0x70, 0x00, 0x00, 0x00, 0x00, 0x60, +0x78, 0x7E, 0x0F, 0x07, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, +0x7F, 0x70, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/rpbaptist/glcdfont_pulse.c b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_pulse.c new file mode 100644 index 00000000000..3699f4500b7 --- /dev/null +++ b/keyboards/crkbd/keymaps/rpbaptist/glcdfont_pulse.c @@ -0,0 +1,231 @@ +#include "progmem.h" + +// Helidox 8x6 font with QMK Firmware Logo +// Online editor: http://teripom.x0.com/ + +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xF0, 0xF8, 0xF8, 0xF0, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xF0, 0xFE, 0x7F, 0x7F, 0xFE, 0xF0, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1F, 0x0F, 0x03, 0x03, 0x1F, + 0xFF, 0xFC, 0xE0, 0xE0, 0xFC, 0xFF, + 0x1F, 0x03, 0x00, 0x00, 0x03, 0x1F, + 0xFF, 0xFC, 0xE0, 0xE0, 0xF8, 0xFC, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, + 0x1F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x0F, 0x0F, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x0F, 0x0F, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/rpbaptist/keymap.c b/keyboards/crkbd/keymaps/rpbaptist/keymap.c index 932641a9f88..0296749d097 100644 --- a/keyboards/crkbd/keymaps/rpbaptist/keymap.c +++ b/keyboards/crkbd/keymaps/rpbaptist/keymap.c @@ -1,46 +1,84 @@ #include QMK_KEYBOARD_H -extern uint8_t is_master; +extern uint8_t is_master; +static uint32_t oled_timer = 0; + +#ifdef RGB_MATRIX_ENABLE + static uint32_t hypno_timer; +#endif enum layer_names { _COLEMAKDHM, _GAMING, _GAMING_EXT, - _NUM, - _FN, + _NUMPAD, + _SYM, _NAV, _UTIL }; +enum custom_keycodes { + BSP_DEL = SAFE_RANGE, + RGB_RST, // Reset RGB + RGB_UND, // Toggle RGB underglow as layer indicator + RGB_IDL, // RGB Idling animations + RGB_MAP, // RGB_MATRIX_TYPING_HEATMAP + RGB_NXS, // RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + RGB_SOL, // RGB_MATRIX_SOLID_COLOR + RGB_CYC, // RGB_MATRIX_CYCLE_ALL + RGB_DUO, // RGB_MATRIX_RAINBOW_PINWHEELS + RGB_SCR // RGB_MATRIX_CYCLE_LEFT_RIGHT +}; + +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change : 1; + bool rgb_matrix_idle_anim : 1; + uint8_t rgb_matrix_active_mode : 4; + uint8_t rgb_matrix_idle_mode : 4; + uint8_t rgb_matrix_active_speed : 8; + uint8_t rgb_matrix_idle_speed : 8; + uint16_t rgb_matrix_idle_timeout : 16; + }; +} user_config_t; + +user_config_t user_config; + // Base layers #define COLEMAK DF(_COLEMAKDHM) -#define GAMING DF(_GAMING) +#define GAMING DF(_GAMING) // Layer toggle and switch #define T_NAV TT(_NAV) #define S_NAV MO(_NAV) -#define T_NUM TT(_NUM) -#define S_NUM MO(_NUM) +#define T_SYM TT(_SYM) +#define S_SYM MO(_SYM) // Layer keys with functionality on tap -#define FN_TAB LT(_FN, KC_TAB) #define NAV_0 LT(_NAV, KC_0) +#define TAB_NUM LT(_NUMPAD, KC_TAB) + #define EXT_SF LT(_GAMING_EXT, KC_LSHIFT) // Tap/mod keys -#define RCTBR RCTL_T(KC_RBRACKET) -#define LCTBR LCTL_T(KC_LBRACKET) +#define RCTL_BR RCTL_T(KC_RBRACKET) +#define LCTL_BR LCTL_T(KC_LBRACKET) -#define SFSPC LSFT_T(KC_SPACE) -#define SFENT LSFT_T(KC_ENTER) +#define SFT_SPC LSFT_T(KC_SPACE) +#define SFT_ENT RSFT_T(KC_ENTER) // Global tab forward and backward -#define TBFWD LCTL(KC_TAB) -#define TBBCK LCTL(LSFT(KC_TAB)) +#define TAB_FWD LCTL(KC_TAB) +#define TAB_BCK LCTL(LSFT(KC_TAB)) +#define TAB_CLS LCTL(KC_W) -// Custom key for NUM layer -#define CTEQL RCTL_T(KC_EQL) +#define WIN_CLS LALT(KC_F4) + +// CTRL become parens keys on NAV and NUM layers +#define LCT_PRN KC_LCPO +#define RCT_PRN KC_RCPC // € #define KC_EUR ALGR(KC_5) @@ -48,19 +86,19 @@ enum layer_names { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_COLEMAKDHM] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,\ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, BSP_DEL,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - FN_TAB, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,\ + TAB_NUM, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - LCTBR, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, RCTBR,\ + LCTL_BR, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, RCTL_BR,\ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - KC_LALT, T_NUM, SFSPC, SFENT, T_NAV, KC_RGUI \ + KC_LALT, T_SYM, SFT_SPC, SFT_ENT, T_NAV, KC_RGUI \ //`--------------------------' `--------------------------' ), [_GAMING] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| @@ -72,59 +110,59 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_GAMING_EXT] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_GRV, KC_1, KC_2, _______, KC_3, KC_4, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_DEL,\ + KC_GRV, KC_1, KC_2, _______, KC_3, KC_4, _______, _______, _______, _______, _______, KC_DEL,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_LBRC, KC_RBRC, _______, _______, _______, KC_BSLS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,\ + KC_LBRC, KC_RBRC, _______, _______, _______, KC_BSLS, _______, _______, _______, _______, _______, _______,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F11, KC_F12, KC_MINS, KC_EQL, _______, _______,\ + KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______,\ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, KC_ENT, _______, _______ \ //`--------------------------' `--------------------------' ), - [_FN] = LAYOUT( \ + [_NUMPAD] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,\ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_EUR, KC_P7, KC_P8, KC_P9, XXXXXXX, _______,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, KC_NLCK, XXXXXXX, KC_MINS, KC_PIPE, KC_BSLS, KC_PLUS, XXXXXXX,\ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PPLS,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, KC_PAUS, KC_SLCK, KC_PSCR, KC_INS, XXXXXXX, KC_UNDS, KC_LT, KC_GT, KC_EQL, _______,\ + KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_EQL, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_PAST,\ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, KC_P0, KC_DOT \ //`--------------------------' `--------------------------' ), - [_NUM] = LAYOUT( \ + [_SYM] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_SLSH, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS,\ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_MINS, KC_PLUS,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, KC_CIRC, KC_AMPR, KC_EUR, KC_LPRN, KC_RPRN, KC_ASTR, KC_1, KC_2, KC_3, KC_UNDS, CTEQL,\ + LCT_PRN, XXXXXXX, XXXXXXX, XXXXXXX, KC_EUR, XXXXXXX, KC_EQL, KC_PIPE, KC_LT, KC_GT, KC_BSLS, RCT_PRN,\ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| - _______, S_NUM, _______, _______, NAV_0, KC_DOT \ + _______, S_SYM, _______, _______, _______, _______ \ //`--------------------------' `--------------------------' ), [_NAV] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - _______, KC_WH_U, TBBCK, KC_MS_U, TBFWD, KC_BTN2, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_DEL,\ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_BSPC,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - KC_TAB, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX,\ + KC_TILD, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, XXXXXXX, KC_WH_L, XXXXXXX, KC_WH_R, XXXXXXX, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, _______,\ - //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------+---------| - _______, _______, _______, _______, S_NAV, _______ \ + LCT_PRN, KC_F11, KC_F12, KC_INS, KC_PSCR, KC_CAPS, WIN_CLS, TAB_BCK, TAB_CLS, TAB_FWD, XXXXXXX, RCT_PRN,\ + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+---------| + _______, _______, _______, _______, S_NAV, _______ \ //`--------------------------' `--------------------------' ), [_UTIL] = LAYOUT( \ //,-----------------------------------------------------. ,-----------------------------------------------------. - RESET, XXXXXXX, KC_MSTP, KC_VOLU, KC_MNXT, XXXXXXX, COLEMAK, GAMING, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + RESET, XXXXXXX, KC_MPRV, KC_VOLU, KC_MNXT, COLEMAK, RGB_IDL, RGB_MAP, RGB_NXS, XXXXXXX, RGB_HUD, RGB_HUI,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, XXXXXXX, KC_MPRV, KC_VOLD, KC_MPLY, XXXXXXX, XXXXXXX, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,\ + RGB_RST, XXXXXXX, KC_MSTP, KC_VOLD, KC_MPLY, GAMING, RGB_UND, RGB_DUO, RGB_SCR, RGB_SPI, RGB_SAD, RGB_SAI,\ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - XXXXXXX, KC_SLEP, XXXXXXX, KC_MUTE, XXXXXXX, XXXXXXX, RGB_TOG,RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD,\ + EEP_RST, KC_SLEP, XXXXXXX, KC_MUTE, XXXXXXX, XXXXXXX, RGB_TOG, RGB_SOL, RGB_CYC, RGB_SPD, RGB_VAD, RGB_VAI,\ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______ \ //`--------------------------' `--------------------------' @@ -132,103 +170,404 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(default_layer_state)) { - case _COLEMAKDHM: - state = update_tri_layer_state(state, _NUM, _NAV, _UTIL); - break; - case _GAMING: - state = update_tri_layer_state(state, _GAMING_EXT, _NAV, _UTIL); - break; - } - return state; + switch (get_highest_layer(default_layer_state)) { + case _COLEMAKDHM: + state = update_tri_layer_state(state, _SYM, _NAV, _UTIL); + break; + case _GAMING: + state = update_tri_layer_state(state, _GAMING_EXT, _NAV, _UTIL); + break; + } + return state; } #ifdef OLED_DRIVER_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_master) { - return OLED_ROTATION_270; - } else { - return OLED_ROTATION_180; - } + if (is_master) { + return OLED_ROTATION_270; + } else { + return OLED_ROTATION_180; + } } void render_crkbd_logo(void) { - static const char PROGMEM crkbd_logo[] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, - 0}; - oled_write_P(crkbd_logo, false); + static const char PROGMEM crkbd_logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + oled_write_P(crkbd_logo, false); } +# ifdef RGB_MATRIX_ENABLE +const char *rgb_matrix_anim_oled_text(uint8_t mode) { + switch (mode) { + case RGB_MATRIX_TYPING_HEATMAP: + return PSTR("Heat "); + case RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS: + return PSTR("Nexus"); + case RGB_MATRIX_SOLID_COLOR: + return PSTR("Solid"); + case RGB_MATRIX_CYCLE_ALL: + return PSTR("Cycle"); + case RGB_MATRIX_RAINBOW_PINWHEELS: + return PSTR("Wheel"); + case RGB_MATRIX_CYCLE_LEFT_RIGHT: + return PSTR("Wave "); + default: + return PSTR(""); + } +} +# endif + void render_status(void) { - // oled_write_P(PSTR("Layout: "), false); - switch (get_highest_layer(default_layer_state)) { - case _COLEMAKDHM: - oled_write_P(PSTR("CLMK "), false); - break; - case _GAMING: - oled_write_P(PSTR("GAME "), false); - break; - } + // oled_write_P(PSTR("Layout: "), false); + switch (get_highest_layer(default_layer_state)) { + case _COLEMAKDHM: + oled_write_P(PSTR("TYPE "), false); + break; + case _GAMING: + oled_write_P(PSTR("GAME "), false); + break; + } - oled_write_P(PSTR("\n"), false); + oled_write_P(PSTR("\n"), false); - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_P(PSTR(" "), false); - break; - case _NUM: - oled_write_P(PSTR("Comm "), false); - break; - case _FN: - oled_write_P(PSTR("Stage"), false); - break; - case _NAV: - oled_write_P(PSTR("Fuel "), false); - break; - case _GAMING_EXT: - oled_write_P(PSTR("Ext "), false); - break; - case _UTIL: - oled_write_P(PSTR("Util "), false); - break; - default: - oled_write_P(PSTR("Unkn "), false); - break; - } - oled_write_P(PSTR("\n"), false); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR(" "), false); + break; + case _SYM: + oled_write_P(PSTR("Sym "), false); + break; + case _NAV: + oled_write_P(PSTR("Nav "), false); + break; + case _GAMING_EXT: + oled_write_P(PSTR("Ext "), false); + break; + case _NUMPAD: + oled_write_P(PSTR("Num "), false); + break; + case _UTIL: + oled_write_P(PSTR("Util "), false); + break; + default: + oled_write_P(PSTR("Unkn "), false); + break; + } + oled_write_P(PSTR("\n"), false); - uint8_t modifiers = get_mods(); + uint8_t modifiers = get_mods(); - oled_write_P( (modifiers & MOD_MASK_CTRL) ? PSTR("PROG ") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_SHIFT) ? PSTR("PULSE") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_ALT) ? PSTR("STBY ") : PSTR(" "), false); - oled_write_P( (modifiers & MOD_MASK_GUI) ? PSTR("GYRO ") : PSTR(" "), false); + oled_write_P((modifiers & MOD_MASK_SHIFT) ? PSTR("SHIFT") : PSTR("\n"), false); + oled_write_P((modifiers & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("\n"), false); + oled_write_P((modifiers & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("\n"), false); + oled_write_P((modifiers & MOD_MASK_GUI) ? PSTR("SUPER") : PSTR("\n"), false); - oled_write_P(PSTR("\n"), false); + oled_write_P(PSTR("\n"), false); - uint8_t led_usb_state = host_keyboard_leds(); - oled_write_P(PSTR("Mode:\n"), false); - oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false); - oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false); - oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false); + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(PSTR("Mode:"), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR("\n"), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR("\n"), false); + +# ifdef RGB_MATRIX_ENABLE + oled_write_P(PSTR("\n"), false); + oled_write_P(PSTR("\n"), false); + + if (rgb_matrix_config.enable) { + if (user_config.rgb_matrix_idle_anim) { + oled_write_P(rgb_matrix_anim_oled_text(user_config.rgb_matrix_active_mode), false); + oled_write_P(rgb_matrix_anim_oled_text(user_config.rgb_matrix_idle_mode), false); + } else { + oled_write_P(PSTR("\n"), false); + oled_write_P(rgb_matrix_anim_oled_text(rgb_matrix_get_mode()), false); + } + } else { + oled_write_P(PSTR("\n"), false); + oled_write_P(PSTR("\n"), false); + } +# endif } void oled_task_user(void) { - if (is_master) { - render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) - } else { - render_crkbd_logo(); - // oled_scroll_left(); // Turns on scrolling - } + if (timer_elapsed32(oled_timer) > OLED_TIMEOUT) { + oled_off(); + return; + } else { + oled_on(); + } + + if (is_master) { + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_crkbd_logo(); + #ifdef RGB_MATRIX_ENABLE + if (user_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == user_config.rgb_matrix_idle_mode) { + oled_scroll_left(); // Turns on scrolling + } else { + oled_scroll_off(); + } + #endif + } +} +#endif + +#ifdef RGB_MATRIX_ENABLE + +extern led_config_t g_led_config; +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t led_type) { + HSV hsv = {hue, sat, val}; + if (hsv.v > rgb_matrix_config.hsv.v) { + hsv.v = rgb_matrix_config.hsv.v; + } + + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } +} + +void check_default_layer(uint8_t type) { + switch (get_highest_layer(default_layer_state)) { + case _COLEMAKDHM: + rgb_matrix_layer_helper(THEME_HSV, type); + break; + case _GAMING: + rgb_matrix_layer_helper(HSV_RED, type); + break; + } +} + +void rgb_matrix_indicators_user(void) { + if ( + user_config.rgb_layer_change && !g_suspend_state && rgb_matrix_config.enable && + (!user_config.rgb_matrix_idle_anim || rgb_matrix_get_mode() != user_config.rgb_matrix_idle_mode) + ) + { + switch (get_highest_layer(layer_state)) { + case _GAMING_EXT: + rgb_matrix_layer_helper(HSV_PURPLE, LED_FLAG_UNDERGLOW); + break; + case _SYM: + rgb_matrix_layer_helper(HSV_GOLDENROD, LED_FLAG_UNDERGLOW); + break; + case _NAV: + rgb_matrix_layer_helper(HSV_SPRINGGREEN, LED_FLAG_UNDERGLOW); + break; + case _UTIL: + rgb_matrix_layer_helper(HSV_PINK, LED_FLAG_UNDERGLOW); + break; + case _NUMPAD: + rgb_matrix_layer_helper(HSV_CORAL, LED_FLAG_UNDERGLOW); + break; + default: { + check_default_layer(LED_FLAG_UNDERGLOW); + break; + } + } + } +} + +void rgb_matrix_update_current_mode(uint8_t mode, uint8_t speed) { + rgb_matrix_config.speed = speed; + rgb_matrix_mode_noeeprom(mode); + eeconfig_update_user(user_config.raw); +} + +void rgb_matrix_update_dynamic_mode(uint8_t mode, uint8_t speed, bool active) { + if (active) { + user_config.rgb_matrix_active_speed = speed; + user_config.rgb_matrix_active_mode = mode; + } else { + user_config.rgb_matrix_idle_speed = speed; + user_config.rgb_matrix_idle_mode = mode; + } +} + +void rgb_matrix_update_mode(uint8_t mode, uint8_t speed, bool active) { + if (user_config.rgb_matrix_idle_anim) { + rgb_matrix_update_dynamic_mode(mode, speed, active); + } + if (active || !user_config.rgb_matrix_idle_anim) { + rgb_matrix_update_current_mode(mode, speed); + } +} + +void rgb_matrix_set_defaults(void) { + rgb_matrix_config.enable = 1; + rgb_matrix_sethsv_noeeprom(THEME_HSV); + + user_config.rgb_layer_change = false; + user_config.rgb_matrix_idle_anim = true; + user_config.rgb_matrix_idle_timeout = 60000; + + rgb_matrix_update_dynamic_mode(RGB_MATRIX_CYCLE_ALL, RGB_MATRIX_ANIMATION_SPEED_SLOWER, false); + rgb_matrix_update_dynamic_mode(RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS, RGB_MATRIX_ANIMATION_SPEED_DEFAULT, true); + + eeprom_update_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); +} + +void matrix_scan_rgb(void) { + if (user_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == user_config.rgb_matrix_active_mode && timer_elapsed32(hypno_timer) > user_config.rgb_matrix_idle_timeout) { + if (user_config.rgb_layer_change) { + rgb_matrix_layer_helper(0, 0, 0, LED_FLAG_UNDERGLOW); + } + rgb_matrix_update_current_mode(user_config.rgb_matrix_idle_mode, user_config.rgb_matrix_idle_speed); + } +} + +void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } + matrix_scan_rgb(); +} + +void eeconfig_init_user(void) { + user_config.raw = 0; + rgb_matrix_mode_noeeprom(user_config.rgb_matrix_active_mode); + keyboard_init(); +} + +void keyboard_post_init_user(void) { + user_config.raw = eeconfig_read_user(); + rgb_matrix_set_defaults(); + rgb_matrix_enable_noeeprom(); } #endif void suspend_power_down_keymap(void) { + oled_off(); rgb_matrix_set_suspend_state(true); } void suspend_wakeup_init_keymap(void) { + oled_on(); rgb_matrix_set_suspend_state(false); } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint8_t saved_mods = 0; + uint16_t temp_keycode = keycode; + + oled_timer = timer_read32(); + +#ifdef RGB_MATRIX_ENABLE + if (user_config.rgb_matrix_idle_anim) { + hypno_timer = timer_read32(); + if (rgb_matrix_get_mode() == user_config.rgb_matrix_idle_mode) { + rgb_matrix_update_current_mode(user_config.rgb_matrix_active_mode, user_config.rgb_matrix_active_speed); + if (!user_config.rgb_layer_change) { + rgb_matrix_layer_helper(0, 0, 0, LED_FLAG_UNDERGLOW); + } + } + } +#endif + + // Filter out the actual keycode from MT and LT keys. + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + temp_keycode &= 0xFF; + } + + switch (temp_keycode) { + case BSP_DEL: + if (record->event.pressed) { + saved_mods = get_mods() & MOD_MASK_SHIFT; + + if (saved_mods == MOD_MASK_SHIFT) { // Both shifts pressed + register_code(KC_DEL); + } else if (saved_mods) { // One shift pressed + del_mods(saved_mods); // Remove any Shifts present + register_code(KC_DEL); + add_mods(saved_mods); // Add shifts again + } else { + register_code(KC_BSPC); + } + } else { + unregister_code(KC_DEL); + unregister_code(KC_BSPC); + } + return false; +#ifdef RGB_MATRIX_ENABLE + case COLEMAK: + if (record->event.pressed) { + user_config.rgb_matrix_idle_timeout = 60000; + rgb_matrix_update_mode(RGB_MATRIX_CYCLE_ALL, RGB_MATRIX_ANIMATION_SPEED_SLOWER, false); + } + return true; + case GAMING: + if (record->event.pressed) { + if (!user_config.rgb_layer_change) { + user_config.rgb_layer_change = true; + } + user_config.rgb_matrix_idle_timeout = 10000; + rgb_matrix_update_mode(RGB_MATRIX_RAINBOW_PINWHEELS, RGB_MATRIX_ANIMATION_SPEED_SLOW, false); + } + return true; + case RGB_RST: + if (record->event.pressed) { + rgb_matrix_set_defaults(); + rgb_matrix_enable(); + } + break; + case RGB_UND: // Toggle separate underglow status + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; + eeconfig_update_user(user_config.raw); + if (user_config.rgb_layer_change) { + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) + } else { + rgb_matrix_layer_helper(0, 0, 0, LED_FLAG_UNDERGLOW); + } + } + break; + case RGB_IDL: // Toggle idle/heatmap animation + if (record->event.pressed) { + user_config.rgb_matrix_idle_anim ^= 1; + if (user_config.rgb_matrix_idle_anim) { + rgb_matrix_update_mode(user_config.rgb_matrix_active_mode, user_config.rgb_matrix_active_speed, true); + } else { + rgb_matrix_update_current_mode(user_config.rgb_matrix_idle_mode, user_config.rgb_matrix_idle_speed); + } + } + break; + case RGB_MAP: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_TYPING_HEATMAP, rgb_matrix_config.speed, true); + } + break; + case RGB_NXS: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS, RGB_MATRIX_ANIMATION_SPEED_DEFAULT, true); + } + break; + case RGB_SOL: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_SOLID_COLOR, rgb_matrix_config.speed, false); + } + break; + case RGB_CYC: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_CYCLE_ALL, RGB_MATRIX_ANIMATION_SPEED_SLOWER, false); + } + break; + case RGB_DUO: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_RAINBOW_PINWHEELS, RGB_MATRIX_ANIMATION_SPEED_SLOW, false); + } + break; + case RGB_SCR: + if (record->event.pressed) { + rgb_matrix_update_mode(RGB_MATRIX_CYCLE_LEFT_RIGHT, RGB_MATRIX_ANIMATION_SPEED_SLOW, false); + } + break; +#endif + } + return true; +} diff --git a/keyboards/crkbd/keymaps/rpbaptist/readme.md b/keyboards/crkbd/keymaps/rpbaptist/readme.md index cb53e75f2de..b9e749b5c67 100644 --- a/keyboards/crkbd/keymaps/rpbaptist/readme.md +++ b/keyboards/crkbd/keymaps/rpbaptist/readme.md @@ -10,27 +10,29 @@ Many thanks to foostan for the keyboard, all QMK contributors and drashna specif ### COLEMAKDHM -Main typing layer. I really love having SHIFT available on thumbs. I am a left thumb space bar person, so I put SPACE there and ENTER on right. I use CTRL key combos lot in my text editor and desktop environment. That's why I have two of them. I also found them to be a great position for the square brackets. (`[` and `]`) +Main typing layer. I really love having SHIFT available on thumbs. I am a left thumb space bar person, so I put SPACE there and ENTER on right. I use CTRL key combos lot in my text editor and desktop environment. That's why I have two of them. I also found them to be a great position for the square brackets. (`[` and `]`). These become parenthesis (`(` and `)`) on either of the layers. -I don't know about you but "lower" and "raise" don't mean that much to me. I named my layers `NUM`, short for numbers and `NAV`, short for navigation. Holding the key will activate the layer for as long as it is held, double tapping it will switch to it. Single tapping it once will switch to main layer again. +Holding SHIFT while tapping BACKSPACE will output DEL. Holding both SHIFT keys will output SHIFT+DEL. -Everything else is pretty standard I'd say. +I don't know about you but "lower" and "raise" don't mean that much to me. I named my layers `SYM`, short for symbols and `NAV`, short for navigation. Holding the key will activate the layer for as long as it is held, double tapping it will switch to it. Single tapping it once will switch to main layer again. -### NUM +Holding TAB will access `NUM` layer which features a numpad. + +### SYM Includes a number row, the symbols normally on SHIFT and numbers, as well as a numpad under right side homing keys. ### NAV -This is where I access arrow keys, page up, down, home, end and mouse control. I also added general tab forward and backward keys. I use these in my browser, terminal and text editor. - -## FN - -Short for function. This gives access to the function keys, as well as rarely used keys on the left side and often used symbols (for me) on the right side. It is accessed by holding TAB. +This is where I access arrow keys, page up, down, home, end and F keys. I also added general tab forward and backward keys. Tab close and window close. I primarily use these in my browser, terminal and text editor. ### UTIL -Short for utility. This is accessed by pressing both `NUM` and `NAV` at the same time. It has a software `RESET` key, media keys, RGB control and switches main layer between Colemak and a gaming layer. +Short for utility. This is accessed by pressing both `SYM` and `NAV` at the same time. It has a software `RESET` key, media keys, RGB control and switches main layer between Colemak and a gaming layer. + +### NUMPAD + +This gives access to a numpad on the right half with some additional symbols I find useful when using the numpad. ### GAMING @@ -38,20 +40,33 @@ Sometimes I switch to type in Discord, Steam, or in game chat, so I think it's m I put movement on FRST (would be ESDF on QWERTY), because it lines up more comfortably with the columnar staggered layout of the Corne. It also gives more easy access to all keys on left half. -Most notable here is that there are no tap and hold differences anymore on left hand side besides the new layer key. This is a different layer than `NUM`. +Most notable here is that there are no tap and hold differences anymore on left hand side besides the new layer key. This is a different layer than `SYM`. ### GAMING_EXT -This is the gaming extended layer where movement keys remain the same. This means I can keep moving while accessing second layer keys. All other keys are keys on which I can easily rebind something. Besides that it gives me the function keys and an ENTER key which does not change. This is good when a game requires you to hold ENTER. +This is the gaming extended layer where movement keys remain the same. This means I can keep moving while accessing second layer keys. All other keys are keys on which I can easily rebind something. Besides that it gives me an ENTER key which does not switch. This is good when a game requires you to hold ENTER. -## Notes +## RGB -I use MT3 Godspeed caps and thought it would be fun to theme the OLED output towards it. The slave side has the icon and two planets. The left side refers to modifiers by matching the novelty mod legends. +I took a big inspiration from Drashna's RGB configuration and tweaked it. + +- `RGB_UND`: Toggles underglow indicators on and off. Each layer has its own color. +- `RGB_IDL`: This will enable/disable idle mode. By default, when typing, the `DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` will be used. When the idle timeout has exceeded the secondary animation will be activated, which is `RGB_MATRIX_CYCLE_ALL` by default. When switching to `GAMING` layer the timeout will be reduced and the idle animation changed to `RGB_MATRIX_RAINBOW_PINWHEELS`. + When idle mode is enabled, `RGB_MATRIX_TYPING_HEATMAP` and `RGB_MATRIX_MULTISPLASH` will be used for active animation. All others for idle animation. When disabling idle mode, the current idle animation will be activated. Additionally, on idling, the underglow layer indication will be deactivated. +- There are no RGB mode cycle keys, but instead several keys to use a specific RGB directly. Each has their own default speed, although this can be changed. ## Building -I am using DFU and have to flash both halves individually. +`make crkbd/rev1:rpbaptist:dfu` -Left half: `make crkbd/rev1:rpbaptist:dfu-split-left` +## Notes -Right half: `make crkbd/rev1:rpbaptist:dfu-split-right RGB_MATRIX_SPLIT_RIGHT=yes` +I use several OLED slave side images, depending on the keycaps I am using. These also determine the default LED color and underglow. + +`make crkbd/rev1:rpbaptist:dfu THEME=pulse` + +Current supported themes are: + +- godspeed +- laser +- pulse diff --git a/keyboards/crkbd/keymaps/rpbaptist/rules.mk b/keyboards/crkbd/keymaps/rpbaptist/rules.mk index 0eed4f997cc..d9e8b701e28 100644 --- a/keyboards/crkbd/keymaps/rpbaptist/rules.mk +++ b/keyboards/crkbd/keymaps/rpbaptist/rules.mk @@ -1,15 +1,16 @@ -# This enables Link Time Optimization. This can save a good chunk of space (several KB for me), but the macro and function ... functions cause it to error out. +#This enables Link Time Optimization.This can save a good chunk of space(several KB for me), but the macro and function... functions cause it to error out. LINK_TIME_OPTIMIZATION_ENABLE = yes -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically +#Build Options +#change to "no" to disable the options, or define them in the Makefile in +#the appropriate keymap folder that will get included automatically # -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# DYNAMIC_MACRO_ENABLE = yes -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration @@ -22,13 +23,21 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing RGB_MATRIX_ENABLE = WS2812 -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +#Do not enable SLEEP_LED_ENABLE.it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend BOOTLOADER = qmk-dfu OLED_DRIVER_ENABLE = yes -# ifneq ($(strip $(OLED_DRIVER_ENABLE)), yes) -# RGB_MATRIX_SPLIT_RIGHT=yes -# endif +ifeq ($(strip $(THEME)), godspeed) + OPT_DEFS += -DTHEME_GODSPEED +endif + +ifeq ($(strip $(THEME)), pulse) + OPT_DEFS += -DTHEME_PULSE +endif + +ifeq ($(strip $(THEME)), laser) + OPT_DEFS += -DTHEME_LASER +endif diff --git a/keyboards/cu80/rules.mk b/keyboards/cu80/rules.mk index 2ca37a529a4..1ce40aef343 100644 --- a/keyboards/cu80/rules.mk +++ b/keyboards/cu80/rules.mk @@ -14,7 +14,7 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug diff --git a/keyboards/db/db63/config.h b/keyboards/db/db63/config.h index 3183201c1fe..4247840173c 100644 --- a/keyboards/db/db63/config.h +++ b/keyboards/db/db63/config.h @@ -37,7 +37,5 @@ along with this program. If not, see . #define RGBLED_NUM 18 #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/ergodox_ez/keymaps/danielo515/config.h b/keyboards/ergodox_ez/keymaps/danielo515/config.h index 6a3d37f1c61..8982e765361 100644 --- a/keyboards/ergodox_ez/keymaps/danielo515/config.h +++ b/keyboards/ergodox_ez/keymaps/danielo515/config.h @@ -16,10 +16,6 @@ #undef MOUSEKEY_WHEEL_TIME_TO_MAX #define MOUSEKEY_WHEEL_TIME_TO_MAX 60 -// Timeout settings for leader key -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 350 -#define LEADER_PER_KEY_TIMING #undef DEBOUNCE #define DEBOUNCE 45 diff --git a/keyboards/ergodox_ez/keymaps/danielo515/keymap.c b/keyboards/ergodox_ez/keymaps/danielo515/keymap.c index 538eab01634..ee8c3213525 100644 --- a/keyboards/ergodox_ez/keymaps/danielo515/keymap.c +++ b/keyboards/ergodox_ez/keymaps/danielo515/keymap.c @@ -36,9 +36,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { OSM(MOD_LSFT) ,LT(2,KC_BSPACE) ,OSM(MOD_LGUI) , - TO(1) ,KC_6 ,KC_7 ,KC_8 ,TD_F9 ,LT(3,KC_0) ,KC_DQUO , + TO(1) ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,LT(3,KC_0) ,KC_DQUO , KC_UNDS ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,RSFT_T(KC_MINUS) , - HYPR_T(KC_H) ,ALT_T(KC_J) ,RCTL_T(KC_K) ,LT(6,KC_L) ,TD_CLN ,GUI_T(KC_QUOTE) , + HYPR_H ,ALT_J ,CTL_K ,LT(6,KC_L) ,TD_CLN ,CMD_QUOT , ALT_TAB ,KC_N ,MEH_T(KC_M) ,KC_COMMA ,KC_DOT ,KC_SLASH ,LT(4,KC_KP_ASTERISK), LT(4,KC_ENTER) ,KC_DOWN ,KC_LBRACKET ,KC_RBRACKET ,OSL(2) , KC_AUDIO_MUTE ,KC_ESCAPE , @@ -88,14 +88,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_LABK ,KC_RABK ,KC_TRANSPARENT ,KC_TRANSPARENT , KC_TRANSPARENT ,KC_AT ,KC_TRANSPARENT ,KC_EQL ,F_ARROW ,KC_GRAVE , KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_LBRACKET ,KC_RBRACKET ,KC_TRANSPARENT ,KC_TRANSPARENT , - KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT , + KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,IARROW ,ARROW , KC_TRANSPARENT ,KC_TRANSPARENT , KC_TRANSPARENT , // Right hand KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT , KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT , LALT(LSFT(KC_UP)) ,KC_HASH ,KC_LCBR ,KC_RCBR ,KC_KP_ASTERISK ,KC_PERC ,KC_DLR , - KC_AMPR ,KC_LPRN ,KC_RPRN ,KC_CIRC ,KC_KP_PLUS ,KC_PIPE , + KC_AMPR ,KC_LPRN ,KC_RPRN ,CLN_EQ ,KC_KP_PLUS ,KC_PIPE , LALT(LSFT(KC_DOWN)),KC_EXLM ,KC_TILD ,KC_CIRC ,ARROW ,KC_BSLASH ,KC_BSLASH , KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT , RESET ,KC_TRANSPARENT , @@ -316,3 +316,11 @@ void oneshot_mods_changed_user(uint8_t mods) { void oneshot_locked_mods_changed_user(uint8_t mods) { oneshot_mods_changed_user(mods); } + +//=============== alt_tab callbacks +void alt_tab_activated(void){ + layer_on(7); // activate motion layer +} +void alt_tab_deactivated(void){ + layer_off(7); // activate motion layer +} diff --git a/keyboards/exent/config.h b/keyboards/exent/config.h index 48aee2206f3..86d628c37c0 100644 --- a/keyboards/exent/config.h +++ b/keyboards/exent/config.h @@ -44,8 +44,6 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ // #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) diff --git a/keyboards/ft/mars80/config.h b/keyboards/ft/mars80/config.h index 8c1ebe4bafe..70313ada9f0 100644 --- a/keyboards/ft/mars80/config.h +++ b/keyboards/ft/mars80/config.h @@ -43,8 +43,6 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ // #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/gingham/config.h b/keyboards/gingham/config.h index 4c880a8fcd4..45ef573ce09 100644 --- a/keyboards/gingham/config.h +++ b/keyboards/gingham/config.h @@ -50,7 +50,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* diff --git a/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c b/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c new file mode 100644 index 00000000000..4b01c9e09e2 --- /dev/null +++ b/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H +#include "keymap_nordic.h" +enum layers { + _DEFAULT, + _LOWER, + _RAISE, + _FN +}; + +enum custom_keycodes { + PRKL = SAFE_RANGE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FN) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Default + * ,-----------------------------------------------------------------------------------.------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | ¨^ | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------|------| + * | Tab | A | S | D | F | G | H | J | K | L | Ö | Ä | Entr | + * |------+------+------+------+------+------|------+------+------+------+------+------|------' + * | Shift| Z | X | C | V | Space | B | N | M | , | . | + * |------+------+------+------+------+------+------+------+------+------+------+------' + */ +[_DEFAULT] = LAYOUT_2u_space( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_QUOT, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH, LT(_FN, KC_ENT), + KC_LSFT, LGUI_T(KC_Z), KC_X, KC_C, KC_V, LT(_LOWER, KC_SPC), KC_B, KC_N, KC_M, KC_COMM, LT(_RAISE, KC_DOT) +), + +/* Lower - Numbers and some symbols + * ,------------------------------------------------------------------------------------------. + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------|------| + * | | TAB | | | | | | | | | | ' | | + * |------+------+------+------+------+------+------+------+------+------+------+------|------' + * | | | | | | | | | | - | | + * `------+------+------+------+------+------+------+------+------+------+------+------' + */ +[_LOWER] = LAYOUT_2u_space( + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_DEL, + _______, KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_APOS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, _______ +), + +/* Raise - AltGred Characters and more symbols + * ,------------------------------------------------------------------------------------------. + * | ~ | > | @ | £ | $ | % | & | | | [ | ] | ≈ | ? | { | + * |------+------+------+------+------+------+------+------+------+------+------+------|------| + * | | | | UP | | | | | | | | | } | + * |------+------+------+------+------+------+------+------+------+------+------+------|------' + * | | < | LEFT | DOWN | RIGHT| | | | | | | + * `------+------+------+------+------+------+------+------+------+------+------+------' + */ +[_RAISE] = LAYOUT_2u_space( + NO_TILD, NO_SECT, NO_AT, NO_PND, NO_DLR, KC_PERC, NO_AMPR, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_QUES, LSFT(NO_LBRC), + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, LSFT(NO_RBRC), + _______, NO_HALF, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______ +), + + /* FN + * ,------------------------------------------------------------------------------------------. + * |RESET | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------|------| + * | |RGB_P |RGB_HD|RGB_HI| VOL- | PREV | NEXT | VOL+ | | | | PRKL | | + * |------+------+------+------+------+------+------+------+------+------+------+------|------' + * | RGB_M|RGB_VD|RGB_VI|RGB_TG| | PLAY/PAUSE | | | |LCA(DEL)| | + * `------+------+------+------+------+------+------+------+------+------+------+------' + */ +[_FN] = LAYOUT_2u_space( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, RGB_M_P, RGB_HUD, RGB_HUI, KC_VOLD, KC_MPRV, KC_MNXT, KC_VOLU, _______, _______, _______, PRKL, _______, + RGB_MOD, RGB_VAD, RGB_VAI, RGB_TOG, _______, KC_MPLY, _______, _______, _______, LCA(KC_DEL), _______ +), + + +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code16(LCTL(KC_RIGHT)); + } else { + tap_code16(LCTL(KC_LEFT)); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PRKL: + if (record->event.pressed) { + //When PRKL is pressed, print out the holy power word of our people + SEND_STRING("PERKELE"); + } + break; + } + return true; +}; diff --git a/keyboards/handwired/prkl30/keymaps/erkhal/readme.md b/keyboards/handwired/prkl30/keymaps/erkhal/readme.md new file mode 100644 index 00000000000..a49657bcaef --- /dev/null +++ b/keyboards/handwired/prkl30/keymaps/erkhal/readme.md @@ -0,0 +1,16 @@ +# The default keymap for PRKL30 + +Layout geared towards productivity with OSX +----- + +Default layer +![prkl30 default layout image](https://i.imgur.com/tekFaHW.png "default") + +Lower +![prkl30 lower layout image](https://i.imgur.com/5F4CL4g.png "lower") + +Raise +![prkl30 raise layout image](https://i.imgur.com/BpC8T6p.png "raise") + +FN +![prkl30 fn layout image](https://i.imgur.com/gwgIKqj.png "fn") diff --git a/keyboards/helix/local_drivers/i2c.c b/keyboards/helix/local_drivers/i2c.c index 4bee5c63982..9221429e96f 100644 --- a/keyboards/helix/local_drivers/i2c.c +++ b/keyboards/helix/local_drivers/i2c.c @@ -6,8 +6,6 @@ #include #include "i2c.h" -#ifdef USE_I2C - // Limits the amount of we wait for any one i2c transaction. // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is // 9 bits, a single transaction will take around 90μs to complete. @@ -159,4 +157,3 @@ ISR(TWI_vect) { // Reset everything, so we are ready for the next TWI interrupt TWCR |= (1<. #define TAPPING_TERM 100 /* Use I2C or Serial */ -#define USE_I2C #define USE_SERIAL //#define USE_MATRIX_I2C @@ -60,6 +59,9 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/helix/pico/keymaps/default/readme.md b/keyboards/helix/pico/keymaps/default/readme.md index 9013e312878..3c097247e52 100644 --- a/keyboards/helix/pico/keymaps/default/readme.md +++ b/keyboards/helix/pico/keymaps/default/readme.md @@ -120,6 +120,13 @@ $ make HELIX=no_ani helix/pico/back:default # with backlight without animation $ make helix/pico/under:default # with underglow ``` +build (experimental use of split_common) +``` +$ make helix/pico/sc:default +$ make helix/pico/sc/back:default +$ make helix/pico/sc/under:default +``` + flash to keyboard ``` $ make helix/pico:default:flash diff --git a/keyboards/helix/pico/local_features.mk b/keyboards/helix/pico/local_features.mk index 47b928647b2..0277a3d227c 100644 --- a/keyboards/helix/pico/local_features.mk +++ b/keyboards/helix/pico/local_features.mk @@ -10,7 +10,7 @@ define HELIX_CUSTOMISE_MSG $(info - OLED_ENABLE = $(OLED_ENABLE)) $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATION = $(LED_ANIMATIONS)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) $(info ) endef @@ -43,12 +43,34 @@ endef ifeq ($(findstring ios,$(HELIX)), ios) IOS_DEVICE_ENABLE = yes endif + ifeq ($(findstring scan,$(HELIX)), scan) + # use DEBUG_MATRIX_SCAN_RATE + # see docs/newbs_testing_debugging.md + OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE + CONSOLE_ENABLE = yes + SHOW_VERBOSE_INFO = yes + endif ifeq ($(findstring verbose,$(HELIX)), verbose) - SHOW_VERBOSE_INFO = yes + SHOW_VERBOSE_INFO = yes endif SHOW_HELIX_OPTIONS = yes endif +ifneq ($(strip $(SPLIT_KEYBOARD)), yes) + SRC += local_drivers/serial.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers + + # A workaround until #7089 is merged. + # serial.c must not be compiled with the -lto option. + # The current LIB_SRC has a side effect with the -fno-lto option, so use it. + LIB_SRC += local_drivers/serial.c + + CUSTOM_MATRIX = yes + + SRC += pico/matrix.c + SRC += pico/split_util.c +endif + ######## # convert Helix-specific options (that represent combinations of standard options) # into QMK standard options. @@ -73,11 +95,13 @@ ifeq ($(strip $(LED_ANIMATIONS)), yes) endif ifeq ($(strip $(OLED_ENABLE)), yes) + SRC += local_drivers/i2c.c + SRC += local_drivers/ssd1306.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers OPT_DEFS += -DOLED_ENABLE -endif - -ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT + ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT + endif endif ifeq ($(strip $(AUDIO_ENABLE)),yes) @@ -92,8 +116,10 @@ endif ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) $(eval $(call HELIX_CUSTOMISE_MSG)) ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE)) $(info ) endif diff --git a/keyboards/helix/pico/matrix.c b/keyboards/helix/pico/matrix.c index c2940e3b3e6..a537ef03c44 100644 --- a/keyboards/helix/pico/matrix.c +++ b/keyboards/helix/pico/matrix.c @@ -46,7 +46,6 @@ along with this program. If not, see . static uint8_t debouncing = DEBOUNCE; static const int ROWS_PER_HAND = MATRIX_ROWS/2; static uint8_t error_count = 0; -uint8_t is_master = 0 ; static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; @@ -94,9 +93,8 @@ uint8_t matrix_cols(void) void matrix_init(void) { - debug_enable = true; - debug_matrix = true; - debug_mouse = true; + split_keyboard_setup(); + // initialize row and col unselect_rows(); init_cols(); @@ -111,8 +109,6 @@ void matrix_init(void) matrix_debouncing[i] = 0; } - is_master = has_usb(); - matrix_init_quantum(); } @@ -197,7 +193,7 @@ int serial_transaction(void) { uint8_t matrix_scan(void) { - if (is_master) { + if (is_helix_master()) { matrix_master_scan(); }else{ matrix_slave_scan(); diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index bb8ba9ca2b4..12b8ae9efa9 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -1,5 +1,9 @@ #include "helix.h" +// Each keymap.c should use is_keyboard_master() instead of 'is_master'. +// But keep 'is_master' for a while for backwards compatibility +// for the old keymap.c. +uint8_t is_master = false; #ifdef SSD1306OLED #include "ssd1306.h" @@ -15,6 +19,23 @@ void led_set_kb(uint8_t usb_led) { #endif void matrix_init_kb(void) { + // Each keymap.c should use is_keyboard_master() instead of is_master. + // But keep is_master for a while for backwards compatibility + // for the old keymap.c. + is_master = is_keyboard_master(); matrix_init_user(); }; + +void keyboard_post_init_kb(void) { +#if defined(DEBUG_MATRIX_SCAN_RATE) + debug_enable = true; +#endif + keyboard_post_init_user(); +} + +#if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) +void matrix_slave_scan_user(void) { + matrix_scan_user(); +} +#endif diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h index 4360be2a9c1..303fe315ea5 100644 --- a/keyboards/helix/pico/pico.h +++ b/keyboards/helix/pico/pico.h @@ -4,18 +4,16 @@ #include "quantum.h" -#ifdef RGBLIGHT_ENABLE -//rgb led driver -#include "ws2812.h" +#ifndef SPLIT_KEYBOARD + extern bool is_helix_master(void); + #define is_keyboard_master() is_helix_master() #endif -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif +// Each keymap.c should use is_keyboard_master() instead of 'is_master', 'has_usb()'. +// But keep 'is_master' for a while for backwards compatibility +// for the old keymap.c. +extern uint8_t is_master; // 'is_master' will be obsolete, it is recommended to use 'is_keyboard_master ()' instead. +#define has_usb() is_keyboard_master() #ifndef FLIP_HALF // Standard Keymap diff --git a/keyboards/helix/pico/post_config.h b/keyboards/helix/pico/post_config.h new file mode 100644 index 00000000000..dda73d5d22b --- /dev/null +++ b/keyboards/helix/pico/post_config.h @@ -0,0 +1,7 @@ +#pragma once + +#if defined(SPLIT_KEYBOARD) /* if use split_common */ +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_SPLIT) +# define RGBLIGHT_SPLIT /* helix hardware need this */ +# endif +#endif diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index d3ad20ccad8..cb9a70e00e3 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,20 +1,5 @@ KEYBOARD_LOCAL_FEATURES_MK := $(dir $(lastword $(MAKEFILE_LIST)))local_features.mk -SRC += local_drivers/i2c.c -SRC += local_drivers/serial.c -SRC += local_drivers/ssd1306.c -KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - -# A workaround until #7089 is merged. -# serial.c must not be compiled with the -lto option. -# The current LIB_SRC has a side effect with the -fno-lto option, so use it. -LIB_SRC += local_drivers/serial.c - -CUSTOM_MATRIX = yes - -SRC += pico/matrix.c -SRC += pico/split_util.c - # Helix Spacific Build Options default values OLED_ENABLE = no # OLED_ENABLE LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" diff --git a/keyboards/helix/pico/sc/back/rules.mk b/keyboards/helix/pico/sc/back/rules.mk new file mode 100644 index 00000000000..066fffb74af --- /dev/null +++ b/keyboards/helix/pico/sc/back/rules.mk @@ -0,0 +1 @@ +LED_BACK_ENABLE = yes diff --git a/keyboards/helix/pico/sc/rules.mk b/keyboards/helix/pico/sc/rules.mk new file mode 100644 index 00000000000..d38a6180907 --- /dev/null +++ b/keyboards/helix/pico/sc/rules.mk @@ -0,0 +1 @@ +SPLIT_KEYBOARD = yes diff --git a/keyboards/helix/pico/sc/under/rules.mk b/keyboards/helix/pico/sc/under/rules.mk new file mode 100644 index 00000000000..a37aa6fab37 --- /dev/null +++ b/keyboards/helix/pico/sc/under/rules.mk @@ -0,0 +1 @@ +LED_UNDERGLOW_ENABLE = yes diff --git a/keyboards/helix/pico/split_util.c b/keyboards/helix/pico/split_util.c index beb39fa0059..c77e63f33c4 100644 --- a/keyboards/helix/pico/split_util.c +++ b/keyboards/helix/pico/split_util.c @@ -7,6 +7,7 @@ #include "split_util.h" #include "matrix.h" #include "keyboard.h" +#include "wait.h" #ifdef USE_MATRIX_I2C # include "i2c.h" @@ -14,21 +15,65 @@ # include "serial.h" #endif +#ifdef EE_HANDS +# include "eeconfig.h" +#endif + +#ifndef SPLIT_USB_TIMEOUT + #define SPLIT_USB_TIMEOUT 2500 +#endif + volatile bool isLeftHand = true; -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif +bool waitForUsb(void) { + for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / 100); i++) { + // This will return true of a USB connection has been established + if (UDADDR & _BV(ADDEN)) { + return true; + } + wait_ms(100); + } + + // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow + (USBCON &= ~(_BV(USBE) | _BV(OTGPADE))); + + return false; } +bool is_keyboard_left(void) { +#if defined(SPLIT_HAND_PIN) + // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand + setPinInput(SPLIT_HAND_PIN); + return readPin(SPLIT_HAND_PIN); +#elif defined(EE_HANDS) + return eeconfig_read_handedness(); +#elif defined(MASTER_RIGHT) + return !is_helix_master(); +#endif + + return is_helix_master(); +} + +bool is_helix_master(void) { + static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + + // only check once, as this is called often + if (usbstate == UNKNOWN) { +#if defined(SPLIT_USB_DETECT) + usbstate = waitForUsb() ? MASTER : SLAVE; +#elif defined(__AVR__) + USBCON |= (1 << OTGPADE); // enables VBUS pad + wait_us(5); + + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS +#else + usbstate = MASTER; +#endif + } + + return (usbstate == MASTER); + } + static void keyboard_master_setup(void) { #ifdef USE_MATRIX_I2C @@ -47,24 +92,13 @@ static void keyboard_slave_setup(void) { #endif } -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1<. #define TAPPING_TERM 100 /* Use I2C or Serial */ -#define USE_I2C #define USE_SERIAL //#define USE_MATRIX_I2C @@ -68,6 +67,9 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/helix/rev2/keymaps/default/readme.md b/keyboards/helix/rev2/keymaps/default/readme.md index c618c475251..1237e5d5b62 100644 --- a/keyboards/helix/rev2/keymaps/default/readme.md +++ b/keyboards/helix/rev2/keymaps/default/readme.md @@ -137,6 +137,16 @@ $ make helix/rev2/oled/back:default # with oled and backlight $ make helix/rev2/oled/under:default # with oled and underglow ``` +build (experimental use of split_common) +``` +$ make helix/rev2/sc:default +$ make helix/rev2/sc/back:default +$ make helix/rev2/sc/under:default +$ make helix/rev2/sc/oled:default +$ make helix/rev2/sc/oledback:default +$ make helix/rev2/sc/oledunder:default +``` + flash to keyboard ``` $ make helix:default:flash diff --git a/keyboards/helix/rev2/keymaps/xulkal/rules.mk b/keyboards/helix/rev2/keymaps/xulkal/rules.mk index a636b2a619e..03800f9bb95 100644 --- a/keyboards/helix/rev2/keymaps/xulkal/rules.mk +++ b/keyboards/helix/rev2/keymaps/xulkal/rules.mk @@ -9,3 +9,5 @@ OLED_DRIVER_ENABLE = yes OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" # Xulkal specific oled define OPT_DEFS += -DOLED_90ROTATION + +SPLIT_KEYBOARD = yes diff --git a/keyboards/helix/rev2/local_features.mk b/keyboards/helix/rev2/local_features.mk index 0f4285eea95..4b120936ded 100644 --- a/keyboards/helix/rev2/local_features.mk +++ b/keyboards/helix/rev2/local_features.mk @@ -10,7 +10,7 @@ define HELIX_CUSTOMISE_MSG $(info - OLED_ENABLE = $(OLED_ENABLE)) $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATION = $(LED_ANIMATIONS)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) $(info ) endef @@ -43,12 +43,35 @@ endef ifeq ($(findstring ios,$(HELIX)), ios) IOS_DEVICE_ENABLE = yes endif + ifeq ($(findstring scan,$(HELIX)), scan) + # use DEBUG_MATRIX_SCAN_RATE + # see docs/newbs_testing_debugging.md + OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE + CONSOLE_ENABLE = yes + SHOW_VERBOSE_INFO = yes + endif ifeq ($(findstring verbose,$(HELIX)), verbose) - SHOW_VERBOSE_INFO = yes + SHOW_VERBOSE_INFO = yes endif SHOW_HELIX_OPTIONS = yes endif +ifneq ($(strip $(SPLIT_KEYBOARD)), yes) + SRC += local_drivers/serial.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers + + # A workaround until #7089 is merged. + # serial.c must not be compiled with the -lto option. + # The current LIB_SRC has a side effect with the -fno-lto option, so use it. + LIB_SRC += local_drivers/serial.c + + CUSTOM_MATRIX = yes + + SRC += rev2/matrix.c + SRC += rev2/split_util.c + SRC += rev2/split_scomm.c +endif + ######## # convert Helix-specific options (that represent combinations of standard options) # into QMK standard options. @@ -80,18 +103,22 @@ ifeq ($(strip $(LED_ANIMATIONS)), yes) endif ifeq ($(strip $(OLED_ENABLE)), yes) + SRC += local_drivers/i2c.c + SRC += local_drivers/ssd1306.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers OPT_DEFS += -DOLED_ENABLE -endif - -ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT + ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT + endif endif ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) $(eval $(call HELIX_CUSTOMISE_MSG)) ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE)) $(info ) endif diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 70a6cb0a5e0..050dcac2d20 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -47,7 +47,6 @@ along with this program. If not, see . static uint8_t debouncing = DEBOUNCE; static const int ROWS_PER_HAND = MATRIX_ROWS/2; static uint8_t error_count = 0; -uint8_t is_master = 0 ; static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; @@ -111,8 +110,6 @@ void matrix_init(void) matrix_debouncing[i] = 0; } - is_master = has_usb(); - matrix_init_quantum(); } @@ -200,7 +197,7 @@ int serial_transaction(int master_changed) { uint8_t matrix_scan(void) { - if (is_master) { + if (is_helix_master()) { matrix_master_scan(); }else{ matrix_slave_scan(); diff --git a/keyboards/helix/rev2/post_config.h b/keyboards/helix/rev2/post_config.h new file mode 100644 index 00000000000..dda73d5d22b --- /dev/null +++ b/keyboards/helix/rev2/post_config.h @@ -0,0 +1,7 @@ +#pragma once + +#if defined(SPLIT_KEYBOARD) /* if use split_common */ +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_SPLIT) +# define RGBLIGHT_SPLIT /* helix hardware need this */ +# endif +#endif diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index abaa02cdb13..12b8ae9efa9 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c @@ -1,5 +1,9 @@ #include "helix.h" +// Each keymap.c should use is_keyboard_master() instead of 'is_master'. +// But keep 'is_master' for a while for backwards compatibility +// for the old keymap.c. +uint8_t is_master = false; #ifdef SSD1306OLED #include "ssd1306.h" @@ -15,7 +19,23 @@ void led_set_kb(uint8_t usb_led) { #endif void matrix_init_kb(void) { + // Each keymap.c should use is_keyboard_master() instead of is_master. + // But keep is_master for a while for backwards compatibility + // for the old keymap.c. + is_master = is_keyboard_master(); matrix_init_user(); }; +void keyboard_post_init_kb(void) { +#if defined(DEBUG_MATRIX_SCAN_RATE) + debug_enable = true; +#endif + keyboard_post_init_user(); +} + +#if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) +void matrix_slave_scan_user(void) { + matrix_scan_user(); +} +#endif diff --git a/keyboards/helix/rev2/rev2.h b/keyboards/helix/rev2/rev2.h index 4e69daef509..8b82a4a6eea 100644 --- a/keyboards/helix/rev2/rev2.h +++ b/keyboards/helix/rev2/rev2.h @@ -4,18 +4,16 @@ #include "quantum.h" -#ifdef RGBLIGHT_ENABLE -//rgb led driver -#include "ws2812.h" +#ifndef SPLIT_KEYBOARD + extern bool is_helix_master(void); + #define is_keyboard_master() is_helix_master() #endif -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif +// Each keymap.c should use is_keyboard_master() instead of 'is_master', 'has_usb()'. +// But keep 'is_master' for a while for backwards compatibility +// for the old keymap.c. +extern uint8_t is_master; // 'is_master' will be obsolete, it is recommended to use 'is_keyboard_master ()' instead. +#define has_usb() is_keyboard_master() #if MATRIX_ROWS == 8 // HELIX_ROWS == 4 #ifndef FLIP_HALF diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk index 7357d568c69..db584c0b23b 100644 --- a/keyboards/helix/rev2/rules.mk +++ b/keyboards/helix/rev2/rules.mk @@ -1,21 +1,5 @@ KEYBOARD_LOCAL_FEATURES_MK := $(dir $(lastword $(MAKEFILE_LIST)))local_features.mk -SRC += local_drivers/i2c.c -SRC += local_drivers/serial.c -SRC += local_drivers/ssd1306.c -KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - -# A workaround until #7089 is merged. -# serial.c must not be compiled with the -lto option. -# The current LIB_SRC has a side effect with the -fno-lto option, so use it. -LIB_SRC += local_drivers/serial.c - -CUSTOM_MATRIX = yes - -SRC += rev2/matrix.c -SRC += rev2/split_util.c -SRC += rev2/split_scomm.c - # Helix Spacific Build Options default values HELIX_ROWS = 5 # Helix Rows is 4 or 5 OLED_ENABLE = no # OLED_ENABLE diff --git a/keyboards/helix/rev2/sc/back/rules.mk b/keyboards/helix/rev2/sc/back/rules.mk new file mode 100644 index 00000000000..066fffb74af --- /dev/null +++ b/keyboards/helix/rev2/sc/back/rules.mk @@ -0,0 +1 @@ +LED_BACK_ENABLE = yes diff --git a/keyboards/helix/rev2/sc/oled/rules.mk b/keyboards/helix/rev2/sc/oled/rules.mk new file mode 100644 index 00000000000..dd68e9d3b09 --- /dev/null +++ b/keyboards/helix/rev2/sc/oled/rules.mk @@ -0,0 +1 @@ +OLED_ENABLE = yes diff --git a/keyboards/helix/rev2/sc/oledback/rules.mk b/keyboards/helix/rev2/sc/oledback/rules.mk new file mode 100644 index 00000000000..645984f865a --- /dev/null +++ b/keyboards/helix/rev2/sc/oledback/rules.mk @@ -0,0 +1,2 @@ +OLED_ENABLE = yes +LED_BACK_ENABLE = yes diff --git a/keyboards/helix/rev2/sc/oledunder/rules.mk b/keyboards/helix/rev2/sc/oledunder/rules.mk new file mode 100644 index 00000000000..e415cbd4920 --- /dev/null +++ b/keyboards/helix/rev2/sc/oledunder/rules.mk @@ -0,0 +1,2 @@ +OLED_ENABLE = yes +LED_UNDERGLOW_ENABLE = yes diff --git a/keyboards/helix/rev2/sc/rules.mk b/keyboards/helix/rev2/sc/rules.mk new file mode 100644 index 00000000000..d38a6180907 --- /dev/null +++ b/keyboards/helix/rev2/sc/rules.mk @@ -0,0 +1 @@ +SPLIT_KEYBOARD = yes diff --git a/keyboards/helix/rev2/sc/under/rules.mk b/keyboards/helix/rev2/sc/under/rules.mk new file mode 100644 index 00000000000..a37aa6fab37 --- /dev/null +++ b/keyboards/helix/rev2/sc/under/rules.mk @@ -0,0 +1 @@ +LED_UNDERGLOW_ENABLE = yes diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c index 9d31d0dec36..ab40315487f 100644 --- a/keyboards/helix/rev2/split_util.c +++ b/keyboards/helix/rev2/split_util.c @@ -45,7 +45,7 @@ bool waitForUsb(void) { } -__attribute__((weak)) bool is_keyboard_left(void) { +bool is_keyboard_left(void) { #if defined(SPLIT_HAND_PIN) // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand setPinInput(SPLIT_HAND_PIN); @@ -53,13 +53,13 @@ __attribute__((weak)) bool is_keyboard_left(void) { #elif defined(EE_HANDS) return eeconfig_read_handedness(); #elif defined(MASTER_RIGHT) - return !has_usb(); + return !is_helix_master(); #endif - return has_usb(); + return is_helix_master(); } -__attribute__((weak)) bool has_usb(void) { +bool is_helix_master(void) { static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; // only check once, as this is called often @@ -100,11 +100,10 @@ static void keyboard_slave_setup(void) { void split_keyboard_setup(void) { isLeftHand = is_keyboard_left(); - if (has_usb()) { + if (is_helix_master()) { keyboard_master_setup(); } else { keyboard_slave_setup(); } sei(); } - diff --git a/keyboards/helix/rev2/split_util.h b/keyboards/helix/rev2/split_util.h index 687ca19bd3e..c0ecdb09741 100644 --- a/keyboards/helix/rev2/split_util.h +++ b/keyboards/helix/rev2/split_util.h @@ -12,7 +12,7 @@ extern volatile bool isLeftHand; void matrix_slave_scan(void); void split_keyboard_setup(void); -bool has_usb(void); +bool is_helix_master(void); void matrix_master_OLED_init (void); diff --git a/keyboards/hhkb/keymaps/brett/config.h b/keyboards/hhkb/keymaps/brett/config.h new file mode 100644 index 00000000000..b9a61e10a78 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/config.h @@ -0,0 +1,17 @@ +#pragma once + +// Define mousekey settings +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define LSPO_KEY KC_9 +#define RSPC_KEY KC_0 +#define LSPO_MOD KC_LSHIFT +#define RSPC_MOD KC_RSHIFT + +// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when +// you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/hhkb/keymaps/brett/keymap.c b/keyboards/hhkb/keymaps/brett/keymap.c new file mode 100644 index 00000000000..1201146b003 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/keymap.c @@ -0,0 +1,119 @@ +/* -*- eval: (turn-on-orgtbl); -*- + * Brettm12345 HHKB Layout + */ +#include QMK_KEYBOARD_H +#include "brett.h" + +enum layers { + BASE = 0, + HHKB = 1, + PROG = 2, + MOUSE = 3 +}; + +// Tap for tab hold for MOUSE +#define TAB_MOUSE LT(MOUSE, KC_TAB) + +// Tap for space hold for PROG +#define SPACE_PROG LT(PROG, KC_SPC) + +// Tap for ESC hold for CTRL +#define CTL_ESC CTL_T(KC_ESC) + +// Tab for ; hold for PROG +#define PROG_SCLN LT(PROG, KC_SCLN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE Level: Default Layer + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backspace | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Control | A | S | D | F | G | H | J | K | L | ; | ' | Return | ****** | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | LShift | Z | X | C | V | B | N | M | , | . | / | RShift | HHKB | ****** | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + + |------+------+----------------------------+------+------| + | LAlt | LGUI | ******* Space/Prog ******* | RGUI | RAlt | + |------+------+----------------------------+------+------| + */ + + [BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + TAB_MOUSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, PROG_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(HHKB), + KC_LALT, KC_LGUI, SPACE_PROG, KC_RGUI, KC_RALT), + + /* HHKB Level: Function Layer + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | Flash | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | Caps | Calc | Mail | Media | Browser | My PC | Browser | u | i | o | Print | [ | ] | Backsp | * | + | | | | Player | Refresh | | Favorites | | | | Screen | | | | | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | Control | Prev | Next | Find | f | g | Browser | Browser | Browser | Browser | ; | ' | Exec | ****** | * | + | | | | | | | Back | Home | Search | Forward | | | | | | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | LShift | Vol+ | Vol- | Mute | Select | b | n | m | , | Again | Browser Search | RShift | HHKB | ****** | * | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + + |------+------+----------------------+------+------| + | Menu | LGUI | ******* Play ******* | RGUI | Menu | + |------+------+----------------------+------+------| + */ + [HHKB] = LAYOUT( + FLASH, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, KC_CALC, KC_MAIL, KC_MSEL, KC_WREF, KC_MYCM, KC_WFAV, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_BSPC, + KC_TRNS, KC_MPRV, KC_MNXT, KC_FIND, KC_TRNS, KC_TRNS, KC_WBAK, KC_WHOM, KC_WSCH, KC_WFWD, KC_TRNS, KC_TRNS, KC_EXEC, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_SLCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AGIN, KC_WSCH, KC_TRNS, KC_TRNS, + KC_MENU, KC_TRNS, KC_MPLY, KC_TRNS, KC_MENU), + + + /* Programming Level: Symbols Layer + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Esc | TTY 1 | TTY 2 | TTY 3 | TTY 4 | TTY 5 | TTY 6 | TTY 7 | TTY 8 | TTY 9 | TTY 10 | TTY 11 | TTY 12 | \ | ` | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Tab/Mouse | => | @ | >>= | =<< | ‖ | <> | <|> | <*> | <@> | |> | <$ | $> | Backsp | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Toggle Mouse | -> | * | <$> | <#> | && | Left | Down | Up | Right | :: | ` | Return | ****** | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | LShift | z | x | c | v | b | n | m | <- | -> | <> | Shift | HHKB | ****** | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + + |------+------+----------------------------+------+------| + | LAlt | LGUI | ******* Space/Prog ******* | RGUI | RAlt | + |------+------+----------------------------+------+------| + */ + [PROG] = LAYOUT( + KC_GESC, LCA(KC_F1), LCA(KC_F2), LCA(KC_F3), LCA(KC_F4), LCA(KC_F5), LCA(KC_F6), LCA(KC_F7), LCA(KC_F8), LCA(KC_F9), LCA(KC_F10), LCA(KC_F11), LCA(KC_F12), KC_TRNS, KC_TRNS, + KC_TRNS, FAT_ARROW, KC_AT, BIND, BIND_FLIPPED, OR, CONCAT, ALT, APPLY, FLAP, PIPE, VOID_LEFT, VOID_RIGHT, KC_TRNS, + TG(MOUSE), SKINNY_ARROW, KC_ASTR, MAP, MAP_FLIPPED, AND, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, DOUBLE_COLON, KC_GRV, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, REVERSE_ARROW, SKINNY_ARROW, CONCAT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + + /* Mouse Level: Mouse Layer + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Esc | Speed 1 | Speed 2 | Speed 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Mouse(Tab) | Q | Up | Button3 | Button4 | Button5 | Y | U | Button3 | Button4 | Button5 | [ | ] | Backsp | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Control(Esc) | Left | Down | Right | Button1 | Button2 | SLeft | SDown | SUp | SRight | Button1 | Button2 | Control(Return) | ****** | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | LShift(() | Z | X | C | V | B | N | M | Button5 | Button4 | Button3 | RShift()) | HHKB | ****** | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + + |---------+---------+----------------------------+---------+---------| + | LAlt([) | LGUI({) | ******* Space/Prog ******* | RGUI(}) | RAlt(]) | + |---------+---------+----------------------------+---------+---------| + */ + [MOUSE] = LAYOUT( + KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MS_U, KC_BTN3, KC_BTN4, KC_BTN5, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN4, KC_BTN5, KC_TRNS, KC_TRNS, KC_TRNS, + TG(MOUSE), KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, KC_BTN2, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN1, KC_BTN2, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; diff --git a/keyboards/hhkb/keymaps/brett/readme.md b/keyboards/hhkb/keymaps/brett/readme.md new file mode 100644 index 00000000000..fd07b155fb7 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/readme.md @@ -0,0 +1,13 @@ +# Generated Keymap Layout + +This layout was generated by the QMK API. You can find the JSON data used to +generate this keymap in the file layers.json. + +To make use of this file you will need follow the following steps: + +* Download or Clone QMK Firmware: +* Extract QMK Firmware to a location on your hard drive +* Copy this folder into %s +* You are now ready to compile or use your keymap with the source + +More information can be found in the QMK docs: \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/brett/rules.mk b/keyboards/hhkb/keymaps/brett/rules.mk new file mode 100644 index 00000000000..88f57515f13 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/rules.mk @@ -0,0 +1,4 @@ +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = no +LEADER_ENABLE = no +UNICODE_ENABLE = no diff --git a/keyboards/illuminati/is0/keymaps/default/keymap.c b/keyboards/illuminati/is0/keymaps/default/keymap.c index 68545add668..e82a965d9d7 100644 --- a/keyboards/illuminati/is0/keymaps/default/keymap.c +++ b/keyboards/illuminati/is0/keymaps/default/keymap.c @@ -32,7 +32,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { SEND_STRING("Hello from Illuminati Works"); } else { - SEND_STRING("iS0 working properly"); + SEND_STRING("iS0 working properly"); } break; } diff --git a/keyboards/j80/config.h b/keyboards/j80/config.h index 3a5328ac412..a4a10bff429 100644 --- a/keyboards/j80/config.h +++ b/keyboards/j80/config.h @@ -38,8 +38,6 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_PIN D4 -#define NO_UART 1 - /* disable these deprecated features by default */ #ifndef LINK_TIME_OPTIMIZATION_ENABLE #define NO_ACTION_MACRO diff --git a/keyboards/jc65/v32a/config.h b/keyboards/jc65/v32a/config.h index 392aebc2a4c..11f39a5e020 100644 --- a/keyboards/jc65/v32a/config.h +++ b/keyboards/jc65/v32a/config.h @@ -42,7 +42,5 @@ along with this program. If not, see . #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 -#define NO_UART 1 - #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h index 90bcacfd162..3138023bb7d 100644 --- a/keyboards/jj40/config.h +++ b/keyboards/jj40/config.h @@ -45,7 +45,6 @@ along with this program. If not, see . /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* key combination for magic key command */ diff --git a/keyboards/jj4x4/config.h b/keyboards/jj4x4/config.h index b3f33d6e7ad..d8ccef3ad7c 100644 --- a/keyboards/jj4x4/config.h +++ b/keyboards/jj4x4/config.h @@ -48,7 +48,6 @@ along with this program. If not, see . /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* key combination for magic key command */ diff --git a/keyboards/jj50/config.h b/keyboards/jj50/config.h index 9b9feb0676d..2f0e98d531e 100644 --- a/keyboards/jj50/config.h +++ b/keyboards/jj50/config.h @@ -48,6 +48,4 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 15 #define RGBLIGHT_VAL_STEP 18 -#define NO_UART 1 - #endif diff --git a/keyboards/keycapsss/plaid_pad/config.h b/keyboards/keycapsss/plaid_pad/config.h index c4d22b6636b..1d0b31a4014 100644 --- a/keyboards/keycapsss/plaid_pad/config.h +++ b/keyboards/keycapsss/plaid_pad/config.h @@ -25,7 +25,6 @@ /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/keyboards/kira80/config.h b/keyboards/kira80/config.h new file mode 100644 index 00000000000..b9ad85eb29a --- /dev/null +++ b/keyboards/kira80/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2020 Lorenz Wellmer + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xC583 +#define DEVICE_VER 0x0102 +#define MANUFACTURER EVE +#define PRODUCT Kira80 + +/* key matrix size */ +#define MATRIX_ROWS 7 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B1, B2, B3, B5, B6, B7, B0 } +#define MATRIX_COL_PINS { A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, A0, C2, D7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCE 5 + +#define BACKLIGHT_PIN D4 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 diff --git a/keyboards/kira80/info.json b/keyboards/kira80/info.json new file mode 100644 index 00000000000..bd096eb600f --- /dev/null +++ b/keyboards/kira80/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "Kira 80", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.25, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Back", "x":13, "y":1.25}, {"label":"Back", "x":14, "y":1.25}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Home", "x":16.25, "y":1.25}, {"label":"PgUp", "x":17.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"End", "x":16.25, "y":2.25}, {"label":"PgDn", "x":17.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Shift", "x":0, "y":4.25, "w":1.25}, {"label":"|", "x":1.25, "y":4.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"label":"FN", "x":14, "y":4.25}, {"label":"\u2191", "x":16.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"Alt", "x":10, "y":5.25, "w":1.25}, {"label":"Win", "x":11.25, "y":5.25, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.25, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.25, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.25}, {"label":"\u2193", "x":16.25, "y":5.25}, {"label":"\u2192", "x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Home", "x":16.25, "y":1.25}, {"label":"PgUp", "x":17.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"End", "x":16.25, "y":2.25}, {"label":"PgDn", "x":17.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"Alt", "x":10, "y":5.25, "w":1.25}, {"label":"Win", "x":11.25, "y":5.25, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.25, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.25, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.25}, {"label":"\u2193", "x":16.25, "y":5.25}, {"label":"\u2192", "x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_ansi_wkl": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Home", "x":16.25, "y":1.25}, {"label":"PgUp", "x":17.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"End", "x":16.25, "y":2.25}, {"label":"PgDn", "x":17.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.25, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.25}, {"label":"\u2193", "x":16.25, "y":5.25}, {"label":"\u2192", "x":17.25, "y":5.25}] + }, + "LAYOUT_tkl_iso": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"\u00ac", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"\"", "x":2, "y":1.25}, {"label":"\u00a3", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Home", "x":16.25, "y":1.25}, {"label":"PgUp", "x":17.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"End", "x":16.25, "y":2.25}, {"label":"PgDn", "x":17.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"@", "x":11.75, "y":3.25}, {"label":"~", "x":12.75, "y":3.25}, {"label":"Enter", "x":13.75, "y":2.25, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":4.25, "w":1.25}, {"label":"|", "x":1.25, "y":4.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"AltGr", "x":10, "y":5.25, "w":1.25}, {"label":"Win", "x":11.25, "y":5.25, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.25, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.25, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.25}, {"label":"\u2193", "x":16.25, "y":5.25}, {"label":"\u2192", "x":17.25, "y":5.25}] + } + } +} diff --git a/keyboards/kira80/keymaps/ansi/keymap.c b/keyboards/kira80/keymaps/ansi/keymap.c new file mode 100644 index 00000000000..c25d9cbeaa7 --- /dev/null +++ b/keyboards/kira80/keymaps/ansi/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_ansi( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/kira80/keymaps/ansi/readme.md b/keyboards/kira80/keymaps/ansi/readme.md new file mode 100644 index 00000000000..183eeaf7482 --- /dev/null +++ b/keyboards/kira80/keymaps/ansi/readme.md @@ -0,0 +1 @@ +# The default ANSI keymap for Kira 80 diff --git a/keyboards/kira80/keymaps/ansi_wkl/keymap.c b/keyboards/kira80/keymaps/ansi_wkl/keymap.c new file mode 100644 index 00000000000..398d9f8118f --- /dev/null +++ b/keyboards/kira80/keymaps/ansi_wkl/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_ansi_wkl( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_ansi_wkl( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/kira80/keymaps/ansi_wkl/readme.md b/keyboards/kira80/keymaps/ansi_wkl/readme.md new file mode 100644 index 00000000000..6e87b5dca3c --- /dev/null +++ b/keyboards/kira80/keymaps/ansi_wkl/readme.md @@ -0,0 +1 @@ +# The default ANSI WKL keymap for Kira 80 diff --git a/keyboards/kira80/keymaps/default/keymap.c b/keyboards/kira80/keymaps/default/keymap.c new file mode 100644 index 00000000000..44a4236f7f8 --- /dev/null +++ b/keyboards/kira80/keymaps/default/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/kira80/keymaps/default/readme.md b/keyboards/kira80/keymaps/default/readme.md new file mode 100644 index 00000000000..1441cdf666c --- /dev/null +++ b/keyboards/kira80/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Kira 80 diff --git a/keyboards/kira80/keymaps/iso/keymap.c b/keyboards/kira80/keymaps/iso/keymap.c new file mode 100644 index 00000000000..1890aa2e190 --- /dev/null +++ b/keyboards/kira80/keymaps/iso/keymap.c @@ -0,0 +1,36 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_iso( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_iso( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/kira80/keymaps/iso/readme.md b/keyboards/kira80/keymaps/iso/readme.md new file mode 100644 index 00000000000..538d1f59453 --- /dev/null +++ b/keyboards/kira80/keymaps/iso/readme.md @@ -0,0 +1 @@ +# The default ISO keymap for Kira 80 diff --git a/keyboards/kira80/kira80.c b/keyboards/kira80/kira80.c new file mode 100644 index 00000000000..a76f4001efa --- /dev/null +++ b/keyboards/kira80/kira80.c @@ -0,0 +1,35 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ + +#include "kira80.h" + +void keyboard_pre_init_kb(void) { + led_init_ports(); + keyboard_pre_init_user(); +} + +void led_init_ports(void) { + setPinOutput(D1); + setPinOutput(D6); +} + +bool led_update_kb(led_t led_state) { + if (led_update_user(led_state)) { + writePin(D1, led_state.caps_lock); + writePin(D6, led_state.scroll_lock); + } + return true; +} \ No newline at end of file diff --git a/keyboards/kira80/kira80.h b/keyboards/kira80/kira80.h new file mode 100644 index 00000000000..7a037e9e499 --- /dev/null +++ b/keyboards/kira80/kira80.h @@ -0,0 +1,95 @@ +/* Copyright 2020 Lorenz Wellmer + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all(\ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K001, K091, K092, K102, \ + K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, K029, K096, K095, K094, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, K103, K098, K097, \ + K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, \ + K060, K058, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, K072, K073, \ + K075, K076, K077, K079, K083, K084, K085, K086, K087, K088, K082 \ +) { \ + { K000, K001, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, KC_NO }, \ + { K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, K029 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, KC_NO }, \ + { K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, K058, KC_NO }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, K072, K073, KC_NO }, \ + { K075, K076, K077, KC_NO, K079, KC_NO, KC_NO, K082, K083, K084, K085, K086, K087, K088, KC_NO }, \ + { KC_NO, K091, K092, KC_NO, K094, K095, K096, K097, K098, KC_NO, KC_NO, KC_NO, K102, K103, KC_NO } \ +} + +#define LAYOUT_tkl_ansi(\ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K001, K091, K092, K102, \ + K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, K096, K095, K094, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, K103, K098, K097, \ + K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, \ + K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, K073, \ + K075, K076, K077, K079, K083, K084, K085, K086, K087, K088, K082 \ +) { \ + { K000, K001, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, KC_NO }, \ + { K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, KC_NO }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, KC_NO }, \ + { K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, KC_NO, KC_NO }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, KC_NO, K073, KC_NO }, \ + { K075, K076, K077, KC_NO, K079, KC_NO, KC_NO, K082, K083, K084, K085, K086, K087, K088, KC_NO }, \ + { KC_NO, K091, K092, KC_NO, K094, K095, K096, K097, K098, KC_NO, KC_NO, KC_NO, K102, K103, KC_NO } \ +} + +#define LAYOUT_tkl_ansi_wkl(\ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K001, K091, K092, K102, \ + K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, K096, K095, K094, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, K103, K098, K097, \ + K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, \ + K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, K073, \ + K075, K077, K079, K084, K086, K087, K088, K082 \ +) { \ + { K000, K001, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, KC_NO }, \ + { K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, KC_NO }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, KC_NO }, \ + { K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, KC_NO, KC_NO }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, KC_NO, K073, KC_NO }, \ + { K075, KC_NO, K077, KC_NO, K079, KC_NO, KC_NO, K082, KC_NO, K084, KC_NO, K086, K087, K088, KC_NO }, \ + { KC_NO, K091, K092, KC_NO, K094, K095, K096, K097, K098, KC_NO, KC_NO, KC_NO, K102, K103, KC_NO } \ +} + +#define LAYOUT_tkl_iso(\ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K001, K091, K092, K102, \ + K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, K096, K095, K094, \ + K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K103, K098, K097, \ + K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K043, K057, \ + K060, K058, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, K073, \ + K075, K076, K077, K079, K083, K084, K085, K086, K087, K088, K082 \ +) { \ + { K000, K001, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, KC_NO }, \ + { K015, K016, K017, K018, K019, K020, K021, K022, K023, K024, K025, K026, K027, K028, KC_NO }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038, K039, K040, K041, K042, K043, KC_NO }, \ + { K045, K046, K047, K048, K049, K050, K051, K052, K053, K054, K055, K056, K057, K058, KC_NO }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068, K069, K070, K071, KC_NO, K073, KC_NO }, \ + { K075, K076, K077, KC_NO, K079, KC_NO, KC_NO, K082, K083, K084, K085, K086, K087, K088, KC_NO }, \ + { KC_NO, K091, K092, KC_NO, K094, K095, K096, K097, K098, KC_NO, KC_NO, KC_NO, K102, K103, KC_NO } \ +} diff --git a/keyboards/kira80/readme.md b/keyboards/kira80/readme.md new file mode 100644 index 00000000000..535e191bf42 --- /dev/null +++ b/keyboards/kira80/readme.md @@ -0,0 +1,50 @@ +# Kira 80/TKL + +![kira80](https://i.imgur.com/QnGKnaml.jpg) +![kira80pcb](https://i.imgur.com/wrEZhg5l.jpg) + +Custom TKL keyboard designed and made by Thesiscamper and EVE + +* Keyboard Maintainer: [elmo-space](https://github.com/elmo-space) +* Hardware Supported: Kira 80 PCB made by EVE +* Hardware Availability: limited [Group Buy](https://geekhack.org/index.php?topic=96381.0) finished + +Make example for this keyboard (after setting up your build environment): + + make kira80:default + +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) + + make kira80:default:flash + +**Reset Key:** Hold down the key located at `K102`, commonly programmed as 'Pause' while plugging in the keyboard. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Hardware Information + +Controller: ATmega32A + +### Pinout: + +|Pin |Use | |Pin |Use | +|----|---------|-|----|---------------| +|`A1`|Column 0 | |`B1`|Row 0 | +|`A2`|Column 1 | |`B2`|Row 1 | +|`A3`|Column 2 | |`B3`|Row 2 | +|`A4`|Column 3 | |`B5`|Row 3 | +|`A5`|Column 4 | |`B6`|Row 4 | +|`A6`|Column 5 | |`B7`|Row 5 | +|`A7`|Column 6 | |`B0`|Row 6 | +|`C7`|Column 7 | | | | +|`C6`|Column 8 | |`D1`|Caps Lock LED | +|`C5`|Column 9 | |`D6`|Scroll Lock LED| +|`C4`|Column 10| |`D4`|Backlight | +|`C3`|Column 11| | | | +|`A0`|Column 12| |`D2`|USB D+ | +|`C2`|Column 13| |`D3`|USB D- | +|`D7`|Column 14| | | | + +### Layout matrix: + +![matrix](https://i.imgur.com/FqjTNQS.png) diff --git a/keyboards/kira80/rules.mk b/keyboards/kira80/rules.mk new file mode 100644 index 00000000000..6e63be4ad14 --- /dev/null +++ b/keyboards/kira80/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = atmega32a + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = bootloadHID + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/kira80/usbconfig.h b/keyboards/kira80/usbconfig.h new file mode 100644 index 00000000000..33030c83161 --- /dev/null +++ b/keyboards/kira80/usbconfig.h @@ -0,0 +1,386 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF) +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'E', 'V', 'E' +#define USB_CFG_VENDOR_NAME_LEN 3 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'K', 'i', 'r', 'a', '8', '0' +#define USB_CFG_DEVICE_NAME_LEN 6 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/kmac/rules.mk b/keyboards/kmac/rules.mk index beda52398cf..36c917fac6c 100644 --- a/keyboards/kmac/rules.mk +++ b/keyboards/kmac/rules.mk @@ -27,7 +27,8 @@ CUSTOM_MATRIX = yes # Custom matrix file SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_DRIVER = custom MIDI_ENABLE = no # MIDI support UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/mechmini/v1/config.h b/keyboards/mechmini/v1/config.h index 07422f9ffda..80a79bf8699 100644 --- a/keyboards/mechmini/v1/config.h +++ b/keyboards/mechmini/v1/config.h @@ -35,8 +35,6 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4 } #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 - #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/mt40/config.h b/keyboards/mt40/config.h index f5038fb5413..5e3eaf935b2 100644 --- a/keyboards/mt40/config.h +++ b/keyboards/mt40/config.h @@ -35,8 +35,6 @@ along with this program. If not, see . #define MATRIX_ROWS 7 #define MATRIX_COLS 15 -#define NO_UART 1 - #define RGB_DI_PIN C0 #define RGBLED_NUM 12 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h index f6746e50ffb..21eff627dc7 100644 --- a/keyboards/mxss/rgblight.h +++ b/keyboards/mxss/rgblight.h @@ -16,8 +16,6 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#include "rgblight_reconfig.h" - /***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) **** old mode number (before 0.6.117) to new mode name table @@ -64,6 +62,39 @@ |-----------------|-----------------------------------| *****/ +#ifdef RGBLIGHT_ANIMATIONS +// for backward compatibility +# 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 +#endif + +#ifdef RGBLIGHT_STATIC_PATTERNS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +#endif + +// clang-format off + +// check dynamic animation effects chose ? +#if defined(RGBLIGHT_EFFECT_BREATHING) \ + || defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) \ + || defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) \ + || defined(RGBLIGHT_EFFECT_SNAKE) \ + || defined(RGBLIGHT_EFFECT_KNIGHT) \ + || defined(RGBLIGHT_EFFECT_CHRISTMAS) \ + || defined(RGBLIGHT_EFFECT_RGB_TEST) \ + || defined(RGBLIGHT_EFFECT_ALTERNATING) +# define RGBLIGHT_USE_TIMER +#endif + +// clang-format on + #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_##sym, #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_##sym, #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_##sym, @@ -263,12 +294,19 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); # define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); +# ifdef RGBLIGHT_USE_TIMER void rgblight_task(void); - void rgblight_timer_init(void); void rgblight_timer_enable(void); void rgblight_timer_disable(void); void rgblight_timer_toggle(void); +# else +# define rgblight_task() +# define rgblight_timer_init() +# define rgblight_timer_enable() +# define rgblight_timer_disable() +# define rgblight_timer_toggle() +# endif # ifdef RGBLIGHT_SPLIT # define RGBLIGHT_STATUS_CHANGE_MODE (1 << 0) diff --git a/keyboards/oddball/adns.c b/keyboards/oddball/adns.c new file mode 100644 index 00000000000..35225f042b6 --- /dev/null +++ b/keyboards/oddball/adns.c @@ -0,0 +1,270 @@ +#include +#include +#include "quantum.h" +#include "pointing_device.h" +#include "adns9800_srom_A4.h" +#include "../../lib/lufa/LUFA/Drivers/Peripheral/SPI.h" + +// registers +#define REG_Product_ID 0x00 +#define REG_Revision_ID 0x01 +#define REG_Motion 0x02 +#define REG_Delta_X_L 0x03 +#define REG_Delta_X_H 0x04 +#define REG_Delta_Y_L 0x05 +#define REG_Delta_Y_H 0x06 +#define REG_SQUAL 0x07 +#define REG_Pixel_Sum 0x08 +#define REG_Maximum_Pixel 0x09 +#define REG_Minimum_Pixel 0x0a +#define REG_Shutter_Lower 0x0b +#define REG_Shutter_Upper 0x0c +#define REG_Frame_Period_Lower 0x0d +#define REG_Frame_Period_Upper 0x0e +#define REG_Configuration_I 0x0f +#define REG_Configuration_II 0x10 +#define REG_Frame_Capture 0x12 +#define REG_SROM_Enable 0x13 +#define REG_Run_Downshift 0x14 +#define REG_Rest1_Rate 0x15 +#define REG_Rest1_Downshift 0x16 +#define REG_Rest2_Rate 0x17 +#define REG_Rest2_Downshift 0x18 +#define REG_Rest3_Rate 0x19 +#define REG_Frame_Period_Max_Bound_Lower 0x1a +#define REG_Frame_Period_Max_Bound_Upper 0x1b +#define REG_Frame_Period_Min_Bound_Lower 0x1c +#define REG_Frame_Period_Min_Bound_Upper 0x1d +#define REG_Shutter_Max_Bound_Lower 0x1e +#define REG_Shutter_Max_Bound_Upper 0x1f +#define REG_LASER_CTRL0 0x20 +#define REG_Observation 0x24 +#define REG_Data_Out_Lower 0x25 +#define REG_Data_Out_Upper 0x26 +#define REG_SROM_ID 0x2a +#define REG_Lift_Detection_Thr 0x2e +#define REG_Configuration_V 0x2f +#define REG_Configuration_IV 0x39 +#define REG_Power_Up_Reset 0x3a +#define REG_Shutdown 0x3b +#define REG_Inverse_Product_ID 0x3f +#define REG_Motion_Burst 0x50 +#define REG_SROM_Load_Burst 0x62 +#define REG_Pixel_Burst 0x64 + +// pins +#define NCS 0 + +extern const uint16_t firmware_length; +extern const uint8_t firmware_data[]; + +enum motion_burst_property{ + motion = 0, + observation, + delta_x_l, + delta_x_h, + delta_y_l, + delta_y_h, + squal, + pixel_sum, + maximum_pixel, + minimum_pixel, + shutter_upper, + shutter_lower, + frame_period_upper, + frame_period_lower, + end_data +}; + +// used to track the motion delta between updates +volatile int32_t delta_x; +volatile int32_t delta_y; + +void adns_begin(void){ + PORTB &= ~ (1 << NCS); +} + +void adns_end(void){ + PORTB |= (1 << NCS); +} + +void adns_write(uint8_t reg_addr, uint8_t data){ + + adns_begin(); + + //send address of the register, with MSBit = 1 to indicate it's a write + SPI_TransferByte(reg_addr | 0x80 ); + SPI_TransferByte(data); + + // tSCLK-NCS for write operation + wait_us(20); + + adns_end(); + + // tSWW/tSWR (=120us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound + wait_us(100); +} + +uint8_t adns_read(uint8_t reg_addr){ + + adns_begin(); + + // send adress of the register, with MSBit = 0 to indicate it's a read + SPI_TransferByte(reg_addr & 0x7f ); + uint8_t data = SPI_TransferByte(0); + + // tSCLK-NCS for read operation is 120ns + wait_us(1); + + adns_end(); + + // tSRW/tSRR (=20us) minus tSCLK-NCS + wait_us(19); + + return data; +} + +void pointing_device_init(void) { + + if(!is_keyboard_master()) + return; + + // interrupt 2 + EICRA &= ~(1 << 4); + EICRA |= (1 << 5); + EIMSK |= (1< 127 ? 127 : delta_x; + report.x = -report.x; + + report.y = delta_y < -127 ? 127 : delta_y > 127 ? 127 : delta_y; + + // reset deltas + delta_x = 0; + delta_y = 0; + + pointing_device_set_report(report); + pointing_device_send(); +} + +int16_t convertDeltaToInt(uint8_t high, uint8_t low){ + + // join bytes into twos compliment + uint16_t twos_comp = (high << 8) | low; + + // convert twos comp to int + if (twos_comp & 0x8000) + return -1 * ((twos_comp ^ 0xffff) + 1); + + return twos_comp; +} + +ISR(INT2_vect) { + // called on interrupt 2 when sensed motion + // copy burst data from the respective registers + + adns_begin(); + + // send adress of the register, with MSBit = 1 to indicate it's a write + SPI_TransferByte(REG_Motion_Burst & 0x7f); + + uint8_t burst_data[pixel_sum]; + + for (int i = 0; i < pixel_sum; ++i) { + burst_data[i] = SPI_TransferByte(0); + } + + delta_x += convertDeltaToInt(burst_data[delta_x_h], burst_data[delta_x_l]); + delta_y += convertDeltaToInt(burst_data[delta_y_h], burst_data[delta_y_l]); + + adns_end(); +} diff --git a/keyboards/oddball/adns9800_srom_A4.h b/keyboards/oddball/adns9800_srom_A4.h new file mode 100644 index 00000000000..11958d21eff --- /dev/null +++ b/keyboards/oddball/adns9800_srom_A4.h @@ -0,0 +1,212 @@ +#pragma once + +#include + +const uint16_t firmware_length = 3070; + +const uint8_t firmware_data[] PROGMEM = { +0x03, 0xa4, 0x6e, 0x16, 0x6d, 0x89, 0x3e, 0xfe, 0x5f, 0x1c, 0xb8, 0xf2, 0x47, 0x0c, 0x7b, +0x74, 0x6a, 0x56, 0x0f, 0x7d, 0x76, 0x71, 0x4b, 0x0c, 0x97, 0xb6, 0xcf, 0xfd, 0x78, 0x72, +0x66, 0x2f, 0xbd, 0xf8, 0x53, 0x24, 0xab, 0xd4, 0x2c, 0xb0, 0xe4, 0x32, 0xf1, 0x6a, 0x56, +0x2e, 0xbf, 0xfc, 0x7a, 0x57, 0x0d, 0x79, 0x70, 0x66, 0x46, 0x0e, 0x7f, 0x5d, 0x19, 0x91, +0xaa, 0xc2, 0x0d, 0x8e, 0x7f, 0x5d, 0x19, 0xb0, 0xe2, 0x46, 0xef, 0x5c, 0x3a, 0xd7, 0x2c, +0xbb, 0xf4, 0x6a, 0x37, 0xcd, 0x18, 0xb2, 0xc7, 0x0c, 0x9a, 0x97, 0x8f, 0x52, 0xfd, 0x0d, +0xb8, 0x41, 0x00, 0x9e, 0x8e, 0x9a, 0x1e, 0x6d, 0x0c, 0xe2, 0xaa, 0x13, 0x93, 0xb8, 0xc1, +0x2a, 0x29, 0xbb, 0x0b, 0xe3, 0x71, 0x08, 0x6d, 0xfd, 0xb6, 0xd9, 0xcf, 0x65, 0x21, 0x27, +0x45, 0x1b, 0xbe, 0xe2, 0x61, 0x86, 0x3c, 0xbf, 0x68, 0x9c, 0xd6, 0x75, 0x01, 0x5e, 0xe0, +0xc6, 0x92, 0x79, 0xf4, 0x6a, 0xa9, 0xbb, 0x2a, 0x79, 0xd0, 0xe1, 0x5c, 0x32, 0xb1, 0x5a, +0x1b, 0xba, 0xaf, 0x11, 0xea, 0x24, 0x6a, 0x83, 0x4f, 0x8d, 0xed, 0x19, 0x62, 0x70, 0x54, +0xfb, 0x0e, 0x1f, 0x83, 0xcc, 0xf0, 0xb7, 0xae, 0x05, 0xd3, 0x42, 0x5d, 0x48, 0xa0, 0x7a, +0x0b, 0x73, 0xb3, 0xc8, 0xa6, 0xb7, 0x1b, 0x08, 0x13, 0x9b, 0x89, 0x44, 0x42, 0xae, 0xd8, +0x6a, 0xba, 0x9b, 0x84, 0x25, 0x8b, 0xa4, 0x5e, 0x0b, 0x85, 0xb0, 0x8f, 0x8d, 0x80, 0x9c, +0xd1, 0x52, 0xc7, 0xcb, 0xff, 0x8d, 0x8b, 0xdd, 0x87, 0xf2, 0x63, 0xca, 0xe7, 0x4f, 0x4a, +0x57, 0x3c, 0xdf, 0xaf, 0xcb, 0x5c, 0xbb, 0x39, 0x0b, 0x01, 0x9c, 0x79, 0x22, 0x15, 0xb8, +0xa0, 0xd3, 0x72, 0x02, 0x35, 0x20, 0x40, 0xe0, 0x17, 0xde, 0x89, 0x88, 0xce, 0xe9, 0x2b, +0x75, 0xba, 0xa0, 0x96, 0x24, 0x1e, 0x71, 0xb5, 0x15, 0x00, 0x61, 0xe0, 0x5c, 0x93, 0x4e, +0xea, 0x53, 0xd0, 0xfc, 0xef, 0xae, 0x2b, 0xeb, 0x8f, 0xc7, 0x69, 0x68, 0xc7, 0xfc, 0x1a, +0x1f, 0x41, 0x0d, 0xd0, 0xc1, 0x03, 0xaf, 0xc9, 0xfd, 0xe4, 0x21, 0x43, 0xc4, 0xef, 0xc2, +0xdd, 0x7b, 0x73, 0xbc, 0xca, 0xf4, 0xa5, 0x2e, 0x83, 0x90, 0x1f, 0x78, 0x41, 0xc3, 0x13, +0x8e, 0x95, 0x0a, 0x57, 0xdf, 0x0a, 0x87, 0x40, 0x2b, 0xd9, 0xba, 0x56, 0x59, 0x9d, 0x2c, +0xb2, 0xb8, 0xb3, 0xfb, 0x77, 0x78, 0x3a, 0xef, 0xbf, 0x2d, 0xc8, 0xb9, 0x94, 0x62, 0x47, +0x92, 0x98, 0x42, 0x23, 0x07, 0xd9, 0x39, 0x46, 0x5e, 0x6f, 0xe0, 0x46, 0x14, 0x0e, 0x3d, +0x74, 0x40, 0x21, 0xb4, 0x67, 0x05, 0xa8, 0xe2, 0x12, 0x93, 0x41, 0xc2, 0x80, 0xb9, 0x56, +0x4b, 0xf9, 0x5a, 0x15, 0x9c, 0x37, 0xc4, 0x4b, 0x05, 0xad, 0x5a, 0xaf, 0xa1, 0x3e, 0xe4, +0x6e, 0xc5, 0x91, 0xb6, 0x75, 0x7d, 0x1b, 0xe4, 0xc5, 0x4d, 0x28, 0x6b, 0xe9, 0xad, 0x20, +0x8b, 0x64, 0x91, 0x57, 0x4f, 0xdf, 0x9a, 0x97, 0x7e, 0xbe, 0x8e, 0xd6, 0xd6, 0x3b, 0x17, +0xf9, 0x19, 0x28, 0xb2, 0x2e, 0x8f, 0x26, 0xb4, 0x9b, 0xe5, 0xde, 0x0f, 0x8d, 0x0a, 0x9a, +0x9d, 0x1b, 0xde, 0x6f, 0xcb, 0x84, 0xba, 0x26, 0xd0, 0x12, 0xef, 0x30, 0x38, 0x43, 0xac, +0xb7, 0xa7, 0xef, 0x09, 0x7c, 0x52, 0x27, 0xfc, 0x2e, 0xab, 0x50, 0xa0, 0x21, 0x40, 0xe7, +0xc1, 0x5f, 0x02, 0x41, 0x84, 0xa8, 0x54, 0xa8, 0x2e, 0x37, 0x6f, 0xd8, 0xb1, 0xa4, 0xd0, +0x75, 0xef, 0x31, 0xca, 0x54, 0x1e, 0x33, 0xad, 0x19, 0xa1, 0x94, 0xbc, 0x1b, 0x34, 0x6c, +0xfb, 0x5f, 0xcc, 0x45, 0x76, 0xc8, 0x96, 0xce, 0x1c, 0x3a, 0x0e, 0x77, 0xed, 0xd8, 0xd2, +0x96, 0xac, 0x77, 0x30, 0xe1, 0xef, 0xb0, 0x33, 0xf0, 0x6e, 0x3d, 0xce, 0x5e, 0x6d, 0xde, +0x8a, 0xdc, 0x9b, 0x91, 0x63, 0x2a, 0x95, 0x20, 0x0d, 0xfd, 0x78, 0xba, 0xcb, 0x15, 0x43, +0xc9, 0x20, 0x96, 0x83, 0x06, 0xd9, 0x11, 0xf3, 0xe2, 0x13, 0xcf, 0x9c, 0x91, 0x7f, 0x33, +0x46, 0xa7, 0xe2, 0xd3, 0x75, 0xff, 0x4f, 0x0c, 0x0c, 0xaf, 0xcd, 0xa6, 0x9c, 0xa6, 0x73, +0xe2, 0x6d, 0x17, 0x16, 0xb5, 0x99, 0x80, 0x35, 0xd9, 0x61, 0xf3, 0x48, 0x23, 0xff, 0xae, +0x53, 0x89, 0xfa, 0x55, 0x1c, 0x37, 0xa5, 0xe8, 0x62, 0x12, 0xb2, 0x22, 0x04, 0xed, 0x42, +0xb6, 0x65, 0xc4, 0x41, 0x42, 0x72, 0xca, 0x7e, 0x5e, 0x2f, 0x69, 0x46, 0xef, 0xbd, 0x7e, +0xdf, 0x35, 0x1e, 0x5b, 0x77, 0xaf, 0x8d, 0x39, 0xf8, 0xa7, 0xd8, 0x31, 0x00, 0xd3, 0x85, +0x66, 0xd5, 0xcd, 0x59, 0xd6, 0x5e, 0x9f, 0xb2, 0x3f, 0x09, 0xd1, 0xc4, 0x5b, 0x74, 0x62, +0xd3, 0x30, 0x35, 0xf3, 0xe3, 0x7d, 0x7f, 0xab, 0x38, 0xc2, 0x33, 0x42, 0xd0, 0x67, 0xd0, +0xf4, 0xcf, 0x97, 0xec, 0x35, 0x31, 0xfe, 0x94, 0x9c, 0xa1, 0x66, 0x91, 0xc8, 0x05, 0x45, +0x19, 0x85, 0x0f, 0x4a, 0xb0, 0x3a, 0x20, 0x44, 0xa4, 0x6b, 0x33, 0x0c, 0xa6, 0xb4, 0x4c, +0x46, 0x30, 0x15, 0x2d, 0xbb, 0x04, 0x3c, 0x9d, 0x48, 0xf6, 0x84, 0x9a, 0x62, 0x07, 0xe9, +0x6c, 0x8f, 0xde, 0x29, 0x28, 0x5a, 0x17, 0xec, 0x56, 0xf3, 0xc4, 0xe0, 0x86, 0x2f, 0xb5, +0x1c, 0x8f, 0xaa, 0xc6, 0xc0, 0xcf, 0x0d, 0xcf, 0x1d, 0x4f, 0xb2, 0xbf, 0x26, 0x5c, 0x7c, +0x8d, 0xd3, 0xe4, 0x56, 0xd1, 0xe8, 0x90, 0x94, 0x6a, 0xba, 0x27, 0xba, 0xf7, 0xba, 0x39, +0xc8, 0x08, 0x03, 0x25, 0x7f, 0x16, 0x8f, 0x61, 0xbf, 0xdf, 0x45, 0x88, 0x7d, 0x90, 0x80, +0x55, 0x58, 0x72, 0x4f, 0xf8, 0xd0, 0x94, 0xbb, 0x55, 0x2a, 0x47, 0x4f, 0xaa, 0x87, 0x2d, +0xd4, 0xe7, 0xaf, 0x08, 0x33, 0xc9, 0xec, 0x0b, 0x5b, 0xb8, 0x53, 0x27, 0x2e, 0xfb, 0xad, +0x69, 0xb6, 0x53, 0x64, 0x48, 0x13, 0x41, 0xf8, 0x02, 0x06, 0x6f, 0xb8, 0xcc, 0x64, 0xec, +0x65, 0x65, 0x7e, 0xdf, 0x3f, 0x1e, 0xe1, 0xee, 0xde, 0x3c, 0x1a, 0xe8, 0x0f, 0xf0, 0x2c, +0xea, 0x6e, 0x52, 0x77, 0x34, 0x41, 0xa1, 0xcc, 0x72, 0x8f, 0x6e, 0x9c, 0x3b, 0x8d, 0x39, +0xdf, 0xd4, 0x08, 0x24, 0xba, 0x36, 0xc7, 0x09, 0xf2, 0xf1, 0xa2, 0xd1, 0xe0, 0xa3, 0x6a, +0x5c, 0xc7, 0xb2, 0x0d, 0x1c, 0xfb, 0x5f, 0xc8, 0x86, 0xd8, 0x3e, 0x1c, 0xb7, 0x1f, 0x2d, +0xd8, 0xf2, 0xcd, 0x52, 0xeb, 0xde, 0x50, 0x14, 0xb7, 0xc7, 0xa2, 0x8b, 0x78, 0x70, 0x11, +0x87, 0x1a, 0xc5, 0xb8, 0xe5, 0x5e, 0xa5, 0xc9, 0x94, 0x22, 0x66, 0x7b, 0x8b, 0x74, 0xab, +0x85, 0x28, 0x95, 0x90, 0x6e, 0x07, 0xdd, 0x79, 0x57, 0xb3, 0x75, 0xc8, 0x18, 0x67, 0x39, +0x06, 0x21, 0x55, 0xba, 0xba, 0xda, 0xf9, 0x3b, 0xe9, 0x5d, 0xc9, 0x1f, 0x6f, 0x61, 0x3b, +0xc2, 0x7e, 0x3d, 0x07, 0xa6, 0x84, 0x91, 0xb7, 0x63, 0x7e, 0x5f, 0xfc, 0xd1, 0x7d, 0x08, +0xdd, 0x79, 0x07, 0xe1, 0x9e, 0x11, 0x25, 0xe8, 0x10, 0x05, 0x66, 0xfa, 0xca, 0xc3, 0x41, +0x01, 0x27, 0x54, 0xd2, 0x46, 0xae, 0xe3, 0xff, 0x43, 0xae, 0x8d, 0x0e, 0x31, 0x13, 0x1f, +0x95, 0x79, 0x82, 0x86, 0x7e, 0xfb, 0xd4, 0x17, 0x57, 0xb8, 0x25, 0xe7, 0x1d, 0x18, 0x8f, +0x06, 0x1a, 0xe5, 0xef, 0x55, 0x28, 0x72, 0x42, 0xae, 0xdf, 0x9e, 0xbb, 0x14, 0xab, 0xd8, +0x36, 0x4f, 0x46, 0x4b, 0x35, 0x92, 0x64, 0x6d, 0xbb, 0x60, 0xc2, 0x0b, 0x6f, 0x57, 0x5e, +0x3a, 0x8f, 0x3d, 0xcb, 0xe5, 0xda, 0x6c, 0x5c, 0x85, 0x8f, 0x9d, 0xa6, 0x7e, 0x1e, 0x49, +0x1a, 0xcc, 0xc9, 0xec, 0x04, 0xab, 0x35, 0xf2, 0x9b, 0xe7, 0xb3, 0x52, 0xb1, 0x1c, 0xc1, +0xfe, 0x5c, 0x0b, 0xf5, 0x72, 0x0b, 0xec, 0x8e, 0xcd, 0x67, 0x98, 0xbf, 0xa5, 0x28, 0xca, +0x48, 0x9b, 0x60, 0x1c, 0xee, 0x00, 0xde, 0x01, 0xbc, 0xa4, 0x02, 0xd2, 0x19, 0xb6, 0x05, +0xd6, 0x52, 0x78, 0xdb, 0x20, 0xbd, 0x3f, 0x95, 0x97, 0xb1, 0x59, 0x3d, 0x9d, 0x83, 0xc2, +0xfd, 0x23, 0xa5, 0xfd, 0xd8, 0x20, 0x92, 0x27, 0xee, 0x3c, 0xe9, 0x5a, 0x61, 0x11, 0xe1, +0x31, 0xb4, 0x4c, 0xb4, 0xa9, 0xe2, 0x6d, 0x2e, 0xae, 0x5f, 0x37, 0x8e, 0x07, 0xfd, 0xed, +0x85, 0x07, 0x79, 0x43, 0x7e, 0xfa, 0xd6, 0x03, 0xe8, 0x5b, 0x65, 0x2a, 0xe4, 0xf9, 0x36, +0x9e, 0xff, 0x53, 0x6d, 0x51, 0x50, 0x61, 0x72, 0x18, 0xcd, 0x3d, 0xe4, 0xb6, 0x27, 0x10, +0x4a, 0xdd, 0xfd, 0xa3, 0x36, 0x67, 0xac, 0xc7, 0x85, 0x1c, 0xd3, 0xe7, 0x17, 0x74, 0xe2, +0x8e, 0xee, 0xa6, 0xf4, 0xb6, 0x86, 0x24, 0xcf, 0x40, 0xdf, 0x35, 0x08, 0x0f, 0x55, 0xdd, +0x51, 0xe9, 0x7c, 0x39, 0x78, 0x5c, 0xdf, 0x20, 0x2a, 0xeb, 0xed, 0x35, 0x10, 0x26, 0x98, +0x77, 0x69, 0x4e, 0x51, 0x7a, 0xb2, 0x9f, 0x1d, 0xbc, 0x06, 0xcd, 0xcf, 0x4d, 0xb9, 0xfa, +0xb7, 0xaf, 0x6a, 0x07, 0x0c, 0x96, 0x42, 0x57, 0x6c, 0x3d, 0xa5, 0xfe, 0x91, 0xe3, 0x76, +0x9f, 0xdd, 0x3c, 0x83, 0x25, 0xab, 0x24, 0x89, 0x47, 0x7c, 0xba, 0xd7, 0x7d, 0x72, 0x90, +0x80, 0xb0, 0x03, 0xa4, 0xef, 0x04, 0x0a, 0x9e, 0x5a, 0x14, 0x1c, 0xab, 0x75, 0x47, 0x05, +0xcb, 0xa2, 0x97, 0x0d, 0x6a, 0xa5, 0x7c, 0xa4, 0x40, 0x90, 0xe2, 0x6c, 0xfa, 0xd4, 0xbd, +0x69, 0xd0, 0x06, 0x53, 0x67, 0xfa, 0xe7, 0xcc, 0x06, 0x42, 0x45, 0xbe, 0xbd, 0x6f, 0x3e, +0x48, 0x70, 0xf5, 0x2b, 0x83, 0xc7, 0xba, 0x54, 0x9c, 0xab, 0x54, 0x1f, 0x81, 0xe2, 0x11, +0x82, 0x51, 0x02, 0x51, 0x63, 0x13, 0x86, 0x38, 0xb1, 0x56, 0x0c, 0x4d, 0x68, 0xf3, 0x53, +0x1d, 0xfb, 0xe3, 0x15, 0xe8, 0x42, 0xf3, 0x27, 0x9b, 0xa5, 0x4a, 0x86, 0x90, 0xe1, 0x17, +0xdc, 0x99, 0xe2, 0x5c, 0x79, 0xc6, 0x5f, 0x7e, 0x33, 0xc0, 0x41, 0xb6, 0x9e, 0xfc, 0x10, +0x8a, 0xf4, 0xfd, 0xe9, 0xd2, 0x52, 0x53, 0x54, 0x89, 0x04, 0xbd, 0x69, 0xd2, 0x54, 0x32, +0x96, 0xec, 0x44, 0x08, 0xc3, 0x86, 0x10, 0xd1, 0x3e, 0x32, 0xb5, 0x4f, 0x52, 0x49, 0x58, +0x49, 0xf2, 0x8d, 0x83, 0x89, 0xf3, 0x24, 0x83, 0x65, 0x72, 0x53, 0xaf, 0x2d, 0x90, 0x61, +0x99, 0x92, 0x31, 0x75, 0x93, 0x46, 0xe5, 0xd3, 0x48, 0x11, 0x01, 0xc9, 0x10, 0x98, 0x66, +0x86, 0x79, 0x19, 0x73, 0x7d, 0xda, 0xa1, 0xb0, 0x41, 0x9e, 0xcd, 0xdc, 0xc2, 0x66, 0x86, +0xdd, 0xb8, 0xc9, 0xe3, 0xe7, 0x80, 0x96, 0xf5, 0x38, 0x72, 0xa5, 0xda, 0xe5, 0x38, 0x13, +0x57, 0x2b, 0xbd, 0x32, 0xc7, 0x44, 0xe0, 0xe3, 0x2d, 0xed, 0x54, 0x40, 0x74, 0x9d, 0x02, +0x55, 0x38, 0x45, 0x89, 0x6f, 0x14, 0x40, 0xf6, 0x7b, 0x41, 0x1e, 0x04, 0xdb, 0xa4, 0xd9, +0xf3, 0x90, 0xae, 0x10, 0xc9, 0xc3, 0x72, 0x5d, 0x0d, 0x01, 0x51, 0xf1, 0xd1, 0x96, 0x43, +0xc6, 0x1a, 0x98, 0x3d, 0xbd, 0xcd, 0xdf, 0x44, 0x82, 0xd0, 0x17, 0xa2, 0x9e, 0x6c, 0x0c, +0x2f, 0x46, 0xeb, 0xd8, 0x4a, 0xce, 0xfe, 0xbe, 0xcd, 0xf9, 0xd4, 0xe3, 0x36, 0xf3, 0xd8, +0x1c, 0x00, 0x24, 0xf2, 0xac, 0x03, 0x11, 0xb6, 0x18, 0x8f, 0x9c, 0xba, 0xf6, 0x4f, 0xfd, +0x78, 0x72, 0x83, 0xbf, 0x3e, 0x5c, 0x24, 0xf9, 0x4d, 0xea, 0x85, 0x74, 0x25, 0xe3, 0x46, +0x7b, 0x5e, 0xfe, 0xbd, 0xbf, 0x5e, 0x68, 0x51, 0xe5, 0x53, 0x85, 0x9a, 0x03, 0x4c, 0x09, +0xf0, 0x6b, 0xc2, 0x97, 0xfc, 0xcc, 0x96, 0x2c, 0xaf, 0xf7, 0x8c, 0x26, 0xd8, 0xc7, 0xfc, +0xda, 0x1f, 0x0e, 0x0f, 0x39, 0x1a, 0xb2, 0x0a, 0x98, 0x1a, 0x15, 0xdc, 0x3e, 0x4b, 0x9e, +0x9d, 0x40, 0x3e, 0x71, 0x5b, 0x66, 0xc3, 0x88, 0xf8, 0x57, 0x14, 0x06, 0xc7, 0x2c, 0xcd, +0x31, 0x8e, 0x1e, 0x88, 0x79, 0x9f, 0x33, 0x94, 0xea, 0x21, 0x08, 0x0d, 0x35, 0x7d, 0xa2, +0x57, 0x46, 0xe3, 0x0f, 0xb9, 0xa9, 0xbc, 0xd2, 0x06, 0xb8, 0xfa, 0xf9, 0xb0, 0xf3, 0xc3, +0x8a, 0x38, 0x82, 0x06, 0x7f, 0xd9, 0xce, 0x92, 0xa2, 0x9e, 0xfc, 0x2a, 0xc8, 0x51, 0xb7, +0x7d, 0xdb, 0x47, 0x37, 0xaf, 0x8b, 0xb8, 0x6d, 0x70, 0x21, 0x02, 0x63, 0x5e, 0xbd, 0x38, +0xf1, 0xe1, 0x9f, 0xe3, 0xe2, 0x79, 0x3b, 0x42, 0x05, 0xe2, 0xc6, 0x13, 0x7a, 0xe2, 0x91, +0x73, 0xe2, 0x79, 0x8b, 0x2f, 0x7f, 0x88, 0x02, 0x06, 0x4e, 0xb8, 0x66, 0xb8, 0xc0, 0xc4, +0x3b, 0x1c, 0x3e, 0x96, 0x0f, 0xbb, 0x7f, 0xe8, 0x85, 0x5b, 0xb2, 0xf6, 0xa7, 0x48, 0x5b, +0x95, 0x83, 0x57, 0xe0, 0xe8, 0x22, 0x67, 0x07, 0x3c, 0x27, 0x65, 0x66, 0xe8, 0x84, 0xab, +0xea, 0xf5, 0xb5, 0x00, 0xec, 0xa4, 0xa3, 0xe8, 0x25, 0x77, 0xd1, 0x81, 0x9c, 0x87, 0xd3, +0x1a, 0x31, 0x58, 0xa4, 0x0a, 0xa8, 0x71, 0x9c, 0x52, 0x88, 0x4d, 0x50, 0xff, 0xdb, 0x41, +0x81, 0x04, 0xc3, 0x84, 0xaa, 0x72, 0x79, 0x2f, 0x9b, 0x2d, 0x2f, 0x1c, 0xa5, 0x6b, 0x68, +0x9b, 0x3b, 0x6b, 0x1c, 0x67, 0xeb, 0x42, 0xe0, 0xe3, 0x2c, 0x7b, 0x52, 0x8e, 0xc1, 0x7e, +0xd8, 0xab, 0x02, 0x46, 0xd1, 0x83, 0x38, 0x1a, 0x18, 0xad, 0x90, 0x7f, 0xdb, 0x22, 0xc1, +0x80, 0xea, 0xf7, 0x67, 0x1d, 0xa7, 0xb2, 0x40, 0xdb, 0xc3, 0xc4, 0xd5, 0x8b, 0x49, 0xf8, +0xdc, 0x25, 0x80, 0x7e, 0xfa, 0x64, 0xac, 0x36, 0x4d, 0x74, 0x6f, 0x3e, 0x57, 0x23, 0xb4, +0x49, 0x7c, 0x6f, 0x3e, 0x7c, 0xa7, 0x34, 0xb7, 0x6b, 0x66, 0xf8, 0xd1, 0x69, 0x6d, 0x83, +0xc5, 0x8a, 0xe2, 0x42, 0x3f, 0x8b, 0x5e, 0x5a, 0xd5, 0xcd, 0x47, 0x64, 0xeb, 0x4e, 0xef, +0x62, 0x19, 0x37, 0xd3, 0x8e, 0x68, 0x51, 0x4a, 0x96, 0xbb, 0x5b, 0xa0, 0x34, 0xd8, 0xb4, +0xf4, 0xb0, 0x99, 0x53, 0xb1, 0x70, 0xc3, 0x1d, 0x6e, 0x2b, 0x03, 0x76, 0xc9, 0x00, 0x0b, +0x10, 0xca, 0xb7, 0xf3, 0xbe, 0x4b, 0xe2, 0xb4, 0x6c, 0x4a, 0x9f, 0x59, 0x39, 0x30, 0xc7, +0xc3, 0x88, 0x38, 0x63, 0xc4, 0xcf, 0xd1, 0xfd, 0xf0, 0x6d, 0xfe, 0x68, 0x92, 0x98, 0x11, +0x7d, 0x90, 0x0c, 0x64, 0x23, 0xe8, 0x25, 0x77, 0xd1, 0x81, 0x75, 0xa4, 0xf4, 0x35, 0x6f, +0xe4, 0x9c, 0x7a, 0x48, 0xd0, 0xde, 0x37, 0x42, 0xf8, 0x5b, 0xe9, 0x16, 0xba, 0x16, 0x4b, +0x7c, 0xdb, 0x2c, 0x0e, 0xa0, 0xbc, 0x5c, 0x82, 0x71, 0xa0, 0x9d, 0x3a, 0x0a, 0x7e, 0xd0, +0xdc, 0x93, 0x79, 0xf6, 0x78, 0xb5, 0x89, 0xd9, 0x70, 0x5d, 0xe0, 0x9d, 0xe7, 0xea, 0xee, +0x88, 0x52, 0x18, 0x11, 0x7d, 0xf1, 0xce, 0xc1, 0x69, 0x8d, 0x3f, 0xea, 0x51, 0xc1, 0x49, +0xb1, 0xc4, 0xa6, 0xf0, 0xdc, 0xbd, 0x61, 0xb7, 0x2c, 0x85, 0x4a, 0xcb, 0xdd, 0x96, 0x50, +0x8b, 0x68, 0xf7, 0x7e, 0xb9, 0x1c, 0x19, 0xfb, 0x5c, 0x79, 0xf8, 0x7d, 0xe9, 0xf3, 0x0e, +0xc7, 0x6e, 0x1c, 0x67, 0xb4, 0xb7, 0x4a, 0xc5, 0xbe, 0x3c, 0x8c, 0x94, 0x36, 0x02, 0x8f, +0x81, 0x57, 0xe7, 0x4b, 0xd6, 0x2b, 0x10, 0xbe, 0x3c, 0x97, 0xbb, 0x41, 0x88, 0x6f, 0x13, +0xe6, 0x27, 0x13, 0x4b, 0xd5, 0x44, 0xa9, 0xd9, 0x2d, 0xcd, 0x51, 0x91, 0x03, 0x14, 0xd5, +0x6b, 0x3d, 0xb5, 0x98, 0xf0, 0x09, 0xaa, 0x42, 0x8e, 0x82, 0xe8, 0xf1, 0x36, 0xec, 0xb5, +0x48, 0x5f, 0x9f, 0xca, 0x16, 0x5a, 0x3f, 0x4d, 0xbb, 0xa6, 0xd4, 0x08, 0x1a, 0xfb, 0xe5, +0xeb, 0x40, 0x04, 0xe8, 0x40, 0x84, 0xc4, 0x8e, 0x74, 0xae, 0x47, 0x4d, 0xfc, 0xb5, 0x91, +0xe2, 0x33, 0xf2, 0xf7, 0xae, 0xcd, 0x10, 0x47, 0xb1, 0x4b, 0xe2, 0xa2, 0x8d, 0x7c, 0x2c, +0x32, 0x6f, 0xdd, 0xc4, 0xc2, 0xf1, 0x09, 0x56, 0x2d, 0x1e, 0x9d, 0x7d, 0x67, 0x32, 0x61, +0x7f, 0x12, 0xe4, 0x3f, 0xfa, 0xe2, 0x7d, 0x7b, 0xd4, 0x67, 0x4e, 0x7f, 0x14, 0x6a, 0x6c, +0x8e, 0x74, 0x9b, 0xbc, 0x3d, 0xc4, 0x70, 0xc4, 0x37, 0xd5, 0x60, 0xe0, 0x87, 0xbd, 0xb8, +0x1a, 0x75, 0x9d, 0x7a, 0x80, 0xc1, 0xa9, 0x1f, 0xad, 0x7b, 0x27, 0xe5, 0x4c, 0xb0, 0x06, +0xd0, 0xfb, 0x1c, 0x5a, 0xeb, 0xbd, 0x2e, 0x96, 0x49, 0x13, 0x43, 0x06, 0x8b, 0xcb, 0x6a, +0xf0, 0x5d, 0x56, 0x6c, 0x4e, 0x18, 0x26, 0xd4, 0xc8, 0x53, 0x48, 0x70, 0xe2, 0x0f, 0x9c, +0xa1, 0x35, 0x01, 0x96, 0xc7, 0x0b, 0xc9, 0x4b, 0xd3, 0x19, 0xe8, 0x5a, 0x75, 0xad, 0xc8, +0x52, 0xce, 0x3c, 0x2e, 0xfd, 0x5f, 0x04, 0xcf, 0x9e, 0xd6, 0x33, 0xdb, 0x08, 0x34, 0xba, +0x34, 0x9b, 0xf4, 0x25, 0xaa, 0x7f, 0x52, 0x37, 0x4f, 0x8b, 0x94, 0x95, 0x94, 0x2d, 0x88, +0x10, 0xd1, 0x05, 0x07, 0xcf, 0xd4, 0x04, 0xdb, 0x95, 0xbe, 0x36, 0xd0, 0x1c, 0x1c, 0xa4, +0x85, 0x0a, 0x02, 0x80, 0xde, 0xb1, 0x1b, 0x56, 0xaf, 0x51, 0x22, 0xa7, 0xa4, 0x4a, 0x2c, +0x2f, 0x17, 0x7c, 0x13, 0x4c, 0x36, 0xad, 0x90, 0x8c, 0xea, 0xd4, 0x58, 0x3a, 0xca, 0xea, +0x1d, 0x5c, 0x6c, 0x93, 0xad, 0x59, 0xed, 0xb1, 0x17, 0xa4, 0x22, 0x95, 0x67, 0xbe, 0xbb, +0x25, 0xaf, 0x65, 0xc8, 0xe5, 0x90, 0xe1, 0x17, 0xdc, 0x7a, 0x47, 0xe9, 0x8f, 0xc3, 0xc3, +0x5a, 0xdc, 0x20, 0x20, 0x4a, 0x09, 0xfc, 0x39, 0x51, 0x29, 0x31, 0xfb, 0xa0, 0x0a, 0x61, +0x08, 0x9b, 0xb9, 0xb3, 0x6c, 0x95, 0xc5, 0x94, 0x00, 0x66, 0xf1, 0xb9, 0x79, 0x90, 0x7f, +0x95, 0x5f, 0x55, 0xe1, 0x13, 0x6b, 0x87, 0xa8, 0x62, 0x21, 0x98, 0xf2, 0x57, 0x19, 0x92, +0x10, 0xb3, 0x24, 0x81, 0x12, 0x21, 0xff, 0xd6, 0xf9, 0x73, 0x71, 0xc2, 0x62, 0x09, 0x31, +0xeb, 0xe0, 0x7a, 0x35, 0x60, 0x8d, 0xc9, 0xb1, 0xe5, 0xa7, 0x8b, 0xca, 0xbc, 0x2d, 0xfa, +0x63, 0xc7, 0x68, 0x1d, 0x19, 0xb5, 0x61, 0x78, 0xd0, 0x8b, 0xdb, 0xc0, 0x39, 0x22, 0x55, +0x6a, 0x28, 0xc2, 0x52, 0x1e, 0x6b, 0xf7, 0x1d, 0xb6, 0xfa, 0x4f, 0xcf, 0x27, 0x7c, 0xaf, +0x7f, 0x0c, 0x96, 0xba, 0xce, 0x2a, 0x54, 0x59, 0x5b, 0x20, 0xfb, 0x42, 0x87, 0x44, 0xd9, +0x2e, 0x10, 0x43, 0xab, 0x58, 0x92, 0xb6, 0x8d, 0x78, 0xf3, 0xa3, 0xde, 0x0e, 0x07, 0x75, +0x68, 0x52, 0x26, 0x3f, 0x3d, 0xec, 0xd0, 0x36, 0xdf, 0x1a, 0x16, 0x88, 0x5f, 0xbd, 0x1c, +0x4d, 0x9e, 0x27, 0x4c, 0x12, 0x07, 0x0d, 0x2b, 0xb1, 0xdc, 0x00, 0x45, 0x54, 0x3d, 0xfc, +0xcf, 0xfa, 0xc9, 0x06, 0x4b, 0x08, 0x64, 0xac, 0x8d, 0x17, 0x4d, 0xdf, 0x83, 0x24, 0xfb, +0xf6, 0x9e, 0x5f, 0xf9, 0x0f, 0x8d, 0x07, 0x18, 0xb1, 0xb2, 0x37, 0xd2, 0x66, 0x9c, 0x82, +0x09, 0x75, 0x52, 0x5b, 0x19, 0x74, 0x59, 0xa3, 0x64, 0x6d, 0x17, 0x93, 0x3a, 0x13, 0xd2, +0xda, 0x97, 0xa4, 0x2b, 0x55, 0x7a, 0x32, 0xf9, 0x2f, 0x9b, 0xaa, 0x87, 0x6d, 0xce, 0x1d, +0x07, 0x9a, 0x52, 0xfa, 0x40, 0xc5, 0x20, 0x43, 0xcc, 0xa8, 0xc3, 0x84, 0x2c, 0x44, 0x8b, +0x44, 0x88, 0x62, 0xe7, 0x68, 0x4c, 0x2a, 0x69, 0xa7, 0xcf, 0x6f, 0x4d, 0x06, 0xed, 0x8a, +0x8f, 0x9a, 0x62, 0xca, 0xed, 0xa5, 0x57, 0x18, 0x86, 0x9d, 0xe8, 0x7c, 0x14, 0xeb, 0x71, +0xeb, 0xc0, 0xf4, 0x3a, 0x98, 0x11, 0x01, 0xc0, 0xa3, 0x53, 0xaf, 0x20, 0x7e, 0xde, 0x22, +0x5c, 0x1f, 0x60, 0x8b, 0xb7, 0x5f, 0x74, 0x76, 0xd0, 0x87, 0xfa, 0x11, 0xd3, 0xa5, 0xba, +0x5c, 0x82, 0xe1, 0x52, 0x54, 0x6b, 0x69, 0xeb, 0x31, 0x43, 0x01, 0x1a, 0x55, 0x7f, 0xdc, +0x2f, 0xd8, 0x01, 0x26, 0x6f, 0x1c, 0x2d, 0x72, 0x7b, 0xc8, 0x93, 0x99, 0x2a, 0x08, 0xa8, +0x6f, 0xb4, 0x28, 0x40, 0x8a, 0x8a, 0x4e, 0xd5, 0x3b, 0x39, 0x45, 0xa8, 0xe4, 0xe7, 0x73, +0x8f, 0x00, 0x64, 0xd3, 0xc7, 0x87, 0xde, 0x43, 0x82, 0x2c, 0xe8, 0x57, 0x17, 0x29, 0xce, +0xb8, 0x47, 0xd6, 0x08, 0x79, 0xd7, 0xc4, 0xe9, 0x23, 0x43, 0x9d, 0xb8, 0xcb, 0x78, 0x08, +0x32, 0xf1, 0xec, 0x84, 0x80, 0x1e, 0xb9, 0x29, 0x12, 0x0c, 0x29, 0xcc, 0x9c, 0xd0, 0x10, +0xa7, 0xd6, 0x8a, 0xe9, 0xf6, 0xfa, 0x8d, 0x7e, 0x95, 0x2e, 0x57, 0xcf, 0x8e, 0x38, 0x6b, +0x35, 0xf0, 0xbc, 0xa6, 0x4e, 0x13, 0x7b, 0x41, 0x19, 0x15, 0x5d, 0x99, 0xbd, 0x22, 0x40, +0x6a, 0x07, 0x2d, 0xd5, 0xd6, 0xff, 0x1d, 0x7b, 0xa6, 0xc4, 0xaa, 0x77, 0x44, 0x78, 0x2f, +0x55, 0x9f, 0x7d, 0x53, 0xf0, 0x2b, 0x2b, 0xba, 0x36, 0xc2, 0xf8, 0x6d, 0xf0, 0x2b, 0xbb, +0x6b, 0x97, 0x05, 0xb4, 0x4a, 0xc2, 0x86, 0x62, 0xb8, 0x76, 0xe7, 0xbb, 0xdf, 0x9c, 0x5a, +0x70, 0x19, 0x95, 0x59, 0x15, 0xcf, 0xa6, 0xa9, 0x7a, 0x24, 0x4c, 0xc6, 0x65, 0xb9, 0xda, +0x17, 0x6f, 0x2b, 0x55, 0x07, 0x32, 0x72, 0xd1, 0xee, 0x9c, 0x3a, 0x51, 0x98, 0x36, 0x37, +0xf8, 0x61, 0xfc, 0x91, 0xbc, 0xcb, 0x34, 0xd8, 0x43, 0xa0, 0x7a, 0xea, 0xc4, 0x8a, 0x64, +0x4d, 0xe0, 0x03, 0x93, 0xfb, 0xb4, 0xd8, 0x11, 0x21, 0x11, 0x66, 0x97, 0xb9, 0xba, 0x81, +0x29, 0xc2, 0x8f, 0x8c, 0x14, 0x18, 0x22, 0x94, 0xc4, 0xb0, 0xf1, 0x10, 0xc4, 0x8b, 0x5d, +0x8d, 0x7f, 0x14, 0xaf, 0x46, 0x19, 0x36, 0xa4, 0x36, 0x22, 0x18, 0x18, 0xe3, 0xab, 0x2c, +0x91, 0x03, 0xf7, 0xc5, 0xf5, 0xf5, 0x59, 0xc2, 0xd2, 0xf7, 0xc7, 0x64, 0x54, 0x76, 0xfb, +0x71, 0x70, 0xe8, 0xb2, 0x44, 0xa1, 0x2d, 0x59, 0x17, 0x02, 0xd6, 0x6f, 0x7a, 0xeb, 0xe0, +0x53, 0x81, 0xf6, 0x5e, 0x7f, 0x37, 0xd4, 0x52, 0x13, 0x04, 0x44, 0xd5, 0xc8, 0xd3, 0xdd, +0x6f, 0xd5, 0xfb, 0x71, 0x20, 0xe3, 0x0d, 0x0c, 0x47, 0x25, 0xa1, 0x41, 0xd2, 0xc7, 0xe5, +0xc9, 0xd9, 0x27, 0xa5, 0x38, 0xe4, 0x30, 0xbb, 0x86, 0x07, 0x84, 0xef, 0x24, 0x9f, 0xf9, +0x52, 0x74, 0xd2, 0x50, 0x73, 0xc4, 0x27, 0x73, 0x3b, 0x8d, 0x9c, 0xa6, 0xf6, 0x4b, 0x25, +0x91, 0xc5, 0x9e, 0x1e, 0xb2, 0x78, 0x0c, 0x23, 0x80, 0xdd, 0xa3, 0x21, 0xf5, 0xa9, 0x9e, +0x00, 0x16, 0x19, 0xbc, 0xd9, 0x55, 0x09, 0x90, 0xa2, 0xc6, 0xef, 0x3d, 0xf8, 0x72, 0x66, +0x2f, 0xdc, 0x3a, 0xf6, 0x4f, 0xfd, 0x59, 0x30, 0xe2, 0x27, 0xcc, 0xfb, 0x55, 0x09, 0x71, +0x41, 0xe1, 0x21, 0xa1, 0xa1, 0xc0, 0xe3, 0x25, 0xa9, 0xd0, 0x22, 0xc6, 0xef, 0x5c, 0x1b, +0xb4, 0xea, 0x56, 0x2e, 0xbf, 0xfc, 0x5b, 0x34, 0xcb, 0x14, 0x8b, 0x94, 0xaa, 0xb7, 0xec, +0x5a, 0x36, 0xcf, 0x1c, 0xba, 0xf6, 0x4d, 0xdb, 0x35, 0xf3 }; diff --git a/keyboards/oddball/config.h b/keyboards/oddball/config.h new file mode 100644 index 00000000000..b3679bea4ce --- /dev/null +++ b/keyboards/oddball/config.h @@ -0,0 +1,255 @@ +/* +Copyright 2020 Alexander Tulloh + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA49 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Alexander Tulloh +#define PRODUCT Oddball +#define DESCRIPTION A ballin keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS { F6, B5, B6, F7 } +#define MATRIX_COL_PINS { D6, D7, B4, D3, C6, C7 } +#define UNUSED_PINS { B7, D4, D5, E6, F0, F1, F4, F5 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define USE_I2C +#define SPLIT_USB_DETECT +#define MASTER_RIGHT + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #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 +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* disable these deprecated features by default */ +#ifndef LINK_TIME_OPTIMIZATION_ENABLE + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION +#endif +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/oddball/info.json b/keyboards/oddball/info.json new file mode 100644 index 00000000000..8b38c9fa839 --- /dev/null +++ b/keyboards/oddball/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "Oddball", + "url": "https://atulloh.github.io/oddball", + "maintainer": "Alexander Tulloh", + "width": 14, + "height": 4.75, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"sw1", "x":0, "y":0.37}, {"label":"sw2", "x":1, "y":0.37}, {"label":"sw3", "x":2, "y":0.12}, {"label":"sw4", "x":3, "y":0}, {"label":"sw5", "x":4, "y":0.12}, {"label":"sw6", "x":5, "y":0.25}, + {"label":"sw6", "x":8 , "y":0.25}, {"label":"sw5", "x":9 , "y":0.12}, {"label":"sw4", "x":10, "y":0}, {"label":"sw3", "x":11, "y":0.12}, {"label":"sw2", "x":12, "y":0.37}, {"label":"sw1", "x":13, "y":0.37}, + {"label":"sw7", "x":0, "y":1.37}, {"label":"sw8", "x":1, "y":1.37}, {"label":"sw9", "x":2, "y":1.12}, {"label":"sw10", "x":3, "y":1}, {"label":"sw11", "x":4, "y":1.12}, {"label":"sw12", "x":5, "y":1.25}, + {"label":"sw12", "x":8, "y":1.25}, {"label":"sw11", "x":9, "y":1.12}, {"label":"sw10", "x":10, "y":1}, {"label":"sw9", "x":11, "y":1.12}, {"label":"sw8", "x":12, "y":1.37}, {"label":"sw7", "x":13, "y":1.37}, + {"label":"sw13", "x":0, "y":2.37}, {"label":"sw14", "x":1, "y":2.37}, {"label":"sw15", "x":2, "y":2.12}, {"label":"sw16", "x":3, "y":2}, {"label":"sw17", "x":4, "y":2.12}, {"label":"sw18", "x":5, "y":2.25}, + {"label":"sw18", "x":8, "y":2.25}, {"label":"sw17", "x":9, "y":2.12}, {"label":"sw16", "x":10, "y":2}, {"label":"sw15", "x":11, "y":2.12}, {"label":"sw14", "x":12, "y":2.37}, {"label":"sw13", "x":13, "y":2.37}, + {"label":"sw19", "x":4.5, "y":3.5, "h":1.25}, {"label":"sw20", "x":5.5, "y":3.5, "h":1.25}, + {"label":"sw20", "x":7.5, "y":3.5, "h":1.25}, {"label":"sw19", "x":8.5, "y":3.5, "h":1.25} + ] + } + } +} diff --git a/keyboards/oddball/keymaps/default/keymap.c b/keyboards/oddball/keymaps/default/keymap.c new file mode 100644 index 00000000000..439e63cd63e --- /dev/null +++ b/keyboards/oddball/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2020 Alexander Tulloh + * + * 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 . + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + KC_BSPC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TAB, + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_SPC, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(_LOWER), KC_LCTL, _______, MO(_RAISE) + ), + + [_LOWER] = LAYOUT( + KC_DEL, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_BTN3, KC_DQUO, KC_7, KC_8, KC_9, KC_ASTR, KC_UNDS, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_QUOT, KC_4, KC_5, KC_6, KC_PLUS, KC_ENT, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_0, KC_1, KC_2, KC_3, KC_MINS, _______, + _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT( + _______, KC_ESC, KC_F7, KC_F9, KC_F9, KC_F10, KC_PIPE, KC_PGUP, KC_UP, KC_PGDN, KC_GRAVE, _______, + _______, KC_LGUI, KC_F4, KC_F5, KC_F6, KC_F11, KC_AMPR, KC_LEFT, KC_DOWN, KC_RGHT, KC_TILD, _______, + _______, KC_INS, KC_F1, KC_F2, KC_F3, KC_F12, KC_EQUAL, KC_HOME, _______, KC_END, KC_BSLS, _______, + _______, _______, _______, _______ + ) +}; diff --git a/keyboards/oddball/oddball.c b/keyboards/oddball/oddball.c new file mode 100644 index 00000000000..5a2ce5ea0e6 --- /dev/null +++ b/keyboards/oddball/oddball.c @@ -0,0 +1,17 @@ +/* Copyright 2020 Alexander Tulloh + * + * 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 . + */ + +#include "oddball.h" diff --git a/keyboards/oddball/oddball.h b/keyboards/oddball/oddball.h new file mode 100644 index 00000000000..1f52271dbd3 --- /dev/null +++ b/keyboards/oddball/oddball.h @@ -0,0 +1,44 @@ +/* Copyright 2020 Alexander Tulloh + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + LT1, LT2, RT1, RT2 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, LT1, LT2 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, RT2, RT1 } \ + } diff --git a/keyboards/oddball/readme.md b/keyboards/oddball/readme.md new file mode 100644 index 00000000000..3f4a4a1b239 --- /dev/null +++ b/keyboards/oddball/readme.md @@ -0,0 +1,13 @@ +# Oddball + +A split keyboard with trackball support. + +* Keyboard Maintainer: [Alexander Tulloh](https://github.com/atulloh) +* Hardware Supported: Oddball PCB and plates, and using an [ADNS9800 and breakout board for mouse](https://www.tindie.com/products/jkicklighter/adns-9800-laser-motion-sensor/) +* Hardware Availability: [atulloh.github.io/oddball](https://atulloh.github.io/oddball) + +Make example for this keyboard (after setting up your build environment): + + make oddball:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/oddball/rules.mk b/keyboards/oddball/rules.mk new file mode 100644 index 00000000000..af8c3d31d40 --- /dev/null +++ b/keyboards/oddball/rules.mk @@ -0,0 +1,39 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = halfkay + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs + +DEBOUNCE_TYPE = eager_pk +SPLIT_KEYBOARD = yes + +# Add trackball support +POINTING_DEVICE_ENABLE = yes +SRC += adns.c diff --git a/keyboards/palette1202/config.h b/keyboards/palette1202/config.h new file mode 100644 index 00000000000..65db763b4d6 --- /dev/null +++ b/keyboards/palette1202/config.h @@ -0,0 +1,55 @@ +/* +Copyright 2019 niltea + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1202 +#define DEVICE_VER 0x0001 +#define MANUFACTURER niltea +#define PRODUCT Palette1202 +#define DESCRIPTION A left hand device with rotary encoder + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 5 + +#define MATRIX_ROW_PINS { B6, B2, B3 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } +#define UNUSED_PINS { D2, D3, D4, B1 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* Encoders */ +#define ENCODERS_PAD_A { F4, F6 } +#define ENCODERS_PAD_B { F5, F7 } + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* Register custom font file */ +#ifdef OLED_DRIVER_ENABLE + #define OLED_FONT_H "lib/glcdfont.c" +#endif + +/* Feature disable options */ +#define NO_DEBUG +#define NO_PRINT diff --git a/keyboards/palette1202/info.json b/keyboards/palette1202/info.json new file mode 100644 index 00000000000..847948626e4 --- /dev/null +++ b/keyboards/palette1202/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "Palette1202", + "url": "https://github.com/niltea/Palette1202", + "maintainer": "niltea", + "width": 5, + "height": 3.5, + "layouts": { + "LAYOUT": { + "key_count": 14, + "layout": [ + { "label":"Tab", "x": 0, "y": 0.75 }, + { "label":"GUI + A", "x": 1, "y": 0.25 }, + { "label":"E", "x": 2, "y": 0 }, + { "label":"P", "x": 3, "y": 0.5 }, + { "label":"GUI + 0", "x": 4, "y": 0 }, + + { "label":"Fn", "x": 0, "y": 1.75 }, + { "label":"M", "x": 1, "y": 1.25 }, + { "label":"BackSP", "x": 2, "y": 1 }, + { "label":"B", "x": 3, "y": 1.5 }, + { "label":"HYPR", "x": 4, "y": 1 }, + + { "label":"Shift", "x": 1, "y": 2.5 }, + { "label":"LGUI", "x": 2, "y": 2.5 }, + { "label":"GUI + Z", "x": 3, "y": 2.5 }, + { "label":"Space", "x": 4, "y": 2.5, "r": 15 } + ] + } + } +} diff --git a/keyboards/palette1202/keymaps/default/config.h b/keyboards/palette1202/keymaps/default/config.h new file mode 100644 index 00000000000..a5bb9bbfc86 --- /dev/null +++ b/keyboards/palette1202/keymaps/default/config.h @@ -0,0 +1,20 @@ +/* Copyright 2019 niltea + * + * 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 . + */ + +#pragma once + +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 diff --git a/keyboards/palette1202/keymaps/default/keymap.c b/keyboards/palette1202/keymaps/default/keymap.c new file mode 100644 index 00000000000..9c7bc745635 --- /dev/null +++ b/keyboards/palette1202/keymaps/default/keymap.c @@ -0,0 +1,329 @@ +/* Copyright 2019 niltea + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef OLED_DRIVER_ENABLE + #include + #include "lib/oled_helper.h" +#endif + +enum custom_keycode { + Mac_CS = SAFE_RANGE, + Mac_PS, + Win_CS, + Win_PS, + IOS_CS, +}; +enum layerID { + MAC_CS_1 = 0, + MAC_CS_2, + MAC_PS_1, + MAC_PS_2, + WIN_CS_1, + WIN_CS_2, + WIN_PS_1, + WIN_PS_2, + IOS_CS_1, + IOS_CS_2, + SETTING, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Mac + // Clip Studio + [MAC_CS_1] = LAYOUT( + KC_TAB, LGUI(KC_A), KC_E, KC_P, LGUI(KC_0), + MO(MAC_CS_2), KC_M, KC_BSPC, KC_B, KC_HYPR, + KC_LSFT, KC_LGUI, LGUI(KC_Z), KC_SPC + ), + [MAC_CS_2] = LAYOUT( + MO(SETTING), KC_ESC, KC_G, KC_R, LGUI(KC_GRV), + _______, LGUI(KC_D), KC_K, KC_F, LGUI(KC_S), + KC_LALT, KC_I, SGUI(KC_Z), KC_H + ), + // Photoshop + [MAC_PS_1] = LAYOUT( + KC_TAB, LGUI(KC_A), KC_E, KC_B, LGUI(KC_1), + MO(MAC_PS_2), KC_L, LGUI(KC_DEL), LGUI(KC_QUOT), KC_MEH, + KC_LSFT, KC_LGUI, LGUI(KC_Z), KC_SPC + ), + [MAC_PS_2] = LAYOUT( + MO(SETTING), KC_ESC, KC_G, KC_R, KC_ESC, + _______, LGUI(KC_D), KC_V, LGUI(KC_T), LGUI(KC_S), + KC_LALT, KC_I, SGUI(KC_Z), KC_H + ), + + // Windows + // Clip Studio + [WIN_CS_1] = LAYOUT( + KC_TAB, LCTL(KC_A), KC_E, KC_P, LCTL(KC_0), + MO(WIN_CS_2), KC_M, KC_BSPC, KC_B, KC_HYPR, + KC_LSFT, KC_LCTRL, LCTL(KC_Z), KC_SPC + ), + [WIN_CS_2] = LAYOUT( + MO(SETTING), KC_ESC, KC_G, KC_R, LCTL(KC_GRV), + _______, LCTL(KC_D), KC_K, KC_F, LCTL(KC_S), + KC_LALT, KC_I, C(S(KC_Z)), KC_H + ), + // Photoshop + [WIN_PS_1] = LAYOUT( + KC_TAB, LCTL(KC_A), KC_E, KC_B, LCTL(KC_1), + MO(WIN_PS_2), KC_L, LCTL(KC_DEL), LCTL(KC_QUOT), KC_MEH, + KC_LSFT, KC_LCTRL, LCTL(KC_Z), KC_SPC + ), + [WIN_PS_2] = LAYOUT( + MO(SETTING), KC_ESC, KC_G, KC_R, KC_ESC, + _______, LCTL(KC_D), KC_V, LCTL(KC_T), LCTL(KC_S), + KC_LALT, KC_I, C(S(KC_Z)), KC_H + ), + // iOS + // Clip Studio + [IOS_CS_1] = LAYOUT( + KC_TAB, LGUI(KC_A), KC_E, KC_P, LGUI(KC_0), + MO(IOS_CS_2), KC_M, KC_BSPC, KC_B, LGUI(KC_LALT), + KC_LSFT, KC_LGUI, LGUI(KC_Z), KC_SPC + ), + [IOS_CS_2] = LAYOUT( + MO(SETTING), KC_ESC, KC_G, KC_R, LGUI(KC_EQL), + _______, LGUI(KC_D), KC_K, KC_F, LGUI(KC_S), + KC_LALT, KC_I, SGUI(KC_Z), KC_H + ), + [SETTING] = LAYOUT( + _______, IOS_CS, Win_CS, Mac_CS, KC_NO, + _______, KC_NO, Win_PS, Mac_PS, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ), +}; + +void encoder_update_user(uint8_t index, bool clockwise) { + uint8_t currentDefault = get_highest_layer(default_layer_state); + uint8_t currentLayer = get_highest_layer(layer_state); + if (index == 0) { /* the upper encoder */ + switch (currentDefault) { + case MAC_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // Zoom + tap_code16(!clockwise ? G(KC_EQL) : G(KC_MINS)); + } else { + // Fn Layer + // rotate canvas + tap_code(!clockwise ? KC_QUOT : KC_MINS); + } + break; + case MAC_PS_1: + if (currentLayer % 2 == 0) { + // default layer + // Zoom + tap_code16(!clockwise ? G(KC_EQL) : G(KC_MINS)); + } else { + // Fn Layer + // undo / redo + tap_code16(!clockwise ? S(G(KC_Z)) : G(KC_Z)); + } + break; + case WIN_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // Zoom + tap_code16(!clockwise ? C(KC_EQL) : C(KC_MINS)); + } else { + // Fn Layer + // rotate canvas + tap_code(!clockwise ? KC_QUOT : KC_MINS); + } + break; + case WIN_PS_1: + if (currentLayer % 2 == 0) { + // default layer + // Zoom + tap_code16(!clockwise ? C(KC_SCLN) : C(KC_MINS)); + } else { + // Fn Layer + // undo / redo + tap_code16(!clockwise ? C(S(KC_Z)) : C(KC_Z)); + } + break; + case IOS_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // Zoom + tap_code16(!clockwise ? G(KC_SCLN) : G(KC_MINS)); + } else { + // Fn Layer + // rotate canvas + tap_code(!clockwise ? KC_EQL : KC_MINS); + } + break; + default: + break; + } + } else if (index == 1) { /* the lower encoder */ + switch (currentDefault) { + case MAC_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // size of brush + tap_code(!clockwise ? KC_RBRC : KC_LBRC); + } else { + // Fn Layer + // opacity of brush + tap_code16(!clockwise ? G(KC_RBRC) : G(KC_LBRC)); + } + break; + case MAC_PS_1: + if (currentLayer % 2 == 0) { + // default layer + // size of brush + tap_code(!clockwise ? KC_RBRC : KC_LBRC); + } else { + // Fn Layer + // opacity of brush + tap_code16(!clockwise ? KC_RCBR : KC_LCBR); + } + break; + case WIN_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // rotate canvas + tap_code(!clockwise ? KC_RBRC : KC_LBRC); + } else { + // Fn Layer + // opacity of brush + tap_code16(!clockwise ? C(KC_RBRC) : C(KC_LBRC)); + } + break; + case WIN_PS_1: + if (currentLayer % 2 == 0) { + // default layer + // rotate canvas + tap_code(!clockwise ? KC_RBRC : KC_LBRC); + } else { + // Fn Layer + // opacity of brush + tap_code16(!clockwise ? KC_RCBR : KC_LCBR); + } + break; + case IOS_CS_1: + if (currentLayer % 2 == 0) { + // default layer + // size of brush + tap_code(!clockwise ? KC_BSLS : KC_RBRC); + } else { + // Fn Layer + // opacity of brush + tap_code16(!clockwise ? G(KC_BSLS) : G(KC_RBRC)); + } + break; + default: + break; + } + } +} + +// custom keycode +// switch default layer +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case Mac_CS: + if (record->event.pressed) { + set_single_persistent_default_layer(MAC_CS_1); + } + return false; + break; + case Mac_PS: + if (record->event.pressed) { + set_single_persistent_default_layer(MAC_PS_1); + } + return false; + break; + case Win_CS: + if (record->event.pressed) { + set_single_persistent_default_layer(WIN_CS_1); + } + return false; + break; + case Win_PS: + if (record->event.pressed) { + set_single_persistent_default_layer(WIN_PS_1); + } + return false; + break; + case IOS_CS: + if (record->event.pressed) { + set_single_persistent_default_layer(IOS_CS_1); + } + return false; + break; + } + return true; +} + +// OLED Display +#ifdef OLED_DRIVER_ENABLE +void oled_task_user(void) { + // get layer Number + uint8_t currentDefault = get_highest_layer(default_layer_state); + uint8_t currentLayer = get_highest_layer(layer_state); + // write OS mode / 1st line of the logo + switch (currentDefault) { + case MAC_CS_1: + case MAC_PS_1: + render_row(0, "Mac "); + break; + case WIN_CS_1: + case WIN_PS_1: + render_row(0, "Win "); + break; + case IOS_CS_1: + render_row(0, "iOS "); + break; + default: + render_row(0, " "); + } + + // write Application mode / 2nd line of the logo + switch (currentDefault) { + case MAC_CS_1: + case WIN_CS_1: + case IOS_CS_1: + render_row(1, "A:CS"); + break; + case MAC_PS_1: + case WIN_PS_1: + render_row(1, "A:Ps"); + break; + default: + render_row(1, " "); + } + + if (currentLayer == SETTING) { + // 3rd & 4th line of the logo + render_row(2, "****"); + render_row(3, "LSEL"); + } else { + // Layer Status / 3rd line of the logo + if (currentLayer % 2 == 0) { + // default layer + render_row(2, "L:DF"); + } else { + // Fn Layer + render_row(2, "L:Fn"); + } + // pressed key / 4th line of the logo + render_row(3, " "); + } +} +#endif // #ifdef OLED_DRIVER_ENABLE diff --git a/keyboards/palette1202/keymaps/default/readme.md b/keyboards/palette1202/keymaps/default/readme.md new file mode 100644 index 00000000000..e84238695a6 --- /dev/null +++ b/keyboards/palette1202/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Palette1202 diff --git a/keyboards/palette1202/keymaps/key-check/keymap.c b/keyboards/palette1202/keymaps/key-check/keymap.c new file mode 100644 index 00000000000..c3496f78c07 --- /dev/null +++ b/keyboards/palette1202/keymaps/key-check/keymap.c @@ -0,0 +1,150 @@ +/* Copyright 2019 niltea + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef OLED_DRIVER_ENABLE + #include + #include "lib/oled_helper.h" +#endif + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + KEY_01 = SAFE_RANGE, + KEY_02, + KEY_03, + KEY_04, + KEY_05, + KEY_06, + KEY_07, + KEY_08, + KEY_09, + KEY_10, + KEY_11, + KEY_12, + KEY_13, + KEY_14 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KEY_01, KEY_02, KEY_03, KEY_04, KEY_05, + KEY_06, KEY_07, KEY_08, KEY_09, KEY_10, + KEY_11, KEY_12, KEY_13, KEY_14 + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KEY_01: + if (record->event.pressed) { + SEND_STRING("R1C1"); + } + break; + case KEY_02: + if (record->event.pressed) { + SEND_STRING("R1C2"); + } + break; + case KEY_03: + if (record->event.pressed) { + SEND_STRING("R1C3"); + } + break; + case KEY_04: + if (record->event.pressed) { + SEND_STRING("R1C4"); + } + break; + case KEY_05: + if (record->event.pressed) { + SEND_STRING("ENCODER-UPPER:Button"); + } + break; + + case KEY_06: + if (record->event.pressed) { + SEND_STRING("R2C1"); + } + break; + case KEY_07: + if (record->event.pressed) { + SEND_STRING("R2C2"); + } + break; + case KEY_08: + if (record->event.pressed) { + SEND_STRING("R2C3"); + } + break; + + case KEY_09: + if (record->event.pressed) { + SEND_STRING("R2C4"); + } + break; + case KEY_10: + if (record->event.pressed) { + SEND_STRING("ENCODER-LOWER:Button"); + } + break; + case KEY_11: + if (record->event.pressed) { + SEND_STRING("R3C1"); + } + break; + case KEY_12: + if (record->event.pressed) { + SEND_STRING("R3C2"); + } + break; + case KEY_13: + if (record->event.pressed) { + SEND_STRING("R3C3"); + } + break; + case KEY_14: + if (record->event.pressed) { + SEND_STRING("R3C4"); + } + break; + } + return true; +} + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* the upper encoder */ + if (clockwise) { + SEND_STRING("ENCODER-UPPER:CW"); + } else { + SEND_STRING("ENCODER-UPPER:CCW"); + } + } else if (index == 1) { /* the lower encoder */ + if (clockwise) { + SEND_STRING("ENCODER-LOWER:CW"); + } else { + SEND_STRING("ENCODER-LOWER:CCW"); + } + } +} + +// OLED Display +#ifdef OLED_DRIVER_ENABLE +void oled_task_user(void) { + render_row(0, "TEST"); + render_row(1, "test"); + render_row(2, "TEST"); + render_row(3, "test"); +} +#endif // #ifdef OLED_DRIVER_ENABLE diff --git a/keyboards/palette1202/keymaps/key-check/readme.md b/keyboards/palette1202/keymaps/key-check/readme.md new file mode 100644 index 00000000000..c9e27ce1431 --- /dev/null +++ b/keyboards/palette1202/keymaps/key-check/readme.md @@ -0,0 +1,2 @@ +# The test-purpose keymap for Palette1202 +組み立て後のテスト用keymapです。 \ No newline at end of file diff --git a/keyboards/palette1202/lib/glcdfont.c b/keyboards/palette1202/lib/glcdfont.c new file mode 100644 index 00000000000..f017091f835 --- /dev/null +++ b/keyboards/palette1202/lib/glcdfont.c @@ -0,0 +1,233 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#include "progmem.h" + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3e, 0x5b, 0x4f, 0x5b, 0x3e, 0x00, +0x3e, 0x6b, 0x4f, 0x6b, 0x3e, 0x00, +0x1c, 0x3e, 0x7c, 0x3e, 0x1c, 0x00, +0x18, 0x3c, 0x7e, 0x3c, 0x18, 0x00, +0x1c, 0x57, 0x7d, 0x57, 0x1c, 0x00, +0x1c, 0x5e, 0x7f, 0x5e, 0x1c, 0x00, +0x00, 0x18, 0x3c, 0x18, 0x00, 0x00, +0xff, 0xe7, 0xc3, 0xe7, 0xff, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xff, 0xe7, 0xdb, 0xe7, 0xff, 0x00, +0x30, 0x28, 0x1a, 0x06, 0x0e, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7f, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7f, 0x05, 0x25, 0x3f, 0x00, +0x5a, 0x3c, 0xe7, 0x3c, 0x5a, 0x00, +0x7f, 0x3e, 0x1c, 0x1c, 0x08, 0x00, +0x08, 0x1c, 0x1c, 0x3e, 0x7f, 0x00, +0x14, 0x22, 0x7f, 0x22, 0x14, 0x00, +0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x00, +0x06, 0x09, 0x7f, 0x01, 0x7f, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6a, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xa2, 0xff, 0xa2, 0x94, 0x00, +0x08, 0x04, 0x7e, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7e, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2a, 0x1c, 0x08, 0x00, +0x08, 0x1c, 0x2a, 0x08, 0x08, 0x00, +0x1e, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0c, 0x1e, 0x0c, 0x1e, 0x0c, 0x00, +0x30, 0x38, 0x3e, 0x38, 0x30, 0x00, +0x06, 0x0e, 0x3e, 0x0e, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7f, 0x14, 0x7f, 0x14, 0x00, +0x24, 0x2a, 0x7f, 0x2a, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1c, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1c, 0x00, 0x00, +0x2a, 0x1c, 0x7f, 0x1c, 0x2a, 0x00, +0x08, 0x08, 0x3e, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3e, 0x51, 0x49, 0x45, 0x3e, 0x00, +0x00, 0x42, 0x7f, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4d, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7f, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3c, 0x4a, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1e, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3e, 0x41, 0x5d, 0x59, 0x4e, 0x00, +0x78, 0x16, 0x11, 0x16, 0x78, 0x00, +0x7f, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3e, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7f, 0x41, 0x41, 0x41, 0x3e, 0x00, +0x7f, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7f, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3e, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7f, 0x08, 0x08, 0x08, 0x7f, 0x00, +0x00, 0x41, 0x7f, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3f, 0x01, 0x00, +0x7f, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7f, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7f, 0x02, 0x1c, 0x02, 0x7f, 0x00, +0x7f, 0x04, 0x08, 0x10, 0x7f, 0x00, +0x3e, 0x41, 0x41, 0x41, 0x3e, 0x00, +0x7f, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3e, 0x41, 0x51, 0x21, 0x5e, 0x00, +0x7f, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7f, 0x01, 0x03, 0x00, +0x3f, 0x40, 0x40, 0x40, 0x3f, 0x00, +0x1f, 0x20, 0x40, 0x20, 0x1f, 0x00, +0x3f, 0x40, 0x38, 0x40, 0x3f, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4d, 0x43, 0x00, +0x00, 0x7f, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7f, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7f, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7f, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7e, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1c, 0x78, 0x00, +0x7f, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7d, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3d, 0x00, 0x00, +0x7f, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7f, 0x40, 0x00, 0x00, +0x7c, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7c, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0xfc, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0xfc, 0x00, +0x7c, 0x08, 0x04, 0x04, 0x08, 0x00, +0x08, 0x54, 0x54, 0x54, 0x20, 0x00, +0x04, 0x04, 0x3f, 0x44, 0x24, 0x00, +0x3c, 0x40, 0x40, 0x20, 0x7c, 0x00, +0x1c, 0x20, 0x40, 0x20, 0x1c, 0x00, +0x1c, 0x60, 0x10, 0x60, 0x1c, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x44, 0x28, 0x10, 0x08, 0x04, 0x00, +0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3c, 0x26, 0x23, 0x26, 0x3c, 0x00, +0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, +0x0f, 0xff, 0xff, 0xfe, 0xfc, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xf8, 0xfc, 0xfe, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xc0, 0xf0, 0xfc, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0xff, 0xff, 0xff, 0xff, 0x00, +0x00, 0xfe, 0xff, 0xff, 0x0f, 0x0f, +0x0f, 0xff, 0xff, 0xfe, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0xfe, 0xff, 0xff, 0x0f, 0x0f, 0x0f, +0xff, 0xff, 0xfe, 0x00, 0x00, 0x0e, +0xff, 0xff, 0xff, 0xff, 0x0e, 0x0e, +0x0e, 0x00, 0x0e, 0xff, 0xff, 0xff, +0xff, 0x0e, 0x0e, 0x0e, 0x00, 0x00, +0xfe, 0xff, 0xff, 0x0f, 0x0f, 0x0f, +0xff, 0xff, 0xfe, 0x00, 0x00, 0xf3, +0xf3, 0x03, 0x03, 0xe3, 0xf3, 0x73, +0x73, 0xf3, 0xe3, 0x03, 0xc3, 0xe3, +0x73, 0x33, 0x73, 0xe3, 0xc3, 0x03, +0xe3, 0xf3, 0x73, 0x73, 0xf3, 0xe3, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x78, 0x78, +0x78, 0x7f, 0x7f, 0x3f, 0x0f, 0x00, +0x00, 0xf8, 0xfc, 0xfe, 0x1e, 0x1e, +0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0xff, 0xff, 0xff, 0x1c, 0x1c, 0x1c, +0x9f, 0x9f, 0x9f, 0x00, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0xff, 0xff, 0xff, +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xff, 0xff, 0x1c, 0x1c, 0x1c, +0x9f, 0x9f, 0x9f, 0x00, 0x00, 0xff, +0xff, 0x00, 0x00, 0x01, 0x81, 0xe0, +0xf8, 0x3f, 0x0f, 0x00, 0xff, 0xff, +0x00, 0x00, 0x00, 0xff, 0xff, 0x00, +0x01, 0x81, 0xe0, 0xf8, 0x3f, 0x0f, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7f, 0xff, 0xff, 0xf0, 0xf0, +0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0x7f, 0xff, 0xff, 0xf0, 0xf0, 0xf0, +0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, +0x7f, 0xff, 0xff, 0xff, 0xe0, 0xe0, +0xe0, 0x00, 0x00, 0x7f, 0xff, 0xff, +0xff, 0xe0, 0xe0, 0xe0, 0x00, 0x00, +0x7f, 0xff, 0xff, 0xf0, 0xf0, 0xf0, +0xff, 0xff, 0x7f, 0x00, 0x00, 0xcf, +0xcf, 0xc0, 0xc0, 0xce, 0xcf, 0xcf, +0xce, 0xce, 0xce, 0xc0, 0xc3, 0xc7, +0xce, 0xcc, 0xce, 0xc7, 0xc3, 0xc0, +0xce, 0xcf, 0xcf, 0xce, 0xce, 0xce, +0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/keyboards/palette1202/lib/oled_helper.c b/keyboards/palette1202/lib/oled_helper.c new file mode 100644 index 00000000000..d4a0b2eb5f6 --- /dev/null +++ b/keyboards/palette1202/lib/oled_helper.c @@ -0,0 +1,30 @@ +#ifdef OLED_DRIVER_ENABLE +#include QMK_KEYBOARD_H +#include +#include + +// returns character cord of the logo by line number +char *read_logo(int row) { + static char logoLines[][18] = { + { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0}, + { 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0}, + { 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0}, + { 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0} + }; + return logoLines[row]; +} + +void render_row(int row, const char* status) { + // reset cursor position + oled_set_cursor(0, row); + // read logo charcode + char * logoLine = read_logo(row); + // copy logo into buffer + char writeLine[22]; + strcpy(writeLine, logoLine); + // combine status string with logo + strcat(writeLine, status); + // write the line to OLED + oled_write(writeLine, false); +} +#endif diff --git a/keyboards/palette1202/lib/oled_helper.h b/keyboards/palette1202/lib/oled_helper.h new file mode 100644 index 00000000000..0d1dde461dd --- /dev/null +++ b/keyboards/palette1202/lib/oled_helper.h @@ -0,0 +1,7 @@ +#pragma once +#ifdef OLED_DRIVER_ENABLE + +void render_row(int row, const char* status); + +#endif /* #ifdef OLED_DRIVER_ENABLE */ + diff --git a/keyboards/palette1202/palette1202.c b/keyboards/palette1202/palette1202.c new file mode 100644 index 00000000000..74ce08319e3 --- /dev/null +++ b/keyboards/palette1202/palette1202.c @@ -0,0 +1,24 @@ +/* Copyright 2019 niltea + * + * 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 . + */ +#include "palette1202.h" + +// initialize OLED if OLED is enabled +#ifdef OLED_DRIVER_ENABLE + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; + } +#endif + \ No newline at end of file diff --git a/keyboards/palette1202/palette1202.h b/keyboards/palette1202/palette1202.h new file mode 100644 index 00000000000..737e381f73e --- /dev/null +++ b/keyboards/palette1202/palette1202.h @@ -0,0 +1,37 @@ +/* Copyright 2019 niltea + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, \ + k10, k11, k12, k13, k14, \ + k21, k22, k23, k24 \ +) \ +{ \ + { k00, k01, k02, k03, k04 }, \ + { k10, k11, k12, k13, k14 }, \ + { KC_NO, k21, k22, k23, k24 }, \ +} diff --git a/keyboards/palette1202/readme.md b/keyboards/palette1202/readme.md new file mode 100644 index 00000000000..4451eac4984 --- /dev/null +++ b/keyboards/palette1202/readme.md @@ -0,0 +1,22 @@ +# Palette1202 + +![Palette1202](https://palette1202.nilgiri-tea.net/images/palette1202.jpg) + +A left hand device with rotary encoder, for artists. + +* Keyboard Maintainer: [niltea](https://github.com/niltea) +* Hardware Supported: Palette1202 +* Hardware Availability: [Pixiv Booth](https://booth.pm/) +* [PCB & Case](https://github.com/niltea/Palette1202) + +Make example for this keyboard (after setting up your build environment): + +- default + + make palette1202:default:flash + +- key check (for after build) + + make palette1202:key-check:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/palette1202/rules.mk b/keyboards/palette1202/rules.mk new file mode 100644 index 00000000000..57ea5030efb --- /dev/null +++ b/keyboards/palette1202/rules.mk @@ -0,0 +1,37 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs +ENCODER_ENABLE = yes # Enable support for rotary encoders +OLED_DRIVER_ENABLE = yes # Enable support for OLED display + +# Additional code +SRC += lib/oled_helper.c # Adding OLED diff --git a/keyboards/pearl/config.h b/keyboards/pearl/config.h index 5dbba3ec0d9..1acee9ba450 100644 --- a/keyboards/pearl/config.h +++ b/keyboards/pearl/config.h @@ -26,8 +26,6 @@ along with this program. If not, see . #define PRODUCT Pearl #define DESCRIPTION 40% keyboard -#define NO_UART 1 - #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 diff --git a/keyboards/percent/canoe/config.h b/keyboards/percent/canoe/config.h index 21b3dcea648..b6cc5df2376 100644 --- a/keyboards/percent/canoe/config.h +++ b/keyboards/percent/canoe/config.h @@ -43,6 +43,4 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - #endif diff --git a/keyboards/percent/skog/config.h b/keyboards/percent/skog/config.h index 15844711f6c..cbfb2b6a567 100644 --- a/keyboards/percent/skog/config.h +++ b/keyboards/percent/skog/config.h @@ -37,5 +37,3 @@ along with this program. If not, see . #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 5 - -#define NO_UART 1 diff --git a/keyboards/plaid/config.h b/keyboards/plaid/config.h index 8fa8aa85b62..8005df2ce94 100644 --- a/keyboards/plaid/config.h +++ b/keyboards/plaid/config.h @@ -49,7 +49,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* diff --git a/keyboards/redox_w/keymaps/danielo515/config.h b/keyboards/redox_w/keymaps/danielo515/config.h new file mode 100644 index 00000000000..43d4ff9cb22 --- /dev/null +++ b/keyboards/redox_w/keymaps/danielo515/config.h @@ -0,0 +1,6 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 200 +#undef ONESHOT_TIMEOUT +#define ONESHOT_TIMEOUT 1500 diff --git a/keyboards/redox_w/keymaps/danielo515/keymap.c b/keyboards/redox_w/keymaps/danielo515/keymap.c new file mode 100644 index 00000000000..2b37a4be333 --- /dev/null +++ b/keyboards/redox_w/keymaps/danielo515/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H +#include "danielo515.h" + +// Shortcut to make keymap more readable +# define SYM_L OSL(_SYMB) + +# define KC_ALAS LALT_T(KC_PAST) // alt or keypad * +# define KC_CTPL LCTL_T(KC_BSLS) // + +# define KC_NAGR LT(_NAV, KC_GRV) +# define KC_NAMI LT(_NAV, KC_MINS) +# define AD_ESC LT(_ADJUST, KC_ESC) +# define NAV_SPC LT(_NAV, KC_SPACE) + +# define KC_ADPU LT(_ADJUST, KC_PGUP) +# define WIN_LEFT WIN_TO_LEFT +# define WIN_RIGHT WIN_TO_RIGHT +# define COPY_CUT TD(COPY_CUT) +# define TD_PASTE TD(PASTE_DANCE) +# define CTL OSM(MOD_LCTL) +# define ALT OSM(MOD_LALT) +# define GUI OSM(MOD_LGUI) +# define ENT_SYM LT(_SYMB, KC_ENT) +# define __S LT(_S,KC_S) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_DQUO , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,TD_PASTE, ALT_TAB ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,SFT_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + SHIFT ,KC_A ,__S ,FN_D ,FN_F ,KC_G ,COPY_CUT, KC_UNDS ,HYPR_H ,ALT_J ,CTL_K ,KC_L ,TD_CLN ,CMD_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_BSLS ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_DEL ,KC_PGDN , ALT_TAB ,AD_ESC ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_ASTR , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + CTL ,ALT ,KC_LEFT ,KC_RIGHT, GUI , SHIFT ,KC_BSPC , KC_LEAD ,NAV_SPC , ENT_SYM, KC_LBRC ,KC_RBRC ,KC_DOWN ,KC_UP + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_DLR ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,KC_PSLS ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PERC ,KC_PMNS , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_AT ,KC_DLR , KC_LPRN, KC_RPRN,KC_GRV ,_______ , _______ ,KC_PAST ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PPLS ,KC_BSPC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,_______ ,_______ , _______ ,_______ ,KC_COLN ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PENT ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_P0 , KC_P0 ,KC_PDOT ,KC_PENT ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX,SFT_LEFT,SFT_RIGHT,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,KC_HOME ,CTL_LEFT,CTL_RIGHT,XXXXXXX,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,WIN_LEFT,WIN_RIGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_MUTE ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), +[_F] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,ALL_WIN ,EXPOSE ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + [_D] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , _______ ,KC_PSLS ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PERC ,KC_PMNS , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , _______ ,KC_PAST ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PPLS ,KC_BSPC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , _______ ,_______ ,KC_COLN ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PENT ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,_______ , KC_P0 , KC_P0 ,KC_PDOT ,KC_PENT ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + [_S] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,KC_LT ,KC_GT ,XXXXXXX ,XXXXXXX , XXXXXXX ,KC_HASH ,KC_LCBR ,KC_RCBR ,KC_ASTR ,KC_PERC ,KC_DLR , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,_______ ,KC_EQL ,F_ARROW ,KC_GRAVE,XXXXXXX , XXXXXXX ,KC_AMPR ,KC_LPRN ,KC_RPRN ,CLN_EQ ,KC_PLUS ,KC_PIPE , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,KC_CIRC ,KC_DLR ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,KC_EXLM ,KC_TILD ,KC_CIRC ,ARROW ,KC_BSLASH,IARROW , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , XXXXXXX ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; + +void alt_tab_activated(void){ + layer_on(_NAV); +}; +void alt_tab_deactivated(void){ + layer_off(_NAV); +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case _QWERTY: + set_led_off; + break; + case _SYMB: + case _D: + set_led_green; + break; + case _NAV: + set_led_blue; + break; + case _ADJUST: + set_led_red; + break; + case _S: + set_led_magenta; + break; + case _F: + set_led_white; + break; + default: + break; + } + return state; +} + + diff --git a/keyboards/redox_w/keymaps/danielo515/readme.md b/keyboards/redox_w/keymaps/danielo515/readme.md new file mode 100644 index 00000000000..0db7072b802 --- /dev/null +++ b/keyboards/redox_w/keymaps/danielo515/readme.md @@ -0,0 +1,2 @@ +# Danielo keymap for Redox Wireless +Most of the custom functionality is on my user-space `users/danielo515` diff --git a/keyboards/redox_w/keymaps/danielo515/rules.mk b/keyboards/redox_w/keymaps/danielo515/rules.mk new file mode 100644 index 00000000000..18f126693e2 --- /dev/null +++ b/keyboards/redox_w/keymaps/danielo515/rules.mk @@ -0,0 +1,6 @@ + +TAP_DANCE_ENABLE = yes # Enable the tap dance feature. +COMBO_ENABLE = yes +LEADER_ENABLE = yes +CONSOLE_ENABLE = no +LTO_ENABLE = yes # link time optimizations diff --git a/keyboards/tartan/config.h b/keyboards/tartan/config.h index 4c49b7e09be..ee4393e53ae 100644 --- a/keyboards/tartan/config.h +++ b/keyboards/tartan/config.h @@ -49,8 +49,6 @@ along with this program. If not, see . /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 - /* * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. */ diff --git a/keyboards/tgr/alice/config.h b/keyboards/tgr/alice/config.h index 1f1b32d4e3f..cf1f107a338 100644 --- a/keyboards/tgr/alice/config.h +++ b/keyboards/tgr/alice/config.h @@ -38,5 +38,3 @@ along with this program. If not, see . #define RGBLED_NUM 18 #define RGBLIGHT_ANIMATIONS - -#define NO_UART 1 diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/keymap.c new file mode 100644 index 00000000000..48f079515d7 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define HHKB_NAV_LAYER 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, _______, KC_MENU, KC_RCTL + ), + + [HHKB_NAV_LAYER] = LAYOUT_hhkb_arrow( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/readme.md new file mode 100644 index 00000000000..53b1333dcd8 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/cijanzen/readme.md @@ -0,0 +1,35 @@ +# cijanzen's keymap for the Bananasplit +## Layout Notes + +Split right shift and split backspace. Second layer follows HHKB layer 2 layout. + +Base layer: +``` +------------------------------------------------------------------------------------------- +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Backspace| +------------------------------------------------------------------------------------------- +| Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn1 | +------------------------------------------------------------------------------------------- +| Ctrl | GUI | Alt | Space | Alt | GUI | App | Ctrl | +------------------------------------------------------------------------------------------- +``` + +Fn1 layer: + +``` +------------------------------------------------------------------------------------------- +|Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | +------------------------------------------------------------------------------------------- +| | | | | | | | |Pscr |Slck |Paus | Up | | Del | +------------------------------------------------------------------------------------------- +| | | | | | | | |Home |PgUp |Left |Right| Enter | +------------------------------------------------------------------------------------------- +| | | | | | | | |End |PgDn |Down | | | +------------------------------------------------------------------------------------------- +| | | | | | | | | +------------------------------------------------------------------------------------------- +``` diff --git a/keyboards/tokyo60/config.h b/keyboards/tokyo60/config.h index 2c1326c0a1a..79b904da1b9 100644 --- a/keyboards/tokyo60/config.h +++ b/keyboards/tokyo60/config.h @@ -1,15 +1,14 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define VENDOR_ID 0x5436 // "T6" +#define PRODUCT_ID 0x6060 // Tokyo60 #define DEVICE_VER 0x0001 #define MANUFACTURER Tokyo Keyboard -#define PRODUCT tokyo60 -#define DESCRIPTION q.m.k. keyboard firmware for tokyo60 +#define PRODUCT Tokyo60 +#define DESCRIPTION q.m.k. keyboard firmware for Tokyo60 /* key matrix size */ #define MATRIX_ROWS 5 @@ -54,5 +53,3 @@ /* For Production */ #define QMK_ESC_OUTPUT F0 // usually COL #define QMK_ESC_INPUT D0 // usually ROW - -#endif diff --git a/keyboards/tokyo60/info.json b/keyboards/tokyo60/info.json index b0e13c0537a..10d1bf093f1 100644 --- a/keyboards/tokyo60/info.json +++ b/keyboards/tokyo60/info.json @@ -1,12 +1,320 @@ { - "keyboard_name": "Tokyo60", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, + "keyboard_name": "Tokyo60", + "url": "https://tokyokeyboard.com/", + "maintainer": "qmk", + "width": 15, + "height": 5, "layouts": { "LAYOUT_60_hhkb": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + "layout": [{ + "label": "Esc", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "label": "|", + "x": 13, + "y": 0 + }, + { + "label": "~", + "x": 14, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "Delete", + "x": 13.5, + "y": 1, + "w": 1.5 + }, + { + "label": "Control", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "\"", + "x": 11.75, + "y": 2 + }, + { + "label": "Enter", + "x": 12.75, + "y": 2, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 1.75 + }, + { + "label": "Fn", + "x": 14, + "y": 3 + }, + { + "label": "Os", + "x": 1.5, + "y": 4 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.5 + }, + { + "x": 4, + "y": 4, + "w": 7 + }, + { + "label": "Alt", + "x": 11, + "y": 4, + "w": 1.5 + }, + { + "label": "Os", + "x": 12.5, + "y": 4 + } + ] } } } \ No newline at end of file diff --git a/keyboards/tokyo60/keymaps/via/keymap.c b/keyboards/tokyo60/keymaps/via/keymap.c new file mode 100644 index 00000000000..ffef9af795c --- /dev/null +++ b/keyboards/tokyo60/keymaps/via/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +#define BL 0 +#define FN 1 +/* + * Default HHKB Layout + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BL] = LAYOUT_60_hhkb( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \ + KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT ), + +[FN]= LAYOUT_60_hhkb( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), + +[2]= LAYOUT_60_hhkb( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______ ), + +[3]= LAYOUT_60_hhkb( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______ ), +}; diff --git a/keyboards/tokyo60/keymaps/via/rules.mk b/keyboards/tokyo60/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/tokyo60/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/tokyo60/readme.md b/keyboards/tokyo60/readme.md index d0bc6e6ce8c..74f4e07ccd7 100644 --- a/keyboards/tokyo60/readme.md +++ b/keyboards/tokyo60/readme.md @@ -1,15 +1,15 @@ -# tokyo60 +# Tokyo60 ​ -![tokyo60](http://tokyokeyboard.com/wp-content/uploads/2018/02/AI7B4543_copy_page_20180215141449-1200x800.jpg) +![Tokyo60](http://tokyokeyboard.com/wp-content/uploads/2018/02/AI7B4543_copy_page_20180215141449-1200x800.jpg) ​ -Minimal hacker style mechanical keyboard designed in Tokyo. Full aluminum hi-pro construction with integrated top-plate. Cherry MX compatible. More Info at [Tokyo Keyboard](http://tokyokeyboard.com). +Minimal hacker style mechanical keyboard designed in Tokyo. Full aluminum hi-pro construction with integrated top-plate. Cherry MX compatible. More Info at [Tokyo Keyboard](http://tokyokeyboard.com). ​ -Keyboard Maintainer: [Tokyo Keyboard](http://tokyokeyboard.com) -Hardware Supported: tokyo60 rev1 -Hardware Availability: [Tokyo Keyboard](http://tokyokeyboard.com), [Massdrop](https://www.massdrop.com/buy/massdrop-x-tokyo-keyboard-tokyo60-keyboard-kit?mode=guest_open) +* Keyboard Maintainer: [Tokyo Keyboard](http://tokyokeyboard.com) +* Hardware Supported: Tokyo60 Rev.1 +* Hardware Availability: [Drop](https://drop.com/buy/massdrop-x-tokyo-keyboard-tokyo60-keyboard-kit?mode=guest_open) ​ Make example for this keyboard (after setting up your build environment): ​ make tokyo60:default ​ -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/tokyo60/rules.mk b/keyboards/tokyo60/rules.mk index 87714ec6c60..fa639b1cab3 100644 --- a/keyboards/tokyo60/rules.mk +++ b/keyboards/tokyo60/rules.mk @@ -14,7 +14,7 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/tokyo60/tokyo60.h b/keyboards/tokyo60/tokyo60.h index 53f5d24a800..9eb5f3e6244 100644 --- a/keyboards/tokyo60/tokyo60.h +++ b/keyboards/tokyo60/tokyo60.h @@ -1,8 +1,9 @@ -#ifndef TOKYO60_H -#define TOKYO60_H +#pragma once #include "quantum.h" +#define XXX KC_NO + #define LAYOUT_60_hhkb( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2D, \ @@ -12,9 +13,7 @@ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { KC_NO, K42, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D } \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K42, K43, XXX, XXX, K46, XXX, XXX, XXX, XXX, XXX, K4B, K4C, K4D } \ } - -#endif diff --git a/keyboards/winkeyless/bface/config.h b/keyboards/winkeyless/bface/config.h index 7ada9a49ac0..68ecaafc1ef 100644 --- a/keyboards/winkeyless/bface/config.h +++ b/keyboards/winkeyless/bface/config.h @@ -40,7 +40,5 @@ along with this program. If not, see . #define RGBLED_NUM 16 #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/winkeyless/bmini/config.h b/keyboards/winkeyless/bmini/config.h index 95c44be9a42..6d46cdecbe2 100644 --- a/keyboards/winkeyless/bmini/config.h +++ b/keyboards/winkeyless/bmini/config.h @@ -38,5 +38,3 @@ along with this program. If not, see . #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 3 - -#define NO_UART 1 diff --git a/keyboards/winkeyless/bminiex/config.h b/keyboards/winkeyless/bminiex/config.h index 8952796a813..2da785214bc 100644 --- a/keyboards/winkeyless/bminiex/config.h +++ b/keyboards/winkeyless/bminiex/config.h @@ -38,5 +38,3 @@ along with this program. If not, see . #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 5 - -#define NO_UART 1 diff --git a/keyboards/ymd75/config.h b/keyboards/ymd75/config.h index 88916be62f8..ef7171cae6f 100644 --- a/keyboards/ymd75/config.h +++ b/keyboards/ymd75/config.h @@ -47,5 +47,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 15 #define RGBLIGHT_VAL_STEP 18 - -#define NO_UART 1 diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index d761e603797..ebb60242bea 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h @@ -33,7 +33,6 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } -//#define RGB_DI_PIN C4 /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -43,7 +42,6 @@ along with this program. If not, see . #define TAPPING_TOGGLE 3 -#define NO_UART 1 #define USB_MAX_POWER_CONSUMPTION 100 /* RGB underglow */ @@ -52,6 +50,4 @@ along with this program. If not, see . #define RGBLED_NUM 18 #define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. #define RGBLIGHT_ANIMATIONS -/*#define RGBLIGHT_VAL_STEP 20 - -#define NO_UART 1*/ +/*#define RGBLIGHT_VAL_STEP 20*/ diff --git a/keyboards/ymdk/bface/config.h b/keyboards/ymdk/bface/config.h index a8c8a21493f..0c12c328ecc 100644 --- a/keyboards/ymdk/bface/config.h +++ b/keyboards/ymdk/bface/config.h @@ -36,7 +36,5 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW -#define NO_UART 1 - #define BACKLIGHT_PIN D4 #define BACKLIGHT_LEVELS 6 diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk_np21/config.h index 91478d90357..291e6a896ba 100644 --- a/keyboards/ymdk_np21/config.h +++ b/keyboards/ymdk_np21/config.h @@ -42,8 +42,6 @@ along with this program. If not, see . #define TAPPING_TOGGLE 3 -#define NO_UART 1 - #define USB_MAX_POWER_CONSUMPTION 100 /* RGB underglow */ diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 72ee38f5620..5149a6215af 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -10,6 +10,7 @@ from . import doctor from . import flash from . import hello from . import json +from . import json2c from . import list from . import kle2json from . import new diff --git a/lib/python/qmk/cli/json/keymap.py b/lib/python/qmk/cli/json/keymap.py index c2b7dde7ab4..6e25b7862bb 100755 --- a/lib/python/qmk/cli/json/keymap.py +++ b/lib/python/qmk/cli/json/keymap.py @@ -1,56 +1,16 @@ """Generate a keymap.c from a configurator export. """ -import json from pathlib import Path from milc import cli -import qmk.keymap -import qmk.path - @cli.argument('-o', '--output', arg_only=True, type=Path, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") @cli.argument('filename', arg_only=True, help='Configurator JSON file') @cli.subcommand('Creates a keymap.c from a QMK Configurator export.') def json_keymap(cli): - """Generate a keymap.c from a configurator export. - - This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided. + """Renamed to `qmk json2c`. """ - cli.args.filename = qmk.path.normpath(cli.args.filename) - - # Error checking - if not cli.args.filename.exists(): - cli.log.error('JSON file does not exist!') - cli.print_usage() - exit(1) - - if str(cli.args.filename) == '-': - # TODO(skullydazed/anyone): Read file contents from STDIN - cli.log.error('Reading from STDIN is not (yet) supported.') - cli.print_usage() - exit(1) - - # Environment processing - if cli.args.output == ('-'): - cli.args.output = None - - # Parse the configurator json - with cli.args.filename.open('r') as fd: - user_keymap = json.load(fd) - - # Generate the keymap - keymap_c = qmk.keymap.generate(user_keymap['keyboard'], user_keymap['layout'], user_keymap['layers']) - - if cli.args.output: - cli.args.output.parent.mkdir(parents=True, exist_ok=True) - if cli.args.output.exists(): - cli.args.output.replace(cli.args.output.name + '.bak') - cli.args.output.write_text(keymap_c) - - if not cli.args.quiet: - cli.log.info('Wrote keymap to %s.', cli.args.output) - - else: - print(keymap_c) + cli.log.error('This command has been renamed to `qmk json2c`.') + exit(1) diff --git a/lib/python/qmk/cli/json2c.py b/lib/python/qmk/cli/json2c.py new file mode 100755 index 00000000000..46c4d04bb70 --- /dev/null +++ b/lib/python/qmk/cli/json2c.py @@ -0,0 +1,55 @@ +"""Generate a keymap.c from a configurator export. +""" +import json + +from milc import cli + +import qmk.keymap +import qmk.path + + +@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') +@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") +@cli.argument('filename', arg_only=True, help='Configurator JSON file') +@cli.subcommand('Creates a keymap.c from a QMK Configurator export.') +def json2c(cli): + """Generate a keymap.c from a configurator export. + + This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided. + """ + cli.args.filename = qmk.path.normpath(cli.args.filename) + + # Error checking + if not cli.args.filename.exists(): + cli.log.error('JSON file does not exist!') + cli.print_usage() + exit(1) + + if str(cli.args.filename) == '-': + # TODO(skullydazed/anyone): Read file contents from STDIN + cli.log.error('Reading from STDIN is not (yet) supported.') + cli.print_usage() + exit(1) + + # Environment processing + if cli.args.output == ('-'): + cli.args.output = None + + # Parse the configurator json + with cli.args.filename.open('r') as fd: + user_keymap = json.load(fd) + + # Generate the keymap + keymap_c = qmk.keymap.generate(user_keymap['keyboard'], user_keymap['layout'], user_keymap['layers']) + + if cli.args.output: + cli.args.output.parent.mkdir(parents=True, exist_ok=True) + if cli.args.output.exists(): + cli.args.output.replace(cli.args.output.name + '.bak') + cli.args.output.write_text(keymap_c) + + if not cli.args.quiet: + cli.log.info('Wrote keymap to %s.', cli.args.output) + + else: + print(keymap_c) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 67d601af7f1..cc35b01ed4d 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -38,17 +38,23 @@ # include "velocikey.h" #endif +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + #ifdef RGBLIGHT_SPLIT /* for split keyboard */ # define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE # define RGBLIGHT_SPLIT_SET_CHANGE_HSVS rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_HSVS # define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS rgblight_status.change_flags |= (RGBLIGHT_STATUS_CHANGE_MODE | RGBLIGHT_STATUS_CHANGE_HSVS) +# define RGBLIGHT_SPLIT_SET_CHANGE_LAYERS rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_LAYERS # define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_TIMER # define RGBLIGHT_SPLIT_ANIMATION_TICK rgblight_status.change_flags |= RGBLIGHT_STATUS_ANIMATION_TICK #else # define RGBLIGHT_SPLIT_SET_CHANGE_MODE # define RGBLIGHT_SPLIT_SET_CHANGE_HSVS # define RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS +# define RGBLIGHT_SPLIT_SET_CHANGE_LAYERS # define RGBLIGHT_SPLIT_SET_CHANGE_TIMER_ENABLE # define RGBLIGHT_SPLIT_ANIMATION_TICK #endif @@ -97,6 +103,10 @@ LED_TYPE led[RGBLED_NUM]; # define LED_ARRAY led #endif +#ifdef RGBLIGHT_LAYERS +rgblight_segment_t const *const *rgblight_layers = NULL; +#endif + static uint8_t clipping_start_pos = 0; static uint8_t clipping_num_leds = RGBLED_NUM; static uint8_t effect_start_pos = 0; @@ -211,9 +221,7 @@ void rgblight_init(void) { eeconfig_debug_rgblight(); // display current eeprom values -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_init(); // setup the timer -#endif if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); @@ -230,9 +238,7 @@ void rgblight_update_dword(uint32_t dword) { if (rgblight_config.enable) rgblight_mode_noeeprom(rgblight_config.mode); else { -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); -#endif rgblight_set(); } } @@ -300,13 +306,9 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { dprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode); } if (is_static_effect(rgblight_config.mode)) { -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); -#endif } else { -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_enable(); -#endif } #ifdef RGBLIGHT_USE_TIMER animation_status.restart = true; @@ -354,9 +356,7 @@ void rgblight_disable(void) { rgblight_config.enable = 0; eeconfig_update_rgblight(rgblight_config.raw); dprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); -#endif RGBLIGHT_SPLIT_SET_CHANGE_MODE; wait_ms(50); rgblight_set(); @@ -365,9 +365,7 @@ void rgblight_disable(void) { void rgblight_disable_noeeprom(void) { rgblight_config.enable = 0; dprintf("rgblight disable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); -#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); -#endif RGBLIGHT_SPLIT_SET_CHANGE_MODE; wait_ms(50); rgblight_set(); @@ -616,11 +614,67 @@ void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_se void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } #endif // ifndef RGBLIGHT_SPLIT +#ifdef RGBLIGHT_LAYERS +void rgblight_set_layer_state(uint8_t layer, bool enabled) { + uint8_t mask = 1 << layer; + if (enabled) { + rgblight_status.enabled_layer_mask |= mask; + } else { + rgblight_status.enabled_layer_mask &= ~mask; + } + RGBLIGHT_SPLIT_SET_CHANGE_LAYERS; + // Static modes don't have a ticker running to update the LEDs + if (rgblight_status.timer_enabled == false) { + rgblight_mode_noeeprom(rgblight_config.mode); + } +} + +bool rgblight_get_layer_state(uint8_t layer) { + uint8_t mask = 1 << layer; + return (rgblight_status.enabled_layer_mask & mask) != 0; +} + +// Write any enabled LED layers into the buffer +static void rgblight_layers_write(void) { + uint8_t i = 0; + // For each layer + for (const rgblight_segment_t *const *layer_ptr = rgblight_layers; i < RGBLIGHT_MAX_LAYERS; layer_ptr++, i++) { + if (!rgblight_get_layer_state(i)) { + continue; // Layer is disabled + } + const rgblight_segment_t *segment_ptr = pgm_read_ptr(layer_ptr); + if (segment_ptr == NULL) { + break; // No more layers + } + // For each segment + while (1) { + rgblight_segment_t segment; + memcpy_P(&segment, segment_ptr, sizeof(rgblight_segment_t)); + if (segment.index == RGBLIGHT_END_SEGMENT_INDEX) { + break; // No more segments + } + // Write segment.count LEDs + LED_TYPE *const limit = &led[MIN(segment.index + segment.count, RGBLED_NUM)]; + for (LED_TYPE *led_ptr = &led[segment.index]; led_ptr < limit; led_ptr++) { + sethsv(segment.hue, segment.sat, segment.val, led_ptr); + } + segment_ptr++; + } + } +} +#endif + #ifndef RGBLIGHT_CUSTOM_DRIVER void rgblight_set(void) { LED_TYPE *start_led; uint16_t num_leds = clipping_num_leds; +# ifdef RGBLIGHT_LAYERS + if (rgblight_layers != NULL) { + rgblight_layers_write(); + } +# endif + if (!rgblight_config.enable) { for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) { led[i].r = 0; @@ -664,6 +718,11 @@ void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo) { /* for split keyboard slave side */ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { +# ifdef RGBLIGHT_LAYERS + if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_LAYERS) { + rgblight_status.enabled_layer_mask = syncinfo->status.enabled_layer_mask; + } +# endif if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_MODE) { if (syncinfo->config.enable) { rgblight_config.enable = 1; // == rgblight_enable_noeeprom(); diff --git a/quantum/rgblight.h b/quantum/rgblight.h index c0fc0f3c636..97882c5b296 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -16,8 +16,6 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#include "rgblight_reconfig.h" - /***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) **** old mode number (before 0.6.117) to new mode name table @@ -64,6 +62,39 @@ |-----------------|-----------------------------------| *****/ +#ifdef RGBLIGHT_ANIMATIONS +// for backward compatibility +# 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 +#endif + +#ifdef RGBLIGHT_STATIC_PATTERNS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +#endif + +// clang-format off + +// check dynamic animation effects chose ? +#if defined(RGBLIGHT_EFFECT_BREATHING) \ + || defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) \ + || defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) \ + || defined(RGBLIGHT_EFFECT_SNAKE) \ + || defined(RGBLIGHT_EFFECT_KNIGHT) \ + || defined(RGBLIGHT_EFFECT_CHRISTMAS) \ + || defined(RGBLIGHT_EFFECT_RGB_TEST) \ + || defined(RGBLIGHT_EFFECT_ALTERNATING) +# define RGBLIGHT_USE_TIMER +#endif + +// clang-format on + #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_##sym, #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_##sym, #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_##sym, @@ -139,6 +170,32 @@ enum RGBLIGHT_EFFECT_MODE { # include # endif +# ifdef RGBLIGHT_LAYERS +typedef struct { + uint8_t index; // The first LED to light + uint8_t count; // The number of LEDs to light + uint8_t hue; + uint8_t sat; + uint8_t val; +} rgblight_segment_t; + +# define RGBLIGHT_END_SEGMENT_INDEX (255) +# define RGBLIGHT_END_SEGMENTS \ + { RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0 } +# define RGBLIGHT_MAX_LAYERS 8 +# define RGBLIGHT_LAYER_SEGMENTS(...) \ + { __VA_ARGS__, RGBLIGHT_END_SEGMENTS } +# define RGBLIGHT_LAYERS_LIST(...) \ + { __VA_ARGS__, NULL } + +// Get/set enabled rgblight layers +void rgblight_set_layer_state(uint8_t layer, bool enabled); +bool rgblight_get_layer_state(uint8_t layer); + +// Point this to an array of rgblight_segment_t arrays in keyboard_post_init_user to use rgblight layers +extern const rgblight_segment_t *const *rgblight_layers; +# endif + extern LED_TYPE led[RGBLED_NUM]; extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM; @@ -168,6 +225,9 @@ typedef struct _rgblight_status_t { # ifdef RGBLIGHT_SPLIT uint8_t change_flags; # endif +# ifdef RGBLIGHT_LAYERS + uint8_t enabled_layer_mask; +# endif } rgblight_status_t; /* === Utility Functions ===*/ @@ -263,18 +323,26 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); # define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF) void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b); +# ifdef RGBLIGHT_USE_TIMER void rgblight_task(void); - void rgblight_timer_init(void); void rgblight_timer_enable(void); void rgblight_timer_disable(void); void rgblight_timer_toggle(void); +# else +# define rgblight_task() +# define rgblight_timer_init() +# define rgblight_timer_enable() +# define rgblight_timer_disable() +# define rgblight_timer_toggle() +# endif # ifdef RGBLIGHT_SPLIT # define RGBLIGHT_STATUS_CHANGE_MODE (1 << 0) # define RGBLIGHT_STATUS_CHANGE_HSVS (1 << 1) # define RGBLIGHT_STATUS_CHANGE_TIMER (1 << 2) # define RGBLIGHT_STATUS_ANIMATION_TICK (1 << 3) +# define RGBLIGHT_STATUS_CHANGE_LAYERS (1 << 4) typedef struct _rgblight_syncinfo_t { rgblight_config_t config; diff --git a/quantum/rgblight_reconfig.h b/quantum/rgblight_reconfig.h deleted file mode 100644 index 4b9d6c4c2f4..00000000000 --- a/quantum/rgblight_reconfig.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef RGBLIGHT_RECONFIG_H -#define RGBLIGHT_RECONFIG_H - -#ifdef RGBLIGHT_ANIMATIONS -// for backward compatibility -# 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 -#endif - -#ifdef RGBLIGHT_STATIC_PATTERNS -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -#endif - -// check dynamic animation effects chose ? -#if defined(RGBLIGHT_EFFECT_BREATHING) || defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) || defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) || defined(RGBLIGHT_EFFECT_SNAKE) || defined(RGBLIGHT_EFFECT_KNIGHT) || defined(RGBLIGHT_EFFECT_CHRISTMAS) || defined(RGBLIGHT_EFFECT_RGB_TEST) || defined(RGBLIGHT_EFFECT_ALTERNATING) -# define RGBLIGHT_USE_TIMER -# ifndef RGBLIGHT_ANIMATIONS -# define RGBLIGHT_ANIMATIONS // for backward compatibility -# endif -#endif - -#endif // RGBLIGHT_RECONFIG_H diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index d93512bca6d..2eb4844226f 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -42,8 +42,6 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - /* disable these deprecated features by default */ #ifndef LINK_TIME_OPTIMIZATION_ENABLE #define NO_ACTION_MACRO diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 4c7d15cd50f..81f86f0f345 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -49,7 +49,7 @@ static void default_layer_state_set(layer_state_t state) { * * Print out the hex value of the 32-bit default layer state, as well as the value of the highest bit. */ -void default_layer_debug(void) { dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state)); } +void default_layer_debug(void) { dprintf("%08lX(%u)", default_layer_state, get_highest_layer(default_layer_state)); } /** \brief Default Layer Set * @@ -178,7 +178,7 @@ void layer_xor(layer_state_t state) { layer_state_set(layer_state ^ state); } * * Print out the hex value of the 32-bit layer state, as well as the value of the highest bit. */ -void layer_debug(void) { dprintf("%08lX(%u)", layer_state, biton32(layer_state)); } +void layer_debug(void) { dprintf("%08lX(%u)", layer_state, get_highest_layer(layer_state)); } #endif #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index c59c1968800..11ac146eb80 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -9,7 +9,6 @@ #include "timer.h" #include "led.h" #include "host.h" -#include "rgblight_reconfig.h" #ifdef PROTOCOL_LUFA # include "lufa.h" @@ -30,23 +29,6 @@ static bool rgblight_enabled; static bool is_suspended; #endif -#define wdt_intr_enable(value) \ - __asm__ __volatile__("in __tmp_reg__,__SREG__" \ - "\n\t" \ - "cli" \ - "\n\t" \ - "wdr" \ - "\n\t" \ - "sts %0,%1" \ - "\n\t" \ - "out __SREG__,__tmp_reg__" \ - "\n\t" \ - "sts %0,%2" \ - "\n\t" \ - : /* no outputs */ \ - : "M"(_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r"(_BV(_WD_CHANGE_BIT) | _BV(WDE)), "r"((uint8_t)((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDIE) | (value & 0x07))) \ - : "r0") - /** \brief Suspend idle * * FIXME: needs doc @@ -122,9 +104,7 @@ static void power_down(uint8_t wdto) { // stop_all_notes(); # endif /* AUDIO_ENABLE */ # if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) -# ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); -# endif if (!is_suspended) { is_suspended = true; rgblight_enabled = rgblight_config.enable; @@ -204,9 +184,7 @@ void suspend_wakeup_init(void) { # endif rgblight_enable_noeeprom(); } -# ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); -# endif #endif suspend_wakeup_init_kb(); } diff --git a/tmk_core/common/avr/suspend_avr.h b/tmk_core/common/avr/suspend_avr.h index d73852ba11c..e4cc0be5054 100644 --- a/tmk_core/common/avr/suspend_avr.h +++ b/tmk_core/common/avr/suspend_avr.h @@ -7,21 +7,22 @@ #include #include -#define wdt_intr_enable(value) \ - __asm__ __volatile__("in __tmp_reg__,__SREG__" \ - "\n\t" \ - "cli" \ - "\n\t" \ - "wdr" \ - "\n\t" \ - "sts %0,%1" \ - "\n\t" \ - "out __SREG__,__tmp_reg__" \ - "\n\t" \ - "sts %0,%2" \ - "\n\t" \ - : /* no outputs */ \ - : "M"(_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r"(_BV(_WD_CHANGE_BIT) | _BV(WDE)), "r"((uint8_t)((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDIE) | (value & 0x07))) \ - : "r0") +// clang-format off +#define wdt_intr_enable(value) \ +__asm__ __volatile__ ( \ + "in __tmp_reg__,__SREG__" "\n\t" \ + "cli" "\n\t" \ + "wdr" "\n\t" \ + "sts %0,%1" "\n\t" \ + "out __SREG__,__tmp_reg__" "\n\t" \ + "sts %0,%2" "\n\t" \ + : /* no outputs */ \ + : "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \ + "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \ + "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \ + _BV(WDIE) | (value & 0x07)) ) \ + : "r0" \ +) +// clang-format on #endif diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index 5be1b767779..8c071e7a086 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -51,9 +51,7 @@ void suspend_power_down(void) { // shouldn't power down TPM/FTM if we want a breathing LED // also shouldn't power down USB #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) -# ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); -# endif if (!is_suspended) { is_suspended = true; rgblight_enabled = rgblight_config.enable; @@ -126,9 +124,7 @@ void suspend_wakeup_init(void) { if (rgblight_enabled) { rgblight_enable_noeeprom(); } -# ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); -# endif #endif suspend_wakeup_init_kb(); } diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index cb4e7637fa1..a767d9c8773 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -335,7 +335,7 @@ MATRIX_LOOP_END: matrix_scan_perf_task(); #endif -#if defined(RGBLIGHT_ANIMATIONS) && defined(RGBLIGHT_ENABLE) +#if defined(RGBLIGHT_ENABLE) rgblight_task(); #endif diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index a61ffad12d2..218a79f8ba1 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -32,9 +32,8 @@ #include "sendchar.h" #include "debug.h" #include "printf.h" -#include "rgblight_reconfig.h" -#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE) +#if defined(RGBLIGHT_ENABLE) # include "rgblight.h" #endif #ifdef SLEEP_LED_ENABLE diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 738c2a6d31a..ca75a91d0e7 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -54,7 +54,6 @@ #include "quantum.h" #include #include "outputselect.h" -#include "rgblight_reconfig.h" #ifdef NKRO_ENABLE # include "keycode_config.h" @@ -78,7 +77,7 @@ extern keymap_config_t keymap_config; # include "virtser.h" #endif -#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE) +#if defined(RGBLIGHT_ENABLE) # include "rgblight.h" #endif diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 1e9d65be0be..6b3f09bc3e1 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -20,9 +20,8 @@ #include "timer.h" #include "uart.h" #include "debug.h" -#include "rgblight_reconfig.h" -#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE) +#if defined(RGBLIGHT_ENABLE) # include "rgblight.h" #endif diff --git a/users/brett/brett.c b/users/brett/brett.c new file mode 100644 index 00000000000..c19c8b4a8a0 --- /dev/null +++ b/users/brett/brett.c @@ -0,0 +1,61 @@ +#include "brett.h" + +char * get_key(uint16_t keycode) { + switch (keycode) { + case FAT_ARROW: + return "=>"; + case SKINNY_ARROW: + return "->"; + case REVERSE_ARROW: + return "<-"; + case CONCAT: + return "<>"; + case MAP: + return "<$>"; + case MAP_FLIPPED: + return "<#>"; + case FLAP: + return "<@>"; + case PIPE: + return "|>"; + case ALT: + return "<|>"; + case APPLY: + return "<*>"; + case AND: + return "&&"; + case OR: + return "||"; + case BIND: + return ">>="; + case BIND_FLIPPED: + return "=<<"; + case DOUBLE_COLON: + return "::"; + case VOID_LEFT: + return "<$"; + case VOID_RIGHT: + return "$>"; + default: + return ""; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + bool pressed = record->event.pressed; + switch (keycode) { + case FAT_ARROW ... DOUBLE_COLON: + if (pressed) { + send_string(get_key(keycode)); + } + return false; + case FLASH: + if (!pressed) { + SEND_STRING("make -j8 --output-sync " QMK_KEYBOARD ":" QMK_KEYMAP ":flash" SS_TAP(X_ENTER)); + reset_keyboard(); + } + return false; + default: + return true; + } +} diff --git a/users/brett/brett.h b/users/brett/brett.h new file mode 100644 index 00000000000..a359c5157a7 --- /dev/null +++ b/users/brett/brett.h @@ -0,0 +1,25 @@ +#pragma once + +enum userspace_custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // Can always be here + FAT_ARROW, // => + SKINNY_ARROW, // -> + REVERSE_ARROW, // <- + CONCAT, // <> + MAP, // <$> + MAP_FLIPPED, // <#> + FLAP, // <@> + PIPE, // |> + ALT, // <|> + APPLY, // <*> + AND, // && + OR, // || + BIND, // >>= + BIND_FLIPPED, // =<< + VOID_LEFT, // <$ + VOID_RIGHT, // $> + DOUBLE_COLON, // :: + FLASH // Handle keyboard flashing +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); diff --git a/users/brett/rules.mk b/users/brett/rules.mk new file mode 100644 index 00000000000..b186662ddb9 --- /dev/null +++ b/users/brett/rules.mk @@ -0,0 +1 @@ +SRC += brett.c diff --git a/users/danielo515/alt_tab.c b/users/danielo515/alt_tab.c new file mode 100644 index 00000000000..1602ee6fb20 --- /dev/null +++ b/users/danielo515/alt_tab.c @@ -0,0 +1,38 @@ +#include "danielo515.h" +#include "alt_tab.h" + +bool altPressed = false; +__attribute__((weak)) void alt_tab_activated(void){}; +__attribute__((weak)) void alt_tab_deactivated(void){}; +extern bool onMac; + +// =============== ALT_TAB single key handling +bool process_alt_tab(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ALT_TAB: + if (!record->event.pressed) { + return false; + } + if (altPressed) { + tap_code(KC_TAB); + } else { + altPressed = true; + onMac ? register_code(KC_LGUI) : register_code(KC_LALT); + tap_code(KC_TAB); + alt_tab_activated(); + } + // avoid alt releasing if the key is of movement + case KC_RIGHT ... KC_UP: + if (altPressed) { + return true; // yes QMK, do your stuff + } + } + // Reset sticky alt tab when any other key is pressed + if (altPressed) { + onMac ? unregister_code(KC_LGUI) : unregister_code(KC_LALT); + altPressed = false; + alt_tab_deactivated(); + return false; + } + return true; +}; diff --git a/users/danielo515/alt_tab.h b/users/danielo515/alt_tab.h new file mode 100644 index 00000000000..f84350c298f --- /dev/null +++ b/users/danielo515/alt_tab.h @@ -0,0 +1,4 @@ +#pragma once +#include "quantum.h" + +bool process_alt_tab(uint16_t keycode, keyrecord_t *record); diff --git a/users/danielo515/combo.c b/users/danielo515/combo.c index bf7d5f9a8a3..1c841437721 100644 --- a/users/danielo515/combo.c +++ b/users/danielo515/combo.c @@ -1,21 +1,36 @@ #include "combo.h" + enum combos { - JK_ESC, - YU_COM, - UI_COM, - IO_COM, - OP_COM, - QW_COM + JK_ESC, + YU_COM, + UI_COM, + IO_COM, + QW_COM, + COM_SLS, + COM_DOT, + M_COMM, + N_M, + OP_COM, }; const uint16_t PROGMEM ui_combo[] = {KC_U, KC_I, COMBO_END}; const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; const uint16_t PROGMEM yu_combo[] = {KC_Y, KC_U, COMBO_END}; const uint16_t PROGMEM io_combo[] = {KC_I, KC_O, COMBO_END}; +const uint16_t PROGMEM qw_combo[] = {KC_Q, KC_W, COMBO_END}; +const uint16_t PROGMEM com_sls[] = {KC_COMMA, KC_SLSH, COMBO_END}; +const uint16_t PROGMEM com_dot[] = {KC_COMMA, KC_DOT, COMBO_END}; +const uint16_t PROGMEM m_comm[] = {KC_M,KC_COMMA, COMBO_END}; +const uint16_t PROGMEM n_m[] = {KC_N, KC_M,COMBO_END}; combo_t key_combos[COMBO_COUNT] = { - [JK_ESC] = COMBO(jk_combo, KC_ESC), - [YU_COM] = COMBO(yu_combo, KC_CIRC), - [UI_COM] = COMBO(ui_combo, KC_ESC), - [IO_COM] = COMBO(io_combo, KC_TILD) + [JK_ESC] = COMBO(jk_combo, KC_ESC), + [YU_COM] = COMBO(yu_combo, KC_CIRC), + [UI_COM] = COMBO(ui_combo, KC_DLR), + [IO_COM] = COMBO(io_combo, KC_TILD), + [QW_COM] = COMBO(qw_combo, KC_AT), + [COM_SLS] = COMBO(com_sls, KC_QUES), + [COM_DOT] = COMBO(com_dot, KC_QUES), + [M_COMM] = COMBO(m_comm, KC_ESC), + [N_M] = COMBO(n_m, KC_DLR), }; diff --git a/users/danielo515/config.h b/users/danielo515/config.h index 65654388d28..fb2472645c6 100644 --- a/users/danielo515/config.h +++ b/users/danielo515/config.h @@ -1,6 +1,10 @@ #pragma once #if defined(COMBO_ENABLE) - #define COMBO_COUNT 4 - #define COMBO_TERM 50 + #define COMBO_COUNT 9 + #define COMBO_TERM 40 #endif // !COMBO_ENABLE +// Timeout settings for leader key +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 350 +#define LEADER_PER_KEY_TIMING diff --git a/users/danielo515/danielo515.c b/users/danielo515/danielo515.c index f37eebb375c..f0836502797 100644 --- a/users/danielo515/danielo515.c +++ b/users/danielo515/danielo515.c @@ -1,373 +1,87 @@ #include "danielo515.h" bool onMac = true; -// Send control or GUI depending if we are on windows or mac -bool CMD(uint16_t kc) { - if(onMac){ tap_code16(LGUI(kc)); } else { tap_code16(LCTL(kc)); } - return false; -} - -//**************** Handle keys function *********************// -bool altPressed = false; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - bool pressed = record->event.pressed; - if(pressed){ - refresh_incremental_macros(keycode); - if(process_incremental_macro(keycode)){ - return false; - } - if(is_macro(keycode)){ - return handle_macro(keycode); - } - switch (keycode) { - case MAC_TGL: - onMac = !onMac; - onMac ? SEND_STRING("On mac") : SEND_STRING("Not on MAC"); - return false; - } - } - - switch (keycode) - { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - layer_on(_QWERTY); - } - return false; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - // == Macros START === - case ARROW: - if (record->event.pressed) SEND_STRING("->"); - return false; - case F_ARROW: - if (record->event.pressed) SEND_STRING("=>"); - return false; - case GREP: - if (record->event.pressed) SEND_STRING(" | grep "); return false; - // == Macros END === - // == Multi Os START === - case KC_HOME:// make the home behave the same on OSX - if (record->event.pressed && onMac) { - SEND_STRING(SS_LCTRL("a")); - return false; - } - case KC_END:// make the end behave the same on OSX - if (record->event.pressed && onMac) { - tap_code16(C(KC_E)); - return false; - } - case AC_A:// Accent á - if (record->event.pressed) SEND_STRING(SS_LALT("e") "a"); return false; - case AC_E:// Accent é - if (record->event.pressed) SEND_STRING(SS_LALT("e") "e"); return false; - case AC_I:// Accent í - if (record->event.pressed) SEND_STRING(SS_LALT("e") "i"); return false; - case AC_O:// Accent ó - if (record->event.pressed) SEND_STRING(SS_LALT("e") "o"); return false; - case CUT: if (record->event.pressed) return CMD(KC_X); - case COPY: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c")); - } - return false; - case PASTE: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v")); - } - return false; - case SAVE: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("s")) : SEND_STRING(SS_LCTRL("s")); - } - return false; - case UNDO: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("z")) : SEND_STRING(SS_LCTRL("z")); - } - return false; - case FIND: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LGUI("f")) : SEND_STRING(SS_LCTRL("f")); - } - return false; - case CHG_LAYOUT: - if (record->event.pressed) { - onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); - } - return false; - // == Multi Os END === -#ifdef RGBLIGHT_ENABLE - case RGB_SLD: - if (record->event.pressed) { rgblight_mode(1); } - return false; - break; - //First time alt + tab, and alt stays sticky. Next press we just send tab. Any other key releases the alt -#endif - case ALT_TAB: - if (record->event.pressed) - { - if (altPressed) - { - tap_code(KC_TAB); - } - else - { - altPressed = true; - layer_on(7); // go to movement layer - onMac ? register_code(KC_LGUI) : register_code(KC_LALT); - tap_code(KC_TAB); - } - } - return false; - // avoid alt releasing if the key is of movement - case KC_RIGHT ... KC_UP: - if (altPressed) - { - return true; // yes QMK, do your stuff - } - } - // Reset sticky alt tab - if (altPressed) - { - onMac ? unregister_code(KC_LGUI) : unregister_code(KC_LALT); - altPressed = false; - layer_off(7); - return false; - } - return true; -}; //**************** LEADER *********************// #ifdef LEADER_ENABLE LEADER_EXTERNS(); -#ifdef RGBLIGHT_ENABLE +# ifdef RGBLIGHT_ENABLE -void leader_start() { - rgblight_setrgb_range(5, 100, 199, 10,15); -}; +void leader_start() { rgblight_setrgb_range(5, 100, 199, 10, 15); }; -void leader_end(){ - rgblight_setrgb_range(200, 200, 255, 10,15); -}; -#endif +void leader_end() { rgblight_setrgb_range(200, 200, 255, 10, 15); }; +# endif -void matrix_scan_user(void) -{ - if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) - { - leading = false; - SEQ_ONE_KEY(KC_T) { - SEND_STRING("``" SS_TAP(X_LEFT)); - } - // Triple ticks - SEQ_TWO_KEYS(KC_T, KC_T) { - SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP)); - } - // ==== International spanish accent vowels ==== - SEQ_ONE_KEY(KC_A) { - SEND_STRING(SS_LALT("e") "a"); - } - SEQ_ONE_KEY(KC_E) { - SEND_STRING(SS_LALT("e") "e"); - } - SEQ_ONE_KEY(KC_I) { - SEND_STRING(SS_LALT("e") "i"); - } - SEQ_ONE_KEY(KC_O) { - SEND_STRING(SS_LALT("e") "o"); - } - SEQ_ONE_KEY(KC_U) { - SEND_STRING(SS_LALT("e") "u"); - } - SEQ_ONE_KEY(KC_N) { // ñ - SEND_STRING(SS_LALT("n") "n"); - } - // ==== MACROS === - SEQ_ONE_KEY(KC_G) { // grep - SEND_STRING(" | grep "); - } - SEQ_ONE_KEY(KC_K) { - onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); - } - SEQ_TWO_KEYS(KC_D, KC_G) { // vim delete all - if(onMac){ - SEND_STRING(SS_LGUI("a") SS_TAP(X_D)); - } else { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_D)); - } - } - SEQ_ONE_KEY(KC_BSPACE) { // tripe delete! - SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE)); - } - SEQ_TWO_KEYS(KC_P, KC_G) { - SEND_STRING("ps -ef | grep "); - } - SEQ_TWO_KEYS(KC_J, KC_A) { - SEND_STRING("() => {}"SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT)); - } - SEQ_TWO_KEYS(KC_S, KC_S) { - SEND_STRING("~/.ssh/ "); // this is a pain to type - } - SEQ_TWO_KEYS(KC_F, KC_T) { - SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT)); - } - // ### LAYER CHANGE - SEQ_ONE_KEY(KC_1) { - layer_on(1); - } - SEQ_ONE_KEY(KC_H) { // control enter, because yes - SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_ENTER) SS_UP(X_LCTRL)); - } - // paste all - SEQ_ONE_KEY(KC_P) { - if(onMac){ - SEND_STRING(SS_LGUI("a") SS_LGUI("v")); - } else { - SEND_STRING(SS_LCTRL("a") SS_LCTRL("v")); - } - } - SEQ_THREE_KEYS(KC_M, KC_A, KC_C) { - onMac = true; - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(255, 255, 255); - #endif - } - SEQ_THREE_KEYS(KC_W, KC_I, KC_N) { - onMac = false; - #ifdef RGBLIGHT_ENABLE - rgblight_setrgb(255, 255, 0); - #endif - } - /* Copy all */ - SEQ_ONE_KEY(KC_Y) { - if(onMac){ - SEND_STRING(SS_LGUI("a") SS_LGUI("c")); - } else { - SEND_STRING(SS_LCTRL("a") SS_LCTRL("c")); - } - } - //emoji bar - SEQ_TWO_KEYS(KC_E, KC_E) { - SEND_STRING(SS_DOWN(X_LGUI) SS_LCTRL(" ") SS_UP(X_LGUI)); - } +void matrix_scan_user(void) { + if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) { + leading = false; + SEQ_ONE_KEY(KC_T) { SEND_STRING("``" SS_TAP(X_LEFT)); } + // Triple ticks + SEQ_TWO_KEYS(KC_T, KC_T) { SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP)); } + // ==== International spanish accent vowels ==== + SEQ_ONE_KEY(KC_A) { SEND_STRING(SS_LALT("e") "a"); } + SEQ_ONE_KEY(KC_E) { SEND_STRING(SS_LALT("e") "e"); } + SEQ_ONE_KEY(KC_I) { SEND_STRING(SS_LALT("e") "i"); } + SEQ_ONE_KEY(KC_O) { SEND_STRING(SS_LALT("e") "o"); } + SEQ_ONE_KEY(KC_U) { SEND_STRING(SS_LALT("e") "u"); } + SEQ_ONE_KEY(KC_N) { SEND_STRING(SS_LALT("n") "n"); } + // ==== MACROS === + SEQ_ONE_KEY(KC_G) { SEND_STRING(" | grep "); } + SEQ_ONE_KEY(KC_K) { onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); } + // vim delete all + SEQ_TWO_KEYS(KC_D, KC_G) { + if (onMac) { + SEND_STRING(SS_LGUI("a") SS_TAP(X_D)); + } else { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_D)); + } + } + // tripe delete! + SEQ_ONE_KEY(KC_BSPACE) { SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE)); } + SEQ_TWO_KEYS(KC_P, KC_G) { SEND_STRING("ps -ef | grep "); } + SEQ_TWO_KEYS(KC_J, KC_A) { SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); } + // this is a pain to type + SEQ_TWO_KEYS(KC_S, KC_S) { SEND_STRING("~/.ssh/ "); } + SEQ_TWO_KEYS(KC_F, KC_T) { SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT)); } + // ### LAYER CHANGE + SEQ_ONE_KEY(KC_1) { layer_on(1); } + // control enter, because yes + SEQ_ONE_KEY(KC_H) { SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_ENTER) SS_UP(X_LCTRL)); } + // paste all + SEQ_ONE_KEY(KC_P) { + if (onMac) { + SEND_STRING(SS_LGUI("a") SS_LGUI("v")); + } else { + SEND_STRING(SS_LCTRL("a") SS_LCTRL("v")); + } + } + SEQ_THREE_KEYS(KC_M, KC_A, KC_C) { + onMac = true; +# ifdef RGBLIGHT_ENABLE + rgblight_setrgb(255, 255, 255); +# endif + } + SEQ_THREE_KEYS(KC_W, KC_I, KC_N) { + onMac = false; +# ifdef RGBLIGHT_ENABLE + rgblight_setrgb(255, 255, 0); +# endif + } + /* Copy all */ + SEQ_ONE_KEY(KC_Y) { + if (onMac) { + SEND_STRING(SS_LGUI("a") SS_LGUI("c")); + } else { + SEND_STRING(SS_LCTRL("a") SS_LCTRL("c")); + } + } + // emoji bar + SEQ_TWO_KEYS(KC_E, KC_E) { SEND_STRING(SS_DOWN(X_LGUI) SS_LCTRL(" ") SS_UP(X_LGUI)); } - SEQ_TWO_KEYS(KC_F, KC_F) { - SEND_STRING("ps -ef | grep "); - } - SEQ_TWO_KEYS(KC_H, KC_T) { - SEND_STRING("https://"); - } + SEQ_TWO_KEYS(KC_F, KC_F) { SEND_STRING("ps -ef | grep "); } + SEQ_TWO_KEYS(KC_H, KC_T) { SEND_STRING("https://"); } - leader_end(); - } + leader_end(); + } } -#endif // LEADER - -// ======== INCREMENTAL MACROS STUFF ============= - -#define MAX_INCREMENTAL_MACRO 20 -#define TAP_ROTATION_TIMEOUT 400 - -uint16_t latest_kc = 0; -uint16_t latest_rotation = 0; -int key_count = 0; - -const char incremental_macros[][MAX_INCREMENTAL_MACRO] = { "String1"SS_TAP(X_HOME)"X-", "String2"SS_TAP(X_HOME) }; - -bool process_incremental_macro (uint16_t kc) { - - if( kc < INC_MACROS_START || kc > INC_MACROS_END ){ - return false; - } - int macro_idx = (int) (kc - INC_MACROS_START) - 1; - char tempstring[3] = {0}; - tempstring[0] = incremental_macros[macro_idx][key_count]; - // Special cases of SS_TAP SS_UP and SS_DOWN, they require two characters so get both once and skip on next iteration - if( tempstring[0] == '\1' || tempstring[0] == '\2' || tempstring[0] == '\3'){ - tempstring[1] = incremental_macros[macro_idx][++key_count]; - } - if( tempstring[0] == '\0'){ - key_count = 0; - } - send_string(tempstring); - - return true; -}; - -void refresh_incremental_macros (uint16_t kc) { - if (kc == latest_kc) - { - if ( (timer_elapsed(latest_rotation) > TAP_ROTATION_TIMEOUT) || (key_count >= MAX_INCREMENTAL_MACRO) ) key_count = 0; - else key_count++; - } else { - key_count = 0; - latest_kc = kc; - } - - latest_rotation = timer_read(); -} - - -// ======== VISUAL STUDIO CODE SHORTCUTS STUFF - -bool is_macro (uint16_t kc){ - return kc > MACRO_START && kc < MACRO_END; -}; - -bool command_shift_p (bool isMac) { - isMac - ? SEND_STRING(SS_DOWN(X_LSHIFT)SS_LGUI("p")SS_UP(X_LSHIFT)) - : SEND_STRING(SS_DOWN(X_LSHIFT)SS_LCTRL("p")SS_UP(X_LSHIFT)); - return false; -}; - -bool VSCommand(bool isMac, char *cmd) -{ - command_shift_p (isMac); - send_string(cmd); - SEND_STRING(SS_TAP(X_ENTER)); - return false; -}; - -bool handle_macro(uint16_t kc) -{ - switch (kc) - { - case T_TERM: return VSCommand(onMac, "toit"); - case FIX_ALL: return VSCommand(onMac, "faap"); - case BLK_CMNT: return VSCommand(onMac, "tbc"); - case LN_CMNT: return VSCommand(onMac, "tlic"); - case CMD_S_P: return command_shift_p(onMac); - case TRI_TICKS: SEND_STRING("[[[ "); break; - } - return false; -}; +#endif // LEADER diff --git a/users/danielo515/danielo515.h b/users/danielo515/danielo515.h index 95c01b6e8a4..715e8132fe8 100644 --- a/users/danielo515/danielo515.h +++ b/users/danielo515/danielo515.h @@ -1,104 +1,6 @@ #pragma once - #include "quantum.h" - - -bool handle_macro(uint16_t kc); -bool is_macro (uint16_t kc); -bool process_incremental_macro (uint16_t); -void refresh_incremental_macros (uint16_t); -//**************** KEYCODES *********************// - -enum custom_keycodes -{ - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - RGB_SLD, - ALT_TAB, - // Macros - ARROW, - F_ARROW, - QWERTY, - GREP, - // Accented characters - AC_A, - AC_E, - AC_I, - AC_O, - // Custom multi-os key-codes - CUT, - COPY, - PASTE, - SAVE, - UNDO, - CHG_LAYOUT, - FIND, - // OTHER OLD STUFF - LOWER, - RAISE, - ADJUST, - MAC_TGL, - MACRO_START, // START OF VSC DECLARATIONS - T_TERM, - FIX_ALL, - BLK_CMNT, - LN_CMNT, - CMD_S_P, - TRI_TICKS, - MACRO_END, // END OF VSC DECLARATIONS - INC_MACROS_START, - INC_MACROS_END, -}; - - -enum layers { - _QWERTY, - _LOWER, - _RAISE, - _F, - _D, - _A, - _S, - _J, - _K, - _MACROS, - _ADJUST, - _SAFE_LAYER -}; - -// Function letters -#define FN_F LT(_F,KC_F) -#define FN_D LT(_D,KC_D) -#define FN_S LT(_S,KC_S) -#define FN_A LT(_A,KC_A) -#define FN_K LT(_K,KC_K) -#define FN_J LT(_J,KC_J) -#define KC_FN_D FN_D -#define KC_FN_S FN_S -#define KC_FN_F FN_F - -#define KC_MACROS OSL(_MACROS) - - -#define KC_E_COLN LSFT(KC_DOT) -#define KC_E_EQL ES_EQL -#define KC_GUI OSM(MOD_RGUI) -#define KC_R_NUB S(KC_NUBS) -#define KC_E_LT KC_NUBS -#define KC_E_GT S(KC_NUBS) -#define KC_E_TILD ES_TILD -#define KC_E_MINS ES_MINS -#define KC_S_SPC SFT_T(KC_SPC) // Tap for Space, hold for Shift -#define KC_E_OVRR ES_OVRR -#define KC_E_APOS ES_APOS -#define KC_E_IEXL ES_IEXL -// Short hand for complex key combinations -# define WIN_LEFT_HALF LALT(LGUI(KC_LEFT)) -# define WIN_RIGHT_HALF LALT(LGUI(KC_RIGHT)) -# define WIN_TO_LEFT LALT(LSFT( LGUI(KC_LEFT) )) -# define WIN_TO_RIGHT LALT(LSFT( LGUI(KC_RIGHT) )) - -// Ready to use Tap dance definitions, just put them on your layout +#include "process_records.h" #ifdef TAP_DANCE_ENABLE #include "tap_dance.h" diff --git a/users/danielo515/process_records.c b/users/danielo515/process_records.c new file mode 100644 index 00000000000..b1a8b92552e --- /dev/null +++ b/users/danielo515/process_records.c @@ -0,0 +1,167 @@ +#include "process_records.h" +#include "alt_tab.h" +extern bool onMac; +// ======== INCREMENTAL MACROS STUFF ============= +#define MAX_INCREMENTAL_MACRO 20 +#define TAP_ROTATION_TIMEOUT 400 +uint16_t latest_kc = 0; +uint16_t latest_rotation = 0; +int key_count = 0; + +const char incremental_macros[][MAX_INCREMENTAL_MACRO] = { "String1"SS_TAP(X_HOME)"X-", "String2"SS_TAP(X_HOME) }; + +bool process_incremental_macro(uint16_t kc) { + if (kc < INC_MACROS_START || kc > INC_MACROS_END) { + return false; + } + int macro_idx = (int)(kc - INC_MACROS_START) - 1; + char tempstring[3] = {0}; + tempstring[0] = incremental_macros[macro_idx][key_count]; + // Special cases of SS_TAP SS_UP and SS_DOWN, they require two characters so get both once and skip on next iteration + if (tempstring[0] == '\1' || tempstring[0] == '\2' || tempstring[0] == '\3') { + tempstring[1] = incremental_macros[macro_idx][++key_count]; + } + if (tempstring[0] == '\0') { + key_count = 0; + } + send_string(tempstring); + + return true; +}; + +void refresh_incremental_macros(uint16_t kc) { + if (kc == latest_kc) { + if ((timer_elapsed(latest_rotation) > TAP_ROTATION_TIMEOUT) || (key_count >= MAX_INCREMENTAL_MACRO)) + key_count = 0; + else + key_count++; + } else { + key_count = 0; + latest_kc = kc; + } + + latest_rotation = timer_read(); +} +// Send control or GUI depending if we are on windows or mac +bool CMD(uint16_t kc) { + if(onMac){ tap_code16(LGUI(kc)); } else { tap_code16(LCTL(kc)); } + return false; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + bool pressed = record->event.pressed; + if(pressed){ + refresh_incremental_macros(keycode); + if(process_incremental_macro(keycode)){ + return false; + } + switch (keycode) { + case MAC_TGL: + onMac = !onMac; + onMac ? SEND_STRING("On mac") : SEND_STRING("Not on MAC"); + return false; + } + } + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + layer_on(_QWERTY); + } + return false; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + // == Macros START === + case IARROW: if (record->event.pressed) SEND_STRING("<-"); return false; + case ARROW: if (record->event.pressed) SEND_STRING("->"); return false; + case F_ARROW: if (record->event.pressed) SEND_STRING("=>"); return false; + case GREP: if (record->event.pressed) SEND_STRING(" | grep "); return false; + case CLN_EQ: if (record->event.pressed) SEND_STRING(":="); return false; + // == Macros END === + // == Multi Os START === + case KC_HOME:// make the home behave the same on OSX + if (record->event.pressed && onMac) { + SEND_STRING(SS_LCTRL("a")); + return false; + } + case KC_END:// make the end behave the same on OSX + if (record->event.pressed && onMac) { + tap_code16(C(KC_E)); + return false; + } + case AC_A:// Accent á + if (record->event.pressed) SEND_STRING(SS_LALT("e") "a"); return false; + case AC_E:// Accent é + if (record->event.pressed) SEND_STRING(SS_LALT("e") "e"); return false; + case AC_I:// Accent í + if (record->event.pressed) SEND_STRING(SS_LALT("e") "i"); return false; + case AC_O:// Accent ó + if (record->event.pressed) SEND_STRING(SS_LALT("e") "o"); return false; + case CUT: if (record->event.pressed) return CMD(KC_X); + case COPY: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c")); + } + return false; + case PASTE: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v")); + } + return false; + case SAVE: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LGUI("s")) : SEND_STRING(SS_LCTRL("s")); + } + return false; + case UNDO: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LGUI("z")) : SEND_STRING(SS_LCTRL("z")); + } + return false; + case FIND: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LGUI("f")) : SEND_STRING(SS_LCTRL("f")); + } + return false; + case CHG_LAYOUT: + if (record->event.pressed) { + onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f")); + } + return false; + // == Multi Os END === +#ifdef RGBLIGHT_ENABLE + case RGB_SLD: + if (record->event.pressed) { rgblight_mode(1); } + return false; + break; + //First time alt + tab, and alt stays sticky. Next press we just send tab. Any other key releases the alt +#endif + } +// =============== ALT_TAB single key handling + return process_alt_tab(keycode, record); +}; + + + diff --git a/users/danielo515/process_records.h b/users/danielo515/process_records.h new file mode 100644 index 00000000000..c994511a5f8 --- /dev/null +++ b/users/danielo515/process_records.h @@ -0,0 +1,104 @@ +#pragma once +#include "quantum.h" + +enum custom_keycodes +{ + EPRM = SAFE_RANGE, + RGB_SLD, + ALT_TAB, + QWERTY, + SYM, + NAV, + ADJUST, +// Macros + ARROW, + IARROW, + CLN_EQ, + F_ARROW, + GREP, +// Accented characters + AC_A, + AC_E, + AC_I, + AC_O, +// Custom multi-os key-codes + CUT, + COPY, + PASTE, + SAVE, + UNDO, + CHG_LAYOUT, + FIND, +// OTHER OLD STUFF + LOWER, + RAISE, + MAC_TGL, + INC_MACROS_START, + INC_MACROS_END, +}; + +//**************** KEYCODES *********************// +enum layers { + _QWERTY, + _SYMB, + _NAV, + _ADJUST, + _F, + _D, + _S, + _A, + _J, + _K, + // iris specific - TBD + _LOWER, + _RAISE, + _MACROS, + _SAFE_LAYER +}; + +//===== Function letters +# define FN_F LT(_F,KC_F) +# define FN_D LT(_D,KC_D) +# define FN_S LT(_S,KC_S) +# define FN_A LT(_A,KC_A) +# define FN_K LT(_K,KC_K) +# define FN_J LT(_J,KC_J) +# define KC_FN_D FN_D +# define KC_FN_S FN_S +# define KC_FN_F FN_F + +# define KC_MACROS OSL(_MACROS) + + +# define KC_E_COLN LSFT(KC_DOT) +# define KC_E_EQL ES_EQL +# define KC_GUI OSM(MOD_RGUI) +# define KC_R_NUB S(KC_NUBS) +# define KC_E_LT KC_NUBS +# define KC_E_GT S(KC_NUBS) +# define KC_E_TILD ES_TILD +# define KC_E_MINS ES_MINS +# define KC_E_OVRR ES_OVRR +# define KC_E_APOS ES_APOS +# define KC_E_IEXL ES_IEXL +//========== Short hand for complex key combinations +# define WIN_LEFT_HALF LALT(LGUI(KC_LEFT)) +# define WIN_RIGHT_HALF LALT(LGUI(KC_RIGHT)) +# define WIN_TO_LEFT LALT(LSFT( LGUI(KC_LEFT) )) +# define WIN_TO_RIGHT LALT(LSFT( LGUI(KC_RIGHT) )) +# define ALL_WIN LCTL(KC_DOWN) +# define EXPOSE LGUI(KC_DOWN) +// ========== Modifiers!! +# define SHIFT OSM(MOD_LSFT) +//=============== tap for key hold for mod +# define HYPR_H HYPR_T(KC_H) +# define CTL_K RCTL_T(KC_K) +# define ALT_J ALT_T(KC_J) +# define SFT_MINS LSFT_T(KC_MINS) // tap - hold shift +# define CMD_QUOT GUI_T(KC_QUOTE) // tap ' hold cmd +//=============== Movement modified +# define CTL_LEFT LCTL(KC_LEFT) +# define CTL_RIGHT LCTL(KC_RIGHT) + +# define SFT_LEFT LSFT(KC_LEFT) +# define SFT_RIGHT LSFT(KC_RIGHT) diff --git a/users/danielo515/rules.mk b/users/danielo515/rules.mk index 091baf20c9d..c77e2f01551 100644 --- a/users/danielo515/rules.mk +++ b/users/danielo515/rules.mk @@ -1,4 +1,6 @@ -SRC += danielo515.c +SRC += danielo515.c \ + alt_tab.c \ + process_records.c ifeq ($(strip $(COMBO_ENABLE)), yes) SRC += combo.c diff --git a/users/danielo515/tap_dance.h b/users/danielo515/tap_dance.h index 6ec4fe13cf9..880ad525eeb 100644 --- a/users/danielo515/tap_dance.h +++ b/users/danielo515/tap_dance.h @@ -57,6 +57,7 @@ void dance_cut (qk_tap_dance_state_t *state, void *user_data); void dance_copy (qk_tap_dance_state_t *state, void *user_data); void dance_paste (qk_tap_dance_state_t *state, void *user_data); +// Ready to use Tap dance definitions, just put them on your layout #define TD_COPY TD(_TD_COPY) #define TD_CUT TD(_TD_CUT) #define KC_TD_COPY TD(_TD_COPY) // Declarations for macros that add KC_ diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c index 448e6ca107e..4ed2b9a0b09 100644 --- a/users/xulkal/custom_oled.c +++ b/users/xulkal/custom_oled.c @@ -7,11 +7,6 @@ rgblight_config_t rgblight_config; #endif -#if KEYBOARD_helix_rev2 -extern uint8_t is_master; -bool is_keyboard_master(void) { return is_master; } -#endif - static void render_logo(void) { static const char PROGMEM font_logo[] = {