Device: Add RAD-Comet3 support
parent
46e244fbab
commit
9c830a91a2
|
|
@ -21,6 +21,9 @@
|
|||
- CAN works
|
||||
- CAN FD works
|
||||
- Ethernet works
|
||||
- RADComet3
|
||||
- CAN works
|
||||
- Ethernet works
|
||||
|
||||
- Connecting over USB
|
||||
- ValueCAN 4 series
|
||||
|
|
@ -48,3 +51,6 @@
|
|||
- CAN works
|
||||
- Ethernet works
|
||||
- RADMoon3
|
||||
- RADComet3
|
||||
- CAN works
|
||||
- Ethernet works
|
||||
|
|
@ -177,6 +177,10 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
|
|||
makeIfSerialRangeMatches<RADComet2>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
||||
#ifdef __RADCOMET3_H_
|
||||
makeIfSerialMatches<RADComet3>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
||||
#ifdef __RADEPSILON_H_
|
||||
makeIfSerialMatches<RADEpsilon>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
|
@ -316,6 +320,10 @@ const std::vector<DeviceType>& DeviceFinder::GetSupportedDevices() {
|
|||
RADComet::DEVICE_TYPE,
|
||||
#endif
|
||||
|
||||
#ifdef __RADCOMET3_H_
|
||||
RADComet3::DEVICE_TYPE,
|
||||
#endif
|
||||
|
||||
#ifdef __RADEPSILON_H_
|
||||
RADEpsilon::DEVICE_TYPE,
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public:
|
|||
RADMoon3 = (0x00000023),
|
||||
RADComet = (0x00000024),
|
||||
FIRE3_FlexRay = (0x00000025),
|
||||
RADComet3 = (0x00000027),
|
||||
RED = (0x00000040),
|
||||
ECU = (0x00000080),
|
||||
IEVB = (0x00000100),
|
||||
|
|
@ -186,6 +187,8 @@ public:
|
|||
return "neoOBD2 SIM";
|
||||
case FIRE3_FlexRay:
|
||||
return "neoVI FIRE3 FlexRay";
|
||||
case RADComet3:
|
||||
return "RAD-Comet 3";
|
||||
case DONT_REUSE0:
|
||||
case DONT_REUSE1:
|
||||
case DONT_REUSE2:
|
||||
|
|
@ -239,6 +242,7 @@ private:
|
|||
#define ICSNEO_DEVICETYPE_RADMoon3 ((devicetype_t)0x00000023)
|
||||
#define ICSNEO_DEVICETYPE_RADCOMET ((devicetype_t)0x00000024)
|
||||
#define ICSNEO_DEVICETYPE_FIRE3FLEXRAY ((devicetype_t)0x00000025)
|
||||
#define ICSNEO_DEVICETYPE_RADCOMET3 ((devicetype_t)0x00000027)
|
||||
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)0x00000040)
|
||||
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)0x00000080)
|
||||
#define ICSNEO_DEVICETYPE_IEVB ((devicetype_t)0x00000100)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
#ifndef __RADCOMET3_H_
|
||||
#define __RADCOMET3_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/radcomet3/radcomet3.h"
|
||||
#include "icsneo/device/tree/radcomet3/radcomet3settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADComet3 : public Device {
|
||||
public:
|
||||
|
||||
// Serial numbers start with C3
|
||||
// USB PID is 0x1208, standard driver is FTDI3
|
||||
// Ethernet MAC allocation is 0x20, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(RADComet3, DeviceType::RADComet3, "C3");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
|
||||
Network::NetID::OP_Ethernet1,
|
||||
Network::NetID::OP_Ethernet2,
|
||||
Network::NetID::OP_Ethernet3,
|
||||
Network::NetID::OP_Ethernet4,
|
||||
Network::NetID::OP_Ethernet5,
|
||||
Network::NetID::OP_Ethernet6,
|
||||
Network::NetID::OP_Ethernet7,
|
||||
|
||||
Network::NetID::LIN,
|
||||
Network::NetID::ISO9141,
|
||||
|
||||
Network::NetID::MDIO1,
|
||||
Network::NetID::MDIO2,
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADComet3(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADComet3Settings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportCANFD = true;
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
std::optional<MemoryAddress> getCoreminiStartAddressFlash() const override {
|
||||
return 32*1024*1024;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
#ifndef __RADCOMET3SETTINGS_H_
|
||||
#define __RADCOMET3SETTINGS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "icsneo/device/idevicesettings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef struct {
|
||||
// ECU ID used in CAN communications.
|
||||
// TX ID = ECU ID with bit28 cleared,
|
||||
// RX ID = ECUID with bit28 set,
|
||||
// ECU ID = 0 implies ECU ID = serial no with bit 27 set
|
||||
uint32_t ecu_id;
|
||||
uint16_t perf_en;
|
||||
struct
|
||||
{
|
||||
uint16_t hwComLatencyTestEn : 1;
|
||||
uint16_t disableUsbCheckOnBoot : 1;
|
||||
uint16_t reserved : 14;
|
||||
} flags;
|
||||
uint16_t network_enabled_on_boot;
|
||||
CAN_SETTINGS can1;
|
||||
CANFD_SETTINGS canfd1;
|
||||
CAN_SETTINGS can2;
|
||||
CANFD_SETTINGS canfd2;
|
||||
ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings_1;
|
||||
uint16_t iso_parity_1;
|
||||
uint16_t iso_msg_termination_1;
|
||||
uint64_t network_enables;
|
||||
uint64_t network_enables_2;
|
||||
uint64_t termination_enables;
|
||||
TIMESYNC_ICSHARDWARE_SETTINGS timeSyncSettings;
|
||||
RAD_REPORTING_SETTINGS reporting;
|
||||
int16_t iso15765_separation_time_offset;
|
||||
uint32_t pwr_man_timeout;
|
||||
uint16_t pwr_man_enable;
|
||||
RAD_GPTP_SETTINGS gPTP;
|
||||
STextAPISettings text_api;
|
||||
// Ethernet 10/100/1000
|
||||
ETHERNET_SETTINGS2 ethernet;
|
||||
// Ethernet General
|
||||
OP_ETH_GENERAL_SETTINGS opEthGen;
|
||||
// 100/1000T1
|
||||
ETHERNET_SETTINGS2 ethT1;
|
||||
OP_ETH_SETTINGS opEth1;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s1;
|
||||
ETHERNET10T1S_SETTINGS t1s1;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s2;
|
||||
ETHERNET10T1S_SETTINGS t1s2;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s3;
|
||||
ETHERNET10T1S_SETTINGS t1s3;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s4;
|
||||
ETHERNET10T1S_SETTINGS t1s4;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s5;
|
||||
ETHERNET10T1S_SETTINGS t1s5;
|
||||
// 10T1S
|
||||
ETHERNET_SETTINGS2 ethT1s6;
|
||||
ETHERNET10T1S_SETTINGS t1s6;
|
||||
LIN_SETTINGS lin1;
|
||||
} radcomet3_settings_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class RADComet3Settings : public IDeviceSettings {
|
||||
public:
|
||||
RADComet3Settings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radcomet3_settings_t)) {}
|
||||
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radcomet3_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::HSCAN:
|
||||
return &(cfg->can1);
|
||||
case Network::NetID::HSCAN2:
|
||||
return &(cfg->can2);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
const CANFD_SETTINGS* getCANFDSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radcomet3_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::HSCAN:
|
||||
return &(cfg->canfd1);
|
||||
case Network::NetID::HSCAN2:
|
||||
return &(cfg->canfd2);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
#include "icsneo/device/tree/rada2b/rada2b.h"
|
||||
#include "icsneo/device/tree/radcomet/radcomet.h"
|
||||
#include "icsneo/device/tree/radcomet/radcomet2.h"
|
||||
#include "icsneo/device/tree/radcomet3/radcomet3.h"
|
||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "icsneo/device/tree/rada2b/rada2b.h"
|
||||
#include "icsneo/device/tree/radcomet/radcomet.h"
|
||||
#include "icsneo/device/tree/radcomet/radcomet2.h"
|
||||
#include "icsneo/device/tree/radcomet3/radcomet3.h"
|
||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue