Commit Graph

749 Commits

Author SHA1 Message Date
sommersoft b1c3d47413 Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-09-01 21:16:12 -05:00
Matthew Newberg d87bfaf480 Add random dithering to ColorConverter 2019-08-31 22:07:09 -04:00
sommersoft 398e7ff6d3 doc update 2019-08-31 16:06:41 -05:00
sommersoft f82c61732a enable Mixer backwards compatibility (when audiomixer is available) 2019-08-31 16:06:16 -05:00
sommersoft 8120f5cdad Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-08-29 22:14:53 -05:00
sommersoft 6a68d0b4d0 bring back 'mixer.play()' & 'mixer.stop_voice()' 2019-08-29 22:12:12 -05:00
sommersoft e618441e18 eval the expression vs [un]defined 2019-08-29 22:09:45 -05:00
Dan Halbert 7a64af9280 rename bleio module to _bleio 2019-08-29 18:44:27 -04:00
Dan Halbert b11b7916fd address minor issues: typos, make translate, and sphinx 2019-08-29 17:58:21 -04:00
Dan Halbert f17059b10b another API rework: less abstraction leakage 2019-08-28 23:15:22 -04:00
Dan Halbert 19c59b41ed bleio: API change to create and connect related objects simulatenously: no orphan bleio objects 2019-08-28 16:15:09 -04:00
Dan Halbert a72bcab0fd Merge remote-tracking branch 'adafruit/master' into bleio-api-revamp 2019-08-28 16:09:18 -04:00
Scott Shawcroft 966a48b23a
More size_t usage 2019-08-27 12:49:46 -07:00
Scott Shawcroft d956b3b359
Merge remote-tracking branch 'adafruit/master' into remove_i2c_stop_kwarg 2019-08-27 11:23:30 -07:00
Scott Shawcroft bea77c651a
Minor renames 2019-08-26 16:37:59 -07:00
Dan Halbert 76446f634b BLE HID WIP: works everywhere except iOS; fixed a bunch of bugs; pretend bonding 2019-08-25 21:38:13 -04:00
sommersoft 750ffcc81a docs: correct audiomixer refs 2019-08-25 14:57:29 -05:00
sommersoft df5568d993 move Mixer & MixerVoice from 'audiocore' to 'audiomixer' 2019-08-24 23:36:18 -05:00
sommersoft b54fd961cb Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-08-24 17:14:05 -05:00
sommersoft db32a79596 comment clean up 2019-08-24 16:21:30 -05:00
sommersoft d02d474cac fix MixerVoice 'get_playing' 2019-08-24 08:20:26 -05:00
sommersoft 93e557e167 docs: make MixerVoice.level a property 2019-08-24 07:57:55 -05:00
sommersoft 2c55b40a53 use a MixerVoice constructor 2019-08-24 07:56:12 -05:00
Scott Shawcroft 7324b70a7c
Rework based on Dan's review 2019-08-23 15:27:21 -07:00
Scott Shawcroft 5662b5813e
Use size_t and document buffers can be the same. 2019-08-23 12:13:11 -07:00
Scott Shawcroft 72e7ffa324
More cleanup 2019-08-22 16:16:09 -07:00
sommersoft 1ec4faee55 remove MixerVoice deinit & context managers 2019-08-22 17:59:19 -05:00
Scott Shawcroft f2a1972ba8
Add refresh_time to use if busy_pin is not given 2019-08-22 14:23:33 -07:00
Scott Shawcroft 3a98de1236
Add reset() to display busses to detect whether it works 2019-08-22 14:23:33 -07:00
Scott Shawcroft 24b30965c4
Refresh ePaper displays once code.py is done running 2019-08-22 14:23:32 -07:00
Scott Shawcroft 36a23e0fe3
Rework refresh API and factor common display stuff out
NOT TESTED! Just compiles

Fixes #1691
2019-08-22 14:23:27 -07:00
Scott Shawcroft c247e7df9c
Begin refresh rework. 2019-08-22 14:08:33 -07:00
Scott Shawcroft 70680d5b22
EPaper displays work mostly. 2019-08-22 14:08:33 -07:00
Scott Shawcroft 8fa8737465
Initial ePaper work 2019-08-22 14:08:32 -07:00
Scott Shawcroft 82d436d05e
Add writeto_then_readfrom to I2C API. Deprecate stop kwarg.
writeto_then_readfrom has been added to do a write -> no stop ->
repeated start -> read sequence. This is done to match the
capabilities of Blinka on Linux.

Code that uses stop=False will not work correctly on Blinka.
To fix, if stop=False then use writeto_then_readfrom otherwise use
writeto then readfrom_into.

First step in #2082
2019-08-22 12:34:46 -07:00
Dan Halbert 7cc15e56c8 make translate 2019-08-22 15:20:23 -04:00
Dave Astels 99a3da3b60 Get rid of the last bits of array dependancy 2019-08-21 15:24:39 -04:00
Dave Astels d547d59cba Merge remote-tracking branch 'adafruit/master' into displayio_fill_area 2019-08-21 15:02:51 -04:00
Dave Astels 8bbab01316 Remove unneeded lines 2019-08-21 13:57:52 -04:00
sommersoft 5cd04366fe remove 'if float' pre-processor checks 2019-08-20 22:39:26 -05:00
Dave Astels 56aad056da getting the buffer info should happen first (due to its check) 2019-08-20 17:00:24 -04:00
Dave Astels eb0a8cc0bf Move the get_buffer call earlier 2019-08-20 13:48:12 -04:00
Dave Astels 0fd886fa7f Remove array cast 2019-08-20 13:45:58 -04:00
Dan Halbert e00696de7f merge from upstream and make translate 2019-08-20 13:06:23 -04:00
Dave Astels f3d476aad8 Remove temporarily comments code 2019-08-20 12:25:56 -04:00
Dave Astels 53bb95a023 Rework to simplify 2019-08-20 10:05:41 -04:00
Dave Astels 10bc0d29d1 Switch to positional parameters 2019-08-20 10:05:09 -04:00
Dave Astels 2b7897cded Fix typo 2019-08-20 10:03:36 -04:00
sommersoft e9efc2fe25 fix one more doc ref to audiocore 2019-08-20 08:32:20 -05:00
Dan Halbert cccbbd956d Detect lack of pulldown; check for pin in use 2019-08-19 23:40:34 -04:00
sommersoft e92ef7b018 fix doc refs for audiocore 2019-08-19 22:04:06 -05:00
Scott Shawcroft bd4d3c6393
Merge pull request #2068 from jepler/audioio-compat
audioio: By default, be compatible with 4.x
2019-08-19 19:43:52 -07:00
sommersoft 1b2996a75e Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-08-19 21:23:27 -05:00
Dan Halbert e3dc5e3a66 Merge remote-tracking branch 'adafruit/master' into run-background-tasks
Restore dependencies indicated by indentation in circuitpy_mpconfig.h.
2019-08-19 12:41:20 -04:00
Dan Halbert 6b54e6749e
Merge pull request #2032 from pewpew-game/audiocore-buffer
Allow to specify pre-allocated buffer in audicore.WaveFile
2019-08-19 11:54:19 -04:00
Jeff Epler f384d2dd80 shared-bindings/time: style 2019-08-18 08:11:14 -05:00
Dan Halbert e2a4c76a37 make nrf touchio be generic: now available for SAMD51 too 2019-08-18 08:44:10 -04:00
Jeff Epler 9d164965c9 localtime: don't hard-fault on argument type errors; handle localtime(float)
It turns out `mp_obj_int_get_checked` is not appropriate to call when
the argument is not of int or long type--the "checked" refers to guarding
against overflow/underflow, not type checking.

For compatibility with CPython, handle float arguments.

Closes: #2069
2019-08-17 20:49:25 -05:00
Jeff Epler 47d6dd843e audioio: By default, be compatible with 4.x
Testing performed: That the shipped .mpy files on a PyPortal (CP 4.x)
still work (play audio) with this branch, instead of erroring because
`WaveFile` can't be found in `audioio`.

Flash usage grew by 28 bytes.  (I expected 24, there must be some other
effect on size/alignment that I didn't predict)
2019-08-17 13:54:06 -05:00
Radomir Dopieralski 58b4cd4956 Improve docs for WaveFile buffer 2019-08-17 11:31:45 +02:00
Dave Astels 7a235f3746 Simplify to only extracting one line
Since this was the usecase, doing so simplifies the function significantly.
2019-08-16 21:10:09 -04:00
Dan Halbert 630c92392a address review comments; avoid calling common_hal_bleio_device... routines from shared-bindings 2019-08-16 15:18:53 -04:00
Dan Halbert af29fc3ea8 make translate and fix sphinx issues 2019-08-15 21:54:52 -04:00
Jeff Epler 32a6d36405 shared-bindings: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Dan Halbert 1570ef2dd4 specifying attribute length; fix up value setting 2019-08-07 23:49:09 -04:00
Dave Astels 239ad19765 Pass in preallocated result buffer 2019-08-07 15:27:43 -04:00
Dave Astels 263f6f439b Remove obsolete experimental property 2019-08-07 15:27:04 -04:00
Dan Halbert d047b73a9c fix newly-introduced bugs; UART client/server working again 2019-08-07 11:10:21 -04:00
Dan Halbert d74c8b9425 WIP: more Descriptor work; refactor gattc/gatts read/write 2019-08-06 22:55:25 -04:00
Dan Halbert 243334da75 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 23:06:24 -04:00
Scott Shawcroft 26f64dd8ec
Merge remote-tracking branch 'adafruit/4.1.x' into merge_in_410 2019-08-05 17:53:08 -07:00
Scott Shawcroft b675a27e16
Merge pull request #2000 from jepler/nrf-pwm-audio
Implement PWM audio out for the nrf port
2019-08-05 17:26:27 -07:00
Dan Halbert b67d04a5b1 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 16:35:44 -04:00
Roy Hooper 3cf9a475b9 fix 'white' byte for dotstars 2019-08-04 11:02:33 -04:00
Roy Hooper 5c08182c73 fix fix the byte order property. 2019-08-03 13:35:11 -04:00
sommersoft 065efb05b7 bring MixerVoice back to building state; update documentation 2019-08-03 11:20:06 -05:00
Radomir Dopieralski 9907e3fa28 Allow to specify pre-allocated buffer in audicore.WaveFile
It lets us re-use the same buffer for playing multiple files.
This also allows us to control the size of the buffer. Half of the
buffer will be used for the fist, and half for the second internal
buffer.
2019-08-03 14:15:19 +02:00
Dan Halbert 7ce3776b80 WIP: rework of Characteristic properties; enhance Descriptor; not tested 2019-08-02 17:57:31 -04:00
Radomir Dopieralski c1e5247d51 Add support for scaling to _stage
On high-resolution displays we can use 2x2 or even 3x3 pixels.
2019-08-02 22:55:55 +02:00
Roy Hooper cff9c9bc95 Reuse error message 2019-08-01 20:24:39 -04:00
Dave Astels cd092df9d8 Merge remote-tracking branch 'adafruit/master' into displayio_fill_area 2019-07-31 18:46:41 -04:00
sommersoft 9939d0c4f4 Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-07-31 16:44:43 -05:00
Jeff Epler b0f7c7bc4c Merge remote-tracking branch 'origin/master' into nrf-pwm-audio 2019-07-31 16:32:54 -05:00
Radomir Dopieralski c4c5d8c5e7 Fix missing write_ram_command in _stage
Since the changes in displayio, displayio_display_set_region_to_update
no longer sends the write_ram_command, so we have to send it explicitly.
2019-07-31 23:32:42 +02:00
Dave Astels 1f9cb44fa3 Expose rotation with a property 2019-07-31 15:00:21 -04:00
Dave Astels 741cd9c40a Get fill_area working 2019-07-31 12:47:32 -04:00
Dan Halbert ee518b9141 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-07-31 11:22:48 -04:00
Dan Halbert 91d791afd0 cleanup adapter.address; add uniquish suffix to BLE device name 2019-07-31 00:30:24 -04:00
Scott Shawcroft 366fdcce18
Merge pull request #2011 from tannewt/ssd1322
Add knobs for SSD1322 and two displayio fixes.
2019-07-30 14:15:37 -07:00
Dan Halbert 83129b8c63 BLE: peripheral client pairing (not yet bonding); fix time doc formatting 2019-07-30 14:26:26 -04:00
Scott Shawcroft f9d314b263
Merge pull request #1985 from sommersoft/dynamic_support_matrix
Docs: Dynamically Build Support Matrix Table
2019-07-29 18:08:16 -07:00
Scott Shawcroft 3b3a7bbd06
Update pwmaudioio module for PWMAudioOut 2019-07-29 17:45:06 -07:00
Scott Shawcroft 3961014a9e
Update doc comments for PWMAudioOut 2019-07-29 17:43:22 -07:00
Jeff Epler b72352949b PWM audio: Rename AudioOut -> PWMAudioOut, _audioio_ -> _audiopwmio_ 2019-07-29 18:39:00 -04:00
sommersoft bbc5255f04 update rST ref link for support matrix 2019-07-28 21:25:43 -05:00
Seth Itow a2bab9f172
bleio: Fix typo in Peripheral example code. 2019-07-27 12:58:28 -07:00
Dan Halbert 28ca05ccdc allow discovery from central or peripheral 2019-07-27 13:22:15 -04:00
sommersoft cebdadd0f6
Merge branch 'master' into dynamic_support_matrix 2019-07-27 10:46:53 -05:00
sommersoft c335f170d7 update 'Core Modules' description 2019-07-27 10:36:08 -05:00
sommersoft c6ac0ba683 move the support matrix to its own page; add linking for modules 2019-07-27 10:03:18 -05:00
Roy Hooper cf3bb7e118 fix bugs and inline the byteorder code 2019-07-26 18:52:22 -04:00
Jeff Epler aa1398e696 support matrix: add audiopwmio, update audiocore, sort 2019-07-26 07:57:21 -05:00
Jeff Epler 91b7ba7dcc docs: An `audiocore.Mixer` suffices where another audio source would 2019-07-26 07:57:21 -05:00
Jeff Epler a53720810b docs: corrections that stem from the "audiocore" rename 2019-07-26 07:57:21 -05:00
Jeff Epler 54cde56ec5 audiopwmio: Add the shared files for this new module 2019-07-26 07:52:37 -05:00
Scott Shawcroft af8cfbedfb
Add knobs for SSD1322 and two fixes.
* Fix terminal clear after first successful code.py run.
* Fix transmitting too many bytes for column constraint with single
  byte bounds.
2019-07-25 15:41:12 -07:00
Dave Astels b6178c9d85 WIP on exposing fill_area 2019-07-25 15:05:30 -04:00
Scott Shawcroft 485f06e36f
Remove unneeded headers 2019-07-25 11:58:27 -07:00
Jeff Epler 6b44e40ee8 audiocore: Factor from audioio
When nrf pwm audio is introduced, it will be called `audiopwmio`.  To
enable code sharing with the existing (dac-based) `audioio`, factor
the sample and mixer types to `audiocore`.

INCOMPATIBLE CHANGE: Now, `Mixer`, `RawSample` and `WaveFile` must
be imported from `audiocore`, not `audioio`.
2019-07-25 06:44:26 -05:00
sommersoft 7b67ef15c4 remove local copy of 'support_matrix.json' 2019-07-23 17:11:39 -05:00
Roy Hooper 31e4591691 WIP: refactor _pixelbuf to use strings instead of classes 2019-07-21 16:37:06 -04:00
Roy Hooper a62a1ae2bd WIP: refactor _pixelbuf to use strings instead of classes 2019-07-21 16:30:09 -04:00
Roy Hooper db84445a62 WIP: refactor _pixelbuf to use strings instead of classes 2019-07-21 16:21:39 -04:00
Scott Shawcroft 1d1b8703b6
Review feedback including NO_BRIGHTNESS_COMMAND macro 2019-07-19 16:11:13 -07:00
Scott Shawcroft 6797ec6ed3
Add support for grayscale displays that are < 8 bit depth.
This also improves Palette so it stores the original RGB888 colors.

Lastly, it adds I2CDisplay as a display bus to talk over I2C. Particularly
useful for the SSD1306.

Fixes #1828. Fixes #1956
2019-07-19 16:06:11 -07:00
Scott Shawcroft 4a6bdb6fe4
Track a dirty area for in-memory bitmaps
This fixes the bug that bitmap changes do not cause screen updates
and optimizes the refresh when the bitmap is simply shown on the
screen. If the bitmap is used in tiles, then changing it will
cause all TileGrids using it to do a full refresh.

Fixes #1981
2019-07-18 16:47:28 -07:00
Dan Halbert 1c31cf5f6a sphinx fix 2019-07-16 21:03:36 -04:00
Dan Halbert 364ee62d10 Address review comments. 2019-07-16 19:53:36 -04:00
Dan Halbert 514d4146d3 Fix sphinx warnings. 2019-07-11 18:23:45 -04:00
Dan Halbert 6a001786a9 merge from master 2019-07-09 08:58:49 -04:00
Dan Halbert 118b26b335 UARTClient now works both directions 2019-07-09 00:21:46 -04:00
Dan Halbert 09ddff8df1 WIP: Need descriptors for Central CCCD discovery; not done yet 2019-07-07 00:07:47 -04:00
sommersoft 4342383d95 add jinja extension; update shared-bindings/index.rst to use jinja 2019-07-04 01:19:56 -05:00
sommersoft f1256c0b35 add script to gather module support matrix info; add initial json file 2019-07-04 01:18:16 -05:00
iot49 6e5d70fa19 changed type of receiver_buffer_size to uint16_t 2019-07-03 12:02:01 -07:00
Dan Halbert bf8a35b2f8 WIP: CharacteristicBuffer for Central; not working: need to set remote Characteristic Service 2019-07-02 22:34:54 -04:00
Scott Shawcroft 745ff8f8c1
Fix Group subscr to detect delete correctly
Fixes #1957
2019-07-02 18:15:23 -07:00
Dan Halbert 6ea01ea9b0 Central is connecting; characteristics can be read and written 2019-06-29 00:20:06 -04:00
Dan Halbert 140904ec84 getting Scanner to work 2019-06-22 22:10:15 -04:00
Dan Halbert 4881e1ff55 WIP: Central compiles; now will test 2019-06-21 18:04:04 -04:00
Dan Halbert 24ac1fdcab WIP: backup only; not compiled 2019-06-19 21:54:28 -04:00
Dan Halbert a1b5d800f3 Update copyrights; get ready for Central 2019-06-19 10:42:36 -04:00
Dan Halbert 35b9191857 Don't operate directly on bleio objects in shared-bindings: use common_hal
routines instead. Changes made but not yet tested.
2019-06-18 23:46:20 -04:00
Craig Forbes 09e7f4db00 Fix reference to Bitmap in fontio.Glyph docs. 2019-06-18 18:44:50 -05:00
Craig Forbes e442efbdec Fix docs in digitalio. 2019-06-18 16:59:05 -05:00
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
Dan Halbert 1356819de1 Handle None for BLE name; fix ScanEntry bug; compile issue 2019-06-17 23:16:40 -04:00
Scott Shawcroft 4013bcde9e
Add baudrate to FourWire and shorten delay. 2019-06-17 17:48:05 -07:00
Dan Halbert cfa8b4b5a9 Merge remote-tracking branch 'adafruit/master' into ble-scanner 2019-06-13 22:01:46 -04:00
Dan Halbert bed6d43a76 merge from upstream; WIP redo Address; no more AddressType 2019-06-13 21:55:07 -04:00
Scott Shawcroft 6d388a34eb
Merge pull request #1943 from adafruit/4.0.x
Merge in gamepadshift fix to master.
2019-06-13 12:26:04 -07:00
Scott Shawcroft 6f6dcafd90
Minor tweaks based on Dan's feedback 2019-06-13 00:34:19 -07:00
Radomir Dopieralski 5e265f4fbd
When clearing gamepad buffer, use the last button state, not 0
When reading the accumulated button presses in gamepad and gamepadshift,
don't clear the buffer to "no buttons pressed", but instead set it to
the current (last checked) state. This clears the accumulated presses,
but retains any ongoing ones.

This fixes #1935
2019-06-12 11:42:41 -07:00
Scott Shawcroft a35d9b469d
Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -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
Dan Halbert 4fc189b60c Merge latest 4.0.x fixes into master 2019-06-11 16:16:29 -04:00
Dan Halbert 6fed24e1b6 WIP 2019-06-10 07:18:28 -04: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
Dan Halbert 62de2506e4 Include display objects in gc. 2019-06-06 17:49:32 -04:00
Scott Shawcroft 84e89146d0
Merge pull request #1893 from elvis-epx/ps2
Add PS/2 support with ps2io module
2019-06-06 10:24:04 -07:00