EthernetModule
Source:
EthernetModule.h
EthChip¶
src/core/system/EthernetModule.h:214What a chip can wire, so the board filter answers for any chip rather than only the one built for.
Public Attributes¶
bool drivesEthernet
bool w5500
bool p4
bool s31
bool fixed
EthernetModule¶
src/core/system/EthernetModule.h:30Inherits:
MoonModule
The wired interface: which board's wiring it uses, its pins, and how it gets an address.
A Network child: the network module runs the cascade, and this one holds what Ethernet needs to join it.

Public Methods¶
virtual inline bool respectsEnabled() const override
: Keep the interface configured whatever the toggle says, or the device drops off the network.
virtual inline bool appliesConfigLive() const override
: The interface comes up once at boot, so a restored config applies at the next boot.
virtual inline uint8_t fixedPins(FixedPin * out, uint8_t max) const override
: The controller's data pads while Ethernet runs, which the chip fixed and nobody sets.
virtual inline void defineControls() override
: Declare the board, the PHY and its pins, then the IP settings.
inline bool adoptLegacy(const char * json)
: The interface settings a config from 6.0 kept at Network's top level, under the same names, with Network's shared addressing as ipSettings; false when it has none.
inline void syncConfig()
: Push the interface config to the platform, before bring-up reads it, and baseline the IP settings.
inline bool syncLive()
: Apply an interface change live where the hardware allows it, returning true when the interface restarted.
inline bool syncIpLive(bool connected)
: Apply an IP settings change at once, returning true when Ethernet carries the device, so the cascade re-judges it.
virtual inline void onControlChanged(const char * name) override
: Static starts from the cable's lease, so nothing moves until an address changes; with no lease, from the station's network.
inline bool isStatic() const
: Whether the user pinned a static address.
inline const uint8_t * configuredIp() const
: The address the user set, or null where a DHCP client runs.
inline bool configured() const
: Whether a wired interface is set up, which is what lets the access point stay closed.
inline void applyStatic() const
: Pin the configured address onto the wired interface, or do nothing where a client runs.
Public Static Attributes¶
constexpr EthChip kThisChip {, , , ,
}
Public Static Methods¶
constexpr static inline constexpr bool presetFits(int8_t type, EthChip chip = kThisChip)
: Whether a board preset with PHY type belongs on chip: Custom everywhere, and every board on the desktop, which drives none and previews them all.
More info¶
Why one preset defaults to itself¶
The preset list is filtered per chip, and the default is Custom rather than row 0. Where the filter leaves exactly ONE real preset that reasoning inverts, because the single survivor IS this chip's board. A P4 offers P4 RMII and an S31 offers S31 RGMII, so Custom there ships an unconfigured interface on a board whose wiring is known. A classic keeps Custom, where several survive and only the catalog knows the board: an Olimex takes Classic RMII, a QuinLED Dig-Octa the no-reset variant.
The applied-tracker starts on a sentinel rather than row 0, or a virgin P4 would select P4 RMII and still boot with the interface at ethNone.