diff --git a/README.rst b/README.rst index f4e39ca..327bfde 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ Introduction :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_ILI9341 :alt: Build Status -.. todo:: Describe what the library does. +displayio driver for ILI9341 and ILI9340 TFT-LCD displays. Dependencies ============= @@ -28,7 +28,41 @@ This is easily achieved by downloading Usage Example ============= -.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst. +.. code-block:: python + + import board + import displayio + import adafruit_ili9341 + + spi = board.SPI() + tft_cs = board.D9 + tft_dc = board.D10 + + displayio.release_displays() + display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs) + + display = adafruit_ili9341.ILI9341(display_bus) + + # Make the display context + splash = displayio.Group(max_size=10) + display.show(splash) + + color_bitmap = displayio.Bitmap(320, 240, 1) + color_palette = displayio.Palette(1) + color_palette[0] = 0xFF0000 + + try: + bg_sprite = displayio.TileGrid(color_bitmap, + pixel_shader=color_palette, + position=(0, 0)) + except TypeError: + bg_sprite = displayio.TileGrid(color_bitmap, + pixel_shader=color_palette, + x=0, y=0) + splash.append(bg_sprite) + + while True: + pass Contributing ============ diff --git a/adafruit_ili9341.py b/adafruit_ili9341.py index 4325f30..ca704a0 100644 --- a/adafruit_ili9341.py +++ b/adafruit_ili9341.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_ILI9341` +`adafruit_ili9341` ==================================================== Display driver for ILI9341 @@ -32,9 +32,16 @@ **Hardware:** -.. todo:: Add links to any specific hardware product page(s), or category page(s). - Use unordered list & hyperlink rST - inline format: "* `Link Text `_" +* 2.2" 18-bit color TFT LCD display with microSD card breakout + +* 2.4" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + +* 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + +* 3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + +* TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers + **Software and Dependencies:** @@ -49,7 +56,7 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ILI9341.git" _INIT_SEQUENCE = ( - b"\x01\x80\x80"# Software reset then delay 0x78 (120ms) + b"\x01\x80\x80" # Software reset then delay 0x80 (128ms) b"\xEF\x03\x03\x80\x02" b"\xCF\x03\x00\xC1\x30" b"\xED\x04\x64\x03\x12\x81" @@ -70,8 +77,8 @@ b"\x26\x01\x01" # Gamma curve selected b"\xe0\x0f\x0F\x31\x2B\x0C\x0E\x08\x4E\xF1\x37\x07\x10\x03\x0E\x09\x00" # Set Gamma b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma - b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms) - b"\x29\x80\x78"# Display on then delay 0x78 (120ms) + b"\x11\x80\x78" # Exit Sleep then delay 0x78 (120ms) + b"\x29\x80\x78" # Display on then delay 0x78 (120ms) ) # pylint: disable=too-few-public-methods diff --git a/docs/conf.py b/docs/conf.py index 232fff3..332954c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,7 +21,7 @@ # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. # autodoc_mock_imports = ["digitalio", "busio"] - +autodoc_mock_imports = ["displayio"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} diff --git a/docs/index.rst b/docs/index.rst index ab55dd4..39f6335 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,14 +23,14 @@ Table of Contents .. toctree:: :caption: Tutorials -.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave - the toctree above for use later. - .. toctree:: :caption: Related Products -.. todo:: Add any product links here. If there are none, then simply delete this todo and leave - the toctree above for use later. + 2.2" 18-bit color TFT LCD display with microSD card breakout + 2.4" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + 3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket + TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers .. toctree:: :caption: Other Links