micropython-st7789py-lcd-dr.../docs/st7789py.html

721 wiersze
55 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>st7789py Reference &mdash; st7789py 0.1.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=01f34227"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Example Programs" href="examples.html" />
<link rel="prev" title="st7789py Driver" href="index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #2980B9" >
<a href="index.html" class="icon icon-home">
st7789py
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">st7789py Driver</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">st7789py Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#st7789py.color565"><code class="docutils literal notranslate"><span class="pre">color565()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#st7789py.ST7789"><code class="docutils literal notranslate"><span class="pre">ST7789</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.init"><code class="docutils literal notranslate"><span class="pre">ST7789.init()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.hard_reset"><code class="docutils literal notranslate"><span class="pre">ST7789.hard_reset()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.soft_reset"><code class="docutils literal notranslate"><span class="pre">ST7789.soft_reset()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.sleep_mode"><code class="docutils literal notranslate"><span class="pre">ST7789.sleep_mode()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.inversion_mode"><code class="docutils literal notranslate"><span class="pre">ST7789.inversion_mode()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.rotation"><code class="docutils literal notranslate"><span class="pre">ST7789.rotation()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.vline"><code class="docutils literal notranslate"><span class="pre">ST7789.vline()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.hline"><code class="docutils literal notranslate"><span class="pre">ST7789.hline()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.pixel"><code class="docutils literal notranslate"><span class="pre">ST7789.pixel()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.blit_buffer"><code class="docutils literal notranslate"><span class="pre">ST7789.blit_buffer()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.rect"><code class="docutils literal notranslate"><span class="pre">ST7789.rect()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.fill_rect"><code class="docutils literal notranslate"><span class="pre">ST7789.fill_rect()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.fill"><code class="docutils literal notranslate"><span class="pre">ST7789.fill()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.line"><code class="docutils literal notranslate"><span class="pre">ST7789.line()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.vscrdef"><code class="docutils literal notranslate"><span class="pre">ST7789.vscrdef()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.vscsad"><code class="docutils literal notranslate"><span class="pre">ST7789.vscsad()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.text"><code class="docutils literal notranslate"><span class="pre">ST7789.text()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.bitmap"><code class="docutils literal notranslate"><span class="pre">ST7789.bitmap()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.pbitmap"><code class="docutils literal notranslate"><span class="pre">ST7789.pbitmap()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.write"><code class="docutils literal notranslate"><span class="pre">ST7789.write()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.write_width"><code class="docutils literal notranslate"><span class="pre">ST7789.write_width()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#st7789py.ST7789.polygon"><code class="docutils literal notranslate"><span class="pre">ST7789.polygon()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Example Programs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#configuration-modules">Configuration modules</a><ul>
<li class="toctree-l3"><a class="reference internal" href="configs/atom_s3.html">M5STACK AtomS3 128x128 (GC9107)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/atom_s3.html#tft-configs-atom-s3-tft-config-py">tft_configs/atom_s3/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/atom_s3.html#tft-configs-atom-s3-tft-buttons-py">tft_configs/atom_s3/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/esp32_320x240.html">Generic ESP32 320x240</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/esp32_320x240.html#tft-configs-esp32-320x240-tft-config-py">tft_configs/esp32_320x240/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/esp32_320x240.html#tft-configs-esp32-320x240-tft-buttons-py">tft_configs/esp32_320x240/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/m5stack_core.html">M5STACK CORE 320x240 (ILI9342)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core.html#tft-configs-m5stack-core-tft-config-py">tft_configs/m5stack_core/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core.html#tft-configs-m5stack-core-tft-buttons-py">tft_configs/m5stack_core/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/m5stack_core2.html">M5STACK CORE2 320x240 (ILI9342)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core2.html#tft-configs-m5stack-core2-tft-config-py">tft_configs/m5stack_core2/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core2.html#tft-configs-m5stack-core2-tft-buttons-py">tft_configs/m5stack_core2/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/m5stack_core3.html">M5STACK CoreS3 320x240 (ILI9342)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core3.html#tft-configs-m5stack-core3-tft-config-py">tft_configs/m5stack_core3/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/m5stack_core3.html#tft-configs-m5stack-core3-tft-buttons-py">tft_configs/m5stack_core3/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/rp2040_touch_lcd_128.html">RP2040-Touch-LCD-1.28 240x240 (GC9A01)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/rp2040_touch_lcd_128.html#tft-configs-rp2040-touch-lcd-128-tft-config-py">tft_configs/rp2040_touch_lcd_128/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/rp2040_touch_lcd_128.html#tft-configs-rp2040-touch-lcd-128-tft-buttons-py">tft_configs/rp2040_touch_lcd_128/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/t-dongle-s3.html">LilyGo T-Dongle-S3 80x160 (ST7735)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/t-dongle-s3.html#tft-configs-t-dongle-s3-tft-config-py">tft_configs/t-dongle-s3/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/t-dongle-s3.html#tft-configs-t-dongle-s3-tft-buttons-py">tft_configs/t-dongle-s3/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/t-embed.html">LilyGo T-embed 170x320</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/t-embed.html#tft-configs-t-embed-tft-config-py">tft_configs/t-embed/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/t-embed.html#tft-configs-t-embed-tft-buttons-py">tft_configs/t-embed/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/t_qt_pro.html">LilyGo T-QT Pro 128x128 (GC9107)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/t_qt_pro.html#tft-configs-t-qt-pro-tft-config-py">tft_configs/t_qt_pro/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/t_qt_pro.html#tft-configs-t-qt-pro-tft-buttons-py">tft_configs/t_qt_pro/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/ttgo_tdisplay.html">LilyGo T-DISPLAY 135x240</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/ttgo_tdisplay.html#tft-configs-ttgo-tdisplay-tft-config-py">tft_configs/ttgo_tdisplay/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/ttgo_tdisplay.html#tft-configs-ttgo-tdisplay-tft-buttons-py">tft_configs/ttgo_tdisplay/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/ttgo_tdisplay_rp2040.html">LilyGo T-DISPLAY RP2040 135x240</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/ttgo_tdisplay_rp2040.html#tft-configs-ttgo-tdisplay-rp2040-tft-config-py">tft_configs/ttgo_tdisplay_rp2040/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/ttgo_tdisplay_rp2040.html#tft-configs-ttgo-tdisplay-rp2040-tft-buttons-py">tft_configs/ttgo_tdisplay_rp2040/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/waveshare_114.html">Waveshare Pico LCD 1.14 135x240</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_114.html#tft-configs-waveshare-114-tft-config-py">tft_configs/waveshare_114/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_114.html#tft-configs-waveshare-114-tft-buttons-py">tft_configs/waveshare_114/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/waveshare_13.html">Waveshare Pico LCD 1.3 240x240</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_13.html#tft-configs-waveshare-13-tft-config-py">tft_configs/waveshare_13/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_13.html#tft-configs-waveshare-13-tft-buttons-py">tft_configs/waveshare_13/tft_buttons.py</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configs/waveshare_2.html">Waveshare Pico LCD 2 240x320</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_2.html#tft-configs-waveshare-2-tft-config-py">tft_configs/waveshare_2/tft_config.py</a></li>
<li class="toctree-l4"><a class="reference internal" href="configs/waveshare_2.html#tft-configs-waveshare-2-tft-buttons-py">tft_configs/waveshare_2/tft_buttons.py</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#examples">Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="examples/alien.html">alien.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/boxlines.html">boxlines.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/chango.html">chango.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/color_test.html">color_test.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/colorbars.html">colorbars.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/feathers.html">feathers.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/fonts.html">fonts.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/hello.html">hello.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/noto_fonts.html">noto_fonts.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/proverbs.html">proverbs.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/roids.html">roids.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/rotations.html">rotations.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/scroll.html">scroll.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/tiny_hello.html">tiny_hello.py</a></li>
<li class="toctree-l3"><a class="reference internal" href="examples/tiny_toasters.html">tiny_toasters.py</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="fonts.html">Fonts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="fonts.html#bitmap-fonts">Bitmap Fonts</a><ul>
<li class="toctree-l3"><a class="reference internal" href="fonts.html#bitmap-font-conversion">Bitmap Font Conversion</a></li>
<li class="toctree-l3"><a class="reference internal" href="fonts.html#bitmap-font-samples">Bitmap Font Samples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
<li class="toctree-l4"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
<li class="toctree-l4"><a class="reference internal" href="fonts.html#id2">16x16 Rom Fonts</a></li>
<li class="toctree-l4"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-fonts">True Type fonts</a><ul>
<li class="toctree-l3"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="utilities.html">Utilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="utilities/create_png_examples.html">create_png_examples.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/create_png_examples.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/create_png_examples.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="utilities/image_converter.html">image_converter.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/image_converter.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/image_converter.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="utilities/make_colorbars_bitmap.html">make_colorbars_bitmap.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/make_colorbars_bitmap.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/make_colorbars_bitmap.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="utilities/sprites_converter.html">sprites_converter.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/sprites_converter.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/sprites_converter.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="utilities/text_font_converter.html">text_font_converter.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/text_font_converter.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/text_font_converter.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="utilities/write_font_converter.html">write_font_converter.py</a><ul>
<li class="toctree-l3"><a class="reference internal" href="utilities/write_font_converter.html#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="utilities/write_font_converter.html#usage">Usage</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="genindex.html">Index</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #2980B9" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">st7789py</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">st7789py Reference</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/st7789py.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="module-st7789py">
<span id="st7789py-reference"></span><h1>st7789py Reference<a class="headerlink" href="#module-st7789py" title="Link to this heading"></a></h1>
<p>MIT License</p>
<p>Copyright (c) 2020-2023 Russ Hughes</p>
<p>Copyright (c) 2019 Ivan Belokobylskiy</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</p>
<p>The driver is based on devbis st7789py_mpy module from
<a class="reference external" href="https://github.com/devbis/st7789py_mpy">https://github.com/devbis/st7789py_mpy</a>.</p>
<p>This driver supports:</p>
<ul class="simple">
<li><p>320x240, 240x240, 135x240 and 128x128 pixel displays</p></li>
<li><p>Display rotation</p></li>
<li><p>RGB and BGR color orders</p></li>
<li><p>Hardware based scrolling</p></li>
<li><p>Drawing text using 8 and 16 bit wide bitmap fonts with heights that are
multiples of 8. Included are 12 bitmap fonts derived from classic pc
BIOS text mode fonts.</p></li>
<li><p>Drawing text using converted TrueType fonts.</p></li>
<li><p>Drawing converted bitmaps</p></li>
<li><p>Named color constants</p>
<ul>
<li><p>BLACK</p></li>
<li><p>BLUE</p></li>
<li><p>RED</p></li>
<li><p>GREEN</p></li>
<li><p>CYAN</p></li>
<li><p>MAGENTA</p></li>
<li><p>YELLOW</p></li>
<li><p>WHITE</p></li>
</ul>
</li>
</ul>
<dl class="py function">
<dt class="sig sig-object py" id="st7789py.color565">
<span class="sig-prename descclassname"><span class="pre">st7789py.</span></span><span class="sig-name descname"><span class="pre">color565</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">red</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">green</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">blue</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#color565"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.color565" title="Link to this definition"></a></dt>
<dd><p>Convert red, green and blue values (0-255) into a 16-bit 565 encoding.</p>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="st7789py.ST7789">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">st7789py.</span></span><span class="sig-name descname"><span class="pre">ST7789</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spi</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dc</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">backlight</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rotation</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color_order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">BGR</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_init</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_rotations</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789" title="Link to this definition"></a></dt>
<dd><p>ST7789 driver class</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>spi</strong> (<em>spi</em>) – spi object <strong>Required</strong></p></li>
<li><p><strong>width</strong> (<em>int</em>) – display width <strong>Required</strong></p></li>
<li><p><strong>height</strong> (<em>int</em>) – display height <strong>Required</strong></p></li>
<li><p><strong>reset</strong> (<em>pin</em>) – reset pin</p></li>
<li><p><strong>dc</strong> (<em>pin</em>) – dc pin <strong>Required</strong></p></li>
<li><p><strong>cs</strong> (<em>pin</em>) – cs pin</p></li>
<li><p><strong>backlight</strong> (<em>pin</em>) – backlight pin</p></li>
<li><p><strong>rotation</strong> (<em>int</em>) – <ul>
<li><p>0-Portrait</p></li>
<li><p>1-Landscape</p></li>
<li><p>2-Inverted Portrait</p></li>
<li><p>3-Inverted Landscape</p></li>
</ul>
</p></li>
<li><p><strong>color_order</strong> (<em>int</em>) – <ul>
<li><p>RGB: Red, Green Blue, default</p></li>
<li><p>BGR: Blue, Green, Red</p></li>
</ul>
</p></li>
<li><p><strong>custom_init</strong> (<em>tuple</em>) – <p>custom initialization commands</p>
<ul>
<li><p>((bcommand, bdata, delay_ms), …)</p></li>
</ul>
</p></li>
<li><p><strong>custom_rotations</strong> (<em>tuple</em>) – <p>custom rotation definitions</p>
<ul>
<li><p>((width, height, xstart, ystart, madctl, needs_swap), …)</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.init">
<span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">commands</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.init"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.init" title="Link to this definition"></a></dt>
<dd><p>Initialize display.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.hard_reset">
<span class="sig-name descname"><span class="pre">hard_reset</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.hard_reset"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.hard_reset" title="Link to this definition"></a></dt>
<dd><p>Hard reset display.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.soft_reset">
<span class="sig-name descname"><span class="pre">soft_reset</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.soft_reset"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.soft_reset" title="Link to this definition"></a></dt>
<dd><p>Soft reset display.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.sleep_mode">
<span class="sig-name descname"><span class="pre">sleep_mode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.sleep_mode"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.sleep_mode" title="Link to this definition"></a></dt>
<dd><p>Enable or disable display sleep mode.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>value</strong> (<em>bool</em>) – if True enable sleep mode. if False disable sleep</p></li>
<li><p><strong>mode</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.inversion_mode">
<span class="sig-name descname"><span class="pre">inversion_mode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.inversion_mode"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.inversion_mode" title="Link to this definition"></a></dt>
<dd><p>Enable or disable display inversion mode.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>value</strong> (<em>bool</em>) – if True enable inversion mode. if False disable</p></li>
<li><p><strong>mode</strong> (<em>inversion</em>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.rotation">
<span class="sig-name descname"><span class="pre">rotation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rotation</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.rotation"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.rotation" title="Link to this definition"></a></dt>
<dd><p>Set display rotation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rotation</strong> (<em>int</em>) – <ul>
<li><p>0-Portrait</p></li>
<li><p>1-Landscape</p></li>
<li><p>2-Inverted Portrait</p></li>
<li><p>3-Inverted Landscape</p></li>
</ul>
</p></li>
<li><p><strong>rotations</strong> (<em>custom_rotations can have any number of</em>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.vline">
<span class="sig-name descname"><span class="pre">vline</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.vline"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.vline" title="Link to this definition"></a></dt>
<dd><p>Draw vertical line at the given location and color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em>) – x coordinate</p></li>
<li><p><strong>Y</strong> (<em>int</em>) – y coordinate</p></li>
<li><p><strong>length</strong> (<em>int</em>) – length of line</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.hline">
<span class="sig-name descname"><span class="pre">hline</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.hline"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.hline" title="Link to this definition"></a></dt>
<dd><p>Draw horizontal line at the given location and color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em>) – x coordinate</p></li>
<li><p><strong>Y</strong> (<em>int</em>) – y coordinate</p></li>
<li><p><strong>length</strong> (<em>int</em>) – length of line</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.pixel">
<span class="sig-name descname"><span class="pre">pixel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.pixel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.pixel" title="Link to this definition"></a></dt>
<dd><p>Draw a pixel at the given location and color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em>) – x coordinate</p></li>
<li><p><strong>Y</strong> (<em>int</em>) – y coordinate</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.blit_buffer">
<span class="sig-name descname"><span class="pre">blit_buffer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">buffer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.blit_buffer"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.blit_buffer" title="Link to this definition"></a></dt>
<dd><p>Copy buffer to display at the given location.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>buffer</strong> (<em>bytes</em>) – Data to copy to display</p></li>
<li><p><strong>x</strong> (<em>int</em>) – Top left corner x coordinate</p></li>
<li><p><strong>Y</strong> (<em>int</em>) – Top left corner y coordinate</p></li>
<li><p><strong>width</strong> (<em>int</em>) – Width</p></li>
<li><p><strong>height</strong> (<em>int</em>) – Height</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.rect">
<span class="sig-name descname"><span class="pre">rect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">w</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">h</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.rect"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.rect" title="Link to this definition"></a></dt>
<dd><p>Draw a rectangle at the given location, size and color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em>) – Top left corner x coordinate</p></li>
<li><p><strong>y</strong> (<em>int</em>) – Top left corner y coordinate</p></li>
<li><p><strong>width</strong> (<em>int</em>) – Width in pixels</p></li>
<li><p><strong>height</strong> (<em>int</em>) – Height in pixels</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.fill_rect">
<span class="sig-name descname"><span class="pre">fill_rect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.fill_rect"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.fill_rect" title="Link to this definition"></a></dt>
<dd><p>Draw a rectangle at the given location, size and filled with color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em>) – Top left corner x coordinate</p></li>
<li><p><strong>y</strong> (<em>int</em>) – Top left corner y coordinate</p></li>
<li><p><strong>width</strong> (<em>int</em>) – Width in pixels</p></li>
<li><p><strong>height</strong> (<em>int</em>) – Height in pixels</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.fill">
<span class="sig-name descname"><span class="pre">fill</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.fill"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.fill" title="Link to this definition"></a></dt>
<dd><p>Fill the entire FrameBuffer with the specified color.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.line">
<span class="sig-name descname"><span class="pre">line</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.line"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.line" title="Link to this definition"></a></dt>
<dd><p>Draw a single pixel wide line starting at x0, y0 and ending at x1, y1.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x0</strong> (<em>int</em>) – Start point x coordinate</p></li>
<li><p><strong>y0</strong> (<em>int</em>) – Start point y coordinate</p></li>
<li><p><strong>x1</strong> (<em>int</em>) – End point x coordinate</p></li>
<li><p><strong>y1</strong> (<em>int</em>) – End point y coordinate</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.vscrdef">
<span class="sig-name descname"><span class="pre">vscrdef</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tfa</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vsa</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bfa</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.vscrdef"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.vscrdef" title="Link to this definition"></a></dt>
<dd><p>Set Vertical Scrolling Definition.</p>
<p>To scroll a 135x240 display these values should be 40, 240, 40.
There are 40 lines above the display that are not shown followed by
240 lines that are shown followed by 40 more lines that are not shown.
You could write to these areas off display and scroll them into view by
changing the TFA, VSA and BFA values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tfa</strong> (<em>int</em>) – Top Fixed Area</p></li>
<li><p><strong>vsa</strong> (<em>int</em>) – Vertical Scrolling Area</p></li>
<li><p><strong>bfa</strong> (<em>int</em>) – Bottom Fixed Area</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.vscsad">
<span class="sig-name descname"><span class="pre">vscsad</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vssa</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.vscsad"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.vscsad" title="Link to this definition"></a></dt>
<dd><p>Set Vertical Scroll Start Address of RAM.</p>
<p>Defines which line in the Frame Memory will be written as the first
line after the last line of the Top Fixed Area on the display</p>
<p class="rubric">Example</p>
<dl class="simple">
<dt>for line in range(40, 280, 1):</dt><dd><p>tft.vscsad(line)
utime.sleep(0.01)</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vssa</strong> (<em>int</em>) – Vertical Scrolling Start Address</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.text">
<span class="sig-name descname"><span class="pre">text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">font</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">WHITE</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">background</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">BLACK</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.text"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.text" title="Link to this definition"></a></dt>
<dd><p>Draw text on display in specified font and colors. 8 and 16 bit wide
fonts are supported.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>font</strong> (<em>module</em>) – font module to use.</p></li>
<li><p><strong>text</strong> (<em>str</em>) – text to write</p></li>
<li><p><strong>x0</strong> (<em>int</em>) – column to start drawing at</p></li>
<li><p><strong>y0</strong> (<em>int</em>) – row to start drawing at</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color to use for characters</p></li>
<li><p><strong>background</strong> (<em>int</em>) – 565 encoded color to use for background</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.bitmap">
<span class="sig-name descname"><span class="pre">bitmap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bitmap</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.bitmap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.bitmap" title="Link to this definition"></a></dt>
<dd><p>Draw a bitmap on display at the specified column and row</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bitmap</strong> (<em>bitmap_module</em>) – The module containing the bitmap to draw</p></li>
<li><p><strong>x</strong> (<em>int</em>) – column to start drawing at</p></li>
<li><p><strong>y</strong> (<em>int</em>) – row to start drawing at</p></li>
<li><p><strong>index</strong> (<em>int</em>) – Optional index of bitmap to draw from multiple bitmap
module</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.pbitmap">
<span class="sig-name descname"><span class="pre">pbitmap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bitmap</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.pbitmap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.pbitmap" title="Link to this definition"></a></dt>
<dd><p>Draw a bitmap on display at the specified column and row one row at a time</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bitmap</strong> (<em>bitmap_module</em>) – The module containing the bitmap to draw</p></li>
<li><p><strong>x</strong> (<em>int</em>) – column to start drawing at</p></li>
<li><p><strong>y</strong> (<em>int</em>) – row to start drawing at</p></li>
<li><p><strong>index</strong> (<em>int</em>) – Optional index of bitmap to draw from multiple bitmap
module</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.write">
<span class="sig-name descname"><span class="pre">write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">font</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">string</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">WHITE</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">BLACK</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.write" title="Link to this definition"></a></dt>
<dd><p>Write a string using a converted true-type font on the display starting
at the specified column and row</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>font</strong> (<em>font</em>) – The module containing the converted true-type font</p></li>
<li><p><strong>s</strong> (<em>string</em>) – The string to write</p></li>
<li><p><strong>x</strong> (<em>int</em>) – column to start writing</p></li>
<li><p><strong>y</strong> (<em>int</em>) – row to start writing</p></li>
<li><p><strong>fg</strong> (<em>int</em>) – foreground color, optional, defaults to WHITE</p></li>
<li><p><strong>bg</strong> (<em>int</em>) – background color, optional, defaults to BLACK</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.write_width">
<span class="sig-name descname"><span class="pre">write_width</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">font</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">string</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.write_width"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.write_width" title="Link to this definition"></a></dt>
<dd><p>Returns the width in pixels of the string if it was written with the
specified font</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>font</strong> (<em>font</em>) – The module containing the converted true-type font</p></li>
<li><p><strong>string</strong> (<em>string</em>) – The string to measure</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The width of the string in pixels</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="st7789py.ST7789.polygon">
<span class="sig-name descname"><span class="pre">polygon</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angle</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">center_x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">center_y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/st7789py.html#ST7789.polygon"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#st7789py.ST7789.polygon" title="Link to this definition"></a></dt>
<dd><p>Draw a polygon on the display.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> (<em>list</em>) – List of points to draw.</p></li>
<li><p><strong>x</strong> (<em>int</em>) – X-coordinate of the polygons position.</p></li>
<li><p><strong>y</strong> (<em>int</em>) – Y-coordinate of the polygons position.</p></li>
<li><p><strong>color</strong> (<em>int</em>) – 565 encoded color.</p></li>
<li><p><strong>angle</strong> (<em>float</em>) – Rotation angle in radians (default: 0).</p></li>
<li><p><strong>center_x</strong> (<em>int</em>) – X-coordinate of the rotation center (default: 0).</p></li>
<li><p><strong>center_y</strong> (<em>int</em>) – Y-coordinate of the rotation center (default: 0).</p></li>
</ul>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>ValueError</strong> – If the polygon has less than 3 points.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="index.html" class="btn btn-neutral float-left" title="st7789py Driver" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="examples.html" class="btn btn-neutral float-right" title="Example Programs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p></p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>