forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extmod/modnetwork: Add network.hostname() and network.country().
This provides a standard interface to setting the global networking config for all interfaces and interface types. For ports that already use either a static hostname (mimxrt, rp2) they will now use the configured value. The default is configured by the port (or optionally the board). For interfaces that previously supported .config(hostname), this is still supported but now implemented using the global network.hostname. Similarly, pyb.country and rp2.country are now deprecated, but the methods still exist (and forward to network.hostname). Because ESP32/ESP8266 do not use extmod/modnetwork.c they are not affected by this commit. Signed-off-by: Jim Mussared <[email protected]>
- Loading branch information
Showing
26 changed files
with
138 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
// Board config for Wiznet W5100S-EVB-Pico. | ||
|
||
// Board and hardware specific configuration | ||
#define MICROPY_HW_BOARD_NAME "W5100S-EVB-Pico" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) | ||
#define MICROPY_HW_BOARD_NAME "W5100S-EVB-Pico" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) | ||
|
||
// Enable networking. | ||
#define MICROPY_PY_NETWORK (1) | ||
#define MICROPY_PY_NETWORK (1) | ||
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "W5100S-EVB" | ||
|
||
// Wiznet HW config. | ||
#define MICROPY_HW_WIZNET_SPI_ID (0) | ||
#define MICROPY_HW_WIZNET_SPI_BAUDRATE (20 * 1000 * 1000) | ||
#define MICROPY_HW_WIZNET_SPI_SCK (18) | ||
#define MICROPY_HW_WIZNET_SPI_MOSI (19) | ||
#define MICROPY_HW_WIZNET_SPI_MISO (16) | ||
#define MICROPY_HW_WIZNET_PIN_CS (17) | ||
#define MICROPY_HW_WIZNET_PIN_RST (20) | ||
#define MICROPY_HW_WIZNET_SPI_ID (0) | ||
#define MICROPY_HW_WIZNET_SPI_BAUDRATE (20 * 1000 * 1000) | ||
#define MICROPY_HW_WIZNET_SPI_SCK (18) | ||
#define MICROPY_HW_WIZNET_SPI_MOSI (19) | ||
#define MICROPY_HW_WIZNET_SPI_MISO (16) | ||
#define MICROPY_HW_WIZNET_PIN_CS (17) | ||
#define MICROPY_HW_WIZNET_PIN_RST (20) | ||
// Connecting the INTN pin enables RECV interrupt handling of incoming data. | ||
#define MICROPY_HW_WIZNET_PIN_INTN (21) | ||
#define MICROPY_HW_WIZNET_PIN_INTN (21) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
// Board config for Wiznet W5500-EVB-Pico. | ||
|
||
// Board and hardware specific configuration | ||
#define MICROPY_HW_BOARD_NAME "W5500-EVB-Pico" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) | ||
#define MICROPY_HW_BOARD_NAME "W5500-EVB-Pico" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) | ||
|
||
// Enable networking. | ||
#define MICROPY_PY_NETWORK (1) | ||
#define MICROPY_PY_NETWORK (1) | ||
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "W5500-EVB" | ||
|
||
// Wiznet HW config. | ||
#define MICROPY_HW_WIZNET_SPI_ID (0) | ||
#define MICROPY_HW_WIZNET_SPI_BAUDRATE (20 * 1000 * 1000) | ||
#define MICROPY_HW_WIZNET_SPI_SCK (18) | ||
#define MICROPY_HW_WIZNET_SPI_MOSI (19) | ||
#define MICROPY_HW_WIZNET_SPI_MISO (16) | ||
#define MICROPY_HW_WIZNET_PIN_CS (17) | ||
#define MICROPY_HW_WIZNET_PIN_RST (20) | ||
#define MICROPY_HW_WIZNET_SPI_ID (0) | ||
#define MICROPY_HW_WIZNET_SPI_BAUDRATE (20 * 1000 * 1000) | ||
#define MICROPY_HW_WIZNET_SPI_SCK (18) | ||
#define MICROPY_HW_WIZNET_SPI_MOSI (19) | ||
#define MICROPY_HW_WIZNET_SPI_MISO (16) | ||
#define MICROPY_HW_WIZNET_PIN_CS (17) | ||
#define MICROPY_HW_WIZNET_PIN_RST (20) | ||
// Connecting the INTN pin enables RECV interrupt handling of incoming data. | ||
#define MICROPY_HW_WIZNET_PIN_INTN (21) | ||
#define MICROPY_HW_WIZNET_PIN_INTN (21) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.