Commit Graph

85 Commits

Author SHA1 Message Date
Craig Forbes db74b92e77 Fix displayio.Display docstring type for display_bus.
Add docs for group parameter for Display.show.
2019-06-18 16:59:05 -05:00
Scott Shawcroft 4013bcde9e
Add baudrate to FourWire and shorten delay. 2019-06-17 17:48:05 -07:00
Scott Shawcroft 6f6dcafd90
Minor tweaks based on Dan's feedback 2019-06-13 00:34:19 -07:00
Scott Shawcroft eb21fc3e31
Add partial display update support.
Different operations to the display tree have different costs. Be
aware of these costs when optimizing your code.
* Changing tiles indices in a TileGrid will update an area
covering them all.
* Changing a palette will refresh every object that references it.
* Moving a TileGrid will update both where it was and where it moved to.
* Adding something to a Group will refresh each individual area it
covers.
* Removing things from a Group will refresh one area that covers all
previous locations. (Not separate areas like add.)
* Setting a new top level Group will refresh the entire display.

Only TileGrid moves are optimized for overlap. All other overlaps
cause sending of duplicate pixels.

This also adds flip_x, flip_y and transpose_xy to TileGrid. They
change the direction of the pixels but not the location.

Fixes #1169. Fixes #1705. Fixes #1923.
2019-06-12 11:32:39 -07:00
sommersoft 9e4396bdcd
Merge pull request #1920 from tannewt/fix_rst
Improve rST consistency for rst2pyi use
2019-06-07 23:41:00 -05:00
Scott Shawcroft cfe24b8532
Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
Scott Shawcroft 3fad7de8db
Rework the pixel computation to use areas
This changes the displayio pixel computation from per-pixel to
per-area. This is precursor work to updating portions of the screen
(#1169). It should provide mild speedups because bounds checks are
done once per area rather than once per pixel. Filling by area also
allows TileGrid to maintain a row-associative fill pattern even when
the display's refresh is orthogonal to it.
2019-05-21 17:41:06 -07:00
Scott Shawcroft 5608e273a0
Add index and remove to Group. 2019-05-15 11:33:16 -07:00
Scott Shawcroft b7b55e0c0a
Make Group iterable via a generic native iterator.
Fixes #1694
2019-05-14 15:15:23 -07:00
Dan Halbert d3ce9280e2
Merge pull request #1883 from tannewt/fix_1881
Check native object in case of early access
2019-05-14 15:30:44 -04:00
Matt Land 0b1c1c1d92
Update Palette.c
Remove None, add in byte and bytearray examples
2019-05-14 08:03:34 -05:00
Scott Shawcroft f29de51325
Check native object in case of early access
If a native displayio object is accessed before it's super().__init__()
has been called, then a placeholder is given that will cause a crash if
accessed. This is tricky to get right so we detect this case and raise
a NotInplementedError instead of crashing.

Fixes #1881
2019-05-13 17:31:30 -07:00
Matt Land ad211b23be
add documentation of transparency 2019-05-10 17:35:51 -05:00
Matt Land 214dfed703
Add documentation for Palette shared binding
Add documentation for the palette subscript operator and how to use it.
2019-05-10 16:41:13 -05:00
Dan Halbert 0113e0970e add Display.__init__() args for brightness and auto_brightness 2019-04-18 15:59:16 -04:00
Dan Halbert 4fc0f8b25c Turn off auto_brightness if brightness is set 2019-04-18 13:57:27 -04:00
Scott Shawcroft 5028f87b09
Tweak pybadge and fix display bugs
* Update pybadge pins and flash for rev D
* TileGrid now validates the type of the pixel_shader.
* Display actually handles incoming subclass objects.
* MicroPython will inspect native parents to see if special
  accessors are used.
2019-04-09 18:32:52 -07:00
Scott Shawcroft de48e4b262
Merge remote-tracking branch 'adafruit/master' into fix_cpx_display 2019-04-08 17:15:08 -07:00
Scott Shawcroft 0f003ac5b8
Reorganize board busses into shared-bindings and shared-module. 2019-04-08 16:58:50 -07:00
Radomir Dopieralski 4b3cb7b6db Expose displayio.Display.bus
With the bus exposed, we can send custom commands to the display, to
leverage advanced features specific to the display, which are not
exposed by default.
2019-04-06 14:25:08 +02:00
Scott Shawcroft 04a4e8a38d
Always check TileGrid's x, y
When using an int index you could end up writing past the end of
TileGrid's memory.

Fixes #1747
2019-04-05 13:10:47 -07:00
Melissa LeBlanc-Williams 8f1fc6c07d Added option to easily treat SPI parameter data as commands 2019-04-04 23:15:00 -07:00
Melissa LeBlanc-Williams 2e0268cb09 Simplified cs toggling into fourwire only 2019-03-27 20:17:22 -07:00
Melissa LeBlanc-Williams f3ec0514cd Simplified into fourwire only 2019-03-27 20:11:32 -07:00
Melissa LeBlanc-Williams 2f7b338a4b Comment Cleanup 2019-03-26 18:56:25 -07:00
Melissa LeBlanc-Williams f4cede4747 Removed parameter so CS is always toggled 2019-03-26 18:46:13 -07:00
Melissa LeBlanc-Williams b2ad16f5c8 Removed parameter so CS is always toggled 2019-03-26 18:34:07 -07:00
Melissa LeBlanc-Williams 5f0e71ccb4 Merge branch 'master' of https://github.com/adafruit/circuitpython into ssd1351-fix 2019-03-26 18:23:02 -07:00
Melissa LeBlanc-Williams 0df40534f3 Merge branch 'master' of https://github.com/adafruit/circuitpython 2019-03-26 18:22:30 -07:00
Radomir Dopieralski 81fe8060d7 Properly calculate BPP for displayio.Bitmap
Fix #1669
2019-03-25 19:40:40 +01:00
Melissa LeBlanc-Williams c3329e224d Added Single Byte Boundaries option for certain displays 2019-03-24 23:59:28 -07:00
Melissa LeBlanc-Williams d9de1b9926 Updated RTD comment to reflect new param defaulting True 2019-03-24 08:23:46 -07:00
Melissa LeBlanc-Williams 0c33f7fdb4 Enable CS toggle for displayio by default 2019-03-23 20:23:23 -07:00
Melissa LeBlanc-Williams 2bb63cbeb3 Added new parameter description in displayio RTD comment 2019-03-23 18:53:04 -07:00
Melissa LeBlanc-Williams fadb5a1024 Added option to toggle cs in displayio init sequence 2019-03-23 18:34:42 -07:00
Scott Shawcroft 4b0afc855d
Fix up sphinx 2019-03-19 18:37:41 -07:00
Scott Shawcroft 5e2fec714c
Move Glyph and BuiltinFont into fontio
It was confusing in displayio.

Fixes #1662
2019-03-19 16:22:09 -07:00
Scott Shawcroft afbf59019e
Update displayio docs to add detail to display bus comments
Fixes #1599
2019-03-12 17:18:33 -07:00
Scott Shawcroft 224e9b1009
Standardize TileGrid to x and y properties over position
This brings it inline with Group. Also fixes #1613

This also includes a number of fixes for where a method is called
through a subclass. We now correctly get the native object.
Fixes #1567

Lastly, this adds subscript support to TileGrid for changing tile
indices. Similar to Bitmap, it accepts ints or 2-tuples.
2019-03-12 17:18:33 -07:00
Scott Shawcroft ea45877ca5
Accept x and y kwargs into Group for initial position. 2019-03-12 17:17:32 -07:00
Dan Halbert 1f31877d55 Rework background display task to allow reads from SPI SD card during display. Clarify code. Handle multiple displays better. 2019-03-07 00:08:16 -05:00
Dan Halbert c854f6617a check display-bus transaction status and act accordingly 2019-03-06 13:45:48 -05:00
Dan Halbert 2eaa98ad71
Merge pull request #1601 from penguindustin/master
added height and width attributes for displayio
2019-03-06 12:43:55 -05:00
Dustin Mendoza 4145f87fcd changed from mp_int_t to uint16_t 2019-03-05 21:25:09 -08:00
Dustin Mendoza 9737a45b33 changed width and height to be properties 2019-03-02 14:50:10 -08:00
Bryan Siepert 945550f4bd Fixed the OnDiskBitmap example to reflect code changes 2019-03-02 09:12:40 -08:00
Dustin Mendoza f127be4dd2 added height and width attributes for displayio 2019-02-25 16:39:20 -08:00
Dan Halbert 379258112a
Merge pull request #1548 from tannewt/shape_arg_check
Arg check width and height into Shape.
2019-02-14 07:42:39 -05:00
Scott Shawcroft b13adfc228
Arg check width and height into Shape.
Fixes #1537
2019-02-13 17:34:39 -08:00
Scott Shawcroft 473bdf48f6
A safe mode fix and displayio fixes
* Fixes safe mode on the SAMD51. The "preserved" value was being
clobbered by the bootloader.
* Fixes auto-reload loop when in safe mode.
* Fixes reading Group children with [].
* Check that a TileGrid actually moves before queueing a refresh.
2019-02-13 15:31:06 -08:00