mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Support the RAD-Epsilon
This commit is contained in:
@@ -44,6 +44,7 @@ public:
|
||||
RADGigastar = (0x00000013),
|
||||
RED2 = (0x00000014),
|
||||
EtherBADGE = (0x00000016),
|
||||
RADEpsilon = (0x00000018),
|
||||
RED = (0x00000040),
|
||||
ECU = (0x00000080),
|
||||
IEVB = (0x00000100),
|
||||
@@ -124,6 +125,8 @@ public:
|
||||
return "neoVI RED 2";
|
||||
case EtherBADGE:
|
||||
return "EtherBADGE";
|
||||
case RADEpsilon:
|
||||
return "RAD-Epsilon";
|
||||
case RED:
|
||||
return "neoVI RED";
|
||||
case ECU:
|
||||
@@ -215,6 +218,7 @@ private:
|
||||
#define ICSNEO_DEVICETYPE_RADGIGASTAR ((devicetype_t)0x00000013)
|
||||
#define ICSNEO_DEVICETYPE_RED2 ((devicetype_t)0x00000014)
|
||||
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)0x00000016)
|
||||
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)0x00000018)
|
||||
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)0x00000040)
|
||||
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)0x00000080)
|
||||
#define ICSNEO_DEVICETYPE_IEVB ((devicetype_t)0x00000100)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef __RADEPSILON_H_
|
||||
#define __RADEPSILON_H_
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/cdcacm.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADEpsilon : public Device {
|
||||
public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADEpsilon;
|
||||
static constexpr const char* SERIAL_START = "RE";
|
||||
static constexpr const uint16_t PRODUCT_ID = 0x1109;
|
||||
static std::vector<std::shared_ptr<Device>> Find() {
|
||||
std::vector<std::shared_ptr<Device>> found;
|
||||
|
||||
for(auto neodevice : CDCACM::FindByProduct(PRODUCT_ID))
|
||||
found.emplace_back(new RADEpsilon(neodevice));
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet, // Connected to port 6 on the switch
|
||||
|
||||
Network::NetID::LIN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
RADEpsilon(neodevice_t neodevice) : Device(neodevice) {
|
||||
initialize<CDCACM>();
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
productId = PRODUCT_ID;
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportCANFD = true;
|
||||
}
|
||||
|
||||
virtual 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
|
||||
virtual void setupSupportedTXNetworks(std::vector<Network>& txNetworks) override { setupSupportedRXNetworks(txNetworks); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user