Sphinx source used to build docs
|
@ -1,7 +1,6 @@
|
|||
.vscode
|
||||
.idea
|
||||
__pycache__
|
||||
sphinx
|
||||
*~
|
||||
*.pyc
|
||||
*.o
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 78614e3006fc5cc56d2562d24941cf0c
|
||||
config: db5947919316628e816682c8ca6bb96d
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
|
@ -82,7 +85,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../index.html">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -99,10 +102,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
|
@ -82,7 +85,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../index.html">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -99,10 +102,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -337,11 +340,11 @@
|
|||
<span class="sd"> ST7789 driver class</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> spi (spi): spi object</span>
|
||||
<span class="sd"> width (int): display width</span>
|
||||
<span class="sd"> height (int): display height</span>
|
||||
<span class="sd"> spi (spi): spi object **Required**</span>
|
||||
<span class="sd"> width (int): display width **Required**</span>
|
||||
<span class="sd"> height (int): display height **Required**</span>
|
||||
<span class="sd"> reset (pin): reset pin</span>
|
||||
<span class="sd"> dc (pin): dc pin</span>
|
||||
<span class="sd"> dc (pin): dc pin **Required**</span>
|
||||
<span class="sd"> cs (pin): cs pin</span>
|
||||
<span class="sd"> backlight(pin): backlight pin</span>
|
||||
<span class="sd"> rotation (int): display rotation</span>
|
||||
|
@ -350,7 +353,7 @@
|
|||
<span class="sd"> - 2-Inverted Portrait</span>
|
||||
<span class="sd"> - 3-Inverted Landscape</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">spi</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">,</span> <span class="n">reset</span><span class="p">,</span> <span class="n">dc</span><span class="p">,</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">spi</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">,</span> <span class="n">reset</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">cs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">backlight</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rotation</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Initialize display.</span>
|
||||
|
@ -360,6 +363,9 @@
|
|||
<span class="s2">"Unsupported display. 320x240, 240x240 and 135x240 are supported."</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">dc</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"dc pin is required."</span><span class="p">)</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_display_width</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">width</span> <span class="o">=</span> <span class="n">width</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_display_height</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">height</span> <span class="o">=</span> <span class="n">height</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">xstart</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
|
|
|
@ -55,8 +55,8 @@ Example use:
|
|||
|
||||
|
||||
|
||||
8x8 Fonts
|
||||
---------
|
||||
8x8 Rom Fonts
|
||||
-------------
|
||||
|
||||
.. figure:: _static/vga1_8x8.png
|
||||
:align: center
|
||||
|
@ -72,8 +72,8 @@ Example use:
|
|||
|
||||
|
|
||||
|
||||
8x16 Fonts
|
||||
----------
|
||||
8x16 Rom Fonts
|
||||
--------------
|
||||
|
||||
.. figure:: _static/vga1_8x16.png
|
||||
:align: center
|
||||
|
@ -89,8 +89,8 @@ Example use:
|
|||
|
||||
|
|
||||
|
||||
16x16 Fonts
|
||||
-----------
|
||||
16x16 Rom Fonts
|
||||
---------------
|
||||
|
||||
.. figure:: _static/vga1_16x16.png
|
||||
:align: center
|
||||
|
@ -120,8 +120,8 @@ Example use:
|
|||
|
||||
|
|
||||
|
||||
16x32 Fonts
|
||||
-----------
|
||||
16x32 Rom Fonts
|
||||
---------------
|
||||
|
||||
.. figure:: _static/vga1_16x32.png
|
||||
:align: center
|
||||
|
|
|
@ -130,7 +130,7 @@ ul.search li a {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.search li div.context {
|
||||
ul.search li p.context {
|
||||
color: #888;
|
||||
margin: 2px 0 0 30px;
|
||||
text-align: left;
|
||||
|
@ -508,6 +508,63 @@ table.hlist td {
|
|||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* -- object description styles --------------------------------------------- */
|
||||
|
||||
.sig {
|
||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||
}
|
||||
|
||||
.sig-name, code.descname {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sig-name {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
code.descname {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.sig-prename, code.descclassname {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.optional {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.sig-paren {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.sig-param.n {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* C++ specific styling */
|
||||
|
||||
.sig-inline.c-texpr,
|
||||
.sig-inline.cpp-texpr {
|
||||
font-family: unset;
|
||||
}
|
||||
|
||||
.sig.c .k, .sig.c .kt,
|
||||
.sig.cpp .k, .sig.cpp .kt {
|
||||
color: #0033B3;
|
||||
}
|
||||
|
||||
.sig.c .m,
|
||||
.sig.cpp .m {
|
||||
color: #1750EB;
|
||||
}
|
||||
|
||||
.sig.c .s, .sig.c .sc,
|
||||
.sig.cpp .s, .sig.cpp .sc {
|
||||
color: #067D17;
|
||||
}
|
||||
|
||||
|
||||
/* -- other body styles ----------------------------------------------------- */
|
||||
|
||||
|
@ -634,14 +691,6 @@ dl.glossary dt {
|
|||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.optional {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.sig-paren {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.versionmodified {
|
||||
font-style: italic;
|
||||
}
|
||||
|
@ -770,8 +819,12 @@ div.code-block-caption code {
|
|||
|
||||
table.highlighttable td.linenos,
|
||||
span.linenos,
|
||||
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
|
||||
user-select: none;
|
||||
div.highlight span.gp { /* gp: Generic.Prompt */
|
||||
user-select: none;
|
||||
-webkit-user-select: text; /* Safari fallback only */
|
||||
-webkit-user-select: none; /* Chrome/Safari */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* IE10+ */
|
||||
}
|
||||
|
||||
div.code-block-caption span.caption-number {
|
||||
|
@ -786,16 +839,6 @@ div.literal-block-wrapper {
|
|||
margin: 1em 0;
|
||||
}
|
||||
|
||||
code.descname {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
code.descclassname {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
code.xref, a code {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -301,12 +301,14 @@ var Documentation = {
|
|||
window.location.href = prevHref;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 39: // right
|
||||
var nextHref = $('link[rel="next"]').prop('href');
|
||||
if (nextHref) {
|
||||
window.location.href = nextHref;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -509,7 +509,7 @@ var Search = {
|
|||
var excerpt = ((start > 0) ? '...' : '') +
|
||||
$.trim(text.substr(start, 240)) +
|
||||
((start + 240 - text.length) ? '...' : '');
|
||||
var rv = $('<div class="context"></div>').text(excerpt);
|
||||
var rv = $('<p class="context"></p>').text(excerpt);
|
||||
$.each(hlwords, function() {
|
||||
rv = rv.highlightText(this, 'highlighted');
|
||||
});
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define('underscore', factory) :
|
||||
(global = global || self, (function () {
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
|
||||
var current = global._;
|
||||
var exports = global._ = factory();
|
||||
exports.noConflict = function () { global._ = current; return exports; };
|
||||
}()));
|
||||
}(this, (function () {
|
||||
// Underscore.js 1.12.0
|
||||
// Underscore.js 1.13.1
|
||||
// https://underscorejs.org
|
||||
// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
|
||||
// Underscore may be freely distributed under the MIT license.
|
||||
|
||||
// Current version.
|
||||
var VERSION = '1.12.0';
|
||||
var VERSION = '1.13.1';
|
||||
|
||||
// Establish the root object, `window` (`self`) in the browser, `global`
|
||||
// on the server, or `this` in some virtual machines. We use `self`
|
||||
|
@ -170,7 +170,7 @@
|
|||
var isArray = nativeIsArray || tagTester('Array');
|
||||
|
||||
// Internal function to check whether `key` is an own property name of `obj`.
|
||||
function has(obj, key) {
|
||||
function has$1(obj, key) {
|
||||
return obj != null && hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
|||
(function() {
|
||||
if (!isArguments(arguments)) {
|
||||
isArguments = function(obj) {
|
||||
return has(obj, 'callee');
|
||||
return has$1(obj, 'callee');
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
@ -268,7 +268,7 @@
|
|||
|
||||
// Constructor is a special case.
|
||||
var prop = 'constructor';
|
||||
if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);
|
||||
if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop);
|
||||
|
||||
while (nonEnumIdx--) {
|
||||
prop = nonEnumerableProps[nonEnumIdx];
|
||||
|
@ -284,7 +284,7 @@
|
|||
if (!isObject(obj)) return [];
|
||||
if (nativeKeys) return nativeKeys(obj);
|
||||
var keys = [];
|
||||
for (var key in obj) if (has(obj, key)) keys.push(key);
|
||||
for (var key in obj) if (has$1(obj, key)) keys.push(key);
|
||||
// Ahem, IE < 9.
|
||||
if (hasEnumBug) collectNonEnumProps(obj, keys);
|
||||
return keys;
|
||||
|
@ -318,24 +318,24 @@
|
|||
// If Underscore is called as a function, it returns a wrapped object that can
|
||||
// be used OO-style. This wrapper holds altered versions of all functions added
|
||||
// through `_.mixin`. Wrapped objects may be chained.
|
||||
function _(obj) {
|
||||
if (obj instanceof _) return obj;
|
||||
if (!(this instanceof _)) return new _(obj);
|
||||
function _$1(obj) {
|
||||
if (obj instanceof _$1) return obj;
|
||||
if (!(this instanceof _$1)) return new _$1(obj);
|
||||
this._wrapped = obj;
|
||||
}
|
||||
|
||||
_.VERSION = VERSION;
|
||||
_$1.VERSION = VERSION;
|
||||
|
||||
// Extracts the result from a wrapped and chained object.
|
||||
_.prototype.value = function() {
|
||||
_$1.prototype.value = function() {
|
||||
return this._wrapped;
|
||||
};
|
||||
|
||||
// Provide unwrapping proxies for some methods used in engine operations
|
||||
// such as arithmetic and JSON stringification.
|
||||
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
|
||||
_$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;
|
||||
|
||||
_.prototype.toString = function() {
|
||||
_$1.prototype.toString = function() {
|
||||
return String(this._wrapped);
|
||||
};
|
||||
|
||||
|
@ -370,8 +370,8 @@
|
|||
// Internal recursive comparison function for `_.isEqual`.
|
||||
function deepEq(a, b, aStack, bStack) {
|
||||
// Unwrap any wrapped objects.
|
||||
if (a instanceof _) a = a._wrapped;
|
||||
if (b instanceof _) b = b._wrapped;
|
||||
if (a instanceof _$1) a = a._wrapped;
|
||||
if (b instanceof _$1) b = b._wrapped;
|
||||
// Compare `[[Class]]` names.
|
||||
var className = toString.call(a);
|
||||
if (className !== toString.call(b)) return false;
|
||||
|
@ -463,7 +463,7 @@
|
|||
while (length--) {
|
||||
// Deep compare each member
|
||||
key = _keys[length];
|
||||
if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
||||
if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
||||
}
|
||||
}
|
||||
// Remove the first object from the stack of traversed objects.
|
||||
|
@ -642,15 +642,15 @@
|
|||
|
||||
// Normalize a (deep) property `path` to array.
|
||||
// Like `_.iteratee`, this function can be customized.
|
||||
function toPath(path) {
|
||||
function toPath$1(path) {
|
||||
return isArray(path) ? path : [path];
|
||||
}
|
||||
_.toPath = toPath;
|
||||
_$1.toPath = toPath$1;
|
||||
|
||||
// Internal wrapper for `_.toPath` to enable minification.
|
||||
// Similar to `cb` for `_.iteratee`.
|
||||
function toPath$1(path) {
|
||||
return _.toPath(path);
|
||||
function toPath(path) {
|
||||
return _$1.toPath(path);
|
||||
}
|
||||
|
||||
// Internal function to obtain a nested property in `obj` along `path`.
|
||||
|
@ -668,19 +668,19 @@
|
|||
// `undefined`, return `defaultValue` instead.
|
||||
// The `path` is normalized through `_.toPath`.
|
||||
function get(object, path, defaultValue) {
|
||||
var value = deepGet(object, toPath$1(path));
|
||||
var value = deepGet(object, toPath(path));
|
||||
return isUndefined(value) ? defaultValue : value;
|
||||
}
|
||||
|
||||
// Shortcut function for checking if an object has a given property directly on
|
||||
// itself (in other words, not on a prototype). Unlike the internal `has`
|
||||
// function, this public version can also traverse nested properties.
|
||||
function has$1(obj, path) {
|
||||
path = toPath$1(path);
|
||||
function has(obj, path) {
|
||||
path = toPath(path);
|
||||
var length = path.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var key = path[i];
|
||||
if (!has(obj, key)) return false;
|
||||
if (!has$1(obj, key)) return false;
|
||||
obj = obj[key];
|
||||
}
|
||||
return !!length;
|
||||
|
@ -703,7 +703,7 @@
|
|||
// Creates a function that, when passed an object, will traverse that object’s
|
||||
// properties down the given `path`, specified as an array of keys or indices.
|
||||
function property(path) {
|
||||
path = toPath$1(path);
|
||||
path = toPath(path);
|
||||
return function(obj) {
|
||||
return deepGet(obj, path);
|
||||
};
|
||||
|
@ -747,12 +747,12 @@
|
|||
function iteratee(value, context) {
|
||||
return baseIteratee(value, context, Infinity);
|
||||
}
|
||||
_.iteratee = iteratee;
|
||||
_$1.iteratee = iteratee;
|
||||
|
||||
// The function we call internally to generate a callback. It invokes
|
||||
// `_.iteratee` if overridden, otherwise `baseIteratee`.
|
||||
function cb(value, context, argCount) {
|
||||
if (_.iteratee !== iteratee) return _.iteratee(value, context);
|
||||
if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);
|
||||
return baseIteratee(value, context, argCount);
|
||||
}
|
||||
|
||||
|
@ -840,7 +840,7 @@
|
|||
|
||||
// By default, Underscore uses ERB-style template delimiters. Change the
|
||||
// following template settings to use alternative delimiters.
|
||||
var templateSettings = _.templateSettings = {
|
||||
var templateSettings = _$1.templateSettings = {
|
||||
evaluate: /<%([\s\S]+?)%>/g,
|
||||
interpolate: /<%=([\s\S]+?)%>/g,
|
||||
escape: /<%-([\s\S]+?)%>/g
|
||||
|
@ -868,13 +868,20 @@
|
|||
return '\\' + escapes[match];
|
||||
}
|
||||
|
||||
// In order to prevent third-party code injection through
|
||||
// `_.templateSettings.variable`, we test it against the following regular
|
||||
// expression. It is intentionally a bit more liberal than just matching valid
|
||||
// identifiers, but still prevents possible loopholes through defaults or
|
||||
// destructuring assignment.
|
||||
var bareIdentifier = /^\s*(\w|\$)+\s*$/;
|
||||
|
||||
// JavaScript micro-templating, similar to John Resig's implementation.
|
||||
// Underscore templating handles arbitrary delimiters, preserves whitespace,
|
||||
// and correctly escapes quotes within interpolated code.
|
||||
// NB: `oldSettings` only exists for backwards compatibility.
|
||||
function template(text, settings, oldSettings) {
|
||||
if (!settings && oldSettings) settings = oldSettings;
|
||||
settings = defaults({}, settings, _.templateSettings);
|
||||
settings = defaults({}, settings, _$1.templateSettings);
|
||||
|
||||
// Combine delimiters into one regular expression via alternation.
|
||||
var matcher = RegExp([
|
||||
|
@ -903,8 +910,17 @@
|
|||
});
|
||||
source += "';\n";
|
||||
|
||||
// If a variable is not specified, place data values in local scope.
|
||||
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
|
||||
var argument = settings.variable;
|
||||
if (argument) {
|
||||
// Insure against third-party code injection. (CVE-2021-23358)
|
||||
if (!bareIdentifier.test(argument)) throw new Error(
|
||||
'variable is not a bare identifier: ' + argument
|
||||
);
|
||||
} else {
|
||||
// If a variable is not specified, place data values in local scope.
|
||||
source = 'with(obj||{}){\n' + source + '}\n';
|
||||
argument = 'obj';
|
||||
}
|
||||
|
||||
source = "var __t,__p='',__j=Array.prototype.join," +
|
||||
"print=function(){__p+=__j.call(arguments,'');};\n" +
|
||||
|
@ -912,18 +928,17 @@
|
|||
|
||||
var render;
|
||||
try {
|
||||
render = new Function(settings.variable || 'obj', '_', source);
|
||||
render = new Function(argument, '_', source);
|
||||
} catch (e) {
|
||||
e.source = source;
|
||||
throw e;
|
||||
}
|
||||
|
||||
var template = function(data) {
|
||||
return render.call(this, data, _);
|
||||
return render.call(this, data, _$1);
|
||||
};
|
||||
|
||||
// Provide the compiled source as a convenience for precompilation.
|
||||
var argument = settings.variable || 'obj';
|
||||
template.source = 'function(' + argument + '){\n' + source + '}';
|
||||
|
||||
return template;
|
||||
|
@ -933,7 +948,7 @@
|
|||
// is invoked with its parent as context. Returns the value of the final
|
||||
// child, or `fallback` if any child is undefined.
|
||||
function result(obj, path, fallback) {
|
||||
path = toPath$1(path);
|
||||
path = toPath(path);
|
||||
var length = path.length;
|
||||
if (!length) {
|
||||
return isFunction$1(fallback) ? fallback.call(obj) : fallback;
|
||||
|
@ -959,7 +974,7 @@
|
|||
|
||||
// Start chaining a wrapped Underscore object.
|
||||
function chain(obj) {
|
||||
var instance = _(obj);
|
||||
var instance = _$1(obj);
|
||||
instance._chain = true;
|
||||
return instance;
|
||||
}
|
||||
|
@ -993,7 +1008,7 @@
|
|||
return bound;
|
||||
});
|
||||
|
||||
partial.placeholder = _;
|
||||
partial.placeholder = _$1;
|
||||
|
||||
// Create a function bound to a given object (assigning `this`, and arguments,
|
||||
// optionally).
|
||||
|
@ -1012,7 +1027,7 @@
|
|||
var isArrayLike = createSizePropertyCheck(getLength);
|
||||
|
||||
// Internal implementation of a recursive `flatten` function.
|
||||
function flatten(input, depth, strict, output) {
|
||||
function flatten$1(input, depth, strict, output) {
|
||||
output = output || [];
|
||||
if (!depth && depth !== 0) {
|
||||
depth = Infinity;
|
||||
|
@ -1025,7 +1040,7 @@
|
|||
if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
|
||||
// Flatten current level of array or arguments object.
|
||||
if (depth > 1) {
|
||||
flatten(value, depth - 1, strict, output);
|
||||
flatten$1(value, depth - 1, strict, output);
|
||||
idx = output.length;
|
||||
} else {
|
||||
var j = 0, len = value.length;
|
||||
|
@ -1042,7 +1057,7 @@
|
|||
// are the method names to be bound. Useful for ensuring that all callbacks
|
||||
// defined on an object belong to it.
|
||||
var bindAll = restArguments(function(obj, keys) {
|
||||
keys = flatten(keys, false, false);
|
||||
keys = flatten$1(keys, false, false);
|
||||
var index = keys.length;
|
||||
if (index < 1) throw new Error('bindAll must be passed function names');
|
||||
while (index--) {
|
||||
|
@ -1057,7 +1072,7 @@
|
|||
var memoize = function(key) {
|
||||
var cache = memoize.cache;
|
||||
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
|
||||
if (!has(cache, address)) cache[address] = func.apply(this, arguments);
|
||||
if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);
|
||||
return cache[address];
|
||||
};
|
||||
memoize.cache = {};
|
||||
|
@ -1074,7 +1089,7 @@
|
|||
|
||||
// Defers a function, scheduling it to run after the current call stack has
|
||||
// cleared.
|
||||
var defer = partial(delay, _, 1);
|
||||
var defer = partial(delay, _$1, 1);
|
||||
|
||||
// Returns a function, that, when invoked, will only be triggered at most once
|
||||
// during a given window of time. Normally, the throttled function will run
|
||||
|
@ -1420,7 +1435,7 @@
|
|||
if (isFunction$1(path)) {
|
||||
func = path;
|
||||
} else {
|
||||
path = toPath$1(path);
|
||||
path = toPath(path);
|
||||
contextPath = path.slice(0, -1);
|
||||
path = path[path.length - 1];
|
||||
}
|
||||
|
@ -1562,7 +1577,7 @@
|
|||
// Groups the object's values by a criterion. Pass either a string attribute
|
||||
// to group by, or a function that returns the criterion.
|
||||
var groupBy = group(function(result, value, key) {
|
||||
if (has(result, key)) result[key].push(value); else result[key] = [value];
|
||||
if (has$1(result, key)) result[key].push(value); else result[key] = [value];
|
||||
});
|
||||
|
||||
// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
|
||||
|
@ -1575,7 +1590,7 @@
|
|||
// either a string attribute to count by, or a function that returns the
|
||||
// criterion.
|
||||
var countBy = group(function(result, value, key) {
|
||||
if (has(result, key)) result[key]++; else result[key] = 1;
|
||||
if (has$1(result, key)) result[key]++; else result[key] = 1;
|
||||
});
|
||||
|
||||
// Split a collection into two arrays: one whose elements all pass the given
|
||||
|
@ -1618,7 +1633,7 @@
|
|||
keys = allKeys(obj);
|
||||
} else {
|
||||
iteratee = keyInObj;
|
||||
keys = flatten(keys, false, false);
|
||||
keys = flatten$1(keys, false, false);
|
||||
obj = Object(obj);
|
||||
}
|
||||
for (var i = 0, length = keys.length; i < length; i++) {
|
||||
|
@ -1636,7 +1651,7 @@
|
|||
iteratee = negate(iteratee);
|
||||
if (keys.length > 1) context = keys[1];
|
||||
} else {
|
||||
keys = map(flatten(keys, false, false), String);
|
||||
keys = map(flatten$1(keys, false, false), String);
|
||||
iteratee = function(value, key) {
|
||||
return !contains(keys, key);
|
||||
};
|
||||
|
@ -1681,14 +1696,14 @@
|
|||
|
||||
// Flatten out an array, either recursively (by default), or up to `depth`.
|
||||
// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
|
||||
function flatten$1(array, depth) {
|
||||
return flatten(array, depth, false);
|
||||
function flatten(array, depth) {
|
||||
return flatten$1(array, depth, false);
|
||||
}
|
||||
|
||||
// Take the difference between one array and a number of other arrays.
|
||||
// Only the elements present in just the first array will remain.
|
||||
var difference = restArguments(function(array, rest) {
|
||||
rest = flatten(rest, true, true);
|
||||
rest = flatten$1(rest, true, true);
|
||||
return filter(array, function(value){
|
||||
return !contains(rest, value);
|
||||
});
|
||||
|
@ -1734,7 +1749,7 @@
|
|||
// Produce an array that contains the union: each distinct element from all of
|
||||
// the passed-in arrays.
|
||||
var union = restArguments(function(arrays) {
|
||||
return uniq(flatten(arrays, true, true));
|
||||
return uniq(flatten$1(arrays, true, true));
|
||||
});
|
||||
|
||||
// Produce an array that contains every item shared between all the
|
||||
|
@ -1821,26 +1836,26 @@
|
|||
|
||||
// Helper function to continue chaining intermediate results.
|
||||
function chainResult(instance, obj) {
|
||||
return instance._chain ? _(obj).chain() : obj;
|
||||
return instance._chain ? _$1(obj).chain() : obj;
|
||||
}
|
||||
|
||||
// Add your own custom functions to the Underscore object.
|
||||
function mixin(obj) {
|
||||
each(functions(obj), function(name) {
|
||||
var func = _[name] = obj[name];
|
||||
_.prototype[name] = function() {
|
||||
var func = _$1[name] = obj[name];
|
||||
_$1.prototype[name] = function() {
|
||||
var args = [this._wrapped];
|
||||
push.apply(args, arguments);
|
||||
return chainResult(this, func.apply(_, args));
|
||||
return chainResult(this, func.apply(_$1, args));
|
||||
};
|
||||
});
|
||||
return _;
|
||||
return _$1;
|
||||
}
|
||||
|
||||
// Add all mutator `Array` functions to the wrapper.
|
||||
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
||||
var method = ArrayProto[name];
|
||||
_.prototype[name] = function() {
|
||||
_$1.prototype[name] = function() {
|
||||
var obj = this._wrapped;
|
||||
if (obj != null) {
|
||||
method.apply(obj, arguments);
|
||||
|
@ -1855,7 +1870,7 @@
|
|||
// Add all accessor `Array` functions to the wrapper.
|
||||
each(['concat', 'join', 'slice'], function(name) {
|
||||
var method = ArrayProto[name];
|
||||
_.prototype[name] = function() {
|
||||
_$1.prototype[name] = function() {
|
||||
var obj = this._wrapped;
|
||||
if (obj != null) obj = method.apply(obj, arguments);
|
||||
return chainResult(this, obj);
|
||||
|
@ -1909,12 +1924,12 @@
|
|||
clone: clone,
|
||||
tap: tap,
|
||||
get: get,
|
||||
has: has$1,
|
||||
has: has,
|
||||
mapObject: mapObject,
|
||||
identity: identity,
|
||||
constant: constant,
|
||||
noop: noop,
|
||||
toPath: toPath,
|
||||
toPath: toPath$1,
|
||||
property: property,
|
||||
propertyOf: propertyOf,
|
||||
matcher: matcher,
|
||||
|
@ -1997,7 +2012,7 @@
|
|||
tail: rest,
|
||||
drop: rest,
|
||||
compact: compact,
|
||||
flatten: flatten$1,
|
||||
flatten: flatten,
|
||||
without: without,
|
||||
uniq: uniq,
|
||||
unique: uniq,
|
||||
|
@ -2011,17 +2026,17 @@
|
|||
range: range,
|
||||
chunk: chunk,
|
||||
mixin: mixin,
|
||||
'default': _
|
||||
'default': _$1
|
||||
};
|
||||
|
||||
// Default Export
|
||||
|
||||
// Add all of the Underscore functions to the wrapper object.
|
||||
var _$1 = mixin(allExports);
|
||||
var _ = mixin(allExports);
|
||||
// Legacy Node.js API.
|
||||
_$1._ = _$1;
|
||||
_._ = _;
|
||||
|
||||
return _$1;
|
||||
return _;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=underscore.js.map
|
||||
//# sourceMappingURL=underscore-umd.js.map
|
1523
docs/examples.html
251
docs/fonts.html
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -83,7 +86,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<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"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -100,10 +103,10 @@
|
|||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Fonts</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -193,61 +196,35 @@ character is 256 pixels or less. They are written using the write method.</p>
|
|||
</div></blockquote>
|
||||
<div class="literal-block-wrapper docutils container" id="id2">
|
||||
<div class="code-block-caption"><span class="caption-text">Sample converted romfont font module.</span><a class="headerlink" href="#id2" title="Permalink to this code">¶</a></div>
|
||||
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
<span class="normal"> 4</span>
|
||||
<span class="normal"> 5</span>
|
||||
<span class="normal"> 6</span>
|
||||
<span class="normal"> 7</span>
|
||||
<span class="normal"> 8</span>
|
||||
<span class="normal"> 9</span>
|
||||
<span class="normal">10</span>
|
||||
<span class="normal">11</span>
|
||||
<span class="normal">12</span>
|
||||
<span class="normal">13</span>
|
||||
<span class="normal">14</span>
|
||||
<span class="normal">15</span>
|
||||
<span class="normal">16</span>
|
||||
<span class="normal">17</span>
|
||||
<span class="normal">18</span>
|
||||
<span class="normal">19</span>
|
||||
<span class="normal">20</span>
|
||||
<span class="normal">21</span>
|
||||
<span class="normal">22</span>
|
||||
<span class="normal">23</span>
|
||||
<span class="normal">24</span>
|
||||
<span class="normal">25</span>
|
||||
<span class="normal">26</span>
|
||||
<span class="normal">27</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="sd">"""converted from vga_8x8.bin """</span>
|
||||
|
||||
<span class="c1"># font width</span>
|
||||
<span class="n">WIDTH</span> <span class="o">=</span> <span class="mi">8</span>
|
||||
|
||||
<span class="c1"># font height</span>
|
||||
<span class="n">HEIGHT</span> <span class="o">=</span> <span class="mi">8</span>
|
||||
|
||||
<span class="c1"># first character in front</span>
|
||||
<span class="n">FIRST</span> <span class="o">=</span> <span class="mh">0x20</span>
|
||||
|
||||
<span class="c1"># last character in font</span>
|
||||
<span class="n">LAST</span> <span class="o">=</span> <span class="mh">0x7f</span>
|
||||
|
||||
<span class="c1"># bitmap of each character from FIRST to LAST</span>
|
||||
<span class="n">_FONT</span> <span class="o">=</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x18\x3c\x3c\x18\x18\x00\x18\x00</span><span class="s1">'</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x66\x66\x24\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
|
||||
<span class="o">...</span> <span class="n">many</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x70\x18\x18\x0e\x18\x18\x70\x00</span><span class="s1">'</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x76\xdc\x00\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x10\x38\x6c\xc6\xc6\xfe\x00</span><span class="s1">'</span>\
|
||||
|
||||
<span class="n">FONT</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_FONT</span><span class="p">)</span>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="sd">"""converted from vga_8x8.bin """</span>
|
||||
<span class="linenos"> 2</span>
|
||||
<span class="linenos"> 3</span><span class="c1"># font width</span>
|
||||
<span class="linenos"> 4</span><span class="n">WIDTH</span> <span class="o">=</span> <span class="mi">8</span>
|
||||
<span class="linenos"> 5</span>
|
||||
<span class="linenos"> 6</span><span class="c1"># font height</span>
|
||||
<span class="linenos"> 7</span><span class="n">HEIGHT</span> <span class="o">=</span> <span class="mi">8</span>
|
||||
<span class="linenos"> 8</span>
|
||||
<span class="linenos"> 9</span><span class="c1"># first character in front</span>
|
||||
<span class="linenos">10</span><span class="n">FIRST</span> <span class="o">=</span> <span class="mh">0x20</span>
|
||||
<span class="linenos">11</span>
|
||||
<span class="linenos">12</span><span class="c1"># last character in font</span>
|
||||
<span class="linenos">13</span><span class="n">LAST</span> <span class="o">=</span> <span class="mh">0x7f</span>
|
||||
<span class="linenos">14</span>
|
||||
<span class="linenos">15</span><span class="c1"># bitmap of each character from FIRST to LAST</span>
|
||||
<span class="linenos">16</span><span class="n">_FONT</span> <span class="o">=</span>\
|
||||
<span class="linenos">17</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">18</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x18\x3c\x3c\x18\x18\x00\x18\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">19</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x66\x66\x24\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">20</span>
|
||||
<span class="linenos">21</span><span class="o">...</span> <span class="n">many</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
<span class="linenos">22</span>
|
||||
<span class="linenos">23</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x70\x18\x18\x0e\x18\x18\x70\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">24</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x76\xdc\x00\x00\x00\x00\x00\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">25</span><span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x10\x38\x6c\xc6\xc6\xfe\x00</span><span class="s1">'</span>\
|
||||
<span class="linenos">26</span>
|
||||
<span class="linenos">27</span><span class="n">FONT</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_FONT</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</td></tr></table></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="true-type-font-conversion">
|
||||
|
@ -264,105 +241,59 @@ the negative glyph.left fix from peterhinch’s font conversion program
|
|||
</ul>
|
||||
<div class="literal-block-wrapper docutils container" id="id3">
|
||||
<div class="code-block-caption"><span class="caption-text">Sample converted TrueType font module.</span><a class="headerlink" href="#id3" title="Permalink to this code">¶</a></div>
|
||||
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
<span class="normal"> 4</span>
|
||||
<span class="normal"> 5</span>
|
||||
<span class="normal"> 6</span>
|
||||
<span class="normal"> 7</span>
|
||||
<span class="normal"> 8</span>
|
||||
<span class="normal"> 9</span>
|
||||
<span class="normal">10</span>
|
||||
<span class="normal">11</span>
|
||||
<span class="normal">12</span>
|
||||
<span class="normal">13</span>
|
||||
<span class="normal">14</span>
|
||||
<span class="normal">15</span>
|
||||
<span class="normal">16</span>
|
||||
<span class="normal">17</span>
|
||||
<span class="normal">18</span>
|
||||
<span class="normal">19</span>
|
||||
<span class="normal">20</span>
|
||||
<span class="normal">21</span>
|
||||
<span class="normal">22</span>
|
||||
<span class="normal">23</span>
|
||||
<span class="normal">24</span>
|
||||
<span class="normal">25</span>
|
||||
<span class="normal">26</span>
|
||||
<span class="normal">27</span>
|
||||
<span class="normal">28</span>
|
||||
<span class="normal">29</span>
|
||||
<span class="normal">30</span>
|
||||
<span class="normal">31</span>
|
||||
<span class="normal">32</span>
|
||||
<span class="normal">33</span>
|
||||
<span class="normal">34</span>
|
||||
<span class="normal">35</span>
|
||||
<span class="normal">36</span>
|
||||
<span class="normal">37</span>
|
||||
<span class="normal">38</span>
|
||||
<span class="normal">39</span>
|
||||
<span class="normal">40</span>
|
||||
<span class="normal">41</span>
|
||||
<span class="normal">42</span>
|
||||
<span class="normal">43</span>
|
||||
<span class="normal">44</span>
|
||||
<span class="normal">45</span>
|
||||
<span class="normal">46</span>
|
||||
<span class="normal">47</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="c1"># -*- coding: utf-8 -*-</span>
|
||||
<span class="c1"># Converted from Chango-Regular.ttf using:</span>
|
||||
<span class="c1"># ./font2bitmap.py Chango-Regular.ttf 16 -c 0x20-0x7f</span>
|
||||
|
||||
<span class="c1"># Maps the order of the character data</span>
|
||||
<span class="n">MAP</span> <span class="o">=</span> <span class="s2">" !</span><span class="se">\"</span><span class="s2">#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[</span><span class="se">\\</span><span class="s2">]^_`abcdefghijklmnopqrstuvwxyz{|}~"</span>
|
||||
|
||||
<span class="c1"># Number of color bits per pixel, currently only 1 is used but could be</span>
|
||||
<span class="c1"># increased to support antialiased or smoothed fonts in the future.</span>
|
||||
<span class="n">BPP</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="c1"># Font height</span>
|
||||
<span class="n">HEIGHT</span> <span class="o">=</span> <span class="mi">17</span>
|
||||
|
||||
<span class="c1"># Font max width</span>
|
||||
<span class="n">MAX_WIDTH</span> <span class="o">=</span> <span class="mi">24</span>
|
||||
|
||||
<span class="c1"># one byte per character table of widths in the same order as the MAP string</span>
|
||||
<span class="n">_WIDTHS</span> <span class="o">=</span> \
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x06\x08\x0a\x0e\x0d\x18\x10\x06\x08\x08\x0a\x0d\x06\x08\x06\x0b</span><span class="s1">'</span>\
|
||||
|
||||
<span class="o">...</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x0d\x0d\x0b\x0a\x0b\x0e\x0c\x12\x0d\x0c\x0b\x09\x06\x09\x0e\x0b</span><span class="s1">'</span>
|
||||
|
||||
<span class="c1"># OFFSET_WIDTH bytes per character in the same order as the MAP string</span>
|
||||
<span class="c1"># to the start of each character in bits.</span>
|
||||
<span class="n">OFFSET_WIDTH</span> <span class="o">=</span> <span class="mi">2</span>
|
||||
<span class="n">_OFFSETS</span> <span class="o">=</span> \
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x66\x00\xee\x01\x98\x02\x86\x03\x63\x04\xfb\x06\x0b</span><span class="s1">'</span>\
|
||||
|
||||
<span class="o">...</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x49\x94\x4a\x71\x4b\x3d\x4b\xf8\x4c\x91\x4c\xf7\x4d\x90\x4e\x7e</span><span class="s1">'</span>
|
||||
|
||||
<span class="c1"># character bitmaps per character in the same order as the MAP string.</span>
|
||||
<span class="c1"># Note: character data may not start on byte boundaries</span>
|
||||
<span class="n">_BITMAPS</span> <span class="o">=</span>\
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x61</span><span class="s1">'</span>\
|
||||
|
||||
<span class="o">...</span> <span class="n">many</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
|
||||
<span class="sa">b</span><span class="s1">'</span><span class="se">\x3d\xe3\xfc\x00\x00\x00\x00\x00</span><span class="s1">'</span>
|
||||
|
||||
<span class="n">WIDTHS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_WIDTHS</span><span class="p">)</span>
|
||||
<span class="n">OFFSETS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_OFFSETS</span><span class="p">)</span>
|
||||
<span class="n">BITMAPS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_BITMAPS</span><span class="p">)</span>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="c1"># -*- coding: utf-8 -*-</span>
|
||||
<span class="linenos"> 2</span><span class="c1"># Converted from Chango-Regular.ttf using:</span>
|
||||
<span class="linenos"> 3</span><span class="c1"># ./font2bitmap.py Chango-Regular.ttf 16 -c 0x20-0x7f</span>
|
||||
<span class="linenos"> 4</span>
|
||||
<span class="linenos"> 5</span><span class="c1"># Maps the order of the character data</span>
|
||||
<span class="linenos"> 6</span><span class="n">MAP</span> <span class="o">=</span> <span class="s2">" !</span><span class="se">\"</span><span class="s2">#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[</span><span class="se">\\</span><span class="s2">]^_`abcdefghijklmnopqrstuvwxyz{|}~"</span>
|
||||
<span class="linenos"> 7</span>
|
||||
<span class="linenos"> 8</span><span class="c1"># Number of color bits per pixel, currently only 1 is used but could be</span>
|
||||
<span class="linenos"> 9</span><span class="c1"># increased to support antialiased or smoothed fonts in the future.</span>
|
||||
<span class="linenos">10</span><span class="n">BPP</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
<span class="linenos">11</span>
|
||||
<span class="linenos">12</span><span class="c1"># Font height</span>
|
||||
<span class="linenos">13</span><span class="n">HEIGHT</span> <span class="o">=</span> <span class="mi">17</span>
|
||||
<span class="linenos">14</span>
|
||||
<span class="linenos">15</span><span class="c1"># Font max width</span>
|
||||
<span class="linenos">16</span><span class="n">MAX_WIDTH</span> <span class="o">=</span> <span class="mi">24</span>
|
||||
<span class="linenos">17</span>
|
||||
<span class="linenos">18</span><span class="c1"># one byte per character table of widths in the same order as the MAP string</span>
|
||||
<span class="linenos">19</span><span class="n">_WIDTHS</span> <span class="o">=</span> \
|
||||
<span class="linenos">20</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x06\x08\x0a\x0e\x0d\x18\x10\x06\x08\x08\x0a\x0d\x06\x08\x06\x0b</span><span class="s1">'</span>\
|
||||
<span class="linenos">21</span>
|
||||
<span class="linenos">22</span> <span class="o">...</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
<span class="linenos">23</span>
|
||||
<span class="linenos">24</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x0d\x0d\x0b\x0a\x0b\x0e\x0c\x12\x0d\x0c\x0b\x09\x06\x09\x0e\x0b</span><span class="s1">'</span>
|
||||
<span class="linenos">25</span>
|
||||
<span class="linenos">26</span><span class="c1"># OFFSET_WIDTH bytes per character in the same order as the MAP string</span>
|
||||
<span class="linenos">27</span><span class="c1"># to the start of each character in bits.</span>
|
||||
<span class="linenos">28</span><span class="n">OFFSET_WIDTH</span> <span class="o">=</span> <span class="mi">2</span>
|
||||
<span class="linenos">29</span><span class="n">_OFFSETS</span> <span class="o">=</span> \
|
||||
<span class="linenos">30</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x66\x00\xee\x01\x98\x02\x86\x03\x63\x04\xfb\x06\x0b</span><span class="s1">'</span>\
|
||||
<span class="linenos">31</span>
|
||||
<span class="linenos">32</span> <span class="o">...</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
<span class="linenos">33</span>
|
||||
<span class="linenos">34</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x49\x94\x4a\x71\x4b\x3d\x4b\xf8\x4c\x91\x4c\xf7\x4d\x90\x4e\x7e</span><span class="s1">'</span>
|
||||
<span class="linenos">35</span>
|
||||
<span class="linenos">36</span><span class="c1"># character bitmaps per character in the same order as the MAP string.</span>
|
||||
<span class="linenos">37</span><span class="c1"># Note: character data may not start on byte boundaries</span>
|
||||
<span class="linenos">38</span><span class="n">_BITMAPS</span> <span class="o">=</span>\
|
||||
<span class="linenos">39</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x61</span><span class="s1">'</span>\
|
||||
<span class="linenos">40</span>
|
||||
<span class="linenos">41</span> <span class="o">...</span> <span class="n">many</span> <span class="n">more</span> <span class="n">lines</span> <span class="n">of</span> <span class="n">data</span><span class="o">...</span>
|
||||
<span class="linenos">42</span>
|
||||
<span class="linenos">43</span> <span class="sa">b</span><span class="s1">'</span><span class="se">\x3d\xe3\xfc\x00\x00\x00\x00\x00</span><span class="s1">'</span>
|
||||
<span class="linenos">44</span>
|
||||
<span class="linenos">45</span><span class="n">WIDTHS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_WIDTHS</span><span class="p">)</span>
|
||||
<span class="linenos">46</span><span class="n">OFFSETS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_OFFSETS</span><span class="p">)</span>
|
||||
<span class="linenos">47</span><span class="n">BITMAPS</span> <span class="o">=</span> <span class="nb">memoryview</span><span class="p">(</span><span class="n">_BITMAPS</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</td></tr></table></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="x8-fonts">
|
||||
<h2>8x8 Fonts<a class="headerlink" href="#x8-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
</div>
|
||||
<div class="section" id="x8-rom-fonts">
|
||||
<h2>8x8 Rom Fonts<a class="headerlink" href="#x8-rom-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="figure align-center" id="id4">
|
||||
<img alt="_images/vga1_8x8.png" src="_images/vga1_8x8.png" />
|
||||
<p class="caption"><span class="caption-text">vga1_8x8.py: 128 Character 8x8 Font</span><a class="headerlink" href="#id4" title="Permalink to this image">¶</a></p>
|
||||
|
@ -378,8 +309,8 @@ the negative glyph.left fix from peterhinch’s font conversion program
|
|||
<div class="line"><br /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="x16-fonts">
|
||||
<h2>8x16 Fonts<a class="headerlink" href="#x16-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="x16-rom-fonts">
|
||||
<h2>8x16 Rom Fonts<a class="headerlink" href="#x16-rom-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="figure align-center" id="id6">
|
||||
<img alt="_images/vga1_8x16.png" src="_images/vga1_8x16.png" />
|
||||
<p class="caption"><span class="caption-text">vga1_8x16.py: 128 Character 8x16 Font</span><a class="headerlink" href="#id6" title="Permalink to this image">¶</a></p>
|
||||
|
@ -396,7 +327,7 @@ the negative glyph.left fix from peterhinch’s font conversion program
|
|||
</div>
|
||||
</div>
|
||||
<div class="section" id="id1">
|
||||
<h2>16x16 Fonts<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
|
||||
<h2>16x16 Rom Fonts<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="figure align-center" id="id8">
|
||||
<img alt="_images/vga1_16x16.png" src="_images/vga1_16x16.png" />
|
||||
<p class="caption"><span class="caption-text">vga1_16x16.py: 128 Character 16x16 Thin Font</span><a class="headerlink" href="#id8" title="Permalink to this image">¶</a></p>
|
||||
|
@ -426,8 +357,8 @@ the negative glyph.left fix from peterhinch’s font conversion program
|
|||
<div class="line"><br /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="x32-fonts">
|
||||
<h2>16x32 Fonts<a class="headerlink" href="#x32-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="x32-rom-fonts">
|
||||
<h2>16x32 Rom Fonts<a class="headerlink" href="#x32-rom-fonts" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="figure align-center" id="id12">
|
||||
<img alt="_images/vga1_16x32.png" src="_images/vga1_16x32.png" />
|
||||
<p class="caption"><span class="caption-text">vga1_16x32.py: 128 Character 16x32 Thin Font</span><a class="headerlink" href="#id12" title="Permalink to this image">¶</a></p>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -82,7 +85,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="index.html">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -99,10 +102,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -83,7 +86,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -100,10 +103,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -181,7 +184,7 @@
|
|||
bit wide bitmap fonts with heights that are multiples of 8. Included are 12
|
||||
bitmap fonts derived from classic pc text mode fonts.</p>
|
||||
<div class="toctree-wrapper compound">
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -198,10 +201,10 @@ bitmap fonts derived from classic pc text mode fonts.</p>
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
BIN
docs/objects.inv
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -89,7 +92,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="index.html">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -106,10 +109,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -30,6 +32,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -85,7 +88,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="index.html">st7789py Driver</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="st7789py.html">st7789py Reference</a></li>
|
||||
|
@ -102,10 +105,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +31,7 @@
|
|||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
|
@ -84,7 +87,7 @@
|
|||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||||
<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></li>
|
||||
|
@ -101,10 +104,10 @@
|
|||
<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#rom-font-conversion">Rom Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#true-type-font-conversion">True-Type Font Conversion</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-fonts">8x8 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-fonts">8x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-fonts">16x32 Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x8-rom-fonts">8x8 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x16-rom-fonts">8x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#id1">16x16 Rom Fonts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="fonts.html#x32-rom-fonts">16x32 Rom Fonts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -210,23 +213,23 @@ BIOS text mode fonts.</p></li>
|
|||
<li><p>Drawing converted bitmaps</p></li>
|
||||
</ul>
|
||||
<dl class="py function">
|
||||
<dt id="st7789py.color565">
|
||||
<code class="sig-prename descclassname"><span class="pre">st7789py.</span></code><code class="sig-name descname"><span class="pre">color565</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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 id="st7789py.ST7789">
|
||||
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">st7789py.</span></code><code class="sig-name descname"><span class="pre">ST7789</span></code><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></em>, <em class="sig-param"><span class="n"><span class="pre">dc</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><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="Permalink to this definition">¶</a></dt>
|
||||
<dt class="sig sig-object py" id="st7789py.ST7789">
|
||||
<em class="property"><span class="pre">class</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><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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>ST7789 driver class</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>spi</strong> (<em>spi</em>) – spi object</p></li>
|
||||
<li><p><strong>width</strong> (<em>int</em>) – display width</p></li>
|
||||
<li><p><strong>height</strong> (<em>int</em>) – display height</p></li>
|
||||
<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</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>) – display rotation
|
||||
|
@ -238,20 +241,20 @@ BIOS text mode fonts.</p></li>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.hard_reset">
|
||||
<code class="sig-name descname"><span class="pre">hard_reset</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Hard reset display.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.soft_reset">
|
||||
<code class="sig-name descname"><span class="pre">soft_reset</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Soft reset display.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.sleep_mode">
|
||||
<code class="sig-name descname"><span class="pre">sleep_mode</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Enable or disable display sleep mode.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
|
@ -264,8 +267,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.inversion_mode">
|
||||
<code class="sig-name descname"><span class="pre">inversion_mode</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Enable or disable display inversion mode.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
|
@ -278,8 +281,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.rotation">
|
||||
<code class="sig-name descname"><span class="pre">rotation</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set display rotation.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
|
@ -295,8 +298,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.vline">
|
||||
<code class="sig-name descname"><span class="pre">vline</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -311,8 +314,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.hline">
|
||||
<code class="sig-name descname"><span class="pre">hline</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -327,8 +330,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.pixel">
|
||||
<code class="sig-name descname"><span class="pre">pixel</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -342,8 +345,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.blit_buffer">
|
||||
<code class="sig-name descname"><span class="pre">blit_buffer</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -359,8 +362,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.rect">
|
||||
<code class="sig-name descname"><span class="pre">rect</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -376,8 +379,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.fill_rect">
|
||||
<code class="sig-name descname"><span class="pre">fill_rect</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -393,8 +396,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.fill">
|
||||
<code class="sig-name descname"><span class="pre">fill</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -404,8 +407,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.line">
|
||||
<code class="sig-name descname"><span class="pre">line</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -421,8 +424,8 @@ BIOS text mode fonts.</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.vscrdef">
|
||||
<code class="sig-name descname"><span class="pre">vscrdef</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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
|
||||
|
@ -441,8 +444,8 @@ changing the TFA, VSA and BFA values.</p>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.vscsad">
|
||||
<code class="sig-name descname"><span class="pre">vscsad</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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>
|
||||
|
@ -460,8 +463,8 @@ utime.sleep(0.01)</p>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.text">
|
||||
<code class="sig-name descname"><span class="pre">text</span></code><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">micropython.const</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">micropython.const</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="Permalink to this definition">¶</a></dt>
|
||||
<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">micropython.const</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">micropython.const</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="Permalink 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">
|
||||
|
@ -479,8 +482,8 @@ fonts are supported.</p>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.bitmap">
|
||||
<code class="sig-name descname"><span class="pre">bitmap</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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</dt>
|
||||
|
@ -496,8 +499,8 @@ module</p></li>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.write">
|
||||
<code class="sig-name descname"><span class="pre">write</span></code><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">micropython.const</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">micropython.const</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="Permalink to this definition">¶</a></dt>
|
||||
<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">micropython.const</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">micropython.const</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="Permalink 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">
|
||||
|
@ -515,8 +518,8 @@ at the specified column and row</p>
|
|||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="st7789py.ST7789.write_width">
|
||||
<code class="sig-name descname"><span class="pre">write_width</span></code><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="Permalink to this definition">¶</a></dt>
|
||||
<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="Permalink 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">
|
||||
|
|
|
@ -164,11 +164,11 @@ class ST7789():
|
|||
ST7789 driver class
|
||||
|
||||
Args:
|
||||
spi (spi): spi object
|
||||
width (int): display width
|
||||
height (int): display height
|
||||
spi (spi): spi object **Required**
|
||||
width (int): display width **Required**
|
||||
height (int): display height **Required**
|
||||
reset (pin): reset pin
|
||||
dc (pin): dc pin
|
||||
dc (pin): dc pin **Required**
|
||||
cs (pin): cs pin
|
||||
backlight(pin): backlight pin
|
||||
rotation (int): display rotation
|
||||
|
@ -177,7 +177,7 @@ class ST7789():
|
|||
- 2-Inverted Portrait
|
||||
- 3-Inverted Landscape
|
||||
"""
|
||||
def __init__(self, spi, width, height, reset, dc,
|
||||
def __init__(self, spi, width, height, reset=None, dc=None,
|
||||
cs=None, backlight=None, rotation=0):
|
||||
"""
|
||||
Initialize display.
|
||||
|
@ -187,6 +187,9 @@ class ST7789():
|
|||
"Unsupported display. 320x240, 240x240 and 135x240 are supported."
|
||||
)
|
||||
|
||||
if dc is None:
|
||||
raise ValueError("dc pin is required.")
|
||||
|
||||
self._display_width = self.width = width
|
||||
self._display_height = self.height = height
|
||||
self.xstart = 0
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
SOURCEDIR = source
|
||||
BUILDDIR = build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
update:
|
||||
# Update documentation on my webserver using rsync over ssh
|
||||
# /usr/bin/rsync --progress --delete -e 'ssh -i ~/.ssh/id_rsa' -avz build/html/ penfold.owt.com:/htdocs/st7789py/
|
||||
# update docs directory of this repo using rsync
|
||||
/usr/bin/rsync --progress --delete -avz build/html/ ../docs/
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# additional sphinx plug-ins, install using pip3
|
||||
sphinx-prompt
|
||||
sphinxcontrib.napoleon
|
||||
sphinxcontrib.napoleon
|
||||
sphinxcontrib.globalsubs
|
||||
sphinx_rtd_theme
|
Po Szerokość: | Wysokość: | Rozmiar: 1.0 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 1.1 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 717 B |
Po Szerokość: | Wysokość: | Rozmiar: 565 B |
Po Szerokość: | Wysokość: | Rozmiar: 1.1 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 1.2 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 2.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 2.6 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 1.6 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 1.3 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 2.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 2.6 KiB |
|
@ -0,0 +1,219 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file does only contain a selection of the most common options. For a
|
||||
# full list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../../examples'))
|
||||
sys.path.insert(0, os.path.abspath('../../lib'))
|
||||
|
||||
autodoc_mock_imports = [
|
||||
'micropython',
|
||||
'ustruct',
|
||||
'machine',
|
||||
'board',
|
||||
'network',
|
||||
'esp',
|
||||
'uos',
|
||||
'btree',
|
||||
]
|
||||
autodoc_member_order = 'bysource'
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = u'st7789py'
|
||||
copyright = u'2020, Russ Hughes'
|
||||
author = u'Russ Hughes'
|
||||
|
||||
# The short X.Y version
|
||||
version = u''
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = u'0.1.0'
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinxcontrib.napoleon',
|
||||
'sphinxcontrib.globalsubs',
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'sphinx-prompt',
|
||||
'sphinx_rtd_theme',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.githubpages',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = []
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = None
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
#html_theme = 'alabaster']
|
||||
html_show_copyright = False
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_options = {
|
||||
'canonical_url': '',
|
||||
'logo_only': False,
|
||||
'display_version': True,
|
||||
'prev_next_buttons_location': 'bottom',
|
||||
'style_external_links': True,
|
||||
'style_nav_header_background': '#2980B9',
|
||||
# Toc options
|
||||
'collapse_navigation': False,
|
||||
'sticky_navigation': True,
|
||||
'navigation_depth': 4,
|
||||
'includehidden': True,
|
||||
'titles_only': False
|
||||
}
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
#
|
||||
# The default sidebars (for documents that don't match any pattern) are
|
||||
# defined by theme itself. Builtin themes are using these templates by
|
||||
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
|
||||
# 'searchbox.html']``.
|
||||
#
|
||||
# html_sidebars = {}
|
||||
|
||||
|
||||
# -- Options for HTMLHelp output ---------------------------------------------
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'st7789pydoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'st7789py.tex', u'st7789py Documentation',
|
||||
u'Russ Hughes', 'manual'),
|
||||
]
|
||||
|
||||
|
||||
# -- Options for manual page output ------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'st7789py', u'st7789py Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
|
||||
# -- Options for Texinfo output ----------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'st7789py', u'st7789py Documentation',
|
||||
author, 'st7789py', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
|
||||
# -- Options for Epub output -------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = project
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#
|
||||
# epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#
|
||||
# epub_uid = ''
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
epub_exclude_files = ['search.html']
|
||||
|
||||
|
||||
# -- Extension configuration -------------------------------------------------
|
||||
|
||||
# -- Options for todo extension ----------------------------------------------
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
|
@ -0,0 +1,72 @@
|
|||
Example Programs
|
||||
================
|
||||
|
||||
These examples run on the LilyGo TTGO-T-Display available from the usual
|
||||
locations. See https://github.com/Xinyuan-LilyGO/TTGO-T-Display for more
|
||||
information.
|
||||
|
||||
|
||||
ttgo_lines.py
|
||||
-------------
|
||||
|
||||
.. literalinclude:: ../../examples/ttgo_lines.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
ttgo_hello.py
|
||||
-------------
|
||||
|
||||
.. literalinclude:: ../../examples/ttgo_hello.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
ttgo_fonts.py
|
||||
-------------
|
||||
|
||||
.. literalinclude:: ../../examples/ttgo_fonts.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
ttgo_scroll.py
|
||||
--------------
|
||||
|
||||
.. literalinclude:: ../../examples/ttgo_scroll.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
toasters.py
|
||||
-----------
|
||||
|
||||
Flying toasters sprite demo using bitmaps created from spritesheet using
|
||||
ImageMagick's convert and imgtobitmap.py utility. See the maketoast script in the utils directory for details.
|
||||
|
||||
.. literalinclude:: ../../examples/toasters/toasters.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
chango.py
|
||||
---------
|
||||
|
||||
Test for font2bitmap converter for the driver.
|
||||
See the font2bitmap program in the utils directory.
|
||||
|
||||
.. literalinclude:: ../../examples/truetype/chango.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
||||
|
||||
noto_fonts.py
|
||||
-------------
|
||||
|
||||
Test for font2bitmap converter for the driver.
|
||||
See the font2bitmap program in the utils directory.
|
||||
|
||||
.. literalinclude:: ../../examples/truetype/noto_fonts.py
|
||||
:linenos:
|
||||
:language: python
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
Fonts
|
||||
=====
|
||||
|
||||
Two type of fonts are supported by this driver fixed size bitmap fonts
|
||||
converted from PC Bios images using the font_from_romfont utility and fixed or proportional fonts converted from True-Type fonts using the font2bitmap utility.
|
||||
|
||||
The rom fonts are available in 128 and 256 PC character sets in 8x8, 8x16, 16x6 and 16x32 pixel sizes. They written using the text method.
|
||||
|
||||
The True-Type fonts can be converted to any size as long as the widest
|
||||
character is 256 pixels or less. They are written using the write method.
|
||||
|
||||
Pre-compiling the font files to .mpy files will significantly reduce the memory required for the fonts.
|
||||
|
||||
Rom Font Conversion
|
||||
-------------------
|
||||
|
||||
The `utils` directory contains the font_from_romfont.py program used to convert PC BIOS bitmap fonts from the font-bin directory of spacerace's
|
||||
https://github.com/spacerace/romfont repo.
|
||||
|
||||
The utility converts all romfont bin files in the specified -input-directory (-i) and writes python font files to the specified -output-directory (-o).
|
||||
|
||||
Characters included can be limited by using the -first-char (-f) and -last-char (-l) options.
|
||||
|
||||
Example:
|
||||
|
||||
font_from_romfont -i font-bin -o fonts -f 32 -l 127
|
||||
|
||||
|
||||
.. literalinclude:: romfont.py
|
||||
:linenos:
|
||||
:language: python
|
||||
:caption: Sample converted romfont font module.
|
||||
|
||||
|
||||
True-Type Font Conversion
|
||||
-------------------------
|
||||
|
||||
The `utils` directory contains the `font2bitmap.py` program used to convert True-Type font into bitmap font modules. Use the -h option to see details of the available options. The `font2bitmap.py` program uses font handling classes from Dan Bader blog post on using freetype
|
||||
http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python and
|
||||
the negative glyph.left fix from peterhinch's font conversion program
|
||||
https://github.com/peterhinch/micropython-font-to-py.
|
||||
|
||||
The utility requires the python freetype module.
|
||||
|
||||
Example use:
|
||||
|
||||
- ./font2bitmap NotoSans-Regular.ttf 32 -s "0123456789ABCEDF"
|
||||
- ./font2bitmap.py Chango-Regular.ttf 16 -c 0x20-0x7f
|
||||
|
||||
|
||||
.. literalinclude:: truetype.py
|
||||
:linenos:
|
||||
:language: python
|
||||
:caption: Sample converted TrueType font module.
|
||||
|
||||
|
||||
|
||||
8x8 Rom Fonts
|
||||
-------------
|
||||
|
||||
.. figure:: _static/vga1_8x8.png
|
||||
:align: center
|
||||
|
||||
vga1_8x8.py: 128 Character 8x8 Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_8x8.png
|
||||
:align: center
|
||||
|
||||
vga2_8x8.py: 256 Character 8x8 Font
|
||||
|
||||
|
|
||||
|
||||
8x16 Rom Fonts
|
||||
--------------
|
||||
|
||||
.. figure:: _static/vga1_8x16.png
|
||||
:align: center
|
||||
|
||||
vga1_8x16.py: 128 Character 8x16 Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_8x16.png
|
||||
:align: center
|
||||
|
||||
vga2_8x16.py: 256 Character 8x16 Font
|
||||
|
||||
|
|
||||
|
||||
16x16 Rom Fonts
|
||||
---------------
|
||||
|
||||
.. figure:: _static/vga1_16x16.png
|
||||
:align: center
|
||||
|
||||
vga1_16x16.py: 128 Character 16x16 Thin Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga1_bold_16x16.png
|
||||
:align: center
|
||||
|
||||
vga1_bold_16x16.py: 128 Character 16x16 Bold Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_16x16.png
|
||||
:align: center
|
||||
|
||||
vga2_16x16.py: 256 Character 16x16 Thin Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_bold_16x16.png
|
||||
:align: center
|
||||
|
||||
vga2_bold_16x16.py: 256 Character 16x16 Bold Font
|
||||
|
||||
|
|
||||
|
||||
16x32 Rom Fonts
|
||||
---------------
|
||||
|
||||
.. figure:: _static/vga1_16x32.png
|
||||
:align: center
|
||||
|
||||
vga1_16x32.py: 128 Character 16x32 Thin Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga1_bold_16x32.png
|
||||
:align: center
|
||||
|
||||
vga1_bold_16x32.py: 128 Character 16x32 Bold Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_16x32.png
|
||||
:align: center
|
||||
|
||||
vga2_16x32.py: 256 Character 16x32 Thin Font
|
||||
|
||||
|
|
||||
|
||||
.. figure:: _static/vga2_bold_16x32.png
|
||||
:align: center
|
||||
|
||||
vga2_bold_16x32.py: 256 Character 16x32 Bold Font
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
st7789py Driver
|
||||
===============
|
||||
|
||||
st7789 tft driver in MicroPython based on devbis' st7789py_mpy module from
|
||||
https://github.com/devbis/st7789py_mpy.
|
||||
|
||||
I added support for display rotation, scrolling and 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 text mode fonts.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
self
|
||||
st7789py
|
||||
examples
|
||||
fonts
|
||||
|
||||
Index
|
||||
=====
|
||||
|
||||
* :ref:`genindex`
|
|
@ -0,0 +1,27 @@
|
|||
"""converted from vga_8x8.bin """
|
||||
|
||||
# font width
|
||||
WIDTH = 8
|
||||
|
||||
# font height
|
||||
HEIGHT = 8
|
||||
|
||||
# first character in front
|
||||
FIRST = 0x20
|
||||
|
||||
# last character in font
|
||||
LAST = 0x7f
|
||||
|
||||
# bitmap of each character from FIRST to LAST
|
||||
_FONT =\
|
||||
b'\x00\x00\x00\x00\x00\x00\x00\x00'\
|
||||
b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\
|
||||
b'\x66\x66\x24\x00\x00\x00\x00\x00'\
|
||||
|
||||
... many more lines of data...
|
||||
|
||||
b'\x70\x18\x18\x0e\x18\x18\x70\x00'\
|
||||
b'\x76\xdc\x00\x00\x00\x00\x00\x00'\
|
||||
b'\x00\x10\x38\x6c\xc6\xc6\xfe\x00'\
|
||||
|
||||
FONT = memoryview(_FONT)
|
|
@ -0,0 +1,5 @@
|
|||
st7789py Reference
|
||||
==================
|
||||
|
||||
.. automodule:: st7789py
|
||||
:members:
|
|
@ -0,0 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Converted from Chango-Regular.ttf using:
|
||||
# ./font2bitmap.py Chango-Regular.ttf 16 -c 0x20-0x7f
|
||||
|
||||
# Maps the order of the character data
|
||||
MAP = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
||||
|
||||
# Number of color bits per pixel, currently only 1 is used but could be
|
||||
# increased to support antialiased or smoothed fonts in the future.
|
||||
BPP = 1
|
||||
|
||||
# Font height
|
||||
HEIGHT = 17
|
||||
|
||||
# Font max width
|
||||
MAX_WIDTH = 24
|
||||
|
||||
# one byte per character table of widths in the same order as the MAP string
|
||||
_WIDTHS = \
|
||||
b'\x06\x08\x0a\x0e\x0d\x18\x10\x06\x08\x08\x0a\x0d\x06\x08\x06\x0b'\
|
||||
|
||||
... more lines of data...
|
||||
|
||||
b'\x0d\x0d\x0b\x0a\x0b\x0e\x0c\x12\x0d\x0c\x0b\x09\x06\x09\x0e\x0b'
|
||||
|
||||
# OFFSET_WIDTH bytes per character in the same order as the MAP string
|
||||
# to the start of each character in bits.
|
||||
OFFSET_WIDTH = 2
|
||||
_OFFSETS = \
|
||||
b'\x00\x00\x00\x66\x00\xee\x01\x98\x02\x86\x03\x63\x04\xfb\x06\x0b'\
|
||||
|
||||
... more lines of data...
|
||||
|
||||
b'\x49\x94\x4a\x71\x4b\x3d\x4b\xf8\x4c\x91\x4c\xf7\x4d\x90\x4e\x7e'
|
||||
|
||||
# character bitmaps per character in the same order as the MAP string.
|
||||
# Note: character data may not start on byte boundaries
|
||||
_BITMAPS =\
|
||||
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x61'\
|
||||
|
||||
... many more lines of data...
|
||||
|
||||
b'\x3d\xe3\xfc\x00\x00\x00\x00\x00'
|
||||
|
||||
WIDTHS = memoryview(_WIDTHS)
|
||||
OFFSETS = memoryview(_OFFSETS)
|
||||
BITMAPS = memoryview(_BITMAPS)
|