[Core] Refactor OLED to allow easy addition of other types (#13454)

* add docs

* core changes

* update keyboards to new OLED

* updated users to new OLED

* update layouts to new OLED

* fixup docs

* drashna's suggestion

* fix up docs

* new keyboards with oled

* core split changes

* remaining keyboard files

* Fix The Helix keyboards oled options

* reflect develop

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: mtei <2170248+mtei@users.noreply.github.com>
master
Xelus22 2021-08-24 16:28:26 +10:00 committed by GitHub
parent 6fd20acf4b
commit 4e1c5887c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
500 changed files with 1579 additions and 1387 deletions

View File

@ -592,11 +592,21 @@ ifeq ($(strip $(HD44780_ENABLE)), yes)
OPT_DEFS += -DHD44780_ENABLE
endif
ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
OPT_DEFS += -DOLED_DRIVER_ENABLE
COMMON_VPATH += $(DRIVER_PATH)/oled
QUANTUM_LIB_SRC += i2c_master.c
SRC += oled_driver.c
VALID_OLED_DRIVER_TYPES := SSD1306 custom
OLED_DRIVER ?= SSD1306
ifeq ($(strip $(OLED_ENABLE)), yes)
ifeq ($(filter $(OLED_DRIVER),$(VALID_OLED_DRIVER_TYPES)),)
$(error OLED_DRIVER="$(OLED_DRIVER)" is not a valid OLED driver)
else
OPT_DEFS += -DOLED_ENABLE
COMMON_VPATH += $(DRIVER_PATH)/oled
OPT_DEFS += -DOLED_DRIVER_$(strip $(shell echo $(OLED_DRIVER) | tr '[:lower:]' '[:upper:]'))
ifeq ($(strip $(OLED_DRIVER)), SSD1306)
SRC += ssd1306_sh1106.c
QUANTUM_LIB_SRC += i2c_master.c
endif
endif
endif
ifeq ($(strip $(ST7565_ENABLE)), yes)

View File

@ -21,13 +21,23 @@ Hardware configurations using Arm-based microcontrollers or different sizes of O
To enable the OLED feature, there are three steps. First, when compiling your keyboard, you'll need to add the following to your `rules.mk`:
```make
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
```
## OLED type
|OLED Driver |Supported Device |
|-------------------|---------------------------|
|SSD1306 (default) |For both SSD1306 and SH1106|
e.g.
```make
OLED_DRIVER = SSD1306
```
Then in your `keymap.c` file, implement the OLED task call. This example assumes your keymap has three layers named `_QWERTY`, `_FN` and `_ADJ`:
```c
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("Layer: "), false);
@ -114,7 +124,7 @@ static void fade_display(void) {
In split keyboards, it is very common to have two OLED displays that each render different content and are oriented or flipped differently. You can do this by switching which content to render by using the return value from `is_keyboard_master()` or `is_keyboard_left()` found in `split_util.h`, e.g:
```c
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand

View File

@ -76,7 +76,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -76,7 +76,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -76,7 +76,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -76,7 +76,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -24,4 +24,5 @@ AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes
LTO_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -92,7 +92,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer = 0;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -92,7 +92,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif
/* oled stuff :) */
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
uint16_t startup_timer = 0;
oled_rotation_t oled_init_user(oled_rotation_t rotation) {

View File

@ -23,4 +23,5 @@ AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes
LTO_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -54,7 +54,7 @@ static void render_logo(void) {
oled_write_P(qmk_logo, false);
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) { render_logo(); }
#endif

View File

@ -54,7 +54,7 @@ static void render_logo(void) {
oled_write_P(qmk_logo, false);
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) { render_logo(); }
#endif

View File

@ -24,5 +24,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
BLUETOOTH = AdafruitBLE
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
ENCODER_ENABLE = yes

View File

@ -24,6 +24,6 @@ NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: htt
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes
OLED_DRIVER_ENABLE = no
OLED_ENABLE = no
DEFAULT_FOLDER = 8pack/rev12

View File

@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void render_layer_state(void) {
oled_write_ln(PSTR("LAYER"), false);

View File

@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void render_layer_state(void) {
oled_write_ln(PSTR("LAYER"), false);

View File

@ -1 +1,3 @@
VIA_ENABLE = yes
OLED_ENABLE = yes
# OLED_DRIVER = not a real thing

View File

@ -3,7 +3,7 @@
// Tested and verified working on ext65rev2
void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); }
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void board_init(void) {
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);

View File

@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#define OLED_TIMEOUT 400000
#endif

View File

@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {

View File

@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X32
#define OLED_TIMEOUT 400000
#endif

View File

@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {

View File

@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#define OLED_TIMEOUT 400000
#endif

View File

@ -12,7 +12,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {

View File

@ -20,7 +20,8 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
OLED_DRIVER_ENABLE = yes # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C
ENCODER_ENABLE = yes
SPLIT_KEYBOARD = yes
LTO_ENABLE = yes

View File

@ -64,7 +64,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_LIMIT_VAL 255
#endif
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# define OLED_DISPLAY_128X64
# define OLED_TIMEOUT 60000
# define OLED_FONT_H "keyboards/anavi/macropad8/glcdfont.c"

View File

@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}

View File

@ -24,7 +24,8 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output on port C6
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
OLED_DRIVER_ENABLE = yes # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

View File

@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_NO, KC_NO, KC_NO, _______, KC_NO, _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) {
oled_write_P(PSTR("Layer: "), false);
switch (biton32(layer_state)) {

View File

@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_APP, KC_RCTL),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) {
// Host Keyboard LED Status
oled_write_P(IS_HOST_LED_ON(USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);

View File

@ -172,7 +172,7 @@ void matrix_scan_user(void) {
#endif
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) {
oled_write_P(PSTR("Layer: "), false);
switch (biton32(layer_state)) {

View File

@ -28,7 +28,8 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
CUSTOM_MATRIX = yes
SRC += matrix.c

View File

@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#if defined(OLED_DRIVER_ENABLE)
#if defined(OLED_ENABLE)
static void render_logo(void) {
//Logo for _MEDIA
static const char PROGMEM logo1[] = {

View File

@ -21,5 +21,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
UNICODE_ENABLE = yes # Unicode
OLED_DRIVER_ENABLE = yes # Enable Support for Oled Display
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enable Support for Oled Display
ENCODER_ENABLE = yes # Enable Support for Encoder

View File

@ -139,7 +139,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -122,7 +122,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180;

View File

@ -16,7 +16,7 @@
#pragma once
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#endif

View File

@ -396,7 +396,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#define ANIM_NUM_FRAMES 4
#define ANIM_FRAME_DURATION 100

View File

@ -18,7 +18,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enables the use of OLED displays
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
SPLIT_KEYBOARD = yes # Split common

View File

@ -103,7 +103,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return result;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
const char *read_logo(void) {
static char logo[] = {

View File

@ -103,7 +103,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return result;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
const char *read_logo(void) {
static char logo[] = {

View File

@ -187,7 +187,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return result;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
const char *read_logo(void) {
static char logo[] = {

View File

@ -84,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_qmk_logo(void) {
static const char PROGMEM qmk_logo[] = {

View File

@ -27,7 +27,8 @@ 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
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
OLED_DRIVER_ENABLE = yes # Disable OLED driver.
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Disable OLED driver.
UNICODE_ENABLE = no # Unicode
LTO_ENABLE = yes

View File

@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
RGB_MOD, KC_VOLD, KC_F1
),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
RGB_MOD, KC_3,KC_4
),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master())
return OLED_ROTATION_180;

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master())
return OLED_ROTATION_180;

View File

@ -1,4 +1,5 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
VIA_ENABLE = yes
EXTRAKEY_ENABLE = yes
RGBLIGHT_ENABLE = yes

View File

@ -35,7 +35,7 @@ void keyboard_post_init_user(void) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_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,

View File

@ -28,4 +28,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -38,7 +38,7 @@ void led_set_user(uint8_t usb_led) {}
void keyboard_post_init_user(void) {}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_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,

View File

@ -28,4 +28,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -1,4 +1,4 @@
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# include QMK_KEYBOARD_H
# include <stdio.h>
# include <string.h>

View File

@ -1,4 +1,4 @@
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void render_logo(void);

View File

@ -64,7 +64,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# include <stdio.h>
# include <string.h>

View File

@ -21,6 +21,7 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
SRC += ./common/oled_helper.c

View File

@ -181,7 +181,7 @@ bool led_update_user(led_t led_state) {
return false;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_write_layer_state(void) {
oled_write_P(PSTR("Layer: "), false);

View File

@ -1,2 +1,3 @@
# Enable SSD1306 OLED
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -58,7 +58,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void oled_task_user(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("Layer: "), false);

View File

@ -28,4 +28,5 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
ENCODER_ENABLE = yes # Enable support for encoders
OLED_DRIVER_ENABLE = yes # Enable support for OLED displays
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enable support for OLED displays

View File

@ -84,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void render_layer_state(void) {
switch (get_highest_layer(layer_state)) {

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -15,5 +15,5 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
OLED_DRIVER_ENABLE = no # Add OLED displays support
OLED_ENABLE = no # Add OLED displays support
SPLIT_KEYBOARD = yes

View File

@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
@ -133,4 +133,4 @@ void oled_render_amsterdam_flag(void) {
void oled_task_user(void) {
oled_render_amsterdam_flag();
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -10,7 +10,7 @@ COMMAND_ENABLE = no
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
BOOTLOADER = atmel-dfu
SPLIT_TRANSPORT = mirror

View File

@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
@ -172,4 +172,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -266,7 +266,7 @@ bool led_update_user(led_t led_state) {
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
@ -407,4 +407,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -1,4 +1,5 @@
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
RGBLIGHT_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -75,7 +75,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_left())
return OLED_ROTATION_180; // flips the display 180 to see it from my side

View File

@ -3,7 +3,7 @@
SRC += ./logo_reader.c
# enable OLED displays
OLED_DRIVER_ENABLE = no
OLED_ENABLE = no
# enable media keys
EXTRAKEY_ENABLE = yes

View File

@ -2,7 +2,7 @@
#include <string.h>
#include "oled.h"
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
void render_host_led_state(void) { oled_write(read_host_led_state(), false); }
void render_layer_state(void) {
@ -52,4 +52,4 @@ void oled_task_user(void) {
render_logo();
}
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -16,7 +16,8 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
SWAP_HANDS_ENABLE = no # Enable one-hand typing
TAP_DANCE_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

View File

@ -1,7 +1,7 @@
#include QMK_KEYBOARD_H
#include "keycodes.h"
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# include "oled.c"
#endif
@ -78,7 +78,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
if (record->event.pressed) {
oled_timer = timer_read();
add_keylog(keycode);

View File

@ -2,5 +2,6 @@ MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
LTO_ENABLE = yes

View File

@ -73,7 +73,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
default:
// Use process_record_keymap to reset timer on all other keypresses to awaken from idle.
if (record->event.pressed) {
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_timer = timer_read32();
#endif
// Restore LEDs if they are enabled by user
@ -125,7 +125,7 @@ void matrix_scan_user(void) {
}
}
// [OLED Configuration] ------------------------------------------------------//
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
// Init Oled and Rotate....
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master())

View File

@ -5,7 +5,8 @@ AUDIO_ENABLE = no # Audio output on port C6
MOUSEKEY_ENABLE = no
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
# If you want to change the display of OLED, you need to change here
SRC += logo_reader.c \

View File

@ -6,7 +6,8 @@
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
RGB_MATRIX_ENABLE = yes # Enable RGB Matrix.
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend

View File

@ -1,6 +1,7 @@
RGB_MATRIX_ENABLE = yes
MOUSEKEY_ENABLE = no
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
LTO_ENABLE = yes
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE

View File

@ -74,7 +74,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;

View File

@ -4,4 +4,5 @@
# the appropriate keymap folder that will get included automatically
#
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
#include <stdio.h>
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
@ -163,4 +163,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# include <stdio.h>
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
@ -219,4 +219,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
#endif // OLED_DRIVER_ENABLE
#endif // OLED_ENABLE

View File

@ -4,4 +4,5 @@ BOOTLOADER = atmel-dfu
# https://www.reddit.com/r/olkb/comments/9pyc0u/qmk_media_keys_are_not_working/
EXTRAKEY_ENABLE = yes
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306

View File

@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define EE_HANDS
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
# undef SSD1306OLED
# define OLED_TIMEOUT 600000
#endif

View File

@ -180,7 +180,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
#ifdef OLED_DRIVER_ENABLE
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;

View File

@ -28,7 +28,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
BOOTLOADER = qmk-dfu
OLED_DRIVER_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
ifeq ($(strip $(THEME)), godspeed)
OPT_DEFS += -DTHEME_GODSPEED

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