mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-11-04 12:59:07 +01:00
Device: RAD-Gemini to RAD-Argos
This commit is contained in:
committed by
Kyle Schwarz
parent
7ef57e6737
commit
f4836f279f
@@ -0,0 +1,77 @@
|
||||
#ifndef __RADARGOS_H_
|
||||
#define __RADARGOS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radargos/radargossettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADArgos : public Device {
|
||||
public:
|
||||
// Serial numbers start with GE
|
||||
// USB PID is 0x110E, standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(RADArgos, DeviceType::RADArgos, "GE");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::MDIO_01,
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
bool isOnlineSupported() const override { return false; }
|
||||
|
||||
bool supportsTC10() const override { return true; }
|
||||
|
||||
ProductID getProductID() const override { return ProductID::RADArgos; }
|
||||
|
||||
const std::vector<ChipInfo>& getChipInfo() const override {
|
||||
static std::vector<ChipInfo> chips = {
|
||||
{ChipID::RADArgos_MCHIP, true, "MCHIP", "radargos_mchip_ief", 0, FirmwareType::IEF},
|
||||
};
|
||||
return chips;
|
||||
}
|
||||
|
||||
BootloaderPipeline getBootloader() override {
|
||||
return BootloaderPipeline()
|
||||
.add<EnterBootloaderPhase>()
|
||||
.add<FlashPhase>(ChipID::RADArgos_MCHIP, BootloaderCommunication::RED)
|
||||
.add<EnterApplicationPhase>(ChipID::RADArgos_MCHIP)
|
||||
.add<ReconnectPhase>()
|
||||
.add<WaitPhase>(std::chrono::milliseconds(3000));
|
||||
}
|
||||
|
||||
protected:
|
||||
RADArgos(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADArgosSettings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.align16bit = true;
|
||||
}
|
||||
|
||||
void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
for(auto& netid : GetSupportedNetworks())
|
||||
rxNetworks.emplace_back(netid);
|
||||
}
|
||||
|
||||
// The supported TX networks are the same as the supported RX networks for this device
|
||||
void setupSupportedTXNetworks(std::vector<Network>& txNetworks) override { setupSupportedRXNetworks(txNetworks); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __RADARGOS_H_
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef LIBICSNEO_RADARGOSSETTINGS_H
|
||||
#define LIBICSNEO_RADARGOSSETTINGS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "icsneo/device/idevicesettings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef struct {
|
||||
uint16_t perf_en; // 2
|
||||
|
||||
ETHERNET_SETTINGS2 ethernet1; // 16
|
||||
ETHERNET_SETTINGS2 ethernet2; // 16
|
||||
ETHERNET_SETTINGS2 autoEthernet1; // 16
|
||||
ETHERNET_SETTINGS2 autoEthernet2; // 16
|
||||
|
||||
uint16_t network_enabled_on_boot; // 2
|
||||
uint16_t network_enables; // 2
|
||||
uint16_t network_enables_2; // 2
|
||||
uint16_t network_enables_3; // 2
|
||||
uint16_t network_enables_4; // 2
|
||||
uint64_t network_enables_5; // 8
|
||||
|
||||
struct
|
||||
{
|
||||
uint16_t enableLatencyTest : 1;
|
||||
uint16_t reserved : 15;
|
||||
} flags; // 2
|
||||
} radargos_settings_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
static_assert(sizeof(radargos_settings_t) == 86, "RADArgos settings size mismatch");
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class RADArgosSettings : public IDeviceSettings {
|
||||
public:
|
||||
RADArgosSettings(Device* device) : IDeviceSettings(device, sizeof(radargos_settings_t)) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
#endif // LIBICSNEO_RADARGOSSETTINGS_H
|
||||
Reference in New Issue
Block a user