Commit Graph

1290 Commits

Author SHA1 Message Date
George Waters
02d0881fca
Fix error when getting a pixelbuf slice 2020-05-20 17:56:08 -04:00
Scott Shawcroft
ba724fffb4
Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalio 2020-05-20 10:48:27 -07:00
Scott Shawcroft
49090d1378
Fully implement digitalio and pin-in-use tracking.
Fixes #2901
2020-05-19 17:46:29 -07:00
Sean Cross
34f91f01c6 bleio: adapter: add advertising timeout and status
Add a field to allow specifying a timeout when initiating advertising.
As part of this, add a new property to determine if the device is still
advertising.

Additionally, have the `anonymous` property require a timeout, and set
the timeout to the maximum possible value if no timeout is specified.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19 15:01:19 +08:00
Sean Cross
cfe65742a3 _bleio: support anonymous advertising
Add a new parameter to the `start_advertising()` function to enable
anonymous advertising.  This forces a call to `sd_ble_gap_privacy_set()`
with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and
`private_addr_type` set to
`BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`.

With this, addresses will cycle at a predefined rate (currently once
every 15 minutes).

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19 15:01:18 +08:00
Scott Shawcroft
2c2b53303d
Merge pull request #2837 from k0d/serial-debug
Add support for a debug console, such as ST-Link VCP.
2020-05-18 18:13:31 -07:00
Mark Olsson
007c92ee6a Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
warriorofwire
dde66cadde remove a duplication in polygon.c 2020-05-18 13:32:06 -07:00
warriorofwire
4bbb80e31a vectorio: speed up polygon
This change takes polygon from 126k pixels per second fill to 240k pps fill
  on a reference 5 point star 50x66px polygon, updating both location and shape
  at 10hz.  Tested on an m4 express feather.

As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;`
  fills just shy of 375k pixels per second.
2020-05-18 13:32:06 -07:00
ppolk-nocimed
c6406c74ec Added DigitalInOut suggestion 2020-05-16 13:21:34 -07:00
ppolk-nocimed
f76ff1eb69 Fixed Optional[Pull] 2020-05-16 13:14:50 -07:00
ppolk-nocimed
db924fb01e Digital In Out Type Hints 2020-05-16 12:47:49 -07:00
Thea Flowers
7d167560af Note that nvm.ByteArray is available at microcontroller.nvm
Fixes #2766
2020-05-15 14:53:14 -07:00
Scott Shawcroft
0d8bca92e2
Merge pull request #2810 from dherrada/master
Pyi integration
2020-05-15 10:31:05 -07:00
Sean Cross
f9ed3acf6d aesio: specify writable buffers for destination buffers
When calling `AES.decrypt_into()` or `AES.encrypt_into()`, the
destination buffers may be any buffer kind.  However, we currently
aren't checking to make sure the destination buffer is actually
writable.

Specify `MP_BUFFER_WRITE` for the destination buffers of both of these
objects so we don't inadvertently write to immutable data.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-15 10:22:42 +08:00
Sean Cross
aba36e4abf aesio: use bufinfo rather than mp_str_bytes
In order to accept both `bytes` objects and `bytearray` objects, use a
`bufinfo` construct to retrieve the data rather than
`mp_obj_str_get_data()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-15 10:16:00 +08:00
Scott Shawcroft
15c2d16bf9
Fix help doc 2020-05-14 16:06:13 -07:00
Scott Shawcroft
afc84c2fd1
Fix ulab, math and template. 2020-05-14 15:58:36 -07:00
dherrada
b477c4812d
Fixed minor indentation issue 2020-05-14 16:58:25 -04:00
Scott Shawcroft
db4dbe0752
Merge pull request #2889 from jepler/gamepad-tick
Gamepad, GamepadShift: Fix after lower-power by enabling supervisor tick
2020-05-13 11:53:23 -07:00
Scott Shawcroft
3ffa5604fc
Update countio to python stub docs 2020-05-13 08:36:16 -07:00
Scott Shawcroft
7546d47f77
Merge remote-tracking branch 'adafruit/master' into improve_verification 2020-05-13 08:23:55 -07:00
Jeff Epler
23ba58bbf5 Gamepad & GamepadShift: Initially allocate as long-lived
This makes less heap churn and decreases code size a tiny bit
2020-05-13 10:14:37 -05:00
Jeff Epler
fbf052bb27 Gamepad & GamepadShift: Enable ticks while object exists
Otherwise, button presses might not be noticed.
2020-05-13 10:14:37 -05:00
Scott Shawcroft
4e646ee6e4
Move vectorio to stubs 2020-05-12 18:40:02 -07:00
Scott Shawcroft
cde6651721
Merge remote-tracking branch 'adafruit/master' into improve_verification 2020-05-12 18:23:59 -07:00
Scott Shawcroft
277e8d528b
Merge branch 'master' into Optical-Encoder-Module 2020-05-12 18:22:57 -07:00
Scott Shawcroft
4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
Scott Shawcroft
d274074f01
Merge remote-tracking branch 'adafruit/master' into vectorio 2020-05-12 12:29:05 -07:00
Scott Shawcroft
bc40034a08
Merge branch 'master' into Optical-Encoder-Module 2020-05-12 12:12:51 -07:00
Scott Shawcroft
a1091bbfbb
Merge pull request #2871 from DavePutz/Issue2812
Throw a NotImplementedError for time functions on boards without long ints
2020-05-12 11:40:49 -07:00
dherrada
c534a872a2
Merge branch 'master' into master 2020-05-12 12:26:02 -04:00
dherrada
6490137812
Did usb_hid, usb_midi, ustack, wiznet 2020-05-12 12:08:46 -04:00
dherrada
e4589543fb
Did time, touchio, uheap 2020-05-12 11:43:24 -04:00
dherrada
991045b9ce
Did struct, supervisor, terminalio 2020-05-12 11:28:33 -04:00
Daniel Pollard
22bf99ccc4 Fixed underline in documentation 2020-05-12 14:52:48 +10:00
Daniel Pollard
ee2cb703c8 merged master 2020-05-12 14:41:28 +10:00
warriorofwire
78444a1018 fix VectorShape on_dirty callback registration being set for the wrong type 2020-05-11 21:21:05 -07:00
warriorofwire
040beb0577 Clean up circle documentation 2020-05-11 21:15:40 -07:00
DavePutz
4712f9f104
Merge branch 'master' into Issue2812 2020-05-11 21:48:54 -05:00
Scott Shawcroft
1b0c52c8ca
Merge pull request #2877 from rhooper/pixelbuf-doc-fix
Pixelbuf doc fix
2020-05-11 15:42:33 -07:00
dherrada
603df58f97
Did stage, socket, storage 2020-05-11 13:40:02 -04:00
dherrada
c7a9d49cba
Did rgbmatrix, rotaryio, and RTC 2020-05-11 13:00:19 -04:00
dherrada
838b6c5685
Did ps2io, pulseio, random 2020-05-11 10:48:11 -04:00
warriorofwire
eb3d5fa453 ujson: do not eat trailing whitespace
Ujson should only worry about whitespace before JSON.  This becomes apparent when you are using MP stream protocol to read directly from input buffers.

When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.

Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.

Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.

Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```

- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
2020-05-10 20:45:42 -07:00
Roy Hooper
09fedb3fd5 fix another doc error (pixelsx - thanks @theacodes) 2020-05-10 21:35:37 -04:00
Roy Hooper
70f2ef3f8e Fix docs some more 2020-05-10 19:50:10 -04:00
Roy Hooper
2f7c0ec8e4 Minor fixes to _pixelbuf.PixelBuf docs 2020-05-10 16:22:01 -04:00
warriorofwire
4086600b61 vectorio: switch per-shape transform to Display
Rather than maintain a transform per-shape, we'll just use whatever
  settings are on the Display.  Currently only transpose is done.
2020-05-09 22:15:51 -07:00
warriorofwire
206d0e598a Add vectorio: for drawing shapes
vectorio builds on m4 express feather

Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.

VectorShape provides transpose and x/y positioning for shape implementations.

Included Shapes:

* Circle
  - A radius; Circle is positioned at its axis in the VectorShape.
  - You can freely modify the radius to grow and shrink the circle in-place.

* Polygon
  - An ordered list of points.
  - Beteween each successive point an edge is inferred.  A final edge closing the shape is inferred between the last
    point and the first point.
  - You can modify the points in a Polygon.  The points' coordinate system is relative to (0, 0) so if you'd like a
      top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape
      x and y properties will position the rectangle relative to its top center point

* Rectangle
  A width and a height.
2020-05-09 15:38:22 -07:00
DavePutz
e7fc806034
Throw a NotImplementedError for time functions on boards without long ints
Fix for Issue #2812. Instead of reporting a missing attribute for functions such as time.time() and time.mktime(); platforms that do not have long integer support will raise a NotImplementedError
2020-05-08 16:33:26 -05:00
dherrada
09530e5dc3
Did os, _pixelbuf, _pew 2020-05-08 16:03:39 -04:00
Kattni Rembor
a83d1d7b4b Update wheel to colorwheel and fix RGB order. 2020-05-08 14:44:41 -04:00
Kattni Rembor
37e5ff7757 Update colorwheel from GRB to RGB. 2020-05-08 13:25:52 -04:00
dherrada
d750096bef
Did neopixel, network, nvm 2020-05-07 18:40:46 -04:00
dherrada
e31e9eeaa1
Did math, microcontroller, and multiterminal 2020-05-07 15:59:52 -04:00
dherrada
4f33a20d17
Added gamepad, gamepadshift, and i2cslave 2020-05-07 15:10:44 -04:00
dherrada
a3d5adb43c
Did _eve, fontio, framebufferio, and frequencyio 2020-05-07 11:56:46 -04:00
dherrada
2ebe3035df
Did board, digitalio, displayio 2020-05-07 10:54:09 -04:00
Daniel Pollard
84c806a4be updated descriptions and build variable 2020-05-07 12:42:46 +10:00
spkuehl
af55af216a Fix type in RTC documentation. 2020-05-06 14:11:11 -05:00
Sean Cross
b168784fa0 aesio: add basic AES encryption and decryption
This adds initial support for an AES module named aesio.  This
implementation supports only a subset of AES modes, namely
ECB, CBC, and CTR modes.

Example usage:

```
>>> import aesio
>>>
>>> key = b'Sixteen byte key'
>>> cipher = aesio.AES(key, aesio.MODE_ECB)
>>> output = bytearray(16)
>>> cipher.encrypt_into(b'Circuit Python!!', output)
>>> output
bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n')
>>>
```

This key is 16-bytes, so it uses AES128.  If your key is 24- or 32-
bytes long, it will switch to AES192 or AES256 respectively.

This has been tested with many of the official NIST test vectors,
such as those used in `pycryptodome` at
39626a5b01/lib/Crypto/SelfTest/Cipher/test_vectors/AES

CTR has not been tested as NIST does not provide test vectors for it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-06 17:40:06 +08:00
Daniel Pollard
8961dd9fe7 changed build variables as per advice 2020-05-06 09:05:14 +10:00
Daniel Pollard
bfa5cd9c13 refactor countio based on feedback 2020-05-05 15:23:38 +10:00
Dan Halbert
e1366d78b1 trivial change to force rebuild 2020-05-04 23:05:47 -04:00
Dan Halbert
b7836aeac6 address review comments 2020-05-04 19:51:08 -04:00
Dan Halbert
bae7a5e433 make translate again 2020-05-04 17:26:59 -04:00
Dan Halbert
d6c6f9f4f0 add PacketBuffer .incoming_ and .outgoing_packet_length 2020-05-04 15:59:45 -04:00
dherrada
0e465e63b9
Did audiopwmio, bitbangio, and _bleio 2020-05-01 18:23:27 -04:00
Scott Shawcroft
242063e1d0
Merge pull request #2838 from spkuehl/UART_sharedbinding_fix
Fix #2814 Corrected UART output.
2020-05-01 11:05:24 -07:00
spkuehl
a3a2dd0f70 Corrected UART output. 2020-04-30 19:14:51 -05:00
dherrada
d65e851044
Did audioio, audiomixer, audiomp3 2020-04-30 13:06:09 -04:00
Dan Halbert
46298ddcb4 PacketBuffer doc fixes 2020-04-30 00:36:01 -04:00
Dan Halbert
f3078511a6 further cleanup and bug fixing 2020-04-29 23:18:08 -04:00
Dan Halbert
180f5c6a94 Merge remote-tracking branch 'adafruit/master' into ringbuf-fixes 2020-04-29 22:11:22 -04:00
Dan Halbert
3d62f87e29 back to '.packet_size' for compatiblity 2020-04-29 22:10:56 -04:00
Dan Halbert
84cee1ab8d rename and improve PacketBuffer packet length property 2020-04-29 17:49:31 -04:00
dherrada
7ff9b9bc80
Did first 3 2020-04-29 17:36:28 -04:00
dherrada
a2a32fea1a
Added newlines after every ellipsis 2020-04-29 15:55:06 -04:00
dherrada
093461e816
Fixed indentation 2020-04-29 15:45:19 -04:00
dherrada
deccdcc1d6
Did the same for the rest of busio 2020-04-29 15:20:05 -04:00
dherrada
93d1e53c66
Hopefully fixed whitespace issues 2020-04-29 14:19:04 -04:00
dherrada
c7b721f4f1
Fixed some more whitespace 2020-04-28 19:22:03 -04:00
dherrada
aacca61598
Fixed whitespace on audiocore 2020-04-28 18:56:19 -04:00
dherrada
c3897d0add
Fixed whitespace in analogio 2020-04-28 18:43:40 -04:00
dherrada
724dcda3ec
Fixed whitespace in busio 2020-04-28 18:39:58 -04:00
Scott Shawcroft
755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
dherrada
829da5c127
Added inline pyi to audiomp3 2020-04-27 17:29:50 -04:00
dherrada
8330471068
Added inline pyi to audiomixer 2020-04-27 17:20:40 -04:00
dherrada
1363e6e724
Added inline pyi to audiocore 2020-04-27 17:02:48 -04:00
dherrada
088b5b1785
Added inline pyi to audiocore 2020-04-27 16:49:12 -04:00
dherrada
e96235d0cf
Added inline pyi to audiobusio 2020-04-27 16:35:03 -04:00
dherrada
8344fce994
Added inline pyi to analogio 2020-04-27 13:06:47 -04:00
dherrada
27e085ec36
Added pyi to OneWire.c 2020-04-25 15:36:16 -04:00
dherrada
e7874277ab
Fixed empty lines 2020-04-25 15:35:24 -04:00
dherrada
7070fe1995
Added inline pyi to UART.c 2020-04-25 15:25:31 -04:00
dherrada
28430a9919
Added inline pyi to I2C.c 2020-04-25 15:07:58 -04:00
dherrada
55bdee688f
Reorganized pyi again 2020-04-23 16:14:17 -04:00
dherrada
855c2033b5
Reogranized pyi in spi.c 2020-04-23 15:35:20 -04:00
dherrada
a18b991ca9
Added pyi to SPI.c 2020-04-22 15:22:34 -04:00
Jeff Epler
b87af3b071 ulab: Update from upstream
Closes: #2787
2020-04-22 09:04:12 -05:00
Dan Halbert
77cd93ac2d merge from adafruit 2020-04-21 17:47:51 -04:00
Dan Halbert
38ec3bc574 further ringbuf cleanup 2020-04-21 17:38:20 -04:00
Jeff Epler
507e17fbf1 displayio: Fix "bus type" problem introduced at 8cba145c90
When allocate_display_bus_or_raise was factored out, the assignment
of the bus's Python type was lost.  Restore it.

This would have affected displays of any type other than RGBMatrix, when
they were created dynamically.  Boards with displays configured in flash
were unaffected.

Closes: #2792
2020-04-21 13:48:34 -05:00
Scott Shawcroft
bebf27e733
Merge remote-tracking branch 'adafruit/master' into lower_power
This isn't perfect and needs a bit more testing.
2020-04-20 18:25:13 -07:00
Jeff Epler
898c09c35e RGBMatrix: nonessential change to kick Actions 2020-04-19 09:10:08 -05:00
Jeff Epler
9bfe6b7197 framebufferio: update copyright information 2020-04-17 18:44:07 -05:00
Jeff Epler
8c455f24bf RGBMatrix: this comment no longer describes the code
... allocate_display_bus_or_raise() uses fixed storage, not heap storage.
2020-04-17 18:44:07 -05:00
Jeff Epler
37cb6bafa8 RGBMatrix: documentation got behind the code 2020-04-17 18:44:07 -05:00
Jeff Epler
5fcc6d6286 RGBMatrix: finish renaming from Protomatter
This gets all the purely internal references.  Some uses of
protomatter/Protomatter/PROTOMATTER remain, as they are references
to symbols in the Protomatter C library itself.
2020-04-17 18:44:07 -05:00
Jeff Epler
1b478bbae6 RGBMatrix: remove unneeded properties 2020-04-17 18:43:57 -05:00
Jeff Epler
57ce2d1f41 framebufferio: get width, etc., from protocol, not object property 2020-04-17 18:43:57 -05:00
Jeff Epler
3d6258f63d Rename Protomatter -> RGBMatrix
This is a quick rename, it changes the user-facing names but not the
internal names of things.
2020-04-17 18:43:57 -05:00
Jeff Epler
64c3968a2e protomatter: move get_width/height to common_hal 2020-04-17 18:43:57 -05:00
Jeff Epler
545b6e560a fix doc build 2020-04-17 18:43:57 -05:00
Jeff Epler
1a91a75b9c framebufferio: get more properties direct from underlying framebuffer 2020-04-17 18:43:57 -05:00
Jeff Epler
a32337718d Rename _protomatter -> protomatter
I originally believed that there would be a wrapper library around it,
like with _pixelbuf; but this proves not to be the case, as there's
too little for the library to do.
2020-04-17 18:43:57 -05:00
Jeff Epler
d1ff23e004 framebufferio: get width, height from framebuffer properties 2020-04-17 18:43:57 -05:00
Jeff Epler
d2aac7a754 Protomatter: add width, height properties 2020-04-17 18:43:57 -05:00
AndrewR-L
f572b72306
busio/UART: Correct and clarify readline() return.
Surely readline() "rtype" is string not int as stated (and not bytes as some might expect).

Also it is not totally unambiguous what happens on a timeout so it would help to clarify in docs that on a timeout 
it does NOT return with what it has read so far, rather it leaves all that in the buffer ready for a future read and returns nothing.

Likewise clarify that if timeout=0 but there is no newline it DOES return what it has read so far (NOT None). 

At least this is what I think it does and/or is supposed to do!

Python docs are generally not too explicit about what is the proper treatment, so perhaps all the more reason to
clarify the interpretation adopted?
2020-04-17 15:10:36 +01:00
Scott Shawcroft
b580b34cbf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-14 17:14:44 -07:00
Jeff Epler
0ce9c008c5 Protomatter: Make all arguments kw-only, add rgb count and optional height checking
They're not readily distinguishable by type.

I also added the requested height optional parameter; this is checked
against the computed one.  It's not feasible to use this parameter to
artificailly reduce the number of used rows, because changes in the
underlying C protomatter library would be required.

Finally, I added a better error message when the number of RGB pins was
not what was expected.
2020-04-14 18:24:59 -05:00
Jeff Epler
880fff80e9 protomatter: Respond to review comments
- rename oe_pin -> output_enable_pin
 - improve and reorganize docstrings
 - rename swapbuffers->refresh
 - rename "paused" -> "brightness", change semantics slightly
 - common_hal several functions
 - clarify why the common_hal routines can't be used directly in the
   protocol's function pointers
 - whitespace cleanups
 - remove prototypes for nonexistent functions
2020-04-14 18:24:59 -05:00
Jeff Epler
5d328c3b44 protomatter: clarify by comment why these functions exist 2020-04-14 18:24:58 -05:00
Jeff Epler
ba20bc8b43 framebufferio: move backlight down to the underlying framebuffer 2020-04-14 18:24:58 -05:00
Jeff Epler
129c6369cf protomatter: code style 2020-04-14 18:24:58 -05:00
Jeff Epler
4a05e938ed protomatter: validate pins to give better error message
The numbered error from the underlying library is not helpful for
beginning users
2020-04-14 18:24:58 -05:00
Jeff Epler
9019710a1e protomatter: improve an error message 2020-04-14 18:24:58 -05:00
Jeff Epler
baf04b7738 FramebufferDisplay: remove probably not needed constructor arguments 2020-04-14 18:24:58 -05:00
Jeff Epler
50219862e1 protomatter: make docstring match implementation 2020-04-14 18:24:58 -05:00
Jeff Epler
a663a7dd30 _protomatter: move get/set paused into shared-module 2020-04-14 18:24:58 -05:00
Jeff Epler
5fcba97a51 Make function name more descriptive 2020-04-14 18:24:58 -05:00
Jeff Epler
89eb45a13c use floor division in docstring
Co-Authored-By: Scott Shawcroft <scott@tannewt.org>
2020-04-14 18:24:58 -05:00
Jeff Epler
09dc46a984 Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
Jeff Epler
8cba145c90 displayio: implement, use allocate_new_display_bus_or_raise 2020-04-14 18:24:54 -05:00
Jeff Epler
6378d600c4 displayio: implement, use allocate_display_or_raise 2020-04-14 18:24:54 -05:00
Scott Shawcroft
ada102dd98
Merge pull request #2767 from jepler/update-ulab
ulab: Get updates from upstream
2020-04-14 15:59:33 -07:00
Scott Shawcroft
e063b066f0
Merge pull request #2756 from caternuson/bitmap_fill
Add fill method to displayio.Bitmap
2020-04-14 12:54:44 -07:00
Jeff Epler
693928d201 doc updates 2020-04-13 20:10:02 -05:00
caternuson
dc75746842 add docstring, clean up 2020-04-09 08:59:26 -07:00
caternuson
49fff2d9b4 initial working fill 2020-04-09 08:43:50 -07:00
sommersoft
61bab8e62e ulab/__init__.rst: fix attribute name; uint8 -> uint16 2020-04-09 08:45:26 -05:00
Scott Shawcroft
317b96e93a
Fix iMX builds 2020-03-31 17:00:30 -07:00
Scott Shawcroft
cbe9512691
Merge pull request #2741 from tannewt/fix_packetbuffer_server
Fix PacketBuffer server support
2020-03-31 13:39:34 -07:00
Jeff Epler
54e8c63b4f
Merge pull request #2730 from tannewt/fix_fourwire_phase_polarity
Add polarity and phase to FourWire.
2020-03-28 07:28:37 -05:00
Scott Shawcroft
a870908718
Don't break the function signature 2020-03-26 14:11:20 -07:00
siddacious
9e0c00dfd4 adding a backlight polarity flag to Display 2020-03-25 22:51:20 -07:00
Scott Shawcroft
8a5d3cd6c4
Add exception on small buffer and fix Connecion WRITE handling 2020-03-25 17:41:47 -07:00
Scott Shawcroft
6b7acc65b6
Add polarity and phase to FourWire.
It was fixed as 0/0 even though it used to get it from the current
SPI state. This makes it more explicit with kwargs.

Thanks to magpie_lark and kmatocha on the Adafruit Support forum
for finding the issue: https://forums.adafruit.com/viewtopic.php?f=60&t=162515
2020-03-25 11:22:46 -07:00
Jeff Epler
aaf07ce72f
Update shared-bindings/ulab/__init__.rst
Co-Authored-By: Scott Shawcroft <scott@tannewt.org>
2020-03-17 16:37:16 -05:00
Jeff Epler
aa54a7e76e ulab: update documentation 2020-03-17 09:25:33 -05:00
Dale Hawkins
8ae103e07c
Fix documentation typo: tm_minute should be tm_min 2020-03-16 09:07:10 -06:00
Dan Halbert
fdcdc1320b Make ParallelBus reset ping arg required 2020-03-06 14:30:30 -05:00
Dan Halbert
210c3274e5 Merge remote-tracking branch 'adafruit/master' into assert_pin-and-mp_const_none-cleanup 2020-03-05 17:47:01 -05:00
Dan Halbert
817b5be320 rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
Dan Halbert
e30b1d3121 missing semicolon 2020-02-29 22:48:11 -05:00
Dan Halbert
8435935429 update uses of assert_pin_free; remove redundant checks 2020-02-29 15:37:32 -05:00
Dan Halbert
b6206406de new pin validation routines; don't use mp_const_none if NULL will do 2020-02-28 23:43:04 -05:00
Jeff Epler
39cfe32c34 Update ulab from upstream again 2020-02-27 14:14:05 -06:00
Jeff Epler
645df931ae typos 2020-02-27 11:07:37 -06:00
Jeff Epler
fa3b9eba92 ulab: Incorporate it 2020-02-27 11:03:03 -06:00
Dan Halbert
e31ac710be Enable _bleio adapter when _bleio is imported 2020-02-20 21:55:04 -05:00
Dave Marples
d388899985 Addition of RS485 support 2020-02-18 23:16:40 +00:00
Dave Marples
84ad3d8393 Addition of RTS/CTS/RS485 UART functionality 2020-02-18 23:16:40 +00:00
Scott Shawcroft
52d96ca151
Merge pull request #2626 from dhalbert/stat-for-shortint
avoid os.stat() int overflow on smallint-only builds
2020-02-18 13:40:52 -08:00
Dan Halbert
e0753c4ad2 avoid os.stat() int overflow on smallint-only builds 2020-02-14 18:33:37 -05:00
Melissa LeBlanc-Williams
33774e790c Updated OnDiskBitmap RTD example for 5.x 2020-02-14 10:23:23 -08:00
Scott Shawcroft
e97b0cfc61
Merge pull request #2581 from jamesbowman/master
First draft of eveL, the low-level module of the Gameduino bindings
2020-02-13 11:21:32 -08:00
James Bowman
b02937d1a7 Split ROMDECLS for readability 2020-02-13 07:28:21 -08:00
Dan Halbert
c57ccd5eb4 doc typo 2020-02-11 20:03:47 -05:00
Dan Halbert
f73b58a2c6 fix doc indentation 2020-02-11 19:57:48 -05:00
Dan Halbert
2e029d55fc nrf: add SPIM3 support 2020-02-11 19:22:14 -05:00
James Bowman
a87dee2f66 Correct the BitmapTransform operations.
Correct argument order
better argument naming
fix copypaste bug on C and F arguments
2020-02-10 19:34:38 -08:00
James Bowman
1f44029c56 Remove unused code 2020-02-10 18:57:04 -08:00
James Bowman
f101ff60c5 Move _eve module declarations into shared-bindings header 2020-02-07 17:10:19 -08:00
James Bowman
c631b4d60e Add doc strings, inline mod_eve-gen.h and remove it 2020-02-07 16:44:48 -08:00
James Bowman
5c6d94d3e5 Split into shared-module and shared-bindings 2020-02-07 10:30:49 -08:00
Dan Halbert
cbd519bfa6 time.sleep() rounds to nearest msec 2020-02-07 10:24:11 -05:00
Dan Halbert
857d8ab40a improve time.monotonic_ns() accuracy from ms to us 2020-02-07 10:02:50 -05:00
James Bowman
a20490c0b3 Add method VertexFormat() and variable fixed-point scaling in Vertex2f() 2020-02-06 08:49:07 -08:00
James Bowman
acef93a253 Rename eveL to _eve, EVEL to _EVE 2020-02-05 18:17:58 -08:00
James Bowman
a9b34f45dc My name 2020-02-05 18:01:25 -08:00
James Bowman
53f7e2be4f Use mp_instance_cast_to_native_base() throughout 2020-02-05 17:58:59 -08:00
Dan Halbert
a4ebd2f7c1 allow tuple or list for Palette color 2020-02-03 22:09:53 -05:00
James Bowman
0bcfabbc87 Add header for module eveL explaining what it is.
Exclude modeveL-gen.h from Sphinx build
2020-02-03 18:41:32 -08:00
James Bowman
7fd30e7d20 First draft of eveL, the low-level module of the Gameduino (and BridgeTek EVE) bindings.
[adafruit/circuitpython#2578]
2020-02-03 16:46:14 -08:00
Scott Shawcroft
55eb1730b8
Merge remote-tracking branch 'adafruit/master' into tweak_pixelbuf 2020-01-30 10:59:21 -08:00
Radomir Dopieralski
27c36eea2b circuitpython-stage: allow choosing background color 2020-01-30 15:24:04 +01:00
Scott Shawcroft
5d24ade5c9
Tweak error messages to reduce code size. 2020-01-29 17:32:07 -08:00
Dan Halbert
e21580b67f PacketBuffer.packet_size was returning bool instead of int 2020-01-27 17:10:56 -05:00
Scott Shawcroft
39971794dd
Encapsulate buffers inside PixelBuf and refactor it. 2020-01-24 18:23:07 -08:00
Dan Halbert
2a75196aa3 merge from adafruit/circuitpython 2020-01-13 18:15:32 -05:00
Dan Halbert
9e7f8743c2 fix CCCD bonding store; avoid excessive bonding writes 2020-01-12 23:32:51 -05:00
Dan Halbert
346ce3b73b wip: HID bonding works! 2020-01-10 23:55:45 -05:00
Scott Shawcroft
8708d3dc45
Merge pull request #2461 from jepler/urandom-hardfaults
Urandom hardfaults
2020-01-10 11:37:59 -08:00
Dan Halbert
9c167af17a wip; redid flash writing to be compatible with SD 2020-01-09 17:40:02 -05:00
Scott Shawcroft
a10cd8580c
Merge pull request #2445 from jepler/mp3-jeplayer-fixes
Fixes for JEplayer
2020-01-08 12:50:13 -08:00
Jeff Epler
6735283d8f os: Don't require an on-stack buffer
This allows urandom requests of even 100k bytes to succeed on a fresh
VM session on a Metro M4 express.
2020-01-08 09:43:13 -06:00
Jeff Epler
b1b4a9e842 fix doc build error 2020-01-06 09:26:32 -06:00
Jeff Epler
dc729718eb audiomp3: rename to MP3Decoder 2020-01-06 07:51:41 -06:00
Scott Shawcroft
82fb761c0f
Add PacketBuffer and MTU negotiation support.
PacketBuffer facilitates packet oriented BLE protocols such as BLE
MIDI and the Apple Media Service.

This also adds PHY, MTU and connection event extension negotiation
to speed up data transfer when possible.
2020-01-03 17:29:54 -08:00
Dan Halbert
fc5f776429
Merge pull request #2034 from rhooper/new-pixelbuf-api
Updates to pixelbuf API - Addresses #884
2020-01-03 17:19:02 -05:00
Roy Hooper
767ce1cdf8 remove unnecessary GCC pragmas 2020-01-02 18:03:18 -05:00
Roy Hooper
ccf158b030 raise mp_raise_NotImplementedError 2020-01-02 18:00:36 -05:00
Roy Hooper
fdddb54db4 rename call_show to pixelbuf_call_show 2020-01-02 17:56:04 -05:00
Jeff Epler
ec22520992 MP3File: Add rms_level property
This lets a music player show it vu-meter style
2020-01-02 15:23:42 -06:00
Roy Hooper
4e1996856f Fix docstring for byteorder 2020-01-01 19:25:44 -05:00
Roy Hooper
12193913a8 move native fill to a helper to work around being unable to call a subclass show method from the native superclass 2020-01-01 17:30:17 -05:00
Roy Hooper
8129a8503a Revert "try a property with a callable static class"
This reverts commit ca5b2770cf.
2020-01-01 16:10:22 -05:00
Roy Hooper
ca5b2770cf try a property with a callable static class 2020-01-01 16:10:01 -05:00
David Glaude
01d49eb0a7
Update Shape.c
Make no sense to say this is experimental and will change in 4.0.0 when we are already above 4.0.0.
This should be removed, or updated to say it will not be in x.0.0
2019-12-30 16:54:16 +01:00
Roy Hooper
023d64fe4a Merge branch 'pixelbuf-subscr-change' into new-pixelbuf-api 2019-12-29 13:56:47 -05:00
Roy Hooper
f1a9039632 Merge branch 'master' into pixelbuf-subscr-change 2019-12-29 13:56:31 -05:00
Jeff Epler
02154caf24 MP3File: Add a settable ".file" property
This enables jeplayer to allocate just one MP3File at startup, rather
than have to make repeated large allocations while the application is
running.

The buffers have to be allocated their theoretical maximum, but that
doesn't matter much as all the real-life MP3 files I checked needed
that much allocation anyway.
2019-12-23 09:36:46 -06:00
Roy Hooper
09d4fe0324 Merge branch 'master' into new-pixelbuf-api 2019-12-20 19:22:27 -05:00
Scott Shawcroft
5fc20145d1
Merge pull request #2390 from jepler/displayio-set-rotation
displayio: make 'rotation' property settable
2019-12-20 09:34:25 -08:00
albang
00c226738d
Typo in doc 2019-12-19 23:16:51 +01:00
Jeff Epler
a63da7a6c0 displayio: make 'rotation' property settable 2019-12-16 15:23:41 -06:00
Roy Hooper
ef2a8906dd move call to show outside loop 2019-12-16 15:05:09 -05:00
Roy Hooper
dc8dd6df20 Revert subscr signature change 2019-12-13 14:29:15 -05:00
Roy Hooper
72ad2e9259 Merge branch 'master' into new-pixelbuf-api 2019-12-13 13:45:16 -05:00
Scott Shawcroft
9a3d45e7d0
Add extended, connectable and scannable error.
Related to https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/44
2019-12-12 13:46:59 -08:00
Roy Hooper
0326c98fd5 Merge branch 'master' into new-pixelbuf-api 2019-12-10 20:44:43 -05:00
Roy Hooper
222dd29a14 Fix slice step. 2019-12-10 20:43:00 -05:00
Jeff Epler
a08d9e6d8e audiocore: Add MP3File using Adafruit_MP3 library 2019-12-10 14:03:06 -06:00
Scott Shawcroft
19ac8aea8c
Merge pull request #2353 from jepler/audiosample-protocol
Convert audiosamples to use micropython "protocols" (safely)
2019-12-09 14:50:16 -08:00
Roy Hooper
dd7ac68fb0 fix slice anf fill bugs 2019-12-08 16:53:08 -05:00
Dan Halbert
f5e913101c
Merge pull request #2301 from tannewt/support_extended_advertising
Add support for extended (>31 byte) BLE advertisements.
2019-12-06 23:51:05 -05:00
Scott Shawcroft
da0ea979ff
Check connection validity after service discovery.
Fixes #2347
2019-12-06 16:03:14 -08:00
Dan Halbert
559ce6a949
Merge pull request #2356 from tannewt/central_pairing
Add connection interval and debugging
2019-12-06 15:19:40 -05:00
Dan Halbert
e30dde0afc Make _bleio.Connection.disconnect() idempotent 2019-12-05 08:40:53 -05:00
Scott Shawcroft
17c8356b8c
Add connection interval and debugging
This also sets TinyUSB to master and to not include its submodules.

It also fixes an old displayio example comment and retries gattc
reads.
2019-12-04 14:39:02 -08:00
Jeff Epler
feb8eb935b audiosample: convert to use a protocol
This eases addition of new sample sources, since the manual virtual
function dispatch functions are just calls via a protocol
2019-12-04 09:31:52 -06:00
Jeff Epler
238e121236 protocols: Allow them to be (optionally) type-safe
Protocols are nice, but there is no way for C code to verify whether
a type's "protocol" structure actually implements some particular
protocol.  As a result, you can pass an object that implements the
"vfs" protocol to one that expects the "stream" protocol, and the
opposite of awesomeness ensues.

This patch adds an OPTIONAL (but enabled by default) protocol identifier
as the first member of any protocol structure.  This identifier is
simply a unique QSTR chosen by the protocol designer and used by each
protocol implementer.  When checking for protocol support, instead of
just checking whether the object's type has a non-NULL protocol field,
use `mp_proto_get` which implements the protocol check when possible.

The existing protocols are now named:
    protocol_framebuf
    protocol_i2c
    protocol_pin
    protocol_stream
    protocol_spi
    protocol_vfs
(most of these are unused in CP and are just inherited from MP; vfs and
stream are definitely used though)

I did not find any crashing examples, but here's one to give a flavor of what
is improved, using `micropython_coverage`.  Before the change,
the vfs "ioctl" protocol is invoked, and the result is not intelligible
as json (but it could have resulted in a hard fault, potentially):

    >>> import uos, ujson
    >>> u = uos.VfsPosix('/tmp')
    >>> ujson.load(u)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: syntax error in JSON

After the change, the vfs object is correctly detected as not supporting
the stream protocol:
    >>> ujson.load(p)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: stream operation not supported
2019-12-04 09:29:57 -06:00
Roy Hooper
0d267eaee1 fix compile fails 2019-12-02 14:25:57 -05:00
Roy Hooper
a4bbf35092 Merge branch 'master' into new-pixelbuf-api 2019-12-02 14:06:33 -05:00
Dan Halbert
d089f16656 'seconds' 2019-11-27 14:49:39 -05:00
Dan Halbert
dd6dfeb30a Squeeze pyruler zh_Latn_pinyin 2019-11-27 14:47:35 -05:00
Dan Halbert
b32a9192df make UART.write be blocking on SAMD; add timeout property 2019-11-27 13:05:29 -05:00
Roy Hooper
a9624fff25 add show 2019-11-26 21:28:41 -05:00
Roy Hooper
56720eae0a remove unnecessary intermediate mp_obj_subscr wrapper 2019-11-26 18:39:08 -05:00
Scott Shawcroft
3fc58cee38
Merge remote-tracking branch 'adafruit/master' into support_extended_advertising 2019-11-26 13:12:43 -08:00
Jeff Epler
e188ae8b23 time: struct_time: allow construction like a namedtuple, too
Whenever there is more than one argument, delegate the operation to
namedtuple_make_new.  This allows other circuitpython-compatible
idioms, like with keywords
    time.struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=0,
        tm_min=0, tm_sec=14, tm_wday=5, tm_yday=5, tm_isdst=-1)
with 9 positional arguments, etc.

The only vaguely plausible CPython behavior still not permitted in
CircuitPython that I found is constructing a timetuple from a length-9
list, a la
    time.struct_time(list(time.localtime())

Even better, by getting rid of an error message, the build shrinks a
tiny bit.
2019-11-26 08:45:44 -06:00
Jeff Epler
8f24ea48fb time: struct_time: allow construction from another struct_time
This doesn't cover ALL the cases that CPython permits for construction
of a struct_time, but it at least makes constructing from any namedtuple
work.

Closes: #2326
2019-11-26 08:45:40 -06:00
Roy Hooper
0ef9344c17 make pixelbuf iterable 2019-11-25 20:21:00 -05:00
Roy Hooper
d4ed258b74 remove unnecessary qstrs 2019-11-25 20:20:51 -05:00
Jeff Epler
5115fdaa6f shared-bindings: I2SOut: Ensure object is deinitialised
(or deinitialized, for those of us on this side of the pond)

Otherwise, a sequence like
```
audio = audiobusio.I2SOut(bit_clock=board.D6, word_select=board.D9, data=board.D10)
sine_wave_sample = audiocore.RawSample(sine_wave)
audio.play(sine_wave_sample, loop=True)
del audio
```
could free the memory associated with audio without stopping the
related background task.  Later, when fresh objects are allocated within
a now-freed memory region, they can get overwritten in the background
task, leading to a hard crash.

This presumably can affect multiple I2S implementations, but it was
reported against the nRF one.
2019-11-25 09:53:55 -06:00
Roy Hooper
a9baa441c9 disable -Wunused-parameter on subscr functions 2019-11-23 13:52:14 -05:00
Roy Hooper
6108fa3766 Merge branch 'master' into new-pixelbuf-api 2019-11-23 12:22:04 -05:00
Roy Hooper
c770ccd939 make ->subscr take an instance to pass when instance_subscr is called from subscr. 2019-11-23 12:09:26 -05:00
Scott Shawcroft
743bc829ab
Clean up debug changes 2019-11-21 16:39:57 -08:00
Scott Shawcroft
39f4046f70
Fix pairing when peripheral. Central untested. 2019-11-21 16:32:42 -08:00
Scott Shawcroft
98e55eb577
Only add module when printing exception. 2019-11-21 12:26:25 -08:00
Scott Shawcroft
521c7531bc
Improve printing to include _bleio. prefix for type. 2019-11-21 11:04:17 -08:00
Scott Shawcroft
5e857fdb67
Use BluetoothError in _bleio
This better differentiates errors than using OSError everywhere.
2019-11-20 14:02:15 -08:00
Scott Shawcroft
11c2c3443f
Add support for extended (>31 byte) BLE advertisements. 2019-11-19 13:55:58 -08:00
Hierophect
81223c76bd revert error 2019-11-15 13:04:25 -05:00
Hierophect
2c6781f74d move neopixel_in_use flag to shared-bindings 2019-11-15 12:59:52 -05:00
Hierophect
de5691acf5 Add never_reset and reset to pin common hal, adjust files 2019-11-15 12:47:00 -05:00
Dan Halbert
8584c1e824 Fix start_scan timeout default value 2019-11-13 21:34:20 -05:00
Dan Halbert
8cd2f87e99
Merge pull request #2236 from tannewt/bleio_tweaks
Refine _bleio
2019-11-04 22:27:54 -05:00
Scott Shawcroft
47e50e5659
Merge remote-tracking branch 'adafruit/master' into bleio_tweaks 2019-11-01 13:20:58 -07:00
Dan Halbert
43b8d5e8ab Update I2C and SPI documentation 2019-10-29 09:58:44 -04:00
Dan Halbert
56ac41fabf
Merge pull request #2240 from theacodes/fix-2086
Track unadjusted PWM duty cycle to avoid accumulating conversion errors
2019-10-28 14:50:01 -04:00
Dan Halbert
cc13fc3433
Merge pull request #2247 from jepler/comment-doc-typos
Comment doc typos
2019-10-28 14:47:52 -04:00
Jeff Epler
c208586bf1 audioio: correct trivial typo 2019-10-27 16:42:18 -05:00
Jeff Epler
0657884fca audiobus: correct trivial typo 2019-10-27 16:42:04 -05:00
Jeff Epler
978cec0316 pixelbuf: correct trivial typos 2019-10-27 16:41:56 -05:00
Thea Flowers
6782948751
Note behavior in documentation 2019-10-25 10:56:41 -07:00
Thea Flowers
4a55c48dbf
Improve documentation for rtc.
- Add examples for `rtc.RTC.datetime`.
- Add type for `rtc.RTC.calibration`.
- Expand on use cases for `rtc.set_time_source`.
2019-10-23 15:48:34 -07:00
Scott Shawcroft
91c9d519ae
Refine comments and switch prefix_len to size_t 2019-10-22 23:09:56 -07:00
Scott Shawcroft
ae30a1e5aa
Refine _bleio
This PR refines the _bleio API. It was originally motivated by
the addition of a new CircuitPython service that enables reading
and modifying files on the device. Moving the BLE lifecycle outside
of the VM motivated a number of changes to remove heap allocations
in some APIs.

It also motivated unifying connection initiation to the Adapter class
rather than the Central and Peripheral classes which have been removed.
Adapter now handles the GAP portion of BLE including advertising, which
has moved but is largely unchanged, and scanning, which has been enhanced
to return an iterator of filtered results.

Once a connection is created (either by us (aka Central) or a remote
device (aka Peripheral)) it is represented by a new Connection class.
This class knows the current connection state and can discover and
instantiate remote Services along with their Characteristics and
Descriptors.

Relates to #586
2019-10-21 18:57:03 -07:00
Roy Hooper
2970680e6a fix show and fix step > 1 2019-10-20 19:54:25 -04:00
Dan Halbert
eca73436c9 Merge remote-tracking branch 'adafruit/master' into cpu-voltage 2019-10-15 09:03:24 -04:00
Kamil Tomaszewski
150f9041e3 Fix unsafe floating point comparison 2019-10-14 09:13:35 +02:00
Kamil Tomaszewski
c67b2c1661 Return None if reference_voltage is 0.0 2019-10-14 08:22:14 +02:00
Dan Halbert
c1ab2486f9 return chip vcc value 2019-10-12 15:42:15 -04:00
Roy Hooper
dc8c27d129 make dotstar byteorder constants start with P. fix small bugs. 2019-10-06 22:44:00 -04:00
Roy Hooper
55c688cbeb restructure to be subclassable 2019-10-05 15:53:53 -04:00
Roy Hooper
000ae6bf17 support subclasses 2019-10-05 13:47:40 -04:00
Roy Hooper
1051001495 Merge branch 'master' into new-pixelbuf-api 2019-10-03 19:06:55 -04:00
Scott Shawcroft
6ad860a963
Merge pull request #2101 from matthewnewberg/display_io_dither
Add random dithering to ColorConverter
2019-09-09 10:11:07 -07:00
Scott Shawcroft
d9e0641606
Set dither default to False and document it 2019-09-08 21:30:52 -07:00
Matthew Newberg
8e55232492 Use kwargs for dither in ColorConverter constructor 2019-09-06 16:23:24 -04:00
Matthew Newberg
b2fb5ac1c1 Fix comment on color converter 2019-09-06 16:11:15 -04:00
Matthew Newberg
4604a69498 Move dither parameter to ColorConverter constructor and parameter 2019-09-05 21:55:45 -04:00
Dan Halbert
fca440fb66
Merge pull request #2113 from tannewt/displayio_hidden
Add .hidden to TileGrid and Group
2019-09-04 15:48:00 -04:00
Scott Shawcroft
321b57a5d2
Merge pull request #2080 from sommersoft/mixer_voice
Add audiocore.MixerVoice
2019-09-04 12:46:59 -07:00
Radomir Dopieralski
5f6228b6f0 Fix transactions in _stage after displayio changes
Also, move the rendering setup code to shared-module from
shared-bindings.

In CP 5.0, displayio_display_core_set_region_to_update now starts
its own transaction, so it has to be moved outside of the transaction
started by the render call.
2019-09-04 16:41:58 +02:00
sommersoft
da912e8c74 doc cleanup 2019-09-03 22:44:43 -05:00
Scott Shawcroft
949f8761b8
Add .hidden to TileGrid and Group
This allows for one to preserve ordering within a Group while
hiding something temporarily.

Fixes #1688
2019-09-03 16:15:27 -07:00
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