File tree Expand file tree Collapse file tree
TLS13-ENC28J60-client/main
TLS13-ENC28J60-server/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -996,8 +996,6 @@ int init_ENC28J60() {
996996 enc28j60_config .int_gpio_num = CONFIG_EXAMPLE_ENC28J60_INT_GPIO ;
997997
998998 eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG ();
999- mac_config .smi_mdc_gpio_num = -1 ; // ENC28J60 doesn't have SMI interface
1000- mac_config .smi_mdio_gpio_num = -1 ;
1001999 esp_eth_mac_t * mac = esp_eth_mac_new_enc28j60 (& enc28j60_config , & mac_config );
10021000
10031001 eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG ();
Original file line number Diff line number Diff line change 1616#include <sys/cdefs.h>
1717#include "esp_log.h"
1818#include "esp_eth.h"
19- #include "eth_phy_regs_struct.h"
2019#include "freertos/FreeRTOS.h"
2120#include "freertos/task.h"
2221#include "driver/gpio.h"
@@ -57,6 +56,25 @@ typedef union {
5756 * @brief PHSTAT2(PHY Status Register 2)
5857 *
5958 */
59+ /* IDF 5.x removed eth_phy_regs_struct.h; this is the standard 802.3 BMCR */
60+ typedef union {
61+ struct {
62+ uint32_t reserved_5_0 : 6 ; // Reserved
63+ uint32_t speed_select_msb : 1 ;// Speed select MSB
64+ uint32_t collision_test : 1 ; // Collision test
65+ uint32_t duplex_mode : 1 ; // Duplex mode
66+ uint32_t restart_auto_nego : 1 ; // Restart auto negotiation
67+ uint32_t isolate : 1 ; // Isolate
68+ uint32_t power_down : 1 ; // Power down
69+ uint32_t en_auto_nego : 1 ; // Enable auto negotiation
70+ uint32_t speed_select : 1 ; // Speed select LSB
71+ uint32_t loopback : 1 ; // Loopback
72+ uint32_t reset : 1 ; // Reset
73+ };
74+ uint32_t val ;
75+ } bmcr_reg_t ;
76+ #define ETH_PHY_BMCR_REG_ADDR (0x00)
77+
6078typedef union {
6179 struct {
6280 uint32_t reserved_4_0 : 5 ; // Reserved
Original file line number Diff line number Diff line change @@ -1016,8 +1016,6 @@ int init_ENC28J60() {
10161016 enc28j60_config .int_gpio_num = CONFIG_EXAMPLE_ENC28J60_INT_GPIO ;
10171017
10181018 eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG ();
1019- mac_config .smi_mdc_gpio_num = -1 ; // ENC28J60 doesn't have SMI interface
1020- mac_config .smi_mdio_gpio_num = -1 ;
10211019 esp_eth_mac_t * mac = esp_eth_mac_new_enc28j60 (& enc28j60_config , & mac_config );
10221020
10231021 eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG ();
Original file line number Diff line number Diff line change 1616#include <sys/cdefs.h>
1717#include "esp_log.h"
1818#include "esp_eth.h"
19- #include "eth_phy_regs_struct.h"
2019#include "freertos/FreeRTOS.h"
2120#include "freertos/task.h"
2221#include "driver/gpio.h"
@@ -57,6 +56,25 @@ typedef union {
5756 * @brief PHSTAT2(PHY Status Register 2)
5857 *
5958 */
59+ /* IDF 5.x removed eth_phy_regs_struct.h; this is the standard 802.3 BMCR */
60+ typedef union {
61+ struct {
62+ uint32_t reserved_5_0 : 6 ; // Reserved
63+ uint32_t speed_select_msb : 1 ;// Speed select MSB
64+ uint32_t collision_test : 1 ; // Collision test
65+ uint32_t duplex_mode : 1 ; // Duplex mode
66+ uint32_t restart_auto_nego : 1 ; // Restart auto negotiation
67+ uint32_t isolate : 1 ; // Isolate
68+ uint32_t power_down : 1 ; // Power down
69+ uint32_t en_auto_nego : 1 ; // Enable auto negotiation
70+ uint32_t speed_select : 1 ; // Speed select LSB
71+ uint32_t loopback : 1 ; // Loopback
72+ uint32_t reset : 1 ; // Reset
73+ };
74+ uint32_t val ;
75+ } bmcr_reg_t ;
76+ #define ETH_PHY_BMCR_REG_ADDR (0x00)
77+
6078typedef union {
6179 struct {
6280 uint32_t reserved_4_0 : 5 ; // Reserved
You can’t perform that action at this time.
0 commit comments