Commit Graph

467 Commits

Author SHA1 Message Date
Scott Shawcroft 8c5c73df38
Add I2S MCLK support to iMX RT 2023-08-17 11:39:14 -07:00
Jeff Epler 10330b273c
Divide 'introspect_t' into inputs & outputs
leave as a single structure because it's more efficient to call
functions with 4 or fewer arguments, and having two struct pointers
would make `consider_instruction` have 5 arguments instead.
2023-08-08 10:44:12 -05:00
Jeff Epler 755fdfab7a
rename variable based on review 2023-08-07 16:26:57 -05:00
Jeff Epler 2077ac150b
Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-08-07 11:51:52 -05:00
Jeff Epler c918d8048d
correct more error detection 2023-08-05 14:46:50 -05:00
Jeff Epler 9a354a4eb8
fix checking for in-pin 2023-08-05 14:24:11 -05:00
Jeff Epler a6e8619940
fix 'uses extra pin' message 2023-08-05 14:24:03 -05:00
Jeff Epler 92e2134009
rp2: StateMachine: Allow loading programs at fixed offsets 2023-07-27 15:47:04 -05:00
Jeff Epler 5780d9a3d2
rp2: Add StateMachine.may_exec
and also sanity-check the init instructions, thanks to the newly
factored-out checker.

Closes: #8221
2023-07-27 15:47:01 -05:00
Scott Shawcroft 5f082561b3
Unify some error strings 2023-07-20 11:20:32 -07:00
Scott Shawcroft 1629faf8b3
Make usb_host.Port a singleton
This allows you to initialize usb_host.Port once successfully and
then returns the same object as long as you pass the same arguments
in. It does allow you to fix incorrect pins but not switching from
one valid set to another. (It needs a reset for that.)

This also moves hcd cache operations to RAM so that they don't
access the cache when doing maintenance.
2023-07-18 10:40:54 -07:00
Scott Shawcroft 7764cde6c2
Merge pull request #8155 from tannewt/imx_usb_host
Basic USB host support and keyboard workflow
2023-07-11 09:50:09 -07:00
Scott Shawcroft 2686beab36
Basic USB host support and keyboard workflow
Connects up read, write and ctrl_transfer to TinyUSB. USB Host
support is available on iMX RT and RP2040.

Fixes #6527 (imx) and fixes #5986 (rp2).
2023-07-10 14:22:21 -07:00
MicroDev 8704ba158b
fix set hostname 2023-07-09 21:25:37 +05:30
Dan Halbert 540bf58102 improve start_ap() doc; make "authmode" use consistent internally 2023-06-22 16:24:18 -04:00
Dan Halbert 955d2723d0 RP2040 SleepMemory 2023-05-21 19:05:25 -04:00
Dan Halbert f2bfced407
Merge pull request #7976 from anecdata/ap_ipv4_picow
Allow Access Point static IPv4 on the raspberrypi port
2023-05-16 18:45:22 -04:00
Bill Sideris 95c1d849d3
Just 500
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2023-05-16 04:47:44 +03:00
Bill Sideris ed31c7dc8f
Await down on stop_station 2023-05-15 22:38:59 +03:00
anecdata 4ac7e7643a
netutils dhcp server 2023-05-14 17:44:27 -05:00
anecdata 6dd2e86727
remove dhcp calls 2023-05-14 14:52:49 -05:00
anecdata cd41fb101a
oops 2023-05-13 22:55:08 -05:00
anecdata 8196366c94 initial 2023-05-13 22:06:16 -05:00
anecdata 29bf64decb raspberrypi common-hal f(x)s Not Implemented 2023-05-08 22:41:33 -05:00
Scott Shawcroft 750615f2da
Merge pull request #7430 from Lanzaa/rp2040_cpu_frequency
Add frequency setting for RP2040 boards.
2023-05-02 09:52:28 -07:00
Scott Shawcroft 488dca565f
Merge pull request #7922 from tannewt/dvi320
Take in framebuffer resolution, not output res
2023-05-02 09:22:51 -07:00
Scott Shawcroft 0aa71ed6e6
Tweak the picodvi docs and arg checking 2023-05-01 11:30:04 -07:00
Scott Shawcroft b08714bb8f
Take in framebuffer resolution, not output res
Fixes #7911
2023-04-28 17:13:17 -07:00
Scott Shawcroft 8104b824e0
Standardize CPU temp and voltage. Add autogen warning 2023-04-28 16:19:43 -07:00
Scott Shawcroft 0f9fb33371
Merge branch 'main' into rp2040_cpu_frequency 2023-04-19 17:05:58 -07:00
Scott Shawcroft e2ab7a4751
Change voltage. Refine docs 2023-04-19 17:04:54 -07:00
Scott Shawcroft 66edcf5d03
Add PicoDVI support
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
2023-04-19 15:14:02 -07:00
Ted Hess 9825b7fbb7 Web Workflow sockets and threads handling improvements.
Fixes polling thread looping forever hangs preventing new connections.
Don't lose listening sockets on mp resets and re-init.
Keep better separation of "system" and "user" sockets.
Track socket states to prevent re-use of sockets before closed.
Close REST socket when transaction completes. No post-init.
Remove unnecessary state flags.
2023-04-05 13:50:42 -04:00
Dan Halbert 5c429320a8 Add wifi.radio.connected, wifi.radio.ap_active 2023-03-31 17:57:53 -04:00
Gregory Neverov 173bc198c6 don't set tcp_err callback for listen sockets 2023-03-29 11:49:32 -07:00
hathach 8c1095b268
Merge branch 'main' into add-codespell 2023-03-23 14:09:57 +07:00
Jeff Epler e05f0ba3b2
Revert "Correctly raise OS error in socketpool_socket_recv_into()"
This reverts commit 7e6e824d56.

Fixes #7770

The change in #7623 needs to be revered; the raise-site added in #7632
is the correct one and the one in socketpool needs to be reverted.

This is not affecting 8.0.x because #7623 was not back-ported to there
before we realized it was not a full fix.

Both #7770 and #7606 should be re-tested. I didn't test.
2023-03-22 14:32:06 -05:00
hathach fecc1bdedb
fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
Dan Halbert 859a48723f
Merge pull request #7633 from tannewt/fix_imx_pwm
Fix `pwmio` on iMX RT.
2023-02-28 14:11:06 -05:00
Dan Halbert f9831b3bbc
Merge pull request #7639 from adafruit/8.0.x
Merge 8.0.x up to main
2023-02-24 19:32:09 -05:00
Scott Shawcroft 1acf65ee22
Fix `pwmio` on iMX RT.
It now handles deinit, never_reset and sharing tracking. PWM
now runs in the WAIT state as well during a time.sleep().

_reset_ok() was removed because it was called in one spot right
before deinit().

Some PWMOut were also switched to a bitmap for use instead of
reference count. That way init and deinit are idempotent.

Fixes #6589. Fixes #4841. Fixes #4541.
2023-02-22 11:22:39 -08:00
Jeff Epler de9233f84a
raspberrypi: SSLSocket: raise OSError when appropriate
Rather than returning the negative error value.

This is intended to close #7606, though I did not test with mqtt.
Instead, I created a simple standalone test program:
```python
import wifi, socketpool, ssl, time
#wifi.radio.connect(<omitted>)
import socketpool
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.create_default_context()

b = bytearray(8)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sss = ctx.wrap_socket(s, server_hostname='example.com')
sss.connect(('example.com', 443))
sss.setblocking(False)
r = sss.recv_into(b)
print(r, b)  # prints 4294967285 which is -11 as unsigned
sss.close()
```

Before the change, r was the out of range value 4294967285. After the
change, the recv_into call raises OSError instead.

This is comparable to the behavior on standard Python, though an
SSLWantReadError is raised instead.

The original (mis)behavior seems to match what was uncovered deep inside
minimqtt by adding logging:
```
370.578: DEBUG - PKT: _sock_exact_recv: recv_len = 4294967285
```
2023-02-22 10:07:48 -06:00
root 7e6e824d56 Correctly raise OS error in socketpool_socket_recv_into() 2023-02-21 13:38:29 -06:00
MicroDev 508f2015b6
Merge pull request #7605 from Neradoc/pico-uart-in-use-error
Tweak the UART in use message on RP2040
2023-02-18 08:35:52 +05:30
Neradoc 13716c9c30 tweak the UART in use message on RP2040 2023-02-17 23:29:44 +01:00
Dan Halbert bbadc00599
Merge pull request #7577 from dhalbert/safemode-py
Implement safemode.py
2023-02-16 14:15:20 -05:00
MicroDev 32d86c3ea3
Merge pull request #7580 from adafruit/8.0.x
Merge 8.0.x up to main
2023-02-15 09:16:51 +05:30
Gregory Neverov 98b61279e4 Add function common_hal_busio_uart_never_reset for rp2 2023-02-14 09:05:24 -08:00
Dan Halbert d8231f1588 Implement safemode.py 2023-02-13 18:26:38 -05:00
Jeff Epler b9f689adf4 Use lowest drive level for PIO 2023-02-08 16:18:58 -06:00