aboutsummaryrefslogtreecommitdiff
path: root/docs/feature_oled_driver.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/feature_oled_driver.md')
-rw-r--r--docs/feature_oled_driver.md20
1 files changed, 17 insertions, 3 deletions
diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md
index f3b659b1b..c97843cfb 100644
--- a/docs/feature_oled_driver.md
+++ b/docs/feature_oled_driver.md
@@ -21,13 +21,23 @@ Hardware configurations using Arm-based microcontrollers or different sizes of O
21To enable the OLED feature, there are three steps. First, when compiling your keyboard, you'll need to add the following to your `rules.mk`: 21To enable the OLED feature, there are three steps. First, when compiling your keyboard, you'll need to add the following to your `rules.mk`:
22 22
23```make 23```make
24OLED_DRIVER_ENABLE = yes 24OLED_ENABLE = yes
25```
26
27## OLED type
28|OLED Driver |Supported Device |
29|-------------------|---------------------------|
30|SSD1306 (default) |For both SSD1306 and SH1106|
31
32e.g.
33```make
34OLED_DRIVER = SSD1306
25``` 35```
26 36
27Then in your `keymap.c` file, implement the OLED task call. This example assumes your keymap has three layers named `_QWERTY`, `_FN` and `_ADJ`: 37Then in your `keymap.c` file, implement the OLED task call. This example assumes your keymap has three layers named `_QWERTY`, `_FN` and `_ADJ`:
28 38
29```c 39```c
30#ifdef OLED_DRIVER_ENABLE 40#ifdef OLED_ENABLE
31void oled_task_user(void) { 41void oled_task_user(void) {
32 // Host Keyboard Layer Status 42 // Host Keyboard Layer Status
33 oled_write_P(PSTR("Layer: "), false); 43 oled_write_P(PSTR("Layer: "), false);
@@ -114,7 +124,7 @@ static void fade_display(void) {
114In 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: 124In 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:
115 125
116```c 126```c
117#ifdef OLED_DRIVER_ENABLE 127#ifdef OLED_ENABLE
118oled_rotation_t oled_init_user(oled_rotation_t rotation) { 128oled_rotation_t oled_init_user(oled_rotation_t rotation) {
119 if (!is_keyboard_master()) { 129 if (!is_keyboard_master()) {
120 return OLED_ROTATION_180; // flips the display 180 degrees if offhand 130 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
@@ -346,6 +356,10 @@ bool oled_scroll_left(void);
346// Returns true if the screen was not scrolling or stops scrolling 356// Returns true if the screen was not scrolling or stops scrolling
347bool oled_scroll_off(void); 357bool oled_scroll_off(void);
348 358
359// Inverts the display
360// Returns true if the screen was or is inverted
361bool oled_invert(bool invert);
362
349// Returns the maximum number of characters that will fit on a line 363// Returns the maximum number of characters that will fit on a line
350uint8_t oled_max_chars(void); 364uint8_t oled_max_chars(void);
351 365