Commit Graph

1147 Commits

Author SHA1 Message Date
foamyguy
90fadc58fd implement color_number argument for vectorio.Rectangle 2022-03-18 18:28:29 -05:00
Scott Shawcroft
dcc3ec171e
Merge remote-tracking branch 'adafruit/7.2.x' into merge_7.2.2 2022-03-15 13:56:11 -07:00
Scott Shawcroft
32ac396a41
Further refine autoreload
This unifies the delay into the post-run delay that also waits
for user input and fake sleep. This ensures we always delay.
Previous code would only delay if the code.py was running when
autoreload was triggered. Now it will always delay.

We also now suspend autoreload when a USB write starts and then
resume on completion. This should prevent reloading in between
sectors of a single write.
2022-03-14 16:49:30 -07:00
Dan Halbert
e4cd9690f1 rework auto-reload delay logic 2022-03-11 14:03:04 -05:00
Scott Shawcroft
00dcf6bd03
Tweaks from review 2022-03-11 10:51:50 -08:00
Scott Shawcroft
83593a1558
Start of USB host API
This allows you to list and explore connected USB devices. It
only stubs out the methods to communicate to endpoints. That will
come in a follow up once TinyUSB has it. (It's in progress.)

Related to #5986
2022-03-07 18:07:25 -08:00
Scott Shawcroft
08b44eade5
Merge pull request #6114 from pewpew-game/displayio-9bit
Add support for 9-bit mode to displayio.FourWire
2022-03-04 16:55:02 -08:00
Radomir Dopieralski
102ee716a7 Add support for 9-bit mode to displayio.FourWire
If the ``command`` pin is None, that information will instead be
sent as a ninth bit in the SPI transactions.

Fix #6109
2022-03-04 22:59:17 +01:00
Tsutomu IKEGAMI
c9aa4527a9 Fix freeze on bitmaptools.dither 2022-03-04 17:06:07 +09:00
Dan Halbert
a45f9a83ea Merge remote-tracking branch 'adafruit/7.2.x' into merge-7.2.x-to-main 2022-02-24 13:07:56 -05:00
Kevin Matocha
790af2d9a6 fix REPL terminal garbled characters upon code.py finished 2022-02-21 14:58:16 -06:00
Kevin Matocha
6b2266b240 retains REPL terminal data after display.show(None) when terminal size is not changed 2022-02-21 10:33:48 -06:00
Kevin Matocha
03f42406d3 updated code so the REPL will retain its text if not resized when code stops 2022-02-21 10:33:08 -06:00
Michael Himing
4bd64885b4 msgpack.unpack requires a readable stream 2022-02-21 09:16:36 +11:00
gamblor21
664e02535b Renaming and documentation 2022-02-20 15:32:44 -06:00
gamblor21
ba229f1007 Initial commit of uzlib module 2022-02-19 10:41:42 -06:00
Dan Halbert
fe6e03f504
Merge pull request #6013 from tannewt/esp_ble_gatt_client
Add S3 GATT client support
2022-02-17 16:02:11 -05:00
Tod Kurt
98ff9957fc appease ci 2022-02-10 17:14:07 -08:00
Tod Kurt
17440ec10c fix #6015 2022-02-10 16:10:05 -08:00
Scott Shawcroft
8958e7ef08
Add S3 GATT client support
This allows you to connect to GATT services on the other device.
It also adds connection initiation (GAP central).

More progress on #5926
2022-02-10 11:31:57 -08:00
Scott Gauche
3b418dbddc change half_duplex to be on spi construct 2022-02-08 21:37:38 -05:00
Jeff Epler
07e710b0a0
Merge remote-tracking branch 'origin/main' into floppy 2022-02-04 09:01:36 -06:00
Dan Halbert
a39f0cfede
Merge pull request #5977 from prplz/bitbang-i2c
Bitbang i2c: switch scl to input for reading
2022-02-03 18:34:49 -05:00
Dan Halbert
4dc9b00221
Merge pull request #5954 from kmatch98/repl_wrangler
Expose display’s root_group, add function to resize REPL terminal
2022-02-02 15:36:22 -05:00
Michael Himing
5472f41860 Bitbang i2c: switch scl to input for reading 2022-02-02 22:54:35 +11:00
gamblor21
9cc470677e merge 2022-02-01 20:31:13 -06:00
gamblor21
afb04f8378 Fix to i2c code 2022-02-01 20:27:54 -06:00
Mark
5972fdc108
Merge branch 'main' into is31pixelbuf 2022-02-01 13:59:28 -06:00
Scott Shawcroft
2964e966b1
Merge pull request #5958 from dhalbert/i2c-common-hal-write-read
I2c common hal write read
2022-02-01 11:08:50 -08:00
Dan Halbert
0b26dba44d
Merge pull request #5955 from prplz/is31fl3741
Only enable is31fl3741 for led glasses board
2022-02-01 12:55:31 -05:00
Kevin Matocha
0290fc35d2 Removing some unnecessary files that were changed 2022-02-01 08:28:40 -06:00
Dan Halbert
cc410ad6a3 common-hal I2C combined write_read 2022-01-31 22:03:30 -05:00
Dan Halbert
d5740c8ad9 Merge remote-tracking branch 'adafruit/main' into i2c-common-hal-write-read 2022-01-31 18:51:32 -05:00
Michael Himing
c92c8ac184 Only enable is31fl3741 for led glasses board
Also fix a warning in is31fl3741
2022-02-01 09:45:50 +11:00
Dan Halbert
25707d311a Track creation of board.I2C(), etc. 2022-01-30 23:20:51 -05:00
Dan Halbert
83e6e6690a wip; works on espressif 2022-01-29 22:44:27 -05:00
Dan Halbert
a672ee6da5
Merge pull request #5862 from jepler/shared-module-i2c
Remove unused files
2022-01-27 22:46:34 -05:00
Scott Shawcroft
5a6f456dbb
Add BLE scanning for S3 and C3.
Everything else should raise NotImplementedError.

First step in #5926
2022-01-25 16:28:46 -08:00
Dan Kulinski
19f9163892 Bringing branch up to date with current main 2022-01-25 11:02:00 -07:00
gamblor21
af93817552 Fixing bad merge 2022-01-23 14:57:06 -06:00
Mark
21c8ac9d4c
Merge branch 'main' into is31pixelbuf 2022-01-23 13:41:10 -06:00
gamblor21
563d8f297c Major refractor to make a common base object 2022-01-23 13:12:37 -06:00
microDev
67293c265c
Merge branch 'main' into board-bus 2022-01-21 10:08:39 +05:30
microDev
30c0891fba
cleanup post instance parameter removal 2022-01-20 20:07:42 +05:30
Jeff Epler
8e895e1986
Add floppyio for rp2040
Tested on RP2040 Feather with a 3.5" Prodigy diskette, the whole
surface reads 100% across 3+ trials.
2022-01-17 16:34:47 -06:00
gamblor21
cf2c8eeec4 Moved init functions to helper python library 2022-01-17 16:13:27 -06:00
Dan Kulinski
ca8299e51b Update logic for offset 2022-01-14 15:25:40 -07:00
Dan Kulinski
fbd9e3284b Add two byte length check 2022-01-14 15:25:40 -07:00
Jeff Epler
ab4e1481fc
Are these files even used? 2022-01-14 15:22:30 -06:00
Jeff Epler
6c53b06a3c
Update adafruit floppy submodule 2022-01-14 14:11:12 -06:00
Jeff Epler
d816a4f19d
Add floppyio
Initially enabled for samd51, this enables reading raw flux data as well
as DOS/MFM formatted media.

This is only the low-level code for reading & decoding flux pulses from a floppy drive.
high level details will live in a Python library.

adafruit-circuitpython-floppy will take care of details like stepping
from track to track, etc.
2022-01-13 15:37:36 -06:00
Ben Combee
131b94540e audiomp3: reset decoded_samples when file resets
In testing, I saw that the decoded_samples value kept increasing when I
stopped and restarted playback, as I'd missed setting it back to zero
during the reset operation.
2022-01-02 15:19:25 -06:00
Ben Combee
98b0029a29 audiomp3: add decoded_samples property
In my testing, there is no way to accurately know how far into a MP3 file
you're currently playing. You can use monotonic time, but that can have
drift versus the audio playback system, which may not be running at exactly
the expected sample rate.

To allow syncing animation with timestamps in a MP3 file, this presents a
new property, decoded_samples, that records the number of audio samples
sent out of the decoder. While this may not be a completely accurate time,
due to mixer delays, it's much better position that the monotonic clock
difference.

Implementation is keeping track of this value in the mp3file structure and
adding to it whenever data is sent out of the decoder. The property
implementation was a copy/paste from current properties in the audiomp3
files.
2022-01-01 23:28:43 -06:00
Jeff Epler
8a94d9a255
Merge pull request #5784 from WarriorOfWire/vectorio_contains
vectorio contains(x, y)
2021-12-31 16:11:24 -07:00
Dan Halbert
2c4e3aa880
Merge pull request #5786 from prplz/fix-busdevice-stub-path
Fix busdevice stub path
2021-12-28 10:43:54 -05:00
Michael Himing
fe71ee0812 Fix busdevice stub path 2021-12-28 19:31:40 +11:00
Dan Halbert
41d494df0b go into safe mode if not CIRCUITPY available 2021-12-27 18:58:24 -05:00
Kenny
8de5f90086 vectorio contains(x, y)
new utility function for all vectorio shape specializations for testing
whether a screen-space x,y point falls within a shape's x,y.

This respects the current orientation of the screen in the manner of
displayio and vectorio - so your x,y requests are in the same coordinate
domain as your x,y locations and your width/height etc. properties that
ou set on other shapes. I.e., if you're using this for touch points then
you will need to make sure the touch events are in the same x,y domain as
your display.

```
contains(2, 4) -> true
------------------
|                |
|                |
| --             |
| | \            |
| |. \           |
| |   \          |
| |____\         |
|                |
------------------

contains(5, 4) -> false
------------------
|                |
|                |
| --             |
| | \            |
| |  \.          |
| |   \          |
| |____\         |
|                |
------------------
```

This helps provide low overhead introspection of shape coverage on screen.
It's envisioned that this will be used for things like touch-and-drag
widget controls, touch "areas" and may help with random ornament placement
on toy Christmas trees.
2021-12-27 12:01:19 -10:00
foamyguy
2ce9dc7680 Merge branch 'adafruit_main' into tilegrid_size_props 2021-12-20 07:31:08 -06:00
George Waters
c615daff30
Explicitly cast float to mp_int_t
Not sure why this is necessary, but it prevents an off-by-one error in
some (rare?) circumstances.
2021-12-17 16:23:58 -05:00
Scott Shawcroft
01f8cffdae
Support 32 bit color with vectorio
Fixes #5639
2021-12-14 17:13:11 -08:00
gamblor21
7c1afb070a Documentation fixes 2021-12-13 22:31:29 -06:00
gamblor21
11ef0b48c0 Change map to tuple to save memory and match _write 2021-12-13 22:31:29 -06:00
gamblor21
9fafd7d7fd Initial commit 2021-12-13 22:31:29 -06:00
foamyguy
c4be8a5c94 tilegrid size properties 2021-12-13 09:44:08 -06:00
Kenny
17b53c7ebe vectorio: Add width and height properties to rectangle
Closes: https://github.com/adafruit/circuitpython/issues/5695
2021-12-12 19:50:00 -08:00
microDev
b6858e4ca7
allow multiple board buses
Co-authored-by: Neradoc <neraOnGit@ri1.fr>
2021-12-11 23:07:21 +05:30
Jeff Epler
bc9ef87d05
print addl debug message 2021-12-08 21:03:06 -06:00
Jeff Epler
11c573ef95
sdcardio: Don't require reaching idle state during early init
.. which is what the addition of cmd25 made happen. We still signal
an error when failing to reach the idle state at any other time,
which _is_ different than adafruit_sdcard but I think that it is
correct.

This fixed #5600 according to Dan's testing on a GCM4 on the internal
SD card slot. There are still some ambiguous results on the MM4 with
external SD card slot on 6" jumper wires.
2021-12-08 21:03:03 -06:00
Scott Shawcroft
ee5536386d
Merge remote-tracking branch 'adafruit/main' into rpi 2021-11-24 14:23:23 -08:00
Scott Shawcroft
153ff6031e
Merge pull request #5616 from jepler/bitmaptools-bugfixes
Bitmaptools bugfixes
2021-11-24 11:50:29 -08:00
Scott Shawcroft
b09c777d0a
Merge pull request #5584 from gamblor21/is31
IS31FL3741 Framebuffer Driver
2021-11-24 11:41:51 -08:00
Jeff Epler
30c07a772f
bitmaptools: dither: get rid of shifts
this happens to make the occasional FS dither artifact disappear.
I guess `a * b >> 8` and `(a * b) / 256` are not identical.  I'm not
sure if it was just the parens or not, but write the clearer code and
rely on the compiler to substitute an appropriate shift if possible.
2021-11-24 09:51:24 -06:00
Jeff Epler
9af76a2f03
bitmaptools dither: Fix off-by-one error filling row data 2021-11-24 09:51:23 -06:00
Scott Shawcroft
927a720de9
Fix I2C and feedback from Dan 2021-11-23 17:23:13 -08:00
gamblor21
97032fdbd0 Renaming files 2021-11-23 17:21:13 -06:00
gamblor21
9f2660f6ac Capitalization changes 2021-11-23 17:06:39 -06:00
gamblor21
fc3b0340b5 Remove hard coded mapping of LEDs 2021-11-23 13:21:09 -06:00
Timon
a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
gamblor21
5243a33584 Check map to display size 2021-11-20 14:04:49 -06:00
gamblor21
6b2d43d3c8 Mapping for LEDs to diplay 2021-11-20 14:04:49 -06:00
gamblor21
9fa3feffb1 Cleanup 2021-11-20 13:46:12 -06:00
gamblor21
2f277eba3e Cleanup and i2c fix 2021-11-20 13:46:12 -06:00
gamblor21
e877449ae0 Cleanup 2021-11-20 13:46:12 -06:00
gamblor21
aa92d3a476 Cleanup and scaling addition 2021-11-20 13:46:11 -06:00
gamblor21
29c58575b0 Removed prints updated brightness 2021-11-20 13:46:11 -06:00
gamblor21
d063bf2675 Initial commit for IS31 2021-11-20 13:46:11 -06:00
Jeff Epler
f4e68e8fae
use mp_get_stream_raise, it's more specific 2021-11-20 08:53:04 -05:00
Jeff Epler
ee5e7161af
bitmaptools: use stream API
this allows `readinto` to succeed in the unix port, where the VFS
is not FAT
2021-11-20 08:51:40 -05:00
Jeff Epler
edac675c48
rainbowio: optimize for code size
.. this saves 76 bytes on trinket_m0
2021-11-12 17:31:22 -06:00
Jeff Epler
c91901dc37
rainbowio: Fix some things the unix build errors about 2021-11-12 17:31:13 -06:00
Jeff Epler
d55388a17d
Add bitmaptools to unix build 2021-11-12 10:47:18 -06:00
Jeff Epler
c6dbc7df3a
Add displayio bitmaps to unix build 2021-11-12 10:47:17 -06:00
Jeff Epler
340d6b9213
more missing-prototypes fixes 2021-11-10 21:00:17 -06:00
Jeff Epler
c9475adb00
Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
Jeff Epler
621953c960
Additional missing-prototypes fixes
I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
2021-11-10 10:55:53 -06:00
Jeff Epler
63fbf98186
Enable -Wmissing-prototypes for atmel-samd 2021-11-09 20:05:00 -06:00
Jeff Epler
cbfa41f238 Merge remote-tracking branch 'origin/main' into dither3 2021-11-08 16:46:36 -06:00
Jeff Epler
eaf8bc0abe bitmaptools: add dither
This can convert a BGR565_SWAPPED bitmap to B&W in about 82ms on
esp32-s2.
2021-11-08 10:35:44 -06:00
Jeff Epler
dfafab675f Enable L8 mode for alphablend 2021-11-05 11:26:07 -05:00