Compare commits

...
18 Commits
Author SHA1 Message Date
Ryan 16a15c1cfc QMK-ify some GPIO macros (#8315) 2020-04-30 16:24:47 +10:00
Ryan 37a4b53c4f BACKLIGHT_ON_STATE config.h fixes (#8862) 2020-04-30 16:24:13 +10:00
QMK Bot 231464c49c format code according to conventions [skip ci] 2020-04-29 11:38:51 +00:00
d26a14c169 add 'togglePin' convenience function (#8734)
* add 'togglePin' conveniance function

for AVR and chibios

* drop outmost parantheses

Co-Authored-By: Konstantin Đorđević <[email protected]>

* toggle pin on avrs

toggle a pin configured as output by writing the corresponding bit to the PIN register

Co-Authored-By: Takeshi ISHII <[email protected]>

* togglepin: add documentation for newly added function

* Update docs/internals_gpio_control.md

Co-Authored-By: Konstantin Đorđević <[email protected]>

* on AVR: use PORTD to toggle the output

... since not all MCUs support toggling through writing to PIN

Co-Authored-By: Ryan <[email protected]>

Co-authored-by: Johannes <[email protected]>
Co-authored-by: Konstantin Đorđević <[email protected]>
Co-authored-by: Takeshi ISHII <[email protected]>
Co-authored-by: Ryan <[email protected]>
2020-04-29 04:04:29 -07:00
Mikkel Jeppesen 195be50745 [Keyboard] Vitamins included VIA support (#8876)
* Added VIA support

* added via support to vitamins included

* Added VIA support

* added via support to vitamins included

* Used actual nkro alias
2020-04-29 03:55:54 -07:00
Sergey Vlasov 8fdb229b66 [Keyboard] id80: Transpose matrix to use faster COL2ROW routines (#8930)
* id80: Transpose matrix to use faster COL2ROW routines

Even the standard QMK matrix_scan() function can give about 2 times
higher scan rate (if compiled with optimizations enabled) if the COL2ROW
matrix layout is used instead of ROW2COL.  Although the ID80 PCB is
wired using the ROW2COL matrix layout, it is possible to transpose the
matrix from the QMK standpoint, so that "columns" would correspond to
horizontal connections, and "rows" would correspond to (mostly) vertical
connections; in this case the matrix could be handled as if it had the
COL2ROW layout.

The matrix layout change makes the older VIA JSON layout definition
incompatible, but the corresponding JSON was not yet accepted to the VIA
repository, so it should still be safe to make this change.

* id80: Remove obsolete comments
2020-04-29 03:52:15 -07:00
Garret G fd3456f362 [Keymap] Add VIA Keymap to RoMac+ Directory (#8966) 2020-04-29 03:11:02 -07:00
QMK Bot 812d80efbd format code according to conventions [skip ci] 2020-04-29 08:57:41 +00:00
Drashna Jaelre 86c4c4e91d Convert clipping variables in rgblight.c to a structure (#7720) 2020-04-29 10:22:28 +02:00
yd-null 5f5c2a219c [Keyboard] Add via support for cypher rev5 PCB (#8898) 2020-04-28 21:42:50 -07:00
Drashna JaelreandJoel Challis e415198235 A few final edits to the keymap and readme. (#8845)
* A few final edits to the keymap and readme.

* Update keyboards/xd75/keymaps/buzzlighter1/readme.md

Co-Authored-By: Joel Challis <[email protected]>

* Update keyboards/xd75/keymaps/buzzlighter1/readme.md

Co-Authored-By: Joel Challis <[email protected]>

* Update keyboards/xd75/keymaps/buzzlighter1/readme.md

Co-Authored-By: Joel Challis <[email protected]>

* Update keyboards/xd75/keymaps/buzzlighter1/readme.md

Co-Authored-By: Joel Challis <[email protected]>

Co-authored-by: Joel Challis <[email protected]>
2020-04-28 21:01:52 -07:00
Nick Brassel b17482c3fd Add SPI master for ChibiOS/ARM. (#8779) 2020-04-29 14:01:20 +10:00
Umberto BaldiandJoel Challis 5b4870c046 fix sick68 space key handwiring location (#8962)
* fix space key handwiring location

* fix mechmerlin layout

* Revert changes from mechmerlin layout

Co-Authored-By: Joel Challis <[email protected]>

* Update layouts/community/65_ansi/mechmerlin/keymap.c

* revert

Co-authored-by: Joel Challis <[email protected]>
2020-04-29 00:45:51 +01:00
buzzlighter1andJoel Challis 47fc2f8855 Update keyboards/xd75/keymaps/buzzlighter1/readme.md
Co-Authored-By: Joel Challis <[email protected]>
2020-04-25 15:22:05 +03:00
buzzlighter1andJoel Challis ee29b515ec Update keyboards/xd75/keymaps/buzzlighter1/readme.md
Co-Authored-By: Joel Challis <[email protected]>
2020-04-25 15:21:57 +03:00
buzzlighter1andJoel Challis c031e13982 Update keyboards/xd75/keymaps/buzzlighter1/readme.md
Co-Authored-By: Joel Challis <[email protected]>
2020-04-25 15:21:34 +03:00
buzzlighter1andJoel Challis a6bd8fe67b Update keyboards/xd75/keymaps/buzzlighter1/readme.md
Co-Authored-By: Joel Challis <[email protected]>
2020-04-18 20:32:24 +03:00
buzzlighter1 db4b11f866 A few final edits to the keymap and readme. 2020-04-18 18:16:11 +03:00
45 changed files with 537 additions and 231 deletions

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ The following functions can provide basic control of GPIOs and are found in `qua
| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | | `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` |
| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | | `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` |
| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | | `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` |
| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` |
## Advanced Settings :id=advanced-settings ## Advanced Settings :id=advanced-settings
+18 -1
View File
@@ -18,7 +18,24 @@ You may use more than one slave select pin, not just the `SS` pin. This is usefu
## ChibiOS/ARM Configuration ## ChibiOS/ARM Configuration
ARM support for this driver is not ready yet. Check back later! You'll need to determine which pins can be used for SPI -- as an example, STM32 parts generally have multiple SPI peripherals, labeled SPI1, SPI2, SPI3 etc.
To enable SPI, modify your board's `halconf.h` to enable SPI - both `HAL_USE_SPI` and `SPI_USE_WAIT` should be `TRUE`, and `SPI_SELECT_MODE` should be `SPI_SELECT_MODE_PAD`.
Then, modify your board's `mcuconf.h` to enable the SPI peripheral you've chosen -- in the case of using SPI2, modify `STM32_SPI_USE_SPI2` to be `TRUE`.
As per the AVR configuration, you may select any other standard GPIO as a slave select pin, and can be supplied to `spi_start()`.
Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303.
`config.h` override | Description | Default Value
----------------------------|---------------------------------------------------------------|--------------
`#define SPI_DRIVER` | SPI peripheral to use - SPI1 => `SPID1`, SPI2 => `SPID2` etc. | `SPID2`
`#define SPI_SCK_PIN` | The pin to use for the SCK | `B13`
`#define SPI_SCK_PAL_MODE` | The alternate function mode for the SCK pin | `5`
`#define SPI_MOSI_PIN` | The pin to use for the MOSI | `B15`
`#define SPI_MOSI_PAL_MODE` | The alternate function mode for the MOSI pin | `5`
`#define SPI_MISO_PIN` | The pin to use for the MISO | `B14`
`#define SPI_MISO_PAL_MODE` | The alternate function mode for the MISO pin | `5`
## Functions ## Functions
+4 -4
View File
@@ -30,8 +30,8 @@
void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds) { apa102_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); } void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds) { apa102_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); }
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) { void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
pinMode(RGB_DI_PIN, PinDirectionOutput); setPinOutput(RGB_DI_PIN);
pinMode(RGB_CLK_PIN, PinDirectionOutput); setPinOutput(RGB_CLK_PIN);
apa102_send_array((uint8_t *)ledarray, leds) apa102_send_array((uint8_t *)ledarray, leds)
} }
@@ -90,7 +90,7 @@ void apa102_end_frame(uint16_t leds) {
void apa102_send_byte(uint8_t byte) { void apa102_send_byte(uint8_t byte) {
uint8_t i; uint8_t i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
digitalWrite(RGB_DI_PIN, !!(byte & (1 << (7-i))); writePin(RGB_DI_PIN, !!(byte & (1 << (7 - i))));
digitalWrite(RGB_CLK_PIN, PinLevelHigh); writePinHigh(RGB_CLK_PIN);
} }
} }
-1
View File
@@ -3,7 +3,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "config.h" #include "config.h"
enum ssd1306_cmds { enum ssd1306_cmds {
+137
View File
@@ -0,0 +1,137 @@
/* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#include "spi_master.h"
#include "quantum.h"
#include "timer.h"
static pin_t currentSlavePin = NO_PIN;
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
__attribute__((weak)) void spi_init(void) {
// Try releasing special pins for a short time
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_INPUT);
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_INPUT);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_INPUT);
chThdSleepMilliseconds(10);
#if defined(USE_GPIOV1)
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
#else
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
#endif
}
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
if (currentSlavePin != NO_PIN || slavePin == NO_PIN) {
return false;
}
uint16_t roundedDivisor = 2;
while (roundedDivisor < divisor) {
roundedDivisor <<= 1;
}
if (roundedDivisor < 2 || roundedDivisor > 256) {
return false;
}
spiConfig.cr1 = 0;
if (lsbFirst) {
spiConfig.cr1 |= SPI_CR1_LSBFIRST;
}
switch (mode) {
case 0:
break;
case 1:
spiConfig.cr1 |= SPI_CR1_CPHA;
break;
case 2:
spiConfig.cr1 |= SPI_CR1_CPOL;
break;
case 3:
spiConfig.cr1 |= SPI_CR1_CPHA | SPI_CR1_CPOL;
break;
}
switch (roundedDivisor) {
case 2:
break;
case 4:
spiConfig.cr1 |= SPI_CR1_BR_0;
break;
case 8:
spiConfig.cr1 |= SPI_CR1_BR_1;
break;
case 16:
spiConfig.cr1 |= SPI_CR1_BR_1 | SPI_CR1_BR_0;
break;
case 32:
spiConfig.cr1 |= SPI_CR1_BR_2;
break;
case 64:
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_0;
break;
case 128:
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_1;
break;
case 256:
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0;
break;
}
currentSlavePin = slavePin;
spiConfig.ssport = PAL_PORT(slavePin);
spiConfig.sspad = PAL_PAD(slavePin);
setPinOutput(slavePin);
spiStart(&SPI_DRIVER, &spiConfig);
spiSelect(&SPI_DRIVER);
return true;
}
spi_status_t spi_write(uint8_t data) { return spi_transmit(&data, 1); }
spi_status_t spi_read(void) {
uint8_t data = 0;
spi_receive(&data, 1);
return data;
}
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
spiSend(&SPI_DRIVER, length, data);
return SPI_STATUS_SUCCESS;
}
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
spiReceive(&SPI_DRIVER, length, data);
return SPI_STATUS_SUCCESS;
}
void spi_stop(void) {
if (currentSlavePin != NO_PIN) {
spiUnselect(&SPI_DRIVER);
spiStop(&SPI_DRIVER);
currentSlavePin = NO_PIN;
}
}
+78
View File
@@ -0,0 +1,78 @@
/* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <ch.h>
#include <hal.h>
#include <quantum.h>
#ifndef SPI_DRIVER
# define SPI_DRIVER SPID2
#endif
#ifndef SPI_SCK_PIN
# define SPI_SCK_PIN B13
#endif
#ifndef SPI_SCK_PAL_MODE
# define SPI_SCK_PAL_MODE 5
#endif
#ifndef SPI_MOSI_PIN
# define SPI_MOSI_PIN B15
#endif
#ifndef SPI_MOSI_PAL_MODE
# define SPI_MOSI_PAL_MODE 5
#endif
#ifndef SPI_MISO_PIN
# define SPI_MISO_PIN B14
#endif
#ifndef SPI_MISO_PAL_MODE
# define SPI_MISO_PAL_MODE 5
#endif
typedef int16_t spi_status_t;
#define SPI_STATUS_SUCCESS (0)
#define SPI_STATUS_ERROR (-1)
#define SPI_STATUS_TIMEOUT (-2)
#define SPI_TIMEOUT_IMMEDIATE (0)
#define SPI_TIMEOUT_INFINITE (0xFFFF)
#ifdef __cplusplus
extern "C" {
#endif
void spi_init(void);
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor);
spi_status_t spi_write(uint8_t data);
spi_status_t spi_read(void);
spi_status_t spi_transmit(const uint8_t *data, uint16_t length);
spi_status_t spi_receive(uint8_t *data, uint16_t length);
void spi_stop(void);
#ifdef __cplusplus
}
#endif
@@ -1,7 +1,6 @@
#include "drashna.h" #include "drashna.h"
#include "analog.h" #include "analog.h"
#include "pointing_device.h" #include "pointing_device.h"
#include "pincontrol.h"
#define KC_X0 LT(_FN, KC_ESC) #define KC_X0 LT(_FN, KC_ESC)
-1
View File
@@ -43,7 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 6 #define BREATHING_PERIOD 6
#define BACKLIGHT_ON_STATE 1
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
+1 -2
View File
@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
@@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
void matrix_render(struct CharacterMatrix *matrix); void matrix_render(struct CharacterMatrix *matrix);
bool process_record_gfx(uint16_t keycode, keyrecord_t *record); bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
+1 -2
View File
@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
@@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
void matrix_render(struct CharacterMatrix *matrix); void matrix_render(struct CharacterMatrix *matrix);
bool process_record_gfx(uint16_t keycode, keyrecord_t *record); bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
+20 -21
View File
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "protocol/serial.h" #include "protocol/serial.h"
#include "timer.h" #include "timer.h"
#include "pincontrol.h"
/* /*
@@ -96,27 +95,27 @@ void pins_init(void) {
// set pins for pullups, Rts , power &etc. // set pins for pullups, Rts , power &etc.
//print ("pins setup\n"); //print ("pins setup\n");
pinMode(VCC_PIN, PinDirectionOutput); setPinOutput(VCC_PIN);
digitalWrite(VCC_PIN, PinLevelLow); writePinLow(VCC_PIN);
#if ( HANDSPRING == 0) #if ( HANDSPRING == 0)
#ifdef CY835 #ifdef CY835
pinMode(GND_PIN, PinDirectionOutput); setPinOutput(GND_PIN);
digitalWrite(GND_PIN, PinLevelLow); writePinLow(GND_PIN);
pinMode(PULLDOWN_PIN, PinDirectionOutput); setPinOutput(PULLDOWN_PIN);
digitalWrite(PULLDOWN_PIN, PinLevelLow); writePinLow(PULLDOWN_PIN);
#endif #endif
pinMode(DCD_PIN, PinDirectionInput); setPinInput(DCD_PIN);
pinMode(RTS_PIN, PinDirectionInput); setPinInput(RTS_PIN);
#endif #endif
/* check that the other side isn't powered up. /* check that the other side isn't powered up.
test=digitalRead(DCD_PIN); test=readPin(DCD_PIN);
xprintf("b%02X:", test); xprintf("b%02X:", test);
test=digitalRead(RTS_PIN); test=readPin(RTS_PIN);
xprintf("%02X\n", test); xprintf("%02X\n", test);
*/ */
@@ -129,20 +128,20 @@ uint8_t rts_reset(void) {
// On boot, we keep rts as input, then switch roles here // On boot, we keep rts as input, then switch roles here
// on leaving sleep, we toggle the same way // on leaving sleep, we toggle the same way
firstread=digitalRead(RTS_PIN); firstread=readPin(RTS_PIN);
// printf("r%02X:", firstread); // printf("r%02X:", firstread);
pinMode(RTS_PIN, PinDirectionOutput); setPinOutput(RTS_PIN);
if (firstread == PinLevelHigh) { if (firstread) {
digitalWrite(RTS_PIN, PinLevelLow); writePinLow(RTS_PIN);
} }
_delay_ms(10); _delay_ms(10);
digitalWrite(RTS_PIN, PinLevelHigh); writePinHigh(RTS_PIN);
/* the future is Arm /* the future is Arm
if (palReadPad(RTS_PIN_IOPRT) == PinLevelLow) if (!palReadPad(RTS_PIN_IOPRT))
{ {
_delay_ms(10); _delay_ms(10);
palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL); palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL);
@@ -224,9 +223,9 @@ uint8_t handspring_handshake(void) {
} }
uint8_t handspring_reset(void) { uint8_t handspring_reset(void) {
digitalWrite(VCC_PIN, PinLevelLow); writePinLow(VCC_PIN);
_delay_ms(5); _delay_ms(5);
digitalWrite(VCC_PIN, PinLevelHigh); writePinHigh(VCC_PIN);
if ( handspring_handshake() ) { if ( handspring_handshake() ) {
last_activity = timer_read(); last_activity = timer_read();
@@ -250,7 +249,7 @@ void matrix_init(void)
#endif #endif
print("power up\n"); print("power up\n");
digitalWrite(VCC_PIN, PinLevelHigh); writePinHigh(VCC_PIN);
// wait for DCD strobe from keyboard - it will do this // wait for DCD strobe from keyboard - it will do this
// up to 3 times, then the board needs the RTS toggled to try again // up to 3 times, then the board needs the RTS toggled to try again
@@ -265,7 +264,7 @@ void matrix_init(void)
} }
#else /// Palm / HP device with DCD #else /// Palm / HP device with DCD
while( digitalRead(DCD_PIN) != PinLevelHigh ) {;} while( !readPin(DCD_PIN) ) {;}
print("dcd\n"); print("dcd\n");
rts_reset(); // at this point the keyboard should think all is well. rts_reset(); // at this point the keyboard should think all is well.
+1 -2
View File
@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
@@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
void matrix_render(struct CharacterMatrix *matrix); void matrix_render(struct CharacterMatrix *matrix);
bool process_record_gfx(uint16_t keycode, keyrecord_t *record); bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
-1
View File
@@ -43,7 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PINS { B1, B2, B3, E6 } #define BACKLIGHT_PINS { B1, B2, B3, E6 }
#define BACKLIGHT_LED_COUNT 4 #define BACKLIGHT_LED_COUNT 4
#define BACKLIGHT_LEVELS 10 #define BACKLIGHT_LEVELS 10
#define BACKLIGHT_ON_STATE 1
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGB_DI_PIN D6 #define RGB_DI_PIN D6
+4 -24
View File
@@ -22,31 +22,11 @@
*/ */
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
# include "ws2812.c"
# include "ergodox_ez.h" # include "ergodox_ez.h"
extern rgblight_config_t rgblight_config; extern rgblight_config_t rgblight_config;
void rgblight_set(void) { void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
#ifdef RGBW
led[i].w = 0;
#endif
}
}
#ifdef RGBW
else {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
convert_rgb_to_rgbw(&led[i]);
}
}
#endif
uint8_t led_num = RGBLED_NUM;
i2c_init(); i2c_init();
i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT); i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT);
int i = 0; int i = 0;
@@ -54,8 +34,8 @@ void rgblight_set(void) {
// prevent right-half code from trying to bitbang all 30 // prevent right-half code from trying to bitbang all 30
// so with 30 LEDs, we count from 29 to 15 here, and the // so with 30 LEDs, we count from 29 to 15 here, and the
// other half does 0 to 14. // other half does 0 to 14.
led_num = RGBLED_NUM / 2; uint8_t half_led_num = RGBLED_NUM / 2;
for (i = led_num + led_num - 1; i >= led_num; --i) for (i = half_led_num + half_led_num - 1; i >= half_led_num; --i)
# elif defined(ERGODOX_LED_15_MIRROR) # elif defined(ERGODOX_LED_15_MIRROR)
for (i = 0; i < led_num; ++i) for (i = 0; i < led_num; ++i)
# else // ERGDOX_LED_15 non-mirrored # else // ERGDOX_LED_15 non-mirrored
@@ -72,7 +52,7 @@ void rgblight_set(void) {
} }
i2c_stop(); i2c_stop();
ws2812_setleds(led, RGBLED_NUM); ws2812_setleds(led, led_num);
} }
-1
View File
@@ -31,7 +31,6 @@ SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard
SLEEP_LED_ENABLE = no SLEEP_LED_ENABLE = no
API_SYSEX_ENABLE = no API_SYSEX_ENABLE = no
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes
RGB_MATRIX_ENABLE = no # enable later RGB_MATRIX_ENABLE = no # enable later
DEBOUNCE_TYPE = eager_pr DEBOUNCE_TYPE = eager_pr
+1
View File
@@ -52,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* https://docs.qmk.fm/#/feature_backlight?id=timer-assisted-pwm-implementation * https://docs.qmk.fm/#/feature_backlight?id=timer-assisted-pwm-implementation
*/ */
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_ON_STATE 0
#define RGB_DI_PIN B2 #define RGB_DI_PIN B2
#ifdef RGB_DI_PIN #ifdef RGB_DI_PIN
-4
View File
@@ -39,7 +39,3 @@ After putting your COD67 in bootloader mode, it will show up as a drive.
* Drag and drop your new `COD67.BIN` to the drive. * Drag and drop your new `COD67.BIN` to the drive.
* Wait a few seconds for it to write. The caps lock LED flashes rapidly while writing. * Wait a few seconds for it to write. The caps lock LED flashes rapidly while writing.
* Press the `Esc` key or eject the drive in Finder to reset the board. You are now ready to type! * Press the `Esc` key or eject the drive in Finder to reset the board. You are now ready to type!
## Notes
The backlight pin is attached to a non PWM pin `D4` so the backlight is only on/off.
-3
View File
@@ -27,9 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT AEK64 #define PRODUCT AEK64
#define DESCRIPTION QMK keyboard firmware for AEK64 handwired #define DESCRIPTION QMK keyboard firmware for AEK64 handwired
/* Define the backlight */
/*#define BACKLIGHT_ON_STATE 1*/
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
#define MATRIX_COLS 14 #define MATRIX_COLS 14
-1
View File
@@ -41,7 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN F6 #define BACKLIGHT_PIN F6
// #define BACKLIGHT_BREATHING // #define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5 #define BACKLIGHT_LEVELS 5
#define BACKLIGHT_ON_STATE 1
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
+4 -4
View File
@@ -30,7 +30,7 @@
// readability // readability
#define XXX KC_NO #define XXX KC_NO
/* TADA68 ANSI layout /* SICK68 ANSI layout
* ,----------------------------------------------------------------. * ,----------------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | 0e | * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | 0e |
* |----------------------------------------------------------------| * |----------------------------------------------------------------|
@@ -40,7 +40,7 @@
* |----------------------------------------------------------------| * |----------------------------------------------------------------|
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d| 3e | * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d| 3e |
* |----------------------------------------------------------------| * |----------------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 49| 4a| 4b| 4c| 4d| 4e | * | 40 | 41 | 42 | 46 | 49| 4a| 4b| 4c| 4d| 4e |
* `----------------------------------------------------------------' * `----------------------------------------------------------------'
*/ */
// The first section contains all of the arguments // The first section contains all of the arguments
@@ -51,12 +51,12 @@
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
k40, k41, k42, k45, k49, k4a, k4b, k4c, k4d, k4e \ k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \
) \ ) \
{ \ { \
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \ {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \ {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \ {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \
{k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \ {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d, k4e} \ {k40, k41, k42, XXX, XXX, XXX, k46, XXX, XXX, k49, k4a, k4b, k4c, k4d, k4e} \
} }
-1
View File
@@ -3,7 +3,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
+17 -11
View File
@@ -28,8 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION A 75% hotswap keyboard #define DESCRIPTION A 75% hotswap keyboard
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 11 #define MATRIX_ROWS 9
#define MATRIX_COLS 9 #define MATRIX_COLS 11
/* /*
* Keyboard Matrix Assignments * Keyboard Matrix Assignments
@@ -41,16 +41,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
* *
* The matrix description in the vendor-supplied JSON file for kbfirmware.com * The matrix description in the vendor-supplied JSON file for kbfirmware.com
* had 12 rows: * had 9 columns:
* { D0, D1, D2, D3, D5, D4, D6, D7, B4 }
* and 12 rows:
* { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 } * { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 }
* However, the row 6 was completely empty, and the pin F0 was not actually * However, the row 6 was completely empty, and the pin F0 was not actually
* routed anywhere on the PCB, therefore this row was removed to save some * routed anywhere on the PCB, therefore this row was removed to save some
* resources (the EEPROM space for dynamic keymaps is especially scarce). * resources (the EEPROM space for dynamic keymaps is especially scarce).
*
* After doing the above change, the matrix was transposed (rows and columns
* were swapped), because a matrix with the COL2ROW layout can be scanned much
* more efficiently than a matrix with the ROW2COL layout (depending on various
* optimizations, the difference in scan rate can be over 2 times). Because of
* this, the "columns" in the matrix layout now mostly correspond to physical
* rows, and the "rows" have mostly vertical physical orientation.
*/ */
#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0, E6, F1, F4, F5, F6, F7 } #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 } #define MATRIX_COL_PINS { B7, B3, B2, B1, B0, E6, F1, F4, F5, F6, F7 }
#define DIODE_DIRECTION ROW2COL #define DIODE_DIRECTION COL2ROW
#define BACKLIGHT_PIN B6 #define BACKLIGHT_PIN B6
// #define BACKLIGHT_BREATHING // #define BACKLIGHT_BREATHING
@@ -81,8 +90,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif #endif
/* Bootmagic Lite key configuration: use the Esc key */ /* Bootmagic Lite key configuration: use the Esc key */
#define BOOTMAGIC_LITE_ROW 5 #define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0 #define BOOTMAGIC_LITE_COLUMN 5
// partially generated by KBFirmware JSON to QMK Parser
// https://noroadsleft.github.io/kbf_qmk_converter/
+9 -14
View File
@@ -25,18 +25,13 @@
K10, K12, K13, K14, K15, K16, K17, K18, K68, K67, K65, K64, K63, \ K10, K12, K13, K14, K15, K16, K17, K18, K68, K67, K65, K64, K63, \
K00, K01, K02, K06, K08, K07, K05, K04, K03 \ K00, K01, K02, K06, K08, K07, K05, K04, K03 \
) { \ ) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ { K00, K10, K20, K30, K40, K50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K10, KC_NO, K12, K13, K14, K15, K16, K17, K18 }, \ { K01, KC_NO, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, K82, K92, KA2 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ { K03, K13, K23, K33, K43, K53, K63, KC_NO, K83, KC_NO, KA3 }, \
{ K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ { K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, KA5 }, \
{ KC_NO, KC_NO, KC_NO, K63, K64, K65, KC_NO, K67, K68 }, \ { K06, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, K96, KA6 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, K74, K75, KC_NO, K77, K78 }, \ { K07, K17, K27, K37, K47, K57, K67, K77, K87, K97, KA7 }, \
{ KC_NO, KC_NO, K82, K83, K84, K85, KC_NO, K87, K88 }, \ { K08, K18, K28, K38, K48, K58, K68, K78, K88, K98, KC_NO }, \
{ KC_NO, KC_NO, K92, KC_NO, K94, K95, K96, K97, K98 }, \
{ KC_NO, KC_NO, KA2, KA3, KA4, KA5, KA6, KA7, KC_NO }, \
} }
// generated by KBFirmware JSON to QMK Parser
// https://noroadsleft.github.io/kbf_qmk_converter/
@@ -0,0 +1,17 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_7, KC_8, KC_9,
KC_4, KC_5, KC_6,
KC_1, KC_2, KC_3,
MO(1), KC_0, KC_DOT
),
[1] = LAYOUT(
RGB_MOD, KC_HOME, KC_PGUP,
KC_TRNS, KC_END, KC_PGDN,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_ENT
)
};
@@ -0,0 +1 @@
VIA_ENABLE = yes
+1 -2
View File
@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
@@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
void matrix_render(struct CharacterMatrix *matrix); void matrix_render(struct CharacterMatrix *matrix);
bool process_record_gfx(uint16_t keycode, keyrecord_t *record); bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
-1
View File
@@ -65,7 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PINS { C2, C7, D5, D6, B0 } #define BACKLIGHT_PINS { C2, C7, D5, D6, B0 }
#define BACKLIGHT_LED_COUNT 5 #define BACKLIGHT_LED_COUNT 5
#define BACKLIGHT_LEVELS 10 #define BACKLIGHT_LEVELS 10
#define BACKLIGHT_ON_STATE 1
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
-1
View File
@@ -18,7 +18,6 @@
#define BACKLIGHT_PIN B7 #define BACKLIGHT_PIN B7
#ifdef BACKLIGHT_PIN #ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 6 #define BACKLIGHT_LEVELS 6
//#define BACKLIGHT_ON_STATE 1
#endif #endif
/* COL2ROW or ROW2COL */ /* COL2ROW or ROW2COL */
@@ -0,0 +1,85 @@
#include QMK_KEYBOARD_H
enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | GUI | Alt |Adjust|Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
KC_LCTRL,KC_LGUI, KC_LALT,MO(_ADJUST),MO(_LOWER),KC_SPC,KC_SPC,MO(_RAISE),KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* |RESET | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |NKTOGG| | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
RESET, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______,_______, \
NK_TOGG, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | |NKTOGG|RESET |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, NK_TOGG, RESET, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Adjust
* ,-----------------------------------------------------------------------------------.
* | | RESET| | | | | | | | | RESET| Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | |RGBMOD|
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, RESET, KC_DEL, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, AU_OFF, AU_ON, _______, _______, _______, _______, _______, RGB_MOD \
)
};
@@ -0,0 +1 @@
VIA_ENABLE = yes
+1 -1
View File
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0x21FF #define VENDOR_ID 0x21FF
#define PRODUCT_ID 0xAA97 #define PRODUCT_ID 0xAA98
#define DEVICE_VER 0x0002 #define DEVICE_VER 0x0002
#define MANUFACTURER westfoxtrot #define MANUFACTURER westfoxtrot
#define PRODUCT cypher #define PRODUCT cypher
@@ -0,0 +1,35 @@
/* VIA Layout > http://www.keyboard-layout-editor.com/#/gists/0e8d4957e77f3179aa09bd6e195f7afa */
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
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_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
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_P7, KC_P8, KC_P9, KC_PPLS,
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_P4, KC_P5, KC_P6, KC_PEQL,
KC_LSFT, KC_BSLS, 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_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RALT, MO(1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC),
[1] = LAYOUT_all(
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_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, BL_TOGG, BL_STEP, BL_ON, BL_OFF, BL_INC, BL_DEC, BL_BRTG, 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, 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),
[2] = 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, 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, 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),
[3] = 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, 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, 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),
};
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
+1
View File
@@ -52,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_LEVELS 6 #define BACKLIGHT_LEVELS 6
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 6 #define BREATHING_PERIOD 6
#define BACKLIGHT_ON_STATE 0
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
+1
View File
@@ -51,6 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN F5 #define BACKLIGHT_PIN F5
#define BACKLIGHT_LEVELS 6 #define BACKLIGHT_LEVELS 6
#define BACKLIGHT_ON_STATE 0
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
+13 -11
View File
@@ -10,6 +10,8 @@ enum custom_keycodes {
QMKURL QMKURL
}; };
#define FN_CAPS LT(_FN, KC_CAPS)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY /* QWERTY
@@ -18,18 +20,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Mute | * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Mute |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | TT(1) | A | S | D | F | G | H | J | K | L | ; | ' | Vol- | Vol+ | ENTER | * | FN(CPS)| A | S | D | F | G | H | J | K | L | ; | ' | Vol- | Vol+ | ENTER |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | Home | PGUP | UP | PGDWN | * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | Home | PGUP | UP | PGDWN |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | Prev | Next | LALT | SPACE | End | LEFT | DOWN | RIGHT | * | LCTRL | Del | ENTER | LALT | SPACE | End | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------' * '--------------------------------------------------------------------------------------------------------------------------------------'
*/ */
[_QW] = LAYOUT_ortho_5x15( /* QWERTY */ [_QW] = LAYOUT_ortho_5x15( /* QWERTY */
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_DEL, KC_BSPC, 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_DEL, KC_BSPC,
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_MUTE, 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_MUTE,
TT(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_VOLD, KC_VOLU, KC_ENT, FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_VOLD, KC_VOLU, 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_HOME, KC_PGUP, KC_UP, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_HOME, KC_PGUP, KC_UP, KC_PGDN,
KC_LCTL, KC_MPRV, KC_MNXT, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_LEFT, KC_DOWN, KC_RGHT KC_LCTL, KC_MPRV, KC_MNXT, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_END, KC_LEFT, KC_DOWN, KC_RGHT
), ),
@@ -38,22 +40,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* .--------------------------------------------------------------------------------------------------------------------------------------. * .--------------------------------------------------------------------------------------------------------------------------------------.
* | XXXXXXX| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _______| _______| * | XXXXXXX| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _______| _______|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | P* | P7 | P8 | P9 | + | NumLk | PR SCR | SCR LK | PAUSE | XXXXXXX| XXXXXXX| BL_DEC | BL_INC | RGB HD | RGB HI | * | _______| P7 | P8 | P9 | + | P* | XXXXXXX| PR SCR | SCR LK | PAUSE | XXXXXXX| BL_DEC | BL_INC | RGB HD | RGB HI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | _______| P4 | P5 | P6 | PENT | CALC | XXXXXXX| POWER | XXXXXXX| RESET | XXXXXXX| BL_BRTG| BL_STEP| RGB SD | RGB SI | * | _______| P4 | P5 | P6 | NumLk | CALC | XXXXXXX| POWER | XXXXXXX| RESET | XXXXXXX| BL_BRTG| BL_STEP| RGB SD | RGB SI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | P/ | P1 | P2 | P3 | - | OS | XXXXXXX| XXXXXXX| XXXXXXX| XXXXXXX| XXXXXXX| BL_OFF | BL_ON | RGB VD | RGB VI | * | _______| P1 | P2 | P3 | - | P/ | XXXXXXX| OS | PLAY | PREV | NXT | BL_OFF | BL_ON | RGB VD | RGB VI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | CPSLCK | P0 | P. | _______| SPACE | BL_TOGG| RGB TG | RGB RMD| RGB MD | * | _______| P0 | P. | PENT | SPACE | BL_TOGG| RGB TG | RGB RMD| RGB MD |
* '--------------------------------------------------------------------------------------------------------------------------------------' * '--------------------------------------------------------------------------------------------------------------------------------------'
*/ */
[_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, XXXXXXX, 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_PAST, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NLCK, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, RGB_HUD, RGB_HUI, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_PAST, XXXXXXX, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, RGB_HUD, RGB_HUI,
_______, KC_P4, KC_P5, KC_P6, KC_PENT, KC_CALC, XXXXXXX, KC_PWR, XXXXXXX, RESET, XXXXXXX, BL_BRTG, BL_STEP, RGB_SAD, RGB_SAI, _______, KC_P4, KC_P5, KC_P6, KC_NLCK, KC_CALC, XXXXXXX, KC_PWR, XXXXXXX, RESET, XXXXXXX, BL_BRTG, BL_STEP, RGB_SAD, RGB_SAI,
KC_PSLS, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_LWIN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_OFF, BL_ON, RGB_VAD, RGB_VAI, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PSLS, XXXXXXX, KC_LWIN, KC_MPLY, KC_MPRV, KC_MNXT, BL_OFF, BL_ON, RGB_VAD, RGB_VAI,
KC_CAPS, KC_P0, KC_PDOT, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, RGB_TOG, RGB_RMOD,RGB_MOD _______, KC_P0, KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, RGB_TOG, RGB_RMOD,RGB_MOD
) )
}; };
+22 -16
View File
@@ -1,41 +1,47 @@
# XD75 with 7U spacebar for EN-RU gamers # XD75 with 7U spacebar for EN-RU gamers
Standard QWERTY oriented on gamers with a Russian alternative input. Standard QWERTY made for gamers with a Russian alternative input.
Base layout is as close to classic layout as possible due to RU alphabet having more letters (thus the need for those extra keys remain on the right side). The keys for extra letters in RU alphabet are where they are expected.
Full uncut 2x4 nav cluster. Full 2x4 nav cluster.
Caps Lock and Win keys sent to the Function layer. Volume/mute control are on base layer, Win key is on function layer.
TT(1) - Function layer tap-toggle at CapsLock position provides fast F-keys access in a heat of a battle. As well as easy access to a Numpad. FN_CAPS provides fast F-keys access while gaming. Lefthanded Numpad operation.
NKRO is working (forced).
/* QWERTY ## QWERTY
```c
* .--------------------------------------------------------------------------------------------------------------------------------------. * .--------------------------------------------------------------------------------------------------------------------------------------.
* | GESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Del | BACKSP | * | GESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Del | BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Mute | * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Mute |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | TT(1) | A | S | D | F | G | H | J | K | L | ; | '' | Vol- | Vol+ | ENTER | * | FN(CPS)| A | S | D | F | G | H | J | K | L | ; | ' | Vol- | Vol+ | ENTER |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | Home | PGUP | UP | PGDWN | * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | Home | PGUP | UP | PGDWN |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | Prev | Next | LALT | SPACE | End | LEFT | DOWN | RIGHT | * | LCTRL | Del | ENTER | LALT | SPACE | End | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------' * '--------------------------------------------------------------------------------------------------------------------------------------'
*/
/* FUNCTION ```
## FUNCTION
```c
* .--------------------------------------------------------------------------------------------------------------------------------------. * .--------------------------------------------------------------------------------------------------------------------------------------.
* | XXXXXXX| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _______| _______| * | XXXXXXX| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | _______| _______|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | P* | P7 | P8 | P9 | + | NumLk | PR SCR | SCR LK | PAUSE | XXXXXXX| XXXXXXX| BL_DEC | BL_INC | RGB HD | RGB HI | * | _______| P7 | P8 | P9 | + | P* | XXXXXXX| PR SCR | SCR LK | PAUSE | XXXXXXX| BL_DEC | BL_INC | RGB HD | RGB HI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | _______| P4 | P5 | P6 | PENT | CALC | XXXXXXX| POWER | XXXXXXX| RESET | XXXXXXX| BL_BRTG| BL_STEP| RGB SD | RGB SI | * | _______| P4 | P5 | P6 | NumLk | CALC | XXXXXXX| POWER | XXXXXXX| RESET | XXXXXXX| BL_BRTG| BL_STEP| RGB SD | RGB SI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | P/ | P1 | P2 | P3 | - | OS | XXXXXXX| XXXXXXX| XXXXXXX| XXXXXXX| XXXXXXX| BL_OFF | BL_ON | RGB VD | RGB VI | * | _______| P1 | P2 | P3 | - | P/ | XXXXXXX| OS | PLAY | PREV | NXT | BL_OFF | BL_ON | RGB VD | RGB VI |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | CPSLCK | P0 | P. | _______| SPACE | BL_TOGG| RGB TG | RGB RMD| RGB MD | * | _______| P0 | P. | PENT | SPACE | BL_TOGG| RGB TG | RGB RMD| RGB MD |
* '--------------------------------------------------------------------------------------------------------------------------------------' * '--------------------------------------------------------------------------------------------------------------------------------------'
*/ ```
## LED control ## LEDs ID
Top left LED - Function layer active. Top left LED - Function layer active.
Mid left LED - CapsLock active. Mid left LED - CapsLock active.
+1 -2
View File
@@ -2,7 +2,6 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include "pincontrol.h"
#include "action.h" #include "action.h"
enum ssd1306_cmds { enum ssd1306_cmds {
@@ -93,4 +92,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
void matrix_render(struct CharacterMatrix *matrix); void matrix_render(struct CharacterMatrix *matrix);
bool process_record_gfx(uint16_t keycode, keyrecord_t *record); bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
-50
View File
@@ -1,50 +0,0 @@
/* Copyright 2016 Wez Furlong
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// Some helpers for controlling gpio pins
#include <avr/io.h>
enum {
PinDirectionInput = 0,
PinDirectionOutput = 1,
PinLevelHigh = 1,
PinLevelLow = 0,
};
// ex: pinMode(B0, PinDirectionOutput);
static inline void pinMode(uint8_t pin, int mode) {
uint8_t bv = _BV(pin & 0xf);
if (mode == PinDirectionOutput) {
_SFR_IO8((pin >> 4) + 1) |= bv;
} else {
_SFR_IO8((pin >> 4) + 1) &= ~bv;
_SFR_IO8((pin >> 4) + 2) &= ~bv;
}
}
// ex: digitalWrite(B0, PinLevelHigh);
static inline void digitalWrite(uint8_t pin, int mode) {
uint8_t bv = _BV(pin & 0xf);
if (mode == PinLevelHigh) {
_SFR_IO8((pin >> 4) + 2) |= bv;
} else {
_SFR_IO8((pin >> 4) + 2) &= ~bv;
}
}
// Return true if the pin is HIGH
// digitalRead(B0)
static inline bool digitalRead(uint8_t pin) { return _SFR_IO8(pin >> 4) & _BV(pin & 0xf); }
+4
View File
@@ -197,6 +197,8 @@ typedef uint8_t pin_t;
# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF))
#elif defined(PROTOCOL_CHIBIOS) #elif defined(PROTOCOL_CHIBIOS)
typedef ioline_t pin_t; typedef ioline_t pin_t;
@@ -210,6 +212,8 @@ typedef ioline_t pin_t;
# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) # define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin))
# define readPin(pin) palReadLine(pin) # define readPin(pin) palReadLine(pin)
# define togglePin(pin) palToggleLine(pin)
#endif #endif
#define SEND_STRING(string) send_string_P(PSTR(string)) #define SEND_STRING(string) send_string_P(PSTR(string))
+34 -36
View File
@@ -107,23 +107,19 @@ LED_TYPE led[RGBLED_NUM];
rgblight_segment_t const *const *rgblight_layers = NULL; rgblight_segment_t const *const *rgblight_layers = NULL;
#endif #endif
static uint8_t clipping_start_pos = 0; rgblight_ranges_t rgblight_ranges = {0, RGBLED_NUM, 0, RGBLED_NUM, RGBLED_NUM};
static uint8_t clipping_num_leds = RGBLED_NUM;
static uint8_t effect_start_pos = 0;
static uint8_t effect_end_pos = RGBLED_NUM;
static uint8_t effect_num_leds = RGBLED_NUM;
void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) { void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) {
clipping_start_pos = start_pos; rgblight_ranges.clipping_start_pos = start_pos;
clipping_num_leds = num_leds; rgblight_ranges.clipping_num_leds = num_leds;
} }
void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds) { void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds) {
if (start_pos >= RGBLED_NUM) return; if (start_pos >= RGBLED_NUM) return;
if (start_pos + num_leds > RGBLED_NUM) return; if (start_pos + num_leds > RGBLED_NUM) return;
effect_start_pos = start_pos; rgblight_ranges.effect_start_pos = start_pos;
effect_end_pos = start_pos + num_leds; rgblight_ranges.effect_end_pos = start_pos + num_leds;
effect_num_leds = num_leds; rgblight_ranges.effect_num_leds = num_leds;
} }
void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
@@ -468,15 +464,15 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w
# else # else
uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2]; uint8_t range = RGBLED_GRADIENT_RANGES[delta / 2];
# endif # endif
for (uint8_t i = 0; i < effect_num_leds; i++) { for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) {
uint8_t _hue = ((uint16_t)i * (uint16_t)range) / effect_num_leds; uint8_t _hue = ((uint16_t)i * (uint16_t)range) / rgblight_ranges.effect_num_leds;
if (direction) { if (direction) {
_hue = hue + _hue; _hue = hue + _hue;
} else { } else {
_hue = hue - _hue; _hue = hue - _hue;
} }
dprintf("rgblight rainbow set hsv: %d,%d,%d,%u\n", i, _hue, direction, range); dprintf("rgblight rainbow set hsv: %d,%d,%d,%u\n", i, _hue, direction, range);
sethsv(_hue, sat, val, (LED_TYPE *)&led[i + effect_start_pos]); sethsv(_hue, sat, val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]);
} }
rgblight_set(); rgblight_set();
} }
@@ -530,7 +526,7 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) {
return; return;
} }
for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) { for (uint8_t i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) {
led[i].r = r; led[i].r = r;
led[i].g = g; led[i].g = g;
led[i].b = b; led[i].b = b;
@@ -664,10 +660,12 @@ static void rgblight_layers_write(void) {
} }
#endif #endif
__attribute__((weak)) void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { ws2812_setleds(start_led, num_leds); }
#ifndef RGBLIGHT_CUSTOM_DRIVER #ifndef RGBLIGHT_CUSTOM_DRIVER
void rgblight_set(void) { void rgblight_set(void) {
LED_TYPE *start_led; LED_TYPE *start_led;
uint16_t num_leds = clipping_num_leds; uint8_t num_leds = rgblight_ranges.clipping_num_leds;
# ifdef RGBLIGHT_LAYERS # ifdef RGBLIGHT_LAYERS
if (rgblight_layers != NULL) { if (rgblight_layers != NULL) {
@@ -676,7 +674,7 @@ void rgblight_set(void) {
# endif # endif
if (!rgblight_config.enable) { if (!rgblight_config.enable) {
for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) { for (uint8_t i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) {
led[i].r = 0; led[i].r = 0;
led[i].g = 0; led[i].g = 0;
led[i].b = 0; led[i].b = 0;
@@ -691,9 +689,9 @@ void rgblight_set(void) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) { for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led0[i] = led[pgm_read_byte(&led_map[i])]; led0[i] = led[pgm_read_byte(&led_map[i])];
} }
start_led = led0 + clipping_start_pos; start_led = led0 + rgblight_ranges.clipping_start_pos;
# else # else
start_led = led + clipping_start_pos; start_led = led + rgblight_ranges.clipping_start_pos;
# endif # endif
# ifdef RGBW # ifdef RGBW
@@ -701,7 +699,7 @@ void rgblight_set(void) {
convert_rgb_to_rgbw(&start_led[i]); convert_rgb_to_rgbw(&start_led[i]);
} }
# endif # endif
ws2812_setleds(start_led, num_leds); rgblight_call_driver(start_led, num_leds);
} }
#endif #endif
@@ -961,9 +959,9 @@ void rgblight_effect_rainbow_swirl(animation_status_t *anim) {
uint8_t hue; uint8_t hue;
uint8_t i; uint8_t i;
for (i = 0; i < effect_num_leds; i++) { for (i = 0; i < rgblight_ranges.effect_num_leds; i++) {
hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / effect_num_leds * i + anim->current_hue); hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / rgblight_ranges.effect_num_leds * i + anim->current_hue);
sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + effect_start_pos]); sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]);
} }
rgblight_set(); rgblight_set();
@@ -991,7 +989,7 @@ void rgblight_effect_snake(animation_status_t *anim) {
# if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) # if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
if (anim->pos == 0) { // restart signal if (anim->pos == 0) { // restart signal
if (increment == 1) { if (increment == 1) {
pos = effect_num_leds - 1; pos = rgblight_ranges.effect_num_leds - 1;
} else { } else {
pos = 0; pos = 0;
} }
@@ -999,8 +997,8 @@ void rgblight_effect_snake(animation_status_t *anim) {
} }
# endif # endif
for (i = 0; i < effect_num_leds; i++) { for (i = 0; i < rgblight_ranges.effect_num_leds; i++) {
LED_TYPE *ledp = led + i + effect_start_pos; LED_TYPE *ledp = led + i + rgblight_ranges.effect_start_pos;
ledp->r = 0; ledp->r = 0;
ledp->g = 0; ledp->g = 0;
ledp->b = 0; ledp->b = 0;
@@ -1013,7 +1011,7 @@ void rgblight_effect_snake(animation_status_t *anim) {
k = k % RGBLED_NUM; k = k % RGBLED_NUM;
} }
if (k < 0) { if (k < 0) {
k = k + effect_num_leds; k = k + rgblight_ranges.effect_num_leds;
} }
if (i == k) { if (i == k) {
sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val * (RGBLIGHT_EFFECT_SNAKE_LENGTH - j) / RGBLIGHT_EFFECT_SNAKE_LENGTH), ledp); sethsv(rgblight_config.hue, rgblight_config.sat, (uint8_t)(rgblight_config.val * (RGBLIGHT_EFFECT_SNAKE_LENGTH - j) / RGBLIGHT_EFFECT_SNAKE_LENGTH), ledp);
@@ -1023,7 +1021,7 @@ void rgblight_effect_snake(animation_status_t *anim) {
rgblight_set(); rgblight_set();
if (increment == 1) { if (increment == 1) {
if (pos - 1 < 0) { if (pos - 1 < 0) {
pos = effect_num_leds - 1; pos = rgblight_ranges.effect_num_leds - 1;
# if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) # if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
anim->pos = 0; anim->pos = 0;
# endif # endif
@@ -1034,7 +1032,7 @@ void rgblight_effect_snake(animation_status_t *anim) {
# endif # endif
} }
} else { } else {
pos = (pos + 1) % effect_num_leds; pos = (pos + 1) % rgblight_ranges.effect_num_leds;
# if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) # if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
anim->pos = pos; anim->pos = pos;
# endif # endif
@@ -1060,7 +1058,7 @@ void rgblight_effect_knight(animation_status_t *anim) {
} }
# endif # endif
// Set all the LEDs to 0 // Set all the LEDs to 0
for (i = effect_start_pos; i < effect_end_pos; i++) { for (i = rgblight_ranges.effect_start_pos; i < rgblight_ranges.effect_end_pos; i++) {
led[i].r = 0; led[i].r = 0;
led[i].g = 0; led[i].g = 0;
led[i].b = 0; led[i].b = 0;
@@ -1070,7 +1068,7 @@ void rgblight_effect_knight(animation_status_t *anim) {
} }
// Determine which LEDs should be lit up // Determine which LEDs should be lit up
for (i = 0; i < RGBLIGHT_EFFECT_KNIGHT_LED_NUM; i++) { for (i = 0; i < RGBLIGHT_EFFECT_KNIGHT_LED_NUM; i++) {
cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % effect_num_leds + effect_start_pos; cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % rgblight_ranges.effect_num_leds + rgblight_ranges.effect_start_pos;
if (i >= low_bound && i <= high_bound) { if (i >= low_bound && i <= high_bound) {
sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[cur]); sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[cur]);
@@ -1107,9 +1105,9 @@ void rgblight_effect_christmas(animation_status_t *anim) {
uint8_t i; uint8_t i;
anim->current_offset = (anim->current_offset + 1) % 2; anim->current_offset = (anim->current_offset + 1) % 2;
for (i = 0; i < effect_num_leds; i++) { for (i = 0; i < rgblight_ranges.effect_num_leds; i++) {
hue = 0 + ((i / RGBLIGHT_EFFECT_CHRISTMAS_STEP + anim->current_offset) % 2) * 85; hue = 0 + ((i / RGBLIGHT_EFFECT_CHRISTMAS_STEP + anim->current_offset) % 2) * 85;
sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + effect_start_pos]); sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i + rgblight_ranges.effect_start_pos]);
} }
rgblight_set(); rgblight_set();
} }
@@ -1148,11 +1146,11 @@ void rgblight_effect_rgbtest(animation_status_t *anim) {
#ifdef RGBLIGHT_EFFECT_ALTERNATING #ifdef RGBLIGHT_EFFECT_ALTERNATING
void rgblight_effect_alternating(animation_status_t *anim) { void rgblight_effect_alternating(animation_status_t *anim) {
for (int i = 0; i < effect_num_leds; i++) { for (int i = 0; i < rgblight_ranges.effect_num_leds; i++) {
LED_TYPE *ledp = led + i + effect_start_pos; LED_TYPE *ledp = led + i + rgblight_ranges.effect_start_pos;
if (i < effect_num_leds / 2 && anim->pos) { if (i < rgblight_ranges.effect_num_leds / 2 && anim->pos) {
sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp); sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp);
} else if (i >= effect_num_leds / 2 && !anim->pos) { } else if (i >= rgblight_ranges.effect_num_leds / 2 && !anim->pos) {
sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp); sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, ledp);
} else { } else {
sethsv(rgblight_config.hue, rgblight_config.sat, 0, ledp); sethsv(rgblight_config.hue, rgblight_config.sat, 0, ledp);
+15 -4
View File
@@ -130,7 +130,7 @@ enum RGBLIGHT_EFFECT_MODE {
# endif # endif
# ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM # ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM
# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (effect_num_leds) # define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (rgblight_ranges.effect_num_leds)
# endif # endif
# ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL # ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
@@ -160,9 +160,7 @@ enum RGBLIGHT_EFFECT_MODE {
# include <stdint.h> # include <stdint.h>
# include <stdbool.h> # include <stdbool.h>
# include "eeconfig.h" # include "eeconfig.h"
# ifndef RGBLIGHT_CUSTOM_DRIVER # include "ws2812.h"
# include "ws2812.h"
# endif
# include "color.h" # include "color.h"
# include "rgblight_list.h" # include "rgblight_list.h"
@@ -230,6 +228,19 @@ typedef struct _rgblight_status_t {
# endif # endif
} rgblight_status_t; } rgblight_status_t;
/*
* Structure for RGB Light clipping ranges
*/
typedef struct _rgblight_ranges_t {
uint8_t clipping_start_pos;
uint8_t clipping_num_leds;
uint8_t effect_start_pos;
uint8_t effect_end_pos;
uint8_t effect_num_leds;
} rgblight_ranges_t;
extern rgblight_ranges_t rgblight_ranges;
/* === Utility Functions ===*/ /* === Utility Functions ===*/
void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check
+1 -1
View File
@@ -156,7 +156,7 @@
* @brief Enables the SPI subsystem. * @brief Enables the SPI subsystem.
*/ */
# if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) # if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
# define HAL_USE_SPI FALSE # define HAL_USE_SPI TRUE
# endif # endif
/** /**
+1 -1
View File
@@ -227,7 +227,7 @@
* SPI driver system settings. * SPI driver system settings.
*/ */
#define STM32_SPI_USE_SPI1 FALSE #define STM32_SPI_USE_SPI1 FALSE
#define STM32_SPI_USE_SPI2 FALSE #define STM32_SPI_USE_SPI2 TRUE
#define STM32_SPI_USE_SPI3 FALSE #define STM32_SPI_USE_SPI3 FALSE
#define STM32_SPI_SPI1_DMA_PRIORITY 1 #define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1 #define STM32_SPI_SPI2_DMA_PRIORITY 1
+5 -6
View File
@@ -2,7 +2,6 @@
#define SOLENOID_H #define SOLENOID_H
#include <timer.h> #include <timer.h>
#include "pincontrol.h"
#define SOLENOID_DEFAULT_DWELL 12 #define SOLENOID_DEFAULT_DWELL 12
@@ -45,7 +44,7 @@ void solenoid_toggle(void) {
} }
void solenoid_stop(void) { void solenoid_stop(void) {
digitalWrite(SOLENOID_PIN, PinLevelLow); writePinLow(SOLENOID_PIN);
solenoid_on = false; solenoid_on = false;
solenoid_buzzing = false; solenoid_buzzing = false;
} }
@@ -59,7 +58,7 @@ void solenoid_fire(void) {
solenoid_on = true; solenoid_on = true;
solenoid_buzzing = true; solenoid_buzzing = true;
solenoid_start = timer_read(); solenoid_start = timer_read();
digitalWrite(SOLENOID_PIN, PinLevelHigh); writePinHigh(SOLENOID_PIN);
} }
void solenoid_check(void) { void solenoid_check(void) {
@@ -80,20 +79,20 @@ void solenoid_check(void) {
if (elapsed / SOLENOID_MIN_DWELL % 2 == 0){ if (elapsed / SOLENOID_MIN_DWELL % 2 == 0){
if (!solenoid_buzzing) { if (!solenoid_buzzing) {
solenoid_buzzing = true; solenoid_buzzing = true;
digitalWrite(SOLENOID_PIN, PinLevelHigh); writePinHigh(SOLENOID_PIN);
} }
} }
else { else {
if (solenoid_buzzing) { if (solenoid_buzzing) {
solenoid_buzzing = false; solenoid_buzzing = false;
digitalWrite(SOLENOID_PIN, PinLevelLow); writePinLow(SOLENOID_PIN);
} }
} }
} }
} }
void solenoid_setup(void) { void solenoid_setup(void) {
pinMode(SOLENOID_PIN, PinDirectionOutput); setPinOutput(SOLENOID_PIN);
} }
#endif #endif