| 
									
										
										
										
											2021-06-19 22:14:09 +00:00
										 |  |  | #ifndef WLED_ETHERNET_H
 | 
					
						
							|  |  |  | #define WLED_ETHERNET_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-23 12:14:48 +00:00
										 |  |  | #include "pin_manager.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 17:48:55 +00:00
										 |  |  | #ifdef WLED_USE_ETHERNET
 | 
					
						
							| 
									
										
										
										
											2021-08-23 12:14:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // For ESP32, the remaining five pins are at least somewhat configurable.
 | 
					
						
							|  |  |  | // eth_address  is in range [0..31], indicates which PHY (MAC?) address should be allocated to the interface
 | 
					
						
							|  |  |  | // eth_power    is an output GPIO pin used to enable/disable the ethernet port (and/or external oscillator)
 | 
					
						
							|  |  |  | // eth_mdc      is an output GPIO pin used to provide the clock for the management data
 | 
					
						
							|  |  |  | // eth_mdio     is an input/output GPIO pin used to transfer management data
 | 
					
						
							|  |  |  | // eth_type     is the physical ethernet module's type (ETH_PHY_LAN8720, ETH_PHY_TLK110)
 | 
					
						
							|  |  |  | // eth_clk_mode defines the GPIO pin and GPIO mode for the clock signal
 | 
					
						
							|  |  |  | //              However, there are really only four configurable options on ESP32:
 | 
					
						
							|  |  |  | //              ETH_CLOCK_GPIO0_IN    == External oscillator, clock input  via GPIO0
 | 
					
						
							|  |  |  | //              ETH_CLOCK_GPIO0_OUT   == ESP32 provides 50MHz clock output via GPIO0
 | 
					
						
							|  |  |  | //              ETH_CLOCK_GPIO16_OUT  == ESP32 provides 50MHz clock output via GPIO16
 | 
					
						
							|  |  |  | //              ETH_CLOCK_GPIO17_OUT  == ESP32 provides 50MHz clock output via GPIO17
 | 
					
						
							| 
									
										
										
										
											2021-06-19 22:14:09 +00:00
										 |  |  | typedef struct EthernetSettings { | 
					
						
							|  |  |  |   uint8_t        eth_address; | 
					
						
							|  |  |  |   int            eth_power; | 
					
						
							|  |  |  |   int            eth_mdc; | 
					
						
							|  |  |  |   int            eth_mdio; | 
					
						
							|  |  |  |   eth_phy_type_t eth_type; | 
					
						
							|  |  |  |   eth_clock_mode_t eth_clk_mode; | 
					
						
							|  |  |  | } ethernet_settings; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 17:48:55 +00:00
										 |  |  | extern const ethernet_settings ethernetBoards[]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define WLED_ETH_RSVD_PINS_COUNT 6
 | 
					
						
							|  |  |  | extern const managed_pin_type esp32_nonconfigurable_ethernet_pins[WLED_ETH_RSVD_PINS_COUNT]; | 
					
						
							| 
									
										
										
										
											2021-06-19 22:14:09 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |