qmk_firmware/assets/features_st7565.md.MoajNurJ.js

16 lines
68 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"ST7565 LCD Driver","description":"","frontmatter":{},"headers":[],"relativePath":"features/st7565.md","filePath":"features/st7565.md"}');
const _sfc_main = { name: "features/st7565.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="st7565-lcd-driver" tabindex="-1">ST7565 LCD Driver <a class="header-anchor" href="#st7565-lcd-driver" aria-label="Permalink to &quot;ST7565 LCD Driver&quot;"></a></h1><h2 id="supported-hardware" tabindex="-1">Supported Hardware <a class="header-anchor" href="#supported-hardware" aria-label="Permalink to &quot;Supported Hardware&quot;"></a></h2><p>LCD modules using ST7565 driver IC, communicating over SPI.</p><table><thead><tr><th>Module</th><th>IC</th><th>Size</th><th>Notes</th></tr></thead><tbody><tr><td>Newhaven Display NHD-C12832A1Z</td><td>ST7565R</td><td>128x32</td><td>Used by Ergodox Infinity; primary consumer of this feature</td></tr><tr><td>Zolentech ZLE12864B</td><td>ST7565P</td><td>128x64</td><td>Requires contrast adjustment</td></tr></tbody></table><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h2><p>To enable the feature, there are three steps. First, when compiling your keyboard, you&#39;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;">ST7565_ENABLE = yes</span></span></code></pre></div><p>Then in your <code>keymap.c</code> file, implement the ST7565 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;"> ST7565_ENABLE</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> st7565_task_user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Host Keyboard Layer Status</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> st7565_write_P</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">PSTR</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Layer: &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> switch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">get_highest_layer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(layer_state)) {</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _QWERTY:</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> st7565_write_P</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">PSTR</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Default</span><span style="--shiki-light:#005CC5;--shiki-dar
const _hoisted_27 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_27);
}
const st7565 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
st7565 as default
};