mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-01-04 03:43:37 +01:00
Merge branch 'pr2306' into dev
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <TaskSchedulerDeclarations.h>
|
||||
#include <WiFi.h>
|
||||
#include <vector>
|
||||
#include "W5500.h"
|
||||
|
||||
enum class network_mode {
|
||||
WiFi,
|
||||
@@ -83,6 +84,7 @@ private:
|
||||
bool _ethConnected = false;
|
||||
std::vector<NetworkEventCbList_t> _cbEventList;
|
||||
bool _lastMdnsEnabled = false;
|
||||
std::unique_ptr<W5500> _w5500;
|
||||
};
|
||||
|
||||
extern NetworkSettingsClass NetworkSettings;
|
||||
|
||||
@@ -26,6 +26,13 @@ struct PinMapping_t {
|
||||
int8_t cmt_gpio3;
|
||||
int8_t cmt_sdio;
|
||||
|
||||
int8_t w5500_mosi;
|
||||
int8_t w5500_miso;
|
||||
int8_t w5500_sclk;
|
||||
int8_t w5500_cs;
|
||||
int8_t w5500_int;
|
||||
int8_t w5500_rst;
|
||||
|
||||
int8_t eth_phy_addr;
|
||||
bool eth_enabled;
|
||||
int eth_power;
|
||||
@@ -49,10 +56,11 @@ public:
|
||||
|
||||
bool isValidNrf24Config() const;
|
||||
bool isValidCmt2300Config() const;
|
||||
bool isValidW5500Config() const;
|
||||
bool isValidEthConfig() const;
|
||||
|
||||
private:
|
||||
PinMapping_t _pinMapping;
|
||||
};
|
||||
|
||||
extern PinMappingClass PinMapping;
|
||||
extern PinMappingClass PinMapping;
|
||||
|
||||
19
include/W5500.h
Normal file
19
include/W5500.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <esp_netif.h>
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class W5500 {
|
||||
public:
|
||||
explicit W5500(int8_t pin_mosi, int8_t pin_miso, int8_t pin_sclk, int8_t pin_cs, int8_t pin_int, int8_t pin_rst);
|
||||
W5500(const W5500&) = delete;
|
||||
W5500 &operator=(const W5500&) = delete;
|
||||
~W5500();
|
||||
|
||||
String macAddress();
|
||||
|
||||
private:
|
||||
esp_eth_handle_t eth_handle;
|
||||
esp_netif_t *eth_netif;
|
||||
};
|
||||
Reference in New Issue
Block a user