From ea5f11268c2a111dc5ff0b01d19280eebdcc2142 Mon Sep 17 00:00:00 2001 From: Yasser Yassine Date: Wed, 26 Feb 2025 02:40:01 +0000 Subject: [PATCH] RADMoon2: Enable communication for MDIO --- include/icsneo/device/device.h | 15 +++++++-------- .../icsneo/device/tree/radmoon2/radmoon2base.h | 17 ++++++----------- .../device/tree/radmoon2/radmoon2settings.h | 6 +----- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/include/icsneo/device/device.h b/include/icsneo/device/device.h index e55cb36..71997f9 100644 --- a/include/icsneo/device/device.h +++ b/include/icsneo/device/device.h @@ -848,6 +848,13 @@ protected: neodevice_t& getWritableNeoDevice() { return data; } + enum class LEDState : uint8_t { + Offline = 0x04, + CoreMiniRunning = 0x08, // This should override "offline" if the CoreMini is running + Online = 0x10 + }; + LEDState ledState; + void updateLEDState(); private: neodevice_t data; std::shared_ptr latestResetStatus; @@ -876,14 +883,6 @@ private: APIEvent::Type getCommunicationNotEstablishedError(); - enum class LEDState : uint8_t { - Offline = 0x04, - CoreMiniRunning = 0x08, // This should override "offline" if the CoreMini is running - Online = 0x10 - }; - LEDState ledState; - void updateLEDState(); - size_t pollingMessageLimit = 20000; moodycamel::BlockingConcurrentQueue> pollingContainer; void enforcePollingMessageLimit(); diff --git a/include/icsneo/device/tree/radmoon2/radmoon2base.h b/include/icsneo/device/tree/radmoon2/radmoon2base.h index a7f8764..b9a3816 100644 --- a/include/icsneo/device/tree/radmoon2/radmoon2base.h +++ b/include/icsneo/device/tree/radmoon2/radmoon2base.h @@ -48,24 +48,19 @@ public: return Device::getProductName(); } - // RADMoon 2 does not go online, you can only set settings and - // view PHY information (when supported) bool goOnline() override { - report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error); - return false; - } - - bool goOffline() override { - report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error); - return false; + if(!com->sendCommand(Command::EnableNetworkCommunication, true)) + return false; + + updateLEDState(); + online = true; + return true; } bool getEthPhyRegControlSupported() const override { return true; } virtual uint8_t getPhyAddrOrPort() const = 0; - bool isOnlineSupported() const override { return false; } - protected: using Device::Device; diff --git a/include/icsneo/device/tree/radmoon2/radmoon2settings.h b/include/icsneo/device/tree/radmoon2/radmoon2settings.h index 6648868..6926e5d 100644 --- a/include/icsneo/device/tree/radmoon2/radmoon2settings.h +++ b/include/icsneo/device/tree/radmoon2/radmoon2settings.h @@ -27,11 +27,7 @@ typedef struct { uint16_t pc_com_mode; TIMESYNC_ICSHARDWARE_SETTINGS timeSyncSettings; uint16_t hwComLatencyTestEn; - struct - { - uint16_t enableLatencyTest : 1; - uint16_t reserved : 15; - } flags; + RAD_GPTP_SETTINGS gPTP; uint64_t network_enables_5;