Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
76fefad1
Commit
76fefad1
authored
Apr 20, 2020
by
Kenneth Ryerson
Committed by
Damien George
Jul 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esp32/network_lan: Add support for IP101 PHY.
Signed-off-by:
Kenneth Ryerson
<
kenneth.ryerson@gmail.com
>
parent
5f0e9d1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
ports/esp32/modnetwork.c
ports/esp32/modnetwork.c
+1
-0
ports/esp32/modnetwork.h
ports/esp32/modnetwork.h
+1
-1
ports/esp32/network_lan.c
ports/esp32/network_lan.c
+7
-1
No files found.
ports/esp32/modnetwork.c
View file @
76fefad1
...
...
@@ -776,6 +776,7 @@ STATIC const mp_rom_map_elem_t mp_module_network_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_PHY_LAN8720
),
MP_ROM_INT
(
PHY_LAN8720
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PHY_TLK110
),
MP_ROM_INT
(
PHY_TLK110
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PHY_IP101
),
MP_ROM_INT
(
PHY_IP101
)
},
// ETH Clock modes from ESP-IDF
#if !MICROPY_ESP_IDF_4
...
...
ports/esp32/modnetwork.h
View file @
76fefad1
...
...
@@ -26,7 +26,7 @@
#ifndef MICROPY_INCLUDED_ESP32_MODNETWORK_H
#define MICROPY_INCLUDED_ESP32_MODNETWORK_H
enum
{
PHY_LAN8720
,
PHY_TLK110
};
enum
{
PHY_LAN8720
,
PHY_TLK110
,
PHY_IP101
};
MP_DECLARE_CONST_FUN_OBJ_KW
(
get_lan_obj
);
MP_DECLARE_CONST_FUN_OBJ_1
(
ppp_make_new_obj
);
...
...
ports/esp32/network_lan.c
View file @
76fefad1
...
...
@@ -33,6 +33,7 @@
#include "eth_phy/phy.h"
#include "eth_phy/phy_tlk110.h"
#include "eth_phy/phy_lan8720.h"
#include "eth_phy/phy_ip101.h"
#include "tcpip_adapter.h"
#include "modnetwork.h"
...
...
@@ -123,7 +124,9 @@ STATIC mp_obj_t get_lan(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ar
mp_raise_ValueError
(
MP_ERROR_TEXT
(
"invalid phy address"
));
}
if
(
args
[
ARG_phy_type
].
u_int
!=
PHY_LAN8720
&&
args
[
ARG_phy_type
].
u_int
!=
PHY_TLK110
)
{
if
(
args
[
ARG_phy_type
].
u_int
!=
PHY_LAN8720
&&
args
[
ARG_phy_type
].
u_int
!=
PHY_TLK110
&&
args
[
ARG_phy_type
].
u_int
!=
PHY_IP101
)
{
mp_raise_ValueError
(
MP_ERROR_TEXT
(
"invalid phy type"
));
}
...
...
@@ -145,6 +148,9 @@ STATIC mp_obj_t get_lan(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ar
case
PHY_LAN8720
:
config
=
phy_lan8720_default_ethernet_config
;
break
;
case
PHY_IP101
:
config
=
phy_ip101_default_ethernet_config
;
break
;
}
self
->
link_func
=
config
.
phy_check_link
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment