├── .gitattributes ├── .github ├── PULL_REQUEST_TEMPLATE │ └── adafruit_circuitpython_pr.md └── workflows │ ├── build.yml │ ├── failure-help-text.yml │ ├── release_gh.yml │ └── release_pypi.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── LICENSES ├── CC-BY-4.0.txt ├── MIT.txt └── Unlicense.txt ├── README.rst ├── README.rst.license ├── adafruit_st7789.py ├── docs ├── _static │ ├── favicon.ico │ └── favicon.ico.license ├── api.rst ├── api.rst.license ├── conf.py ├── examples.rst ├── examples.rst.license ├── index.rst ├── index.rst.license └── requirements.txt ├── examples ├── st7789_170x320_1.9_simpletest.py ├── st7789_172x320_1.47_simpletest.py ├── st7789_240x135_pitft_simpletest.py ├── st7789_240x135_simpletest.py ├── st7789_240x135_simpletest_Pimoroni_Pico_Display_Pack.py ├── st7789_240x240_bonnet_simpletest.py ├── st7789_240x240_pitft_simpletest.py ├── st7789_240x240_simpletest_Pimoroni_Pico_Explorer.py ├── st7789_240x240_simpletest_Waveshare_PicoLCD_1_3.py ├── st7789_280x240_simpletest.py ├── st7789_320x240_simpletest.py ├── st7789_320x240_simpletest_Pimoroni_Pico_Display_2_0.py ├── st7789_simpletest.py └── st7789_tft_gizmo_simpletest.py ├── optional_requirements.txt ├── pyproject.toml ├── requirements.txt └── ruff.toml /.gitattributes: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | 5 | .py text eol=lf 6 | .rst text eol=lf 7 | .txt text eol=lf 8 | .yaml text eol=lf 9 | .toml text eol=lf 10 | .license text eol=lf 11 | .md text eol=lf 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | Thank you for contributing! Before you submit a pull request, please read the following. 6 | 7 | Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html 8 | 9 | If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs 10 | 11 | Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code 12 | 13 | Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. 14 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: Build CI 6 | 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Run Build CI workflow 14 | uses: adafruit/workflows-circuitpython-libs/build@main 15 | -------------------------------------------------------------------------------- /.github/workflows/failure-help-text.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: Failure help text 6 | 7 | on: 8 | workflow_run: 9 | workflows: ["Build CI"] 10 | types: 11 | - completed 12 | 13 | jobs: 14 | post-help: 15 | runs-on: ubuntu-latest 16 | if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} 17 | steps: 18 | - name: Post comment to help 19 | uses: adafruit/circuitpython-action-library-ci-failed@v1 20 | -------------------------------------------------------------------------------- /.github/workflows/release_gh.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: GitHub Release Actions 6 | 7 | on: 8 | release: 9 | types: [published] 10 | 11 | jobs: 12 | upload-release-assets: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Run GitHub Release CI workflow 16 | uses: adafruit/workflows-circuitpython-libs/release-gh@main 17 | with: 18 | github-token: ${{ secrets.GITHUB_TOKEN }} 19 | upload-url: ${{ github.event.release.upload_url }} 20 | -------------------------------------------------------------------------------- /.github/workflows/release_pypi.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: PyPI Release Actions 6 | 7 | on: 8 | release: 9 | types: [published] 10 | 11 | jobs: 12 | upload-release-assets: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Run PyPI Release CI workflow 16 | uses: adafruit/workflows-circuitpython-libs/release-pypi@main 17 | with: 18 | pypi-username: ${{ secrets.pypi_username }} 19 | pypi-password: ${{ secrets.pypi_password }} 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | # Do not include files and directories created by your personal work environment, such as the IDE 6 | # you use, except for those already listed here. Pull requests including changes to this file will 7 | # not be accepted. 8 | 9 | # This .gitignore file contains rules for files generated by working with CircuitPython libraries, 10 | # including building Sphinx, testing with pip, and creating a virual environment, as well as the 11 | # MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. 12 | 13 | # If you find that there are files being generated on your machine that should not be included in 14 | # your git commit, you should create a .gitignore_global file on your computer to include the 15 | # files created by your personal setup. To do so, follow the two steps below. 16 | 17 | # First, create a file called .gitignore_global somewhere convenient for you, and add rules for 18 | # the files you want to exclude from git commits. 19 | 20 | # Second, configure Git to use the exclude file for all Git repositories by running the 21 | # following via commandline, replacing "path/to/your/" with the actual path to your newly created 22 | # .gitignore_global file: 23 | # git config --global core.excludesfile path/to/your/.gitignore_global 24 | 25 | # CircuitPython-specific files 26 | *.mpy 27 | 28 | # Python-specific files 29 | __pycache__ 30 | *.pyc 31 | 32 | # Sphinx build-specific files 33 | _build 34 | 35 | # This file results from running `pip -e install .` in a local repository 36 | *.egg-info 37 | 38 | # Virtual environment-specific files 39 | .env 40 | .venv 41 | 42 | # MacOS-specific files 43 | *.DS_Store 44 | 45 | # IDE-specific files 46 | .idea 47 | .vscode 48 | *~ 49 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | 5 | repos: 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v4.5.0 8 | hooks: 9 | - id: check-yaml 10 | - id: end-of-file-fixer 11 | - id: trailing-whitespace 12 | - repo: https://github.com/astral-sh/ruff-pre-commit 13 | rev: v0.3.4 14 | hooks: 15 | - id: ruff-format 16 | - id: ruff 17 | args: ["--fix"] 18 | - repo: https://github.com/fsfe/reuse-tool 19 | rev: v3.0.1 20 | hooks: 21 | - id: reuse 22 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | 5 | # Read the Docs configuration file 6 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 7 | 8 | # Required 9 | version: 2 10 | 11 | sphinx: 12 | configuration: docs/conf.py 13 | 14 | build: 15 | os: ubuntu-20.04 16 | tools: 17 | python: "3" 18 | 19 | python: 20 | install: 21 | - requirements: docs/requirements.txt 22 | - requirements: requirements.txt 23 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Adafruit Community Code of Conduct 8 | 9 | ## Our Pledge 10 | 11 | In the interest of fostering an open and welcoming environment, we as 12 | contributors and leaders pledge to making participation in our project and 13 | our community a harassment-free experience for everyone, regardless of age, body 14 | size, disability, ethnicity, gender identity and expression, level or type of 15 | experience, education, socio-economic status, nationality, personal appearance, 16 | race, religion, or sexual identity and orientation. 17 | 18 | ## Our Standards 19 | 20 | We are committed to providing a friendly, safe and welcoming environment for 21 | all. 22 | 23 | Examples of behavior that contributes to creating a positive environment 24 | include: 25 | 26 | * Be kind and courteous to others 27 | * Using welcoming and inclusive language 28 | * Being respectful of differing viewpoints and experiences 29 | * Collaborating with other community members 30 | * Gracefully accepting constructive criticism 31 | * Focusing on what is best for the community 32 | * Showing empathy towards other community members 33 | 34 | Examples of unacceptable behavior by participants include: 35 | 36 | * The use of sexualized language or imagery and sexual attention or advances 37 | * The use of inappropriate images, including in a community member's avatar 38 | * The use of inappropriate language, including in a community member's nickname 39 | * Any spamming, flaming, baiting or other attention-stealing behavior 40 | * Excessive or unwelcome helping; answering outside the scope of the question 41 | asked 42 | * Trolling, insulting/derogatory comments, and personal or political attacks 43 | * Promoting or spreading disinformation, lies, or conspiracy theories against 44 | a person, group, organisation, project, or community 45 | * Public or private harassment 46 | * Publishing others' private information, such as a physical or electronic 47 | address, without explicit permission 48 | * Other conduct which could reasonably be considered inappropriate 49 | 50 | The goal of the standards and moderation guidelines outlined here is to build 51 | and maintain a respectful community. We ask that you don’t just aim to be 52 | "technically unimpeachable", but rather try to be your best self. 53 | 54 | We value many things beyond technical expertise, including collaboration and 55 | supporting others within our community. Providing a positive experience for 56 | other community members can have a much more significant impact than simply 57 | providing the correct answer. 58 | 59 | ## Our Responsibilities 60 | 61 | Project leaders are responsible for clarifying the standards of acceptable 62 | behavior and are expected to take appropriate and fair corrective action in 63 | response to any instances of unacceptable behavior. 64 | 65 | Project leaders have the right and responsibility to remove, edit, or 66 | reject messages, comments, commits, code, issues, and other contributions 67 | that are not aligned to this Code of Conduct, or to ban temporarily or 68 | permanently any community member for other behaviors that they deem 69 | inappropriate, threatening, offensive, or harmful. 70 | 71 | ## Moderation 72 | 73 | Instances of behaviors that violate the Adafruit Community Code of Conduct 74 | may be reported by any member of the community. Community members are 75 | encouraged to report these situations, including situations they witness 76 | involving other community members. 77 | 78 | You may report in the following ways: 79 | 80 | In any situation, you may send an email to . 81 | 82 | On the Adafruit Discord, you may send an open message from any channel 83 | to all Community Moderators by tagging @community moderators. You may 84 | also send an open message from any channel, or a direct message to 85 | @kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442, 86 | @sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. 87 | 88 | Email and direct message reports will be kept confidential. 89 | 90 | In situations on Discord where the issue is particularly egregious, possibly 91 | illegal, requires immediate action, or violates the Discord terms of service, 92 | you should also report the message directly to Discord. 93 | 94 | These are the steps for upholding our community’s standards of conduct. 95 | 96 | 1. Any member of the community may report any situation that violates the 97 | Adafruit Community Code of Conduct. All reports will be reviewed and 98 | investigated. 99 | 2. If the behavior is an egregious violation, the community member who 100 | committed the violation may be banned immediately, without warning. 101 | 3. Otherwise, moderators will first respond to such behavior with a warning. 102 | 4. Moderators follow a soft "three strikes" policy - the community member may 103 | be given another chance, if they are receptive to the warning and change their 104 | behavior. 105 | 5. If the community member is unreceptive or unreasonable when warned by a 106 | moderator, or the warning goes unheeded, they may be banned for a first or 107 | second offense. Repeated offenses will result in the community member being 108 | banned. 109 | 110 | ## Scope 111 | 112 | This Code of Conduct and the enforcement policies listed above apply to all 113 | Adafruit Community venues. This includes but is not limited to any community 114 | spaces (both public and private), the entire Adafruit Discord server, and 115 | Adafruit GitHub repositories. Examples of Adafruit Community spaces include 116 | but are not limited to meet-ups, audio chats on the Adafruit Discord, or 117 | interaction at a conference. 118 | 119 | This Code of Conduct applies both within project spaces and in public spaces 120 | when an individual is representing the project or its community. As a community 121 | member, you are representing our community, and are expected to behave 122 | accordingly. 123 | 124 | ## Attribution 125 | 126 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 127 | version 1.4, available at 128 | , 129 | and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). 130 | 131 | For other projects adopting the Adafruit Community Code of 132 | Conduct, please contact the maintainers of those projects for enforcement. 133 | If you wish to use this code of conduct for your own project, consider 134 | explicitly mentioning your moderation policy or making a copy with your 135 | own moderation policy so as to avoid confusion. 136 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Melissa LeBlanc-Williams for Adafruit Industries LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSES/CC-BY-4.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution 4.0 International Creative Commons Corporation 2 | ("Creative Commons") is not a law firm and does not provide legal services 3 | or legal advice. Distribution of Creative Commons public licenses does not 4 | create a lawyer-client or other relationship. Creative Commons makes its licenses 5 | and related information available on an "as-is" basis. Creative Commons gives 6 | no warranties regarding its licenses, any material licensed under their terms 7 | and conditions, or any related information. Creative Commons disclaims all 8 | liability for damages resulting from their use to the fullest extent possible. 9 | 10 | Using Creative Commons Public Licenses 11 | 12 | Creative Commons public licenses provide a standard set of terms and conditions 13 | that creators and other rights holders may use to share original works of 14 | authorship and other material subject to copyright and certain other rights 15 | specified in the public license below. The following considerations are for 16 | informational purposes only, are not exhaustive, and do not form part of our 17 | licenses. 18 | 19 | Considerations for licensors: Our public licenses are intended for use by 20 | those authorized to give the public permission to use material in ways otherwise 21 | restricted by copyright and certain other rights. Our licenses are irrevocable. 22 | Licensors should read and understand the terms and conditions of the license 23 | they choose before applying it. Licensors should also secure all rights necessary 24 | before applying our licenses so that the public can reuse the material as 25 | expected. Licensors should clearly mark any material not subject to the license. 26 | This includes other CC-licensed material, or material used under an exception 27 | or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors 28 | 29 | Considerations for the public: By using one of our public licenses, a licensor 30 | grants the public permission to use the licensed material under specified 31 | terms and conditions. If the licensor's permission is not necessary for any 32 | reason–for example, because of any applicable exception or limitation to copyright–then 33 | that use is not regulated by the license. Our licenses grant only permissions 34 | under copyright and certain other rights that a licensor has authority to 35 | grant. Use of the licensed material may still be restricted for other reasons, 36 | including because others have copyright or other rights in the material. A 37 | licensor may make special requests, such as asking that all changes be marked 38 | or described. Although not required by our licenses, you are encouraged to 39 | respect those requests where reasonable. More considerations for the public 40 | : wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution 41 | 4.0 International Public License 42 | 43 | By exercising the Licensed Rights (defined below), You accept and agree to 44 | be bound by the terms and conditions of this Creative Commons Attribution 45 | 4.0 International Public License ("Public License"). To the extent this Public 46 | License may be interpreted as a contract, You are granted the Licensed Rights 47 | in consideration of Your acceptance of these terms and conditions, and the 48 | Licensor grants You such rights in consideration of benefits the Licensor 49 | receives from making the Licensed Material available under these terms and 50 | conditions. 51 | 52 | Section 1 – Definitions. 53 | 54 | a. Adapted Material means material subject to Copyright and Similar Rights 55 | that is derived from or based upon the Licensed Material and in which the 56 | Licensed Material is translated, altered, arranged, transformed, or otherwise 57 | modified in a manner requiring permission under the Copyright and Similar 58 | Rights held by the Licensor. For purposes of this Public License, where the 59 | Licensed Material is a musical work, performance, or sound recording, Adapted 60 | Material is always produced where the Licensed Material is synched in timed 61 | relation with a moving image. 62 | 63 | b. Adapter's License means the license You apply to Your Copyright and Similar 64 | Rights in Your contributions to Adapted Material in accordance with the terms 65 | and conditions of this Public License. 66 | 67 | c. Copyright and Similar Rights means copyright and/or similar rights closely 68 | related to copyright including, without limitation, performance, broadcast, 69 | sound recording, and Sui Generis Database Rights, without regard to how the 70 | rights are labeled or categorized. For purposes of this Public License, the 71 | rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 72 | 73 | d. Effective Technological Measures means those measures that, in the absence 74 | of proper authority, may not be circumvented under laws fulfilling obligations 75 | under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, 76 | and/or similar international agreements. 77 | 78 | e. Exceptions and Limitations means fair use, fair dealing, and/or any other 79 | exception or limitation to Copyright and Similar Rights that applies to Your 80 | use of the Licensed Material. 81 | 82 | f. Licensed Material means the artistic or literary work, database, or other 83 | material to which the Licensor applied this Public License. 84 | 85 | g. Licensed Rights means the rights granted to You subject to the terms and 86 | conditions of this Public License, which are limited to all Copyright and 87 | Similar Rights that apply to Your use of the Licensed Material and that the 88 | Licensor has authority to license. 89 | 90 | h. Licensor means the individual(s) or entity(ies) granting rights under this 91 | Public License. 92 | 93 | i. Share means to provide material to the public by any means or process that 94 | requires permission under the Licensed Rights, such as reproduction, public 95 | display, public performance, distribution, dissemination, communication, or 96 | importation, and to make material available to the public including in ways 97 | that members of the public may access the material from a place and at a time 98 | individually chosen by them. 99 | 100 | j. Sui Generis Database Rights means rights other than copyright resulting 101 | from Directive 96/9/EC of the European Parliament and of the Council of 11 102 | March 1996 on the legal protection of databases, as amended and/or succeeded, 103 | as well as other essentially equivalent rights anywhere in the world. 104 | 105 | k. You means the individual or entity exercising the Licensed Rights under 106 | this Public License. Your has a corresponding meaning. 107 | 108 | Section 2 – Scope. 109 | 110 | a. License grant. 111 | 112 | 1. Subject to the terms and conditions of this Public License, the Licensor 113 | hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, 114 | irrevocable license to exercise the Licensed Rights in the Licensed Material 115 | to: 116 | 117 | A. reproduce and Share the Licensed Material, in whole or in part; and 118 | 119 | B. produce, reproduce, and Share Adapted Material. 120 | 121 | 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions 122 | and Limitations apply to Your use, this Public License does not apply, and 123 | You do not need to comply with its terms and conditions. 124 | 125 | 3. Term. The term of this Public License is specified in Section 6(a). 126 | 127 | 4. Media and formats; technical modifications allowed. The Licensor authorizes 128 | You to exercise the Licensed Rights in all media and formats whether now known 129 | or hereafter created, and to make technical modifications necessary to do 130 | so. The Licensor waives and/or agrees not to assert any right or authority 131 | to forbid You from making technical modifications necessary to exercise the 132 | Licensed Rights, including technical modifications necessary to circumvent 133 | Effective Technological Measures. For purposes of this Public License, simply 134 | making modifications authorized by this Section 2(a)(4) never produces Adapted 135 | Material. 136 | 137 | 5. Downstream recipients. 138 | 139 | A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed 140 | Material automatically receives an offer from the Licensor to exercise the 141 | Licensed Rights under the terms and conditions of this Public License. 142 | 143 | B. No downstream restrictions. You may not offer or impose any additional 144 | or different terms or conditions on, or apply any Effective Technological 145 | Measures to, the Licensed Material if doing so restricts exercise of the Licensed 146 | Rights by any recipient of the Licensed Material. 147 | 148 | 6. No endorsement. Nothing in this Public License constitutes or may be construed 149 | as permission to assert or imply that You are, or that Your use of the Licensed 150 | Material is, connected with, or sponsored, endorsed, or granted official status 151 | by, the Licensor or others designated to receive attribution as provided in 152 | Section 3(a)(1)(A)(i). 153 | 154 | b. Other rights. 155 | 156 | 1. Moral rights, such as the right of integrity, are not licensed under this 157 | Public License, nor are publicity, privacy, and/or other similar personality 158 | rights; however, to the extent possible, the Licensor waives and/or agrees 159 | not to assert any such rights held by the Licensor to the limited extent necessary 160 | to allow You to exercise the Licensed Rights, but not otherwise. 161 | 162 | 2. Patent and trademark rights are not licensed under this Public License. 163 | 164 | 3. To the extent possible, the Licensor waives any right to collect royalties 165 | from You for the exercise of the Licensed Rights, whether directly or through 166 | a collecting society under any voluntary or waivable statutory or compulsory 167 | licensing scheme. In all other cases the Licensor expressly reserves any right 168 | to collect such royalties. 169 | 170 | Section 3 – License Conditions. 171 | 172 | Your exercise of the Licensed Rights is expressly made subject to the following 173 | conditions. 174 | 175 | a. Attribution. 176 | 177 | 1. If You Share the Licensed Material (including in modified form), You must: 178 | 179 | A. retain the following if it is supplied by the Licensor with the Licensed 180 | Material: 181 | 182 | i. identification of the creator(s) of the Licensed Material and any others 183 | designated to receive attribution, in any reasonable manner requested by the 184 | Licensor (including by pseudonym if designated); 185 | 186 | ii. a copyright notice; 187 | 188 | iii. a notice that refers to this Public License; 189 | 190 | iv. a notice that refers to the disclaimer of warranties; 191 | 192 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 193 | 194 | B. indicate if You modified the Licensed Material and retain an indication 195 | of any previous modifications; and 196 | 197 | C. indicate the Licensed Material is licensed under this Public License, and 198 | include the text of, or the URI or hyperlink to, this Public License. 199 | 200 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner 201 | based on the medium, means, and context in which You Share the Licensed Material. 202 | For example, it may be reasonable to satisfy the conditions by providing a 203 | URI or hyperlink to a resource that includes the required information. 204 | 205 | 3. If requested by the Licensor, You must remove any of the information required 206 | by Section 3(a)(1)(A) to the extent reasonably practicable. 207 | 208 | 4. If You Share Adapted Material You produce, the Adapter's License You apply 209 | must not prevent recipients of the Adapted Material from complying with this 210 | Public License. 211 | 212 | Section 4 – Sui Generis Database Rights. 213 | 214 | Where the Licensed Rights include Sui Generis Database Rights that apply to 215 | Your use of the Licensed Material: 216 | 217 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, 218 | reuse, reproduce, and Share all or a substantial portion of the contents of 219 | the database; 220 | 221 | b. if You include all or a substantial portion of the database contents in 222 | a database in which You have Sui Generis Database Rights, then the database 223 | in which You have Sui Generis Database Rights (but not its individual contents) 224 | is Adapted Material; and 225 | 226 | c. You must comply with the conditions in Section 3(a) if You Share all or 227 | a substantial portion of the contents of the database. 228 | 229 | For the avoidance of doubt, this Section 4 supplements and does not replace 230 | Your obligations under this Public License where the Licensed Rights include 231 | other Copyright and Similar Rights. 232 | 233 | Section 5 – Disclaimer of Warranties and Limitation of Liability. 234 | 235 | a. Unless otherwise separately undertaken by the Licensor, to the extent possible, 236 | the Licensor offers the Licensed Material as-is and as-available, and makes 237 | no representations or warranties of any kind concerning the Licensed Material, 238 | whether express, implied, statutory, or other. This includes, without limitation, 239 | warranties of title, merchantability, fitness for a particular purpose, non-infringement, 240 | absence of latent or other defects, accuracy, or the presence or absence of 241 | errors, whether or not known or discoverable. Where disclaimers of warranties 242 | are not allowed in full or in part, this disclaimer may not apply to You. 243 | 244 | b. To the extent possible, in no event will the Licensor be liable to You 245 | on any legal theory (including, without limitation, negligence) or otherwise 246 | for any direct, special, indirect, incidental, consequential, punitive, exemplary, 247 | or other losses, costs, expenses, or damages arising out of this Public License 248 | or use of the Licensed Material, even if the Licensor has been advised of 249 | the possibility of such losses, costs, expenses, or damages. Where a limitation 250 | of liability is not allowed in full or in part, this limitation may not apply 251 | to You. 252 | 253 | c. The disclaimer of warranties and limitation of liability provided above 254 | shall be interpreted in a manner that, to the extent possible, most closely 255 | approximates an absolute disclaimer and waiver of all liability. 256 | 257 | Section 6 – Term and Termination. 258 | 259 | a. This Public License applies for the term of the Copyright and Similar Rights 260 | licensed here. However, if You fail to comply with this Public License, then 261 | Your rights under this Public License terminate automatically. 262 | 263 | b. Where Your right to use the Licensed Material has terminated under Section 264 | 6(a), it reinstates: 265 | 266 | 1. automatically as of the date the violation is cured, provided it is cured 267 | within 30 days of Your discovery of the violation; or 268 | 269 | 2. upon express reinstatement by the Licensor. 270 | 271 | c. For the avoidance of doubt, this Section 6(b) does not affect any right 272 | the Licensor may have to seek remedies for Your violations of this Public 273 | License. 274 | 275 | d. For the avoidance of doubt, the Licensor may also offer the Licensed Material 276 | under separate terms or conditions or stop distributing the Licensed Material 277 | at any time; however, doing so will not terminate this Public License. 278 | 279 | e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 280 | 281 | Section 7 – Other Terms and Conditions. 282 | 283 | a. The Licensor shall not be bound by any additional or different terms or 284 | conditions communicated by You unless expressly agreed. 285 | 286 | b. Any arrangements, understandings, or agreements regarding the Licensed 287 | Material not stated herein are separate from and independent of the terms 288 | and conditions of this Public License. 289 | 290 | Section 8 – Interpretation. 291 | 292 | a. For the avoidance of doubt, this Public License does not, and shall not 293 | be interpreted to, reduce, limit, restrict, or impose conditions on any use 294 | of the Licensed Material that could lawfully be made without permission under 295 | this Public License. 296 | 297 | b. To the extent possible, if any provision of this Public License is deemed 298 | unenforceable, it shall be automatically reformed to the minimum extent necessary 299 | to make it enforceable. If the provision cannot be reformed, it shall be severed 300 | from this Public License without affecting the enforceability of the remaining 301 | terms and conditions. 302 | 303 | c. No term or condition of this Public License will be waived and no failure 304 | to comply consented to unless expressly agreed to by the Licensor. 305 | 306 | d. Nothing in this Public License constitutes or may be interpreted as a limitation 307 | upon, or waiver of, any privileges and immunities that apply to the Licensor 308 | or You, including from the legal processes of any jurisdiction or authority. 309 | 310 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative 311 | Commons may elect to apply one of its public licenses to material it publishes 312 | and in those instances will be considered the "Licensor." The text of the 313 | Creative Commons public licenses is dedicated to the public domain under the 314 | CC0 Public Domain Dedication. Except for the limited purpose of indicating 315 | that material is shared under a Creative Commons public license or as otherwise 316 | permitted by the Creative Commons policies published at creativecommons.org/policies, 317 | Creative Commons does not authorize the use of the trademark "Creative Commons" 318 | or any other trademark or logo of Creative Commons without its prior written 319 | consent including, without limitation, in connection with any unauthorized 320 | modifications to any of its public licenses or any other arrangements, understandings, 321 | or agreements concerning use of licensed material. For the avoidance of doubt, 322 | this paragraph does not form part of the public licenses. 323 | 324 | Creative Commons may be contacted at creativecommons.org. 325 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice (including the next 11 | paragraph) shall be included in all copies or substantial portions of the 12 | Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 17 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 19 | OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /LICENSES/Unlicense.txt: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or distribute 4 | this software, either in source code form or as a compiled binary, for any 5 | purpose, commercial or non-commercial, and by any means. 6 | 7 | In jurisdictions that recognize copyright laws, the author or authors of this 8 | software dedicate any and all copyright interest in the software to the public 9 | domain. We make this dedication for the benefit of the public at large and 10 | to the detriment of our heirs and successors. We intend this dedication to 11 | be an overt act of relinquishment in perpetuity of all present and future 12 | rights to this software under copyright law. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 17 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 19 | THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, 20 | please refer to 21 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | 4 | .. image:: https://readthedocs.org/projects/adafruit-circuitpython-st7789/badge/?version=latest 5 | :target: https://docs.circuitpython.org/projects/st7789/en/latest/ 6 | :alt: Documentation Status 7 | 8 | .. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg 9 | :target: https://adafru.it/discord 10 | :alt: Discord 11 | 12 | .. image:: https://github.com/adafruit/Adafruit_CircuitPython_ST7789/workflows/Build%20CI/badge.svg 13 | :target: https://github.com/adafruit/Adafruit_CircuitPython_ST7789/actions/ 14 | :alt: Build Status 15 | 16 | .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json 17 | :target: https://github.com/astral-sh/ruff 18 | :alt: Code Style: Ruff 19 | 20 | displayio driver for ST7789 TFT-LCD displays. 21 | 22 | Dependencies 23 | ============= 24 | This driver depends on: 25 | 26 | * `Adafruit CircuitPython 4.0.0-beta.0+ `_ 27 | 28 | Please ensure all dependencies are available on the CircuitPython filesystem. 29 | This is easily achieved by downloading 30 | `the Adafruit library and driver bundle `_. 31 | 32 | Usage Example 33 | ============= 34 | 35 | .. code-block:: python 36 | 37 | import board 38 | import displayio 39 | # Starting in CircuitPython 9.x fourwire will be a seperate internal library 40 | # rather than a component of the displayio library 41 | try: 42 | from fourwire import FourWire 43 | except ImportError: 44 | from displayio import FourWire 45 | 46 | from adafruit_st7789 import ST7789 47 | 48 | displayio.release_displays() 49 | 50 | spi = board.SPI() 51 | while not spi.try_lock(): 52 | pass 53 | spi.configure(baudrate=24000000) # Configure SPI for 24MHz 54 | spi.unlock() 55 | tft_cs = board.D5 56 | tft_dc = board.D6 57 | 58 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9) 59 | 60 | display = ST7789(display_bus, width=240, height=240, rowstart=80, bgr=True, invert=True) 61 | 62 | # Make the display context 63 | splash = displayio.Group() 64 | display.root_group = splash 65 | 66 | color_bitmap = displayio.Bitmap(240, 240, 1) 67 | color_palette = displayio.Palette(1) 68 | color_palette[0] = 0xFF0000 69 | 70 | bg_sprite = displayio.TileGrid(color_bitmap, 71 | pixel_shader=color_palette, 72 | x=0, y=0) 73 | splash.append(bg_sprite) 74 | 75 | while True: 76 | pass 77 | 78 | Documentation 79 | ============= 80 | 81 | API documentation for this library can be found on `Read the Docs `_. 82 | 83 | For information on building library documentation, please check out `this guide `_. 84 | 85 | Contributing 86 | ============ 87 | 88 | Contributions are welcome! Please read our `Code of Conduct 89 | `_ 90 | before contributing to help this project stay welcoming. 91 | -------------------------------------------------------------------------------- /README.rst.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries 2 | 3 | SPDX-License-Identifier: MIT 4 | -------------------------------------------------------------------------------- /adafruit_st7789.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019 Melissa LeBlanc-Williams for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | """ 6 | `adafruit_st7789` 7 | ==================================================== 8 | 9 | Displayio driver for ST7789 based displays. 10 | 11 | * Author(s): Melissa LeBlanc-Williams 12 | 13 | Implementation Notes 14 | -------------------- 15 | 16 | **Hardware:** 17 | 18 | * Adafruit 1.3" 240x240 Wide Angle TFT LCD Display with MicroSD - ST7789: 19 | https://www.adafruit.com/product/4313 20 | 21 | * Adafruit 1.54" 240x240 Wide Angle TFT LCD Display with MicroSD - ST7789: 22 | https://www.adafruit.com/product/3787 23 | 24 | * Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789: 25 | https://www.adafruit.com/product/4383 26 | 27 | * Adafruit Mini PiTFT 1.3" - 240x240 TFT Add-on for Raspberry Pi: 28 | https://www.adafruit.com/product/4484 29 | 30 | * Adafruit 1.3" Color TFT Bonnet for Raspberry Pi - 240x240 TFT + Joystick Add-on 31 | https://www.adafruit.com/product/4506 32 | 33 | * Adafruit Mini PiTFT - 135x240 Color TFT Add-on for Raspberry Pi: 34 | https://www.adafruit.com/product/4393 35 | 36 | **Software and Dependencies:** 37 | 38 | * Adafruit CircuitPython firmware for the supported boards: 39 | https://github.com/adafruit/circuitpython/releases 40 | 41 | """ 42 | 43 | from busdisplay import BusDisplay 44 | 45 | try: 46 | from typing import Any 47 | 48 | from fourwire import FourWire 49 | except ImportError: 50 | pass 51 | __version__ = "0.0.0+auto.0" 52 | __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ST7789.git" 53 | 54 | _INIT_SEQUENCE = ( 55 | b"\x01\x80\x96" # _SWRESET and Delay 150ms 56 | b"\x11\x80\xff" # _SLPOUT and Delay 500ms 57 | b"\x3a\x81\x55\x0a" # _COLMOD and Delay 10ms 58 | b"\x36\x01\x08" # _MADCTL 59 | b"\x13\x80\x0a" # _NORON and Delay 10ms 60 | b"\x29\x80\xff" # _DISPON and Delay 500ms 61 | ) 62 | 63 | 64 | # pylint: disable=too-few-public-methods 65 | class ST7789(BusDisplay): 66 | """ 67 | ST7789 driver 68 | 69 | :param FourWire bus: bus that the display is connected to 70 | :param bool bgr: (Optional) An extra init sequence to append (default=True) 71 | :param bool invert: (Optional) Invert the colors (default=True) 72 | """ 73 | 74 | def __init__(self, bus: FourWire, *, bgr: bool = True, invert: bool = True, **kwargs: Any): 75 | init_sequence = _INIT_SEQUENCE 76 | if bgr: 77 | init_sequence += b"\x36\x01\xc0" # _MADCTL Default rotation plus BGR encoding 78 | else: 79 | init_sequence += b"\x36\x01\xc8" # _MADCTL Default rotation plus RGB encoding 80 | if invert: 81 | init_sequence += b"\x21\x00" # _INVON 82 | super().__init__(bus, init_sequence, **kwargs) 83 | -------------------------------------------------------------------------------- /docs/_static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_ST7789/5661a1c717b15e0da5b16c9cbc898b3a5ac651bc/docs/_static/favicon.ico -------------------------------------------------------------------------------- /docs/_static/favicon.ico.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries 2 | 3 | SPDX-License-Identifier: CC-BY-4.0 4 | -------------------------------------------------------------------------------- /docs/api.rst: -------------------------------------------------------------------------------- 1 | 2 | .. If you created a package, create one automodule per module in the package. 3 | 4 | .. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py) 5 | .. use this format as the module name: "adafruit_foo.foo" 6 | 7 | API Reference 8 | ############# 9 | 10 | .. automodule:: adafruit_st7789 11 | :members: 12 | -------------------------------------------------------------------------------- /docs/api.rst.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | import datetime 6 | import os 7 | import sys 8 | 9 | sys.path.insert(0, os.path.abspath("..")) 10 | 11 | # -- General configuration ------------------------------------------------ 12 | 13 | # Add any Sphinx extension module names here, as strings. They can be 14 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 15 | # ones. 16 | extensions = [ 17 | "sphinx.ext.autodoc", 18 | "sphinxcontrib.jquery", 19 | "sphinx.ext.intersphinx", 20 | "sphinx.ext.napoleon", 21 | "sphinx.ext.todo", 22 | ] 23 | 24 | # TODO: Please Read! 25 | # Uncomment the below if you use native CircuitPython modules such as 26 | # digitalio, micropython and busio. List the modules you use. Without it, the 27 | # autodoc module docs will fail to generate with a warning. 28 | # autodoc_mock_imports = ["digitalio", "busio"] 29 | autodoc_mock_imports = ["busdisplay", "fourwire"] 30 | 31 | intersphinx_mapping = { 32 | "python": ("https://docs.python.org/3", None), 33 | "CircuitPython": ("https://docs.circuitpython.org/en/latest/", None), 34 | } 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ["_templates"] 38 | 39 | source_suffix = ".rst" 40 | 41 | # The master toctree document. 42 | master_doc = "index" 43 | 44 | # General information about the project. 45 | project = "Adafruit ST7789 Library" 46 | creation_year = "2019" 47 | current_year = str(datetime.datetime.now().year) 48 | year_duration = ( 49 | current_year if current_year == creation_year else creation_year + " - " + current_year 50 | ) 51 | copyright = year_duration + " Melissa LeBlanc-Williams" 52 | author = "Melissa LeBlanc-Williams" 53 | 54 | # The version info for the project you're documenting, acts as replacement for 55 | # |version| and |release|, also used in various other places throughout the 56 | # built documents. 57 | # 58 | # The short X.Y version. 59 | version = "1.0" 60 | # The full version, including alpha/beta/rc tags. 61 | release = "1.0" 62 | 63 | # The language for content autogenerated by Sphinx. Refer to documentation 64 | # for a list of supported languages. 65 | # 66 | # This is also used if you do content translation via gettext catalogs. 67 | # Usually you set "language" from the command line for these cases. 68 | language = "en" 69 | 70 | # List of patterns, relative to source directory, that match files and 71 | # directories to ignore when looking for source files. 72 | # This patterns also effect to html_static_path and html_extra_path 73 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"] 74 | 75 | # The reST default role (used for this markup: `text`) to use for all 76 | # documents. 77 | # 78 | default_role = "any" 79 | 80 | # If true, '()' will be appended to :func: etc. cross-reference text. 81 | # 82 | add_function_parentheses = True 83 | 84 | # The name of the Pygments (syntax highlighting) style to use. 85 | pygments_style = "sphinx" 86 | 87 | # If true, `todo` and `todoList` produce output, else they produce nothing. 88 | todo_include_todos = False 89 | 90 | # If this is True, todo emits a warning for each TODO entries. The default is False. 91 | todo_emit_warnings = True 92 | 93 | napoleon_numpy_docstring = False 94 | 95 | # -- Options for HTML output ---------------------------------------------- 96 | 97 | # The theme to use for HTML and HTML Help pages. See the documentation for 98 | # a list of builtin themes. 99 | # 100 | import sphinx_rtd_theme 101 | 102 | html_theme = "sphinx_rtd_theme" 103 | 104 | # Add any paths that contain custom static files (such as style sheets) here, 105 | # relative to this directory. They are copied after the builtin static files, 106 | # so a file named "default.css" will overwrite the builtin "default.css". 107 | html_static_path = ["_static"] 108 | 109 | # The name of an image file (relative to this directory) to use as a favicon of 110 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 111 | # pixels large. 112 | # 113 | html_favicon = "_static/favicon.ico" 114 | 115 | # Output file base name for HTML help builder. 116 | htmlhelp_basename = "AdafruitSt7789Librarydoc" 117 | 118 | # -- Options for LaTeX output --------------------------------------------- 119 | 120 | latex_elements = { 121 | # The paper size ('letterpaper' or 'a4paper'). 122 | # 123 | # 'papersize': 'letterpaper', 124 | # The font size ('10pt', '11pt' or '12pt'). 125 | # 126 | # 'pointsize': '10pt', 127 | # Additional stuff for the LaTeX preamble. 128 | # 129 | # 'preamble': '', 130 | # Latex figure (float) alignment 131 | # 132 | # 'figure_align': 'htbp', 133 | } 134 | 135 | # Grouping the document tree into LaTeX files. List of tuples 136 | # (source start file, target name, title, 137 | # author, documentclass [howto, manual, or own class]). 138 | latex_documents = [ 139 | ( 140 | master_doc, 141 | "AdafruitST7789Library.tex", 142 | "AdafruitST7789 Library Documentation", 143 | author, 144 | "manual", 145 | ), 146 | ] 147 | 148 | # -- Options for manual page output --------------------------------------- 149 | 150 | # One entry per manual page. List of tuples 151 | # (source start file, name, description, authors, manual section). 152 | man_pages = [ 153 | ( 154 | master_doc, 155 | "AdafruitST7789library", 156 | "Adafruit ST7789 Library Documentation", 157 | [author], 158 | 1, 159 | ) 160 | ] 161 | 162 | # -- Options for Texinfo output ------------------------------------------- 163 | 164 | # Grouping the document tree into Texinfo files. List of tuples 165 | # (source start file, target name, title, author, 166 | # dir menu entry, description, category) 167 | texinfo_documents = [ 168 | ( 169 | master_doc, 170 | "AdafruitST7789Library", 171 | "Adafruit ST7789 Library Documentation", 172 | author, 173 | "AdafruitST7789Library", 174 | "One line description of project.", 175 | "Miscellaneous", 176 | ), 177 | ] 178 | -------------------------------------------------------------------------------- /docs/examples.rst: -------------------------------------------------------------------------------- 1 | Simple test 2 | ------------ 3 | 4 | Ensure your device works with this simple test. 5 | 6 | .. literalinclude:: ../examples/st7789_simpletest.py 7 | :caption: examples/st7789_simpletest.py 8 | :linenos: 9 | 10 | 240x135 11 | ======= 12 | 13 | .. literalinclude:: ../examples/st7789_240x135_simpletest.py 14 | :caption: examples/st7789_240x135_simpletest.py 15 | :linenos: 16 | 17 | 280x240 18 | ======= 19 | 20 | .. literalinclude:: ../examples/st7789_280x240_simpletest.py 21 | :caption: examples/st7789_280x240_simpletest.py 22 | :linenos: 23 | 24 | 320x240 25 | ======= 26 | 27 | .. literalinclude:: ../examples/st7789_320x240_simpletest.py 28 | :caption: examples/st7789_320x240_simpletest.py 29 | :linenos: 30 | 31 | Product specific examples 32 | ------------------------- 33 | 34 | 1.14" Mini PiTFT 35 | ================ 36 | 37 | .. literalinclude:: ../examples/st7789_240x135_pitft_simpletest.py 38 | :caption: examples/st7789_240x135_pitft_simpletest.py 39 | :linenos: 40 | 41 | 1.3" TFT Bonnet 42 | =============== 43 | 44 | .. literalinclude:: ../examples/st7789_240x240_bonnet_simpletest.py 45 | :caption: examples/st7789_240x240_bonnet_simpletest.py 46 | :linenos: 47 | 48 | 1.3" PiTFT 49 | ========== 50 | 51 | .. literalinclude:: ../examples/st7789_240x240_pitft_simpletest.py 52 | :caption: examples/st7789_240x240_pitft_simpletest.py 53 | :linenos: 54 | 55 | Gizmo 56 | ===== 57 | 58 | .. literalinclude:: ../examples/st7789_tft_gizmo_simpletest.py 59 | :caption: examples/st7789_tft_gizmo_simpletest.py 60 | :linenos: 61 | 62 | Pimoroni Pico Display Pack 63 | ========================== 64 | 65 | .. literalinclude:: ../examples/st7789_240x135_simpletest_Pimoroni_Pico_Display_Pack.py 66 | :caption: examples/st7789_240x135_simpletest_Pimoroni_Pico_Display_Pack.py 67 | :linenos: 68 | 69 | Pimoroni Pico Explorer 70 | ====================== 71 | 72 | .. literalinclude:: ../examples/st7789_240x240_simpletest_Pimoroni_Pico_Explorer.py 73 | :caption: examples/st7789_240x240_simpletest_Pimoroni_Pico_Explorer.py 74 | :linenos: 75 | 76 | Pimoroni Pico Display Pack 2.0 77 | ============================== 78 | 79 | .. literalinclude:: ../examples/st7789_320x240_simpletest_Pimoroni_Pico_Display_2_0.py 80 | :caption: examples/st7789_320x240_simpletest_Pimoroni_Pico_Display_2_0.py 81 | :linenos: 82 | 83 | Waveshare Pico LCD 1.3 84 | ============================== 85 | 86 | .. literalinclude:: ../examples/st7789_240x240_simpletest_Waveshare_PicoLCD_1_3.py 87 | :caption: examples/st7789_240x240_simpletest_Waveshare_PicoLCD_1_3.py 88 | :linenos: 89 | -------------------------------------------------------------------------------- /docs/examples.rst.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | 3 | Table of Contents 4 | ================= 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | :hidden: 9 | 10 | self 11 | 12 | .. toctree:: 13 | :caption: Examples 14 | 15 | examples 16 | 17 | .. toctree:: 18 | :caption: API Reference 19 | :maxdepth: 3 20 | 21 | api 22 | 23 | .. toctree:: 24 | :caption: Tutorials 25 | 26 | .. toctree:: 27 | :caption: Related Products 28 | 29 | Adafruit 1.3" 240x240 Wide Angle TFT LCD Display with MicroSD 30 | 31 | Adafruit 1.54" 240x240 Wide Angle TFT LCD Display with MicroSD 32 | 33 | Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout 34 | 35 | Adafruit Mini PiTFT 1.3" - 240x240 TFT Add-on for Raspberry Pi 36 | 37 | Adafruit 1.3" Color TFT Bonnet for Raspberry Pi - 240x240 TFT + Joystick Add-on 38 | 39 | Adafruit Mini PiTFT - 135x240 Color TFT Add-on for Raspberry Pi 40 | 41 | .. toctree:: 42 | :caption: Other Links 43 | 44 | Download from GitHub 45 | Download Library Bundle 46 | CircuitPython Reference Documentation 47 | CircuitPython Support Forum 48 | Discord Chat 49 | Adafruit Learning System 50 | Adafruit Blog 51 | Adafruit Store 52 | 53 | Indices and tables 54 | ================== 55 | 56 | * :ref:`genindex` 57 | * :ref:`modindex` 58 | * :ref:`search` 59 | -------------------------------------------------------------------------------- /docs/index.rst.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | 5 | sphinx 6 | sphinxcontrib-jquery 7 | sphinx-rtd-theme 8 | -------------------------------------------------------------------------------- /examples/st7789_170x320_1.9_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import displayio 11 | import terminalio 12 | from adafruit_display_text import label 13 | from fourwire import FourWire 14 | 15 | from adafruit_st7789 import ST7789 16 | 17 | BORDER_WIDTH = 20 18 | TEXT_SCALE = 3 19 | 20 | # Release any resources currently in use for the displays 21 | displayio.release_displays() 22 | 23 | spi = board.SPI() 24 | tft_cs = board.D5 25 | tft_dc = board.D6 26 | tft_rst = board.D9 27 | 28 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_rst) 29 | 30 | display = ST7789(display_bus, width=320, height=170, colstart=35, rotation=90) 31 | 32 | # Make the display context 33 | splash = displayio.Group() 34 | display.root_group = splash 35 | 36 | color_bitmap = displayio.Bitmap(display.width, display.height, 1) 37 | color_palette = displayio.Palette(1) 38 | color_palette[0] = 0x00FF00 # Bright Green 39 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 40 | splash.append(bg_sprite) 41 | 42 | # Draw a smaller inner rectangle 43 | inner_bitmap = displayio.Bitmap( 44 | display.width - (BORDER_WIDTH * 2), display.height - (BORDER_WIDTH * 2), 1 45 | ) 46 | inner_palette = displayio.Palette(1) 47 | inner_palette[0] = 0xAA0088 # Purple 48 | inner_sprite = displayio.TileGrid( 49 | inner_bitmap, pixel_shader=inner_palette, x=BORDER_WIDTH, y=BORDER_WIDTH 50 | ) 51 | splash.append(inner_sprite) 52 | 53 | # Draw a label 54 | text_area = label.Label( 55 | terminalio.FONT, 56 | text="Hello World!", 57 | color=0xFFFF00, 58 | scale=TEXT_SCALE, 59 | anchor_point=(0.5, 0.5), 60 | anchored_position=(display.width // 2, display.height // 2), 61 | ) 62 | splash.append(text_area) 63 | 64 | while True: 65 | pass 66 | -------------------------------------------------------------------------------- /examples/st7789_172x320_1.47_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import displayio 11 | import terminalio 12 | from adafruit_display_text import label 13 | from fourwire import FourWire 14 | 15 | from adafruit_st7789 import ST7789 16 | 17 | BORDER_WIDTH = 28 18 | TEXT_SCALE = 3 19 | 20 | # Release any resources currently in use for the displays 21 | displayio.release_displays() 22 | 23 | # built-in, silkscreen labelled SPI bus 24 | spi = board.SPI() 25 | tft_cs = board.D5 26 | tft_dc = board.D6 27 | tft_rst = board.D9 28 | 29 | # If using a Raspberry Pi Pico or Pico-w 30 | # Uncomment the below code to use GP (General Purpose) pins 31 | # instead of D (Digital) 32 | 33 | # import busio 34 | # spi = busio.SPI(board.GP2, board.GP3, board.GP4) 35 | # tft_cs = board.GP5 36 | # tft_dc = board.GP6 37 | # tft_rst = board.GP7 38 | 39 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_rst) 40 | 41 | display = ST7789(display_bus, width=320, height=172, colstart=34, rotation=270) 42 | 43 | # Make the display context 44 | splash = displayio.Group() 45 | display.root_group = splash 46 | 47 | color_bitmap = displayio.Bitmap(display.width, display.height, 1) 48 | color_palette = displayio.Palette(1) 49 | color_palette[0] = 0x00FF00 # Bright Green 50 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 51 | splash.append(bg_sprite) 52 | 53 | # Draw a smaller inner rectangle 54 | inner_bitmap = displayio.Bitmap( 55 | display.width - (BORDER_WIDTH * 2), display.height - (BORDER_WIDTH * 2), 1 56 | ) 57 | 58 | inner_palette = displayio.Palette(1) 59 | inner_palette[0] = 0xAA0088 # Purple 60 | inner_sprite = displayio.TileGrid( 61 | inner_bitmap, pixel_shader=inner_palette, x=BORDER_WIDTH, y=BORDER_WIDTH 62 | ) 63 | splash.append(inner_sprite) 64 | 65 | # Draw a label 66 | text_area = label.Label( 67 | terminalio.FONT, 68 | text="Hello World!", 69 | color=0xFFFF00, 70 | scale=TEXT_SCALE, 71 | anchor_point=(0.5, 0.5), 72 | anchored_position=(display.width // 2, display.height // 2), 73 | ) 74 | splash.append(text_area) 75 | 76 | while True: 77 | pass 78 | -------------------------------------------------------------------------------- /examples/st7789_240x135_pitft_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | 8 | Pinouts are for the 1.14" Mini PiTFT and should be run in CPython. 9 | """ 10 | 11 | import board 12 | import displayio 13 | import terminalio 14 | from adafruit_display_text import label 15 | from fourwire import FourWire 16 | 17 | from adafruit_st7789 import ST7789 18 | 19 | # First set some parameters used for shapes and text 20 | BORDER = 20 21 | FONTSCALE = 2 22 | BACKGROUND_COLOR = 0x00FF00 # Bright Green 23 | FOREGROUND_COLOR = 0xAA0088 # Purple 24 | TEXT_COLOR = 0xFFFF00 25 | 26 | # Release any resources currently in use for the displays 27 | displayio.release_displays() 28 | 29 | spi = board.SPI() 30 | tft_cs = board.CE0 31 | tft_dc = board.D25 32 | 33 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 34 | display = ST7789(display_bus, rotation=90, width=240, height=135, rowstart=40, colstart=53) 35 | 36 | # Make the display context 37 | splash = displayio.Group() 38 | display.root_group = splash 39 | 40 | color_bitmap = displayio.Bitmap(display.width, display.height, 1) 41 | color_palette = displayio.Palette(1) 42 | color_palette[0] = BACKGROUND_COLOR 43 | 44 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 45 | splash.append(bg_sprite) 46 | 47 | # Draw a smaller inner rectangle 48 | inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1) 49 | inner_palette = displayio.Palette(1) 50 | inner_palette[0] = FOREGROUND_COLOR 51 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER) 52 | splash.append(inner_sprite) 53 | 54 | # Draw a label 55 | text = "Hello World!" 56 | text_area = label.Label(terminalio.FONT, text=text, color=TEXT_COLOR) 57 | text_width = text_area.bounding_box[2] * FONTSCALE 58 | text_group = displayio.Group( 59 | scale=FONTSCALE, 60 | x=display.width // 2 - text_width // 2, 61 | y=display.height // 2, 62 | ) 63 | text_group.append(text_area) # Subgroup for text scaling 64 | splash.append(text_group) 65 | 66 | while True: 67 | pass 68 | -------------------------------------------------------------------------------- /examples/st7789_240x135_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import displayio 11 | import terminalio 12 | from adafruit_display_text import label 13 | from fourwire import FourWire 14 | 15 | from adafruit_st7789 import ST7789 16 | 17 | # First set some parameters used for shapes and text 18 | BORDER = 20 19 | FONTSCALE = 2 20 | BACKGROUND_COLOR = 0x00FF00 # Bright Green 21 | FOREGROUND_COLOR = 0xAA0088 # Purple 22 | TEXT_COLOR = 0xFFFF00 23 | 24 | # Release any resources currently in use for the displays 25 | displayio.release_displays() 26 | 27 | spi = board.SPI() 28 | tft_cs = board.D5 29 | tft_dc = board.D6 30 | 31 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 32 | display = ST7789(display_bus, rotation=270, width=240, height=135, rowstart=40, colstart=53) 33 | 34 | # Make the display context 35 | splash = displayio.Group() 36 | display.root_group = splash 37 | 38 | color_bitmap = displayio.Bitmap(display.width, display.height, 1) 39 | color_palette = displayio.Palette(1) 40 | color_palette[0] = BACKGROUND_COLOR 41 | 42 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 43 | splash.append(bg_sprite) 44 | 45 | # Draw a smaller inner rectangle 46 | inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1) 47 | inner_palette = displayio.Palette(1) 48 | inner_palette[0] = FOREGROUND_COLOR 49 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER) 50 | splash.append(inner_sprite) 51 | 52 | # Draw a label 53 | text = "Hello World!" 54 | text_area = label.Label(terminalio.FONT, text=text, color=TEXT_COLOR) 55 | text_width = text_area.bounding_box[2] * FONTSCALE 56 | text_group = displayio.Group( 57 | scale=FONTSCALE, 58 | x=display.width // 2 - text_width // 2, 59 | y=display.height // 2, 60 | ) 61 | text_group.append(text_area) # Subgroup for text scaling 62 | splash.append(text_group) 63 | 64 | while True: 65 | pass 66 | -------------------------------------------------------------------------------- /examples/st7789_240x135_simpletest_Pimoroni_Pico_Display_Pack.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import busio 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # First set some parameters used for shapes and text 19 | BORDER = 20 20 | FONTSCALE = 2 21 | BACKGROUND_COLOR = 0x00FF00 # Bright Green 22 | FOREGROUND_COLOR = 0xAA0088 # Purple 23 | TEXT_COLOR = 0xFFFF00 24 | 25 | # Release any resources currently in use for the displays 26 | displayio.release_displays() 27 | 28 | tft_cs = board.GP17 29 | tft_dc = board.GP16 30 | spi_mosi = board.GP19 31 | spi_clk = board.GP18 32 | spi = busio.SPI(spi_clk, spi_mosi) 33 | backlight = board.GP20 34 | 35 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 36 | 37 | display = ST7789( 38 | display_bus, 39 | rotation=270, 40 | width=240, 41 | height=135, 42 | rowstart=40, 43 | colstart=53, 44 | backlight_pin=backlight, 45 | ) 46 | 47 | # Set the backlight 48 | display.brightness = 0.8 49 | 50 | # Make the display context 51 | splash = displayio.Group() 52 | display.root_group = splash 53 | 54 | color_bitmap = displayio.Bitmap(display.width, display.height, 1) 55 | color_palette = displayio.Palette(1) 56 | color_palette[0] = BACKGROUND_COLOR 57 | 58 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 59 | splash.append(bg_sprite) 60 | 61 | # Draw a smaller inner rectangle 62 | inner_bitmap = displayio.Bitmap(display.width - BORDER * 2, display.height - BORDER * 2, 1) 63 | inner_palette = displayio.Palette(1) 64 | inner_palette[0] = FOREGROUND_COLOR 65 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER) 66 | splash.append(inner_sprite) 67 | 68 | # Draw a label 69 | text = "Hello World!" 70 | text_area = label.Label(terminalio.FONT, text=text, color=TEXT_COLOR) 71 | text_width = text_area.bounding_box[2] * FONTSCALE 72 | text_group = displayio.Group( 73 | scale=FONTSCALE, 74 | x=display.width // 2 - text_width // 2, 75 | y=display.height // 2, 76 | ) 77 | text_group.append(text_area) # Subgroup for text scaling 78 | splash.append(text_group) 79 | 80 | while True: 81 | pass 82 | -------------------------------------------------------------------------------- /examples/st7789_240x240_bonnet_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | 8 | Pinouts are for the 1.3" TFT Bonnet and should be run in CPython. 9 | """ 10 | 11 | import board 12 | import displayio 13 | import terminalio 14 | from adafruit_display_text import label 15 | from fourwire import FourWire 16 | 17 | from adafruit_st7789 import ST7789 18 | 19 | # Release any resources currently in use for the displays 20 | displayio.release_displays() 21 | 22 | spi = board.SPI() 23 | tft_cs = board.CE0 24 | tft_dc = board.D25 25 | tft_lite = board.D26 26 | 27 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 28 | 29 | display = ST7789( 30 | display_bus, 31 | width=240, 32 | height=240, 33 | rowstart=80, 34 | rotation=180, 35 | backlight_pin=tft_lite, 36 | ) 37 | 38 | # Make the display context 39 | splash = displayio.Group() 40 | display.root_group = splash 41 | 42 | color_bitmap = displayio.Bitmap(240, 240, 1) 43 | color_palette = displayio.Palette(1) 44 | color_palette[0] = 0x00FF00 # Bright Green 45 | 46 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 47 | splash.append(bg_sprite) 48 | 49 | # Draw a smaller inner rectangle 50 | inner_bitmap = displayio.Bitmap(200, 200, 1) 51 | inner_palette = displayio.Palette(1) 52 | inner_palette[0] = 0xAA0088 # Purple 53 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 54 | splash.append(inner_sprite) 55 | 56 | # Draw a label 57 | text_group = displayio.Group(scale=2, x=50, y=120) 58 | text = "Hello World!" 59 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 60 | text_group.append(text_area) # Subgroup for text scaling 61 | splash.append(text_group) 62 | 63 | while True: 64 | pass 65 | -------------------------------------------------------------------------------- /examples/st7789_240x240_pitft_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | 8 | Pinouts are for the 1.3" PiTFT and should be run in CPython. 9 | """ 10 | 11 | import board 12 | import displayio 13 | import terminalio 14 | from adafruit_display_text import label 15 | from fourwire import FourWire 16 | 17 | from adafruit_st7789 import ST7789 18 | 19 | # Release any resources currently in use for the displays 20 | displayio.release_displays() 21 | 22 | spi = board.SPI() 23 | tft_cs = board.CE0 24 | tft_dc = board.D25 25 | 26 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 27 | 28 | display = ST7789(display_bus, width=240, height=240, rowstart=80, rotation=180) 29 | 30 | # Make the display context 31 | splash = displayio.Group() 32 | display.root_group = splash 33 | 34 | color_bitmap = displayio.Bitmap(240, 240, 1) 35 | color_palette = displayio.Palette(1) 36 | color_palette[0] = 0x00FF00 # Bright Green 37 | 38 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 39 | splash.append(bg_sprite) 40 | 41 | # Draw a smaller inner rectangle 42 | inner_bitmap = displayio.Bitmap(200, 200, 1) 43 | inner_palette = displayio.Palette(1) 44 | inner_palette[0] = 0xAA0088 # Purple 45 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 46 | splash.append(inner_sprite) 47 | 48 | # Draw a label 49 | text_group = displayio.Group(scale=2, x=50, y=120) 50 | text = "Hello World!" 51 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 52 | text_group.append(text_area) # Subgroup for text scaling 53 | splash.append(text_group) 54 | 55 | while True: 56 | pass 57 | -------------------------------------------------------------------------------- /examples/st7789_240x240_simpletest_Pimoroni_Pico_Explorer.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import busio 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # Release any resources currently in use for the displays 19 | displayio.release_displays() 20 | 21 | tft_cs = board.GP17 22 | tft_dc = board.GP16 23 | spi_mosi = board.GP19 24 | spi_clk = board.GP18 25 | spi = busio.SPI(spi_clk, spi_mosi) 26 | 27 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 28 | 29 | display = ST7789(display_bus, width=240, height=240, rowstart=80, rotation=180) 30 | 31 | # Make the display context 32 | splash = displayio.Group() 33 | display.root_group = splash 34 | 35 | color_bitmap = displayio.Bitmap(240, 240, 1) 36 | color_palette = displayio.Palette(1) 37 | color_palette[0] = 0x00FF00 # Bright Green 38 | 39 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 40 | splash.append(bg_sprite) 41 | 42 | # Draw a smaller inner rectangle 43 | inner_bitmap = displayio.Bitmap(200, 200, 1) 44 | inner_palette = displayio.Palette(1) 45 | inner_palette[0] = 0xAA0088 # Purple 46 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 47 | splash.append(inner_sprite) 48 | 49 | # Draw a label 50 | text_group = displayio.Group(scale=2, x=50, y=120) 51 | text = "Hello World!" 52 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 53 | text_group.append(text_area) # Subgroup for text scaling 54 | splash.append(text_group) 55 | 56 | while True: 57 | pass 58 | -------------------------------------------------------------------------------- /examples/st7789_240x240_simpletest_Waveshare_PicoLCD_1_3.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import busio 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # Release any resources currently in use for the displays 19 | displayio.release_displays() 20 | 21 | tft_dc = board.GP8 22 | tft_cs = board.GP9 23 | spi_clk = board.GP10 24 | spi_mosi = board.GP11 25 | tft_rst = board.GP12 26 | backlight = board.GP13 27 | spi = busio.SPI(spi_clk, spi_mosi) 28 | 29 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_rst) 30 | 31 | display = ST7789( 32 | display_bus, 33 | rotation=270, 34 | width=240, 35 | height=240, 36 | rowstart=80, 37 | backlight_pin=backlight, 38 | ) 39 | 40 | # Make the display context 41 | splash = displayio.Group() 42 | display.root_group = splash 43 | 44 | color_bitmap = displayio.Bitmap(240, 240, 1) 45 | color_palette = displayio.Palette(1) 46 | color_palette[0] = 0x00FF00 # Bright Green 47 | 48 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 49 | splash.append(bg_sprite) 50 | 51 | # Draw a smaller inner rectangle 52 | inner_bitmap = displayio.Bitmap(200, 200, 1) 53 | inner_palette = displayio.Palette(1) 54 | inner_palette[0] = 0xAA0088 # Purple 55 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 56 | splash.append(inner_sprite) 57 | 58 | # Draw a label 59 | text_group = displayio.Group(scale=2, x=50, y=120) 60 | text = "Hello World!" 61 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 62 | text_group.append(text_area) # Subgroup for text scaling 63 | splash.append(text_group) 64 | 65 | while True: 66 | pass 67 | -------------------------------------------------------------------------------- /examples/st7789_280x240_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio, set display brightness and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. The test also has the option of 7 | rotating the screen content. 8 | """ 9 | 10 | import board 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # set the display rotation 19 | rotation = 90 20 | if rotation not in {0, 90, 180, 270}: 21 | raise ValueError("The value of rotation must be one of: 0, 90, 180, 270") 22 | 23 | # Display settings depending on the selected rotation 24 | # first value default setting for 1.69" with 0° and 180° rotation 25 | # second value default setting for 1.69" with 90° and 270° rotation 26 | width = 240 if rotation in {0, 180} else 280 27 | height = 280 if rotation in {0, 180} else 240 28 | color_bitmap_x = 240 if rotation in {0, 180} else 280 29 | color_bitmap_y = 280 if rotation in {0, 180} else 240 30 | inner_bitmap_x = 200 if rotation in {0, 180} else 240 31 | inner_bitmap_y = 240 if rotation in {0, 180} else 200 32 | scale = 2 if rotation in {0, 180} else 3 33 | x = 50 if rotation in {0, 180} else 37 34 | y = 140 if rotation in {0, 180} else 120 35 | 36 | # Release any resources currently in use for the displays 37 | displayio.release_displays() 38 | spi = board.SPI() 39 | tft_cs = board.D20 40 | tft_dc = board.D21 41 | backlight = board.D6 42 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D5) 43 | display = ST7789( 44 | display_bus, 45 | width=width, 46 | height=height, 47 | colstart=0, 48 | rowstart=20, 49 | rotation=rotation, 50 | backlight_pin=backlight, 51 | bgr=True, 52 | invert=True, 53 | ) 54 | 55 | # set the backlight 56 | # minimum value 0.001 (0.000 would be off), maximum value 1.000 57 | display.brightness = 0.5 58 | 59 | # Make the display context 60 | splash = displayio.Group() 61 | display.root_group = splash 62 | 63 | # Draw background rectangle 64 | color_bitmap = displayio.Bitmap(color_bitmap_x, color_bitmap_y, 1) 65 | color_palette = displayio.Palette(1) 66 | color_palette[0] = 0x00FF00 # Bright Green 67 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 68 | splash.append(bg_sprite) 69 | 70 | # Draw a smaller inner rectangle 71 | inner_bitmap = displayio.Bitmap(inner_bitmap_x, inner_bitmap_y, 1) 72 | inner_palette = displayio.Palette(1) 73 | inner_palette[0] = 0xAA0088 # Purple 74 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 75 | splash.append(inner_sprite) 76 | 77 | # Draw a label 78 | text_group = displayio.Group(scale=scale, x=x, y=y) 79 | text = "Hello World!" 80 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 81 | text_group.append(text_area) # Subgroup for text scaling 82 | splash.append(text_group) 83 | 84 | while True: 85 | pass 86 | -------------------------------------------------------------------------------- /examples/st7789_320x240_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import displayio 11 | import terminalio 12 | from adafruit_display_text import label 13 | from fourwire import FourWire 14 | 15 | from adafruit_st7789 import ST7789 16 | 17 | # Release any resources currently in use for the displays 18 | displayio.release_displays() 19 | 20 | spi = board.SPI() 21 | tft_cs = board.D5 22 | tft_dc = board.D6 23 | 24 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9) 25 | 26 | display = ST7789(display_bus, width=320, height=240, rotation=90) 27 | 28 | # Make the display context 29 | splash = displayio.Group() 30 | display.root_group = splash 31 | 32 | color_bitmap = displayio.Bitmap(320, 240, 1) 33 | color_palette = displayio.Palette(1) 34 | color_palette[0] = 0x00FF00 # Bright Green 35 | 36 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 37 | splash.append(bg_sprite) 38 | 39 | # Draw a smaller inner rectangle 40 | inner_bitmap = displayio.Bitmap(280, 200, 1) 41 | inner_palette = displayio.Palette(1) 42 | inner_palette[0] = 0xAA0088 # Purple 43 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 44 | splash.append(inner_sprite) 45 | 46 | # Draw a label 47 | text_group = displayio.Group(scale=3, x=57, y=120) 48 | text = "Hello World!" 49 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 50 | text_group.append(text_area) # Subgroup for text scaling 51 | splash.append(text_group) 52 | 53 | while True: 54 | pass 55 | -------------------------------------------------------------------------------- /examples/st7789_320x240_simpletest_Pimoroni_Pico_Display_2_0.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import busio 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # Release any resources currently in use for the displays 19 | displayio.release_displays() 20 | 21 | tft_cs = board.GP17 22 | tft_dc = board.GP16 23 | spi_mosi = board.GP19 24 | spi_clk = board.GP18 25 | spi = busio.SPI(spi_clk, spi_mosi) 26 | backlight = board.GP20 27 | 28 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 29 | 30 | display = ST7789( 31 | display_bus, 32 | rotation=270, 33 | width=320, 34 | height=240, 35 | backlight_pin=backlight, 36 | ) 37 | 38 | # Set the backlight 39 | display.brightness = 0.8 40 | 41 | # Make the display context 42 | splash = displayio.Group() 43 | display.root_group = splash 44 | 45 | color_bitmap = displayio.Bitmap(320, 240, 1) 46 | color_palette = displayio.Palette(1) 47 | color_palette[0] = 0x00FF00 # Bright Green 48 | 49 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 50 | splash.append(bg_sprite) 51 | 52 | # Draw a smaller inner rectangle 53 | inner_bitmap = displayio.Bitmap(280, 200, 1) 54 | inner_palette = displayio.Palette(1) 55 | inner_palette[0] = 0xAA0088 # Purple 56 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 57 | splash.append(inner_sprite) 58 | 59 | # Draw a label 60 | text_group = displayio.Group(scale=3, x=57, y=120) 61 | text = "Hello World!" 62 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 63 | text_group.append(text_area) # Subgroup for text scaling 64 | splash.append(text_group) 65 | 66 | while True: 67 | pass 68 | -------------------------------------------------------------------------------- /examples/st7789_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import displayio 11 | import terminalio 12 | from adafruit_display_text import label 13 | from fourwire import FourWire 14 | 15 | from adafruit_st7789 import ST7789 16 | 17 | # Release any resources currently in use for the displays 18 | displayio.release_displays() 19 | 20 | spi = board.SPI() 21 | tft_cs = board.D5 22 | tft_dc = board.D6 23 | 24 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9) 25 | 26 | display = ST7789(display_bus, width=240, height=240, rowstart=80, bgr=True, invert=True) 27 | 28 | # Make the display context 29 | splash = displayio.Group() 30 | display.root_group = splash 31 | 32 | color_bitmap = displayio.Bitmap(240, 240, 1) 33 | color_palette = displayio.Palette(1) 34 | color_palette[0] = 0x00FF00 # Bright Green 35 | 36 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 37 | splash.append(bg_sprite) 38 | 39 | # Draw a smaller inner rectangle 40 | inner_bitmap = displayio.Bitmap(200, 200, 1) 41 | inner_palette = displayio.Palette(1) 42 | inner_palette[0] = 0xAA0088 # Purple 43 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 44 | splash.append(inner_sprite) 45 | 46 | # Draw a label 47 | text_group = displayio.Group(scale=2, x=50, y=120) 48 | text = "Hello World!" 49 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 50 | text_group.append(text_area) # Subgroup for text scaling 51 | splash.append(text_group) 52 | 53 | while True: 54 | pass 55 | -------------------------------------------------------------------------------- /examples/st7789_tft_gizmo_simpletest.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries 2 | # SPDX-License-Identifier: MIT 3 | 4 | """ 5 | This test will initialize the display using displayio and draw a solid green 6 | background, a smaller purple rectangle, and some yellow text. 7 | """ 8 | 9 | import board 10 | import busio 11 | import displayio 12 | import terminalio 13 | from adafruit_display_text import label 14 | from fourwire import FourWire 15 | 16 | from adafruit_st7789 import ST7789 17 | 18 | # Release any resources currently in use for the displays 19 | displayio.release_displays() 20 | 21 | spi = busio.SPI(board.SCL, MOSI=board.SDA) 22 | tft_cs = board.RX 23 | tft_dc = board.TX 24 | tft_backlight = board.A3 25 | 26 | display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs) 27 | 28 | display = ST7789( 29 | display_bus, 30 | width=240, 31 | height=240, 32 | rowstart=80, 33 | backlight_pin=tft_backlight, 34 | rotation=180, 35 | ) 36 | 37 | # Make the display context 38 | splash = displayio.Group() 39 | display.root_group = splash 40 | 41 | color_bitmap = displayio.Bitmap(240, 240, 1) 42 | color_palette = displayio.Palette(1) 43 | color_palette[0] = 0x00FF00 # Bright Green 44 | 45 | bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) 46 | splash.append(bg_sprite) 47 | 48 | # Draw a smaller inner rectangle 49 | inner_bitmap = displayio.Bitmap(200, 200, 1) 50 | inner_palette = displayio.Palette(1) 51 | inner_palette[0] = 0xAA0088 # Purple 52 | inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20) 53 | splash.append(inner_sprite) 54 | 55 | # Draw a label 56 | text_group = displayio.Group(scale=2, x=50, y=120) 57 | text = "Hello World!" 58 | text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00) 59 | text_group.append(text_area) # Subgroup for text scaling 60 | splash.append(text_group) 61 | 62 | while True: 63 | pass 64 | -------------------------------------------------------------------------------- /optional_requirements.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | [build-system] 6 | requires = [ 7 | "setuptools", 8 | "wheel", 9 | "setuptools-scm", 10 | ] 11 | 12 | [project] 13 | name = "adafruit-circuitpython-st7789" 14 | description = "displayio driver for ST7789 TFT-LCD displays." 15 | version = "0.0.0+auto.0" 16 | readme = "README.rst" 17 | authors = [ 18 | {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} 19 | ] 20 | urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_ST7789"} 21 | keywords = [ 22 | "adafruit", 23 | "blinka", 24 | "circuitpython", 25 | "micropython", 26 | "st7789", 27 | "display", 28 | "tft", 29 | "lcd", 30 | "displayio", 31 | ] 32 | license = {text = "MIT"} 33 | classifiers = [ 34 | "Intended Audience :: Developers", 35 | "Topic :: Software Development :: Libraries", 36 | "Topic :: Software Development :: Embedded Systems", 37 | "Topic :: System :: Hardware", 38 | "License :: OSI Approved :: MIT License", 39 | "Programming Language :: Python :: 3", 40 | ] 41 | dynamic = ["dependencies", "optional-dependencies"] 42 | 43 | [tool.setuptools] 44 | py-modules = ["adafruit_st7789"] 45 | 46 | [tool.setuptools.dynamic] 47 | dependencies = {file = ["requirements.txt"]} 48 | optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} 49 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: Unlicense 4 | 5 | Adafruit-Blinka 6 | adafruit-blinka-displayio 7 | -------------------------------------------------------------------------------- /ruff.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target-version = "py38" 6 | line-length = 100 7 | 8 | [lint] 9 | preview = true 10 | select = ["I", "PL", "UP"] 11 | 12 | extend-select = [ 13 | "D419", # empty-docstring 14 | "E501", # line-too-long 15 | "W291", # trailing-whitespace 16 | "PLC0414", # useless-import-alias 17 | "PLC2401", # non-ascii-name 18 | "PLC2801", # unnecessary-dunder-call 19 | "PLC3002", # unnecessary-direct-lambda-call 20 | "E999", # syntax-error 21 | "PLE0101", # return-in-init 22 | "F706", # return-outside-function 23 | "F704", # yield-outside-function 24 | "PLE0116", # continue-in-finally 25 | "PLE0117", # nonlocal-without-binding 26 | "PLE0241", # duplicate-bases 27 | "PLE0302", # unexpected-special-method-signature 28 | "PLE0604", # invalid-all-object 29 | "PLE0605", # invalid-all-format 30 | "PLE0643", # potential-index-error 31 | "PLE0704", # misplaced-bare-raise 32 | "PLE1141", # dict-iter-missing-items 33 | "PLE1142", # await-outside-async 34 | "PLE1205", # logging-too-many-args 35 | "PLE1206", # logging-too-few-args 36 | "PLE1307", # bad-string-format-type 37 | "PLE1310", # bad-str-strip-call 38 | "PLE1507", # invalid-envvar-value 39 | "PLE2502", # bidirectional-unicode 40 | "PLE2510", # invalid-character-backspace 41 | "PLE2512", # invalid-character-sub 42 | "PLE2513", # invalid-character-esc 43 | "PLE2514", # invalid-character-nul 44 | "PLE2515", # invalid-character-zero-width-space 45 | "PLR0124", # comparison-with-itself 46 | "PLR0202", # no-classmethod-decorator 47 | "PLR0203", # no-staticmethod-decorator 48 | "UP004", # useless-object-inheritance 49 | "PLR0206", # property-with-parameters 50 | "PLR0904", # too-many-public-methods 51 | "PLR0911", # too-many-return-statements 52 | "PLR0912", # too-many-branches 53 | "PLR0913", # too-many-arguments 54 | "PLR0914", # too-many-locals 55 | "PLR0915", # too-many-statements 56 | "PLR0916", # too-many-boolean-expressions 57 | "PLR1702", # too-many-nested-blocks 58 | "PLR1704", # redefined-argument-from-local 59 | "PLR1711", # useless-return 60 | "C416", # unnecessary-comprehension 61 | "PLR1733", # unnecessary-dict-index-lookup 62 | "PLR1736", # unnecessary-list-index-lookup 63 | 64 | # ruff reports this rule is unstable 65 | #"PLR6301", # no-self-use 66 | 67 | "PLW0108", # unnecessary-lambda 68 | "PLW0120", # useless-else-on-loop 69 | "PLW0127", # self-assigning-variable 70 | "PLW0129", # assert-on-string-literal 71 | "B033", # duplicate-value 72 | "PLW0131", # named-expr-without-context 73 | "PLW0245", # super-without-brackets 74 | "PLW0406", # import-self 75 | "PLW0602", # global-variable-not-assigned 76 | "PLW0603", # global-statement 77 | "PLW0604", # global-at-module-level 78 | 79 | # fails on the try: import typing used by libraries 80 | #"F401", # unused-import 81 | 82 | "F841", # unused-variable 83 | "E722", # bare-except 84 | "PLW0711", # binary-op-exception 85 | "PLW1501", # bad-open-mode 86 | "PLW1508", # invalid-envvar-default 87 | "PLW1509", # subprocess-popen-preexec-fn 88 | "PLW2101", # useless-with-lock 89 | "PLW3301", # nested-min-max 90 | ] 91 | 92 | ignore = [ 93 | "PLR2004", # magic-value-comparison 94 | "UP030", # format literals 95 | "PLW1514", # unspecified-encoding 96 | 97 | ] 98 | 99 | [format] 100 | line-ending = "lf" 101 | --------------------------------------------------------------------------------