-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
RP2: Add networking support. #7667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b35943
to
ab1da7e
Compare
On a somewhat related note: for me it would be very interesting to have a breakout with the murata module used in the PYBD series. That way it could share the WiFi/BT codebase with PYBD. Do you know if such a module exists? |
I'm not sure, I'm adding support for the Nano RP2040 which uses a ublox (esp32 based?) WiFi/BT module, but anyway this PR lays the groundwork for adding more networking modules support once they become available. The CYW43 bt driver may have some portability issues that will need to be fixed first (for example it uses stm32 uart driver functions not available in the RP2 port). I avoid the uart issue by using machine_uart for the bt hci driver. |
@robert-hh Note I actually made the ublox/Nina Python module API compatible with the PYBD/CYW43 module, so it can share the same Python scripts with the PYBD/CYW43. So to the user the same code will run on both modules without changes. |
I think it would make more sense to try to move modnetwork and modusocket somewhere where they can be shared between ports instead of copying these modules. The mod_network_lwip_poll_wrapper, lwip_poll and sys_now can stay in port specific files. @dpgeorge What do you think ? |
ab1da7e
to
7fd3f11
Compare
44f5a19
to
c7f13b3
Compare
@dpgeorge rebased on the latest modnetwork/modusocket changes. |
14f36c3
to
227288b
Compare
227288b
to
386c76b
Compare
#define MICROPY_PORT_ROOT_POINTERS \ | ||
const char *readline_hist[8]; \ | ||
void *machine_pin_irq_obj[30]; \ | ||
void *rp2_pio_irq_obj[2]; \ | ||
void *rp2_state_machine_irq_obj[8]; \ | ||
void *rp2_uart_rx_buffer[2]; \ | ||
void *rp2_uart_tx_buffer[2]; \ | ||
MICROPY_BOARD_ROOT_POINTERS \ | ||
NETWORK_ROOT_POINTERS \ | ||
MICROPY_BOARD_ROOT_POINTERS \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpgeorge can this be fixed in the code format ? It insists on indenting the last line in a #define
like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would need to be done in the fix-up stage of tools/codeformat.py
. Feel free to have a go at doing that (separate PR tho!).
Codecov Report
@@ Coverage Diff @@
## master #7667 +/- ##
==========================================
- Coverage 98.24% 98.24% -0.01%
==========================================
Files 154 154
Lines 20043 20008 -35
==========================================
- Hits 19692 19657 -35
Misses 351 351
Continue to review full report at Codecov.
|
386c76b
to
9a0d5e3
Compare
@@ -35,7 +35,7 @@ | |||
#include "shared/netutils/netutils.h" | |||
#include "modnetwork.h" | |||
|
|||
#if MICROPY_PY_USOCKET && !MICROPY_PY_LWIP | |||
#if MICROPY_PY_NETWORK && MICROPY_PY_USOCKET && !MICROPY_PY_LWIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zephyr port fails here because it defines PY_USOCKET.
9a0d5e3
to
1b10615
Compare
1b10615
to
4262e15
Compare
4262e15
to
68592de
Compare
Merged in 38f8e85 |
@dpgeorge Should I fix the conflicts ? |
These are moved: * Display -> busdisplay.BusDisplay * FourWire -> fourwire.FourWire * EPaperDisplay -> epaperdisplay.EPaperDisplay * I2CDisplay -> i2cdisplaybus.I2CDisplayBus Bus related helpers are split out of display_core into bus_core. It is in still displayio since it is a dependency of both busdisplay and epaperdisplay. Fixes micropython#7667
These are moved: * Display -> busdisplay.BusDisplay * FourWire -> fourwire.FourWire * EPaperDisplay -> epaperdisplay.EPaperDisplay * I2CDisplay -> i2cdisplaybus.I2CDisplayBus `paralleldisplay` is now `paralleldisplaybus` (and registered as `paralleldisplay` too). Bus related helpers are split out of display_core into bus_core. It is in still displayio since it is a dependency of both busdisplay and epaperdisplay. Fixes micropython#7667
These are moved: * Display -> busdisplay.BusDisplay * FourWire -> fourwire.FourWire * EPaperDisplay -> epaperdisplay.EPaperDisplay * I2CDisplay -> i2cdisplaybus.I2CDisplayBus `paralleldisplay` is now `paralleldisplaybus` (and registered as `paralleldisplay` too). Bus related helpers are split out of display_core into bus_core. It is in still displayio since it is a dependency of both busdisplay and epaperdisplay. Fixes micropython#7667
These are moved: * Display -> busdisplay.BusDisplay * FourWire -> fourwire.FourWire * EPaperDisplay -> epaperdisplay.EPaperDisplay * I2CDisplay -> i2cdisplaybus.I2CDisplayBus `paralleldisplay` is now `paralleldisplaybus` (and registered as `paralleldisplay` too). Bus related helpers are split out of display_core into bus_core. It is in still displayio since it is a dependency of both busdisplay and epaperdisplay. Fixes micropython#7667
These are moved: * Display -> busdisplay.BusDisplay * FourWire -> fourwire.FourWire * EPaperDisplay -> epaperdisplay.EPaperDisplay * I2CDisplay -> i2cdisplaybus.I2CDisplayBus `paralleldisplay` is now `paralleldisplaybus` (and registered as `paralleldisplay` too). Bus related helpers are split out of display_core into bus_core. It is in still displayio since it is a dependency of both busdisplay and epaperdisplay. Fixes micropython#7667
Add basic generic networking module support. This serves as a placeholder for adding specific NICs/WiFi drivers later.