2024-09-24 08:56:37 +00:00
|
|
|
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js";
|
2024-06-02 02:43:43 +00:00
|
|
|
|
const __pageData = JSON.parse('{"title":"OLED Driver","description":"","frontmatter":{},"headers":[],"relativePath":"features/oled_driver.md","filePath":"features/oled_driver.md"}');
|
|
|
|
|
const _sfc_main = { name: "features/oled_driver.md" };
|
2024-05-30 02:02:10 +00:00
|
|
|
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="oled-driver" tabindex="-1">OLED Driver <a class="header-anchor" href="#oled-driver" aria-label="Permalink to "OLED Driver""></a></h1><h2 id="supported-hardware" tabindex="-1">Supported Hardware <a class="header-anchor" href="#supported-hardware" aria-label="Permalink to "Supported Hardware""></a></h2><p>OLED modules using SSD1306, SH1106 or SH1107 driver ICs, communicating over I2C or SPI. Tested combinations:</p><table><thead><tr><th>IC</th><th>Size</th><th>Platform</th><th>Notes</th></tr></thead><tbody><tr><td>SSD1306</td><td>128x32</td><td>AVR</td><td>Primary support</td></tr><tr><td>SSD1306</td><td>128x64</td><td>AVR</td><td>Verified working</td></tr><tr><td>SSD1306</td><td>128x32</td><td>Arm</td><td></td></tr><tr><td>SSD1306</td><td>128x64</td><td>Arm</td><td>Verified working</td></tr><tr><td>SH1106</td><td>128x64</td><td>AVR</td><td>No scrolling</td></tr><tr><td>SH1107</td><td>64x128</td><td>AVR</td><td>No scrolling</td></tr><tr><td>SH1107</td><td>64x128</td><td>Arm</td><td>No scrolling</td></tr><tr><td>SH1107</td><td>128x128</td><td>Arm</td><td>No scrolling</td></tr></tbody></table><p>Hardware configurations using Arm-based microcontrollers or different sizes of OLED modules may be compatible, but are untested.</p><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage""></a></h2><p>To enable the OLED feature, there are two steps. First, when compiling your keyboard, you'll need to add the following to your <code>rules.mk</code>:</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">OLED_ENABLE = yes</span></span></code></pre></div><h2 id="oled-type" tabindex="-1">OLED type <a class="header-anchor" href="#oled-type" aria-label="Permalink to "OLED type""></a></h2><table><thead><tr><th>OLED Driver</th><th>Supported Device</th></tr></thead><tbody><tr><td><code>ssd1306</code> (default)</td><td>For both SSD1306, SH1106, and SH1107</td></tr></tbody></table><p>e.g.</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">OLED_DRIVER = ssd1306</span></span></code></pre></div><table><thead><tr><th>OLED Transport</th><th></th></tr></thead><tbody><tr><td><code>i2c</code> (default)</td><td>Uses I2C for communication with the OLED panel</td></tr><tr><td><code>spi</code></td><td>Uses SPI for communication with the OLED panel</td></tr></tbody></table><p>e.g.</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">OLED_TRANSPORT = i2c</span></span></code></pre></div><p>Then in your <code>keymap.c</code> file, implement the OLED task call. This example assumes your keymap has three layers named <code>_QWERTY</code>, <code>_FN</code> and <code>_ADJ</code>:</p><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#ifdef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> OLED_ENABLE</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">bool</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> oled_task_user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span styl
|
|
|
|
|
const _hoisted_59 = [
|
|
|
|
|
_hoisted_1
|
|
|
|
|
];
|
|
|
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
|
|
return openBlock(), createElementBlock("div", null, _hoisted_59);
|
|
|
|
|
}
|
2024-06-02 02:43:43 +00:00
|
|
|
|
const oled_driver = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
2024-05-30 02:02:10 +00:00
|
|
|
|
export {
|
|
|
|
|
__pageData,
|
2024-06-02 02:43:43 +00:00
|
|
|
|
oled_driver as default
|
2024-05-30 02:02:10 +00:00
|
|
|
|
};
|