RAD-A2B: Initial support
parent
2e296dc8d3
commit
9871430288
|
|
@ -14,6 +14,9 @@
|
||||||
- RADStar 2
|
- RADStar 2
|
||||||
- CAN works
|
- CAN works
|
||||||
- Ethernet works
|
- Ethernet works
|
||||||
|
- RADA2B
|
||||||
|
- CAN works
|
||||||
|
- Ethernet works
|
||||||
|
|
||||||
- Connecting over USB
|
- Connecting over USB
|
||||||
- ValueCAN 4 series
|
- ValueCAN 4 series
|
||||||
|
|
@ -36,4 +39,7 @@
|
||||||
- neoVI PLASMA
|
- neoVI PLASMA
|
||||||
- CAN works
|
- CAN works
|
||||||
- neoVI ION
|
- neoVI ION
|
||||||
- CAN works
|
- CAN works
|
||||||
|
- RADA2B
|
||||||
|
- CAN works
|
||||||
|
- Ethernet works
|
||||||
|
|
@ -129,6 +129,10 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
|
||||||
makeIfPIDMatches<NeoVIPLASMA>(dev, newFoundDevices);
|
makeIfPIDMatches<NeoVIPLASMA>(dev, newFoundDevices);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __RADA2B_H_
|
||||||
|
makeIfSerialMatches<RADA2B>(dev, newFoundDevices);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __RADEPSILON_H_
|
#ifdef __RADEPSILON_H_
|
||||||
makeIfSerialMatches<RADEpsilon>(dev, newFoundDevices);
|
makeIfSerialMatches<RADEpsilon>(dev, newFoundDevices);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -244,6 +248,10 @@ const std::vector<DeviceType>& DeviceFinder::GetSupportedDevices() {
|
||||||
NeoVIPLASMA::DEVICE_TYPE,
|
NeoVIPLASMA::DEVICE_TYPE,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __RADA2B_H_
|
||||||
|
RADA2B::DEVICE_TYPE,
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __RADEPSILON_H_
|
#ifdef __RADEPSILON_H_
|
||||||
RADEpsilon::DEVICE_TYPE,
|
RADEpsilon::DEVICE_TYPE,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,8 @@ public:
|
||||||
I2C3 = 518,
|
I2C3 = 518,
|
||||||
I2C4 = 519,
|
I2C4 = 519,
|
||||||
Ethernet2 = 520,
|
Ethernet2 = 520,
|
||||||
|
A2B1 = 522,
|
||||||
|
A2B2 = 523,
|
||||||
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
|
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
|
||||||
Invalid = 0xffff
|
Invalid = 0xffff
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ public:
|
||||||
RADGigastar = (0x00000013),
|
RADGigastar = (0x00000013),
|
||||||
RED2 = (0x00000014),
|
RED2 = (0x00000014),
|
||||||
EtherBADGE = (0x00000016),
|
EtherBADGE = (0x00000016),
|
||||||
|
RAD_A2B = (0x00000017),
|
||||||
RADEpsilon = (0x00000018),
|
RADEpsilon = (0x00000018),
|
||||||
RED = (0x00000040),
|
RED = (0x00000040),
|
||||||
ECU = (0x00000080),
|
ECU = (0x00000080),
|
||||||
|
|
@ -128,6 +129,8 @@ public:
|
||||||
return "neoVI RED 2";
|
return "neoVI RED 2";
|
||||||
case EtherBADGE:
|
case EtherBADGE:
|
||||||
return "EtherBADGE";
|
return "EtherBADGE";
|
||||||
|
case RAD_A2B:
|
||||||
|
return "RAD-A2B";
|
||||||
case RADEpsilon:
|
case RADEpsilon:
|
||||||
return "RAD-Epsilon";
|
return "RAD-Epsilon";
|
||||||
case RED:
|
case RED:
|
||||||
|
|
@ -222,6 +225,7 @@ private:
|
||||||
#define ICSNEO_DEVICETYPE_RADGIGASTAR ((devicetype_t)0x00000013)
|
#define ICSNEO_DEVICETYPE_RADGIGASTAR ((devicetype_t)0x00000013)
|
||||||
#define ICSNEO_DEVICETYPE_RED2 ((devicetype_t)0x00000014)
|
#define ICSNEO_DEVICETYPE_RED2 ((devicetype_t)0x00000014)
|
||||||
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)0x00000016)
|
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)0x00000016)
|
||||||
|
#define ICSNEO_DEVICETYPE_RAD_A2B ((devicetype_t)0x00000017)
|
||||||
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)0x00000018)
|
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)0x00000018)
|
||||||
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)0x00000040)
|
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)0x00000040)
|
||||||
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)0x00000080)
|
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)0x00000080)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
#ifndef __RADA2B_H_
|
||||||
|
#define __RADA2B_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include "icsneo/device/device.h"
|
||||||
|
#include "icsneo/device/devicetype.h"
|
||||||
|
#include "icsneo/communication/packetizer.h"
|
||||||
|
#include "icsneo/communication/decoder.h"
|
||||||
|
#include "icsneo/device/tree/rada2b/rada2bsettings.h"
|
||||||
|
|
||||||
|
namespace icsneo {
|
||||||
|
|
||||||
|
class RADA2B : public Device {
|
||||||
|
public:
|
||||||
|
// Serial numbers start with AB
|
||||||
|
// USB PID is 0x0006, standard driver is FTDI
|
||||||
|
// Ethernet MAC allocation is 0x18, standard driver is Raw
|
||||||
|
ICSNEO_FINDABLE_DEVICE(RADA2B, DeviceType::RAD_A2B, "AB");
|
||||||
|
|
||||||
|
static const std::vector<Network>& GetSupportedNetworks() {
|
||||||
|
static std::vector<Network> supportedNetworks = {
|
||||||
|
Network::NetID::HSCAN,
|
||||||
|
Network::NetID::HSCAN2,
|
||||||
|
|
||||||
|
Network::NetID::Ethernet,
|
||||||
|
|
||||||
|
Network::NetID::LIN,
|
||||||
|
|
||||||
|
Network::NetID::A2B1,
|
||||||
|
Network::NetID::A2B2
|
||||||
|
};
|
||||||
|
return supportedNetworks;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
RADA2B(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||||
|
initialize<RADA2BSettings>(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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); }
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
#ifndef __RADA2BSETTINGS_H_
|
||||||
|
#define __RADA2BSETTINGS_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "icsneo/device/idevicesettings.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
namespace icsneo {
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma pack(push, 2)
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t tdmMode;
|
||||||
|
uint8_t upstreamChannelOffset;
|
||||||
|
uint8_t downstreamChannelOffset;
|
||||||
|
uint8_t nodeType;
|
||||||
|
/*
|
||||||
|
* bit0: 16-bit channel width
|
||||||
|
*/
|
||||||
|
uint8_t flags;
|
||||||
|
uint8_t reserved[15];
|
||||||
|
} rada2b_monitor_settings_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t perf_en;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint16_t hwComLatencyTestEn : 1;
|
||||||
|
uint16_t : 15;
|
||||||
|
} flags;
|
||||||
|
uint16_t network_enabled_on_boot;
|
||||||
|
CAN_SETTINGS can1;
|
||||||
|
CANFD_SETTINGS canfd1;
|
||||||
|
CAN_SETTINGS can2;
|
||||||
|
CANFD_SETTINGS canfd2;
|
||||||
|
LIN_SETTINGS lin1;
|
||||||
|
ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings_1;
|
||||||
|
uint16_t iso_parity_1;
|
||||||
|
uint16_t iso_msg_termination_1;
|
||||||
|
uint64_t network_enables;
|
||||||
|
uint64_t termination_enables;
|
||||||
|
TIMESYNC_ICSHARDWARE_SETTINGS timeSyncSettings;
|
||||||
|
RAD_REPORTING_SETTINGS reporting;
|
||||||
|
DISK_SETTINGS disk;
|
||||||
|
LOGGER_SETTINGS logger;
|
||||||
|
int16_t iso15765_separation_time_offset;
|
||||||
|
rada2b_monitor_settings_t a2b_monitor;
|
||||||
|
rada2b_monitor_settings_t a2b_node;
|
||||||
|
uint32_t pwr_man_timeout;
|
||||||
|
uint16_t pwr_man_enable;
|
||||||
|
ETHERNET_SETTINGS2 ethernet;
|
||||||
|
} rada2b_settings_t;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
class RADA2BSettings : public IDeviceSettings {
|
||||||
|
public:
|
||||||
|
RADA2BSettings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(rada2b_settings_t)) {}
|
||||||
|
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
|
||||||
|
auto cfg = getStructurePointer<rada2b_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<rada2b_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
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "icsneo/device/tree/neovired2/neovired2.h"
|
#include "icsneo/device/tree/neovired2/neovired2.h"
|
||||||
#include "icsneo/device/tree/plasion/neoviion.h"
|
#include "icsneo/device/tree/plasion/neoviion.h"
|
||||||
#include "icsneo/device/tree/plasion/neoviplasma.h"
|
#include "icsneo/device/tree/plasion/neoviplasma.h"
|
||||||
|
#include "icsneo/device/tree/rada2b/rada2b.h"
|
||||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "icsneo/device/tree/neovired2/neovired2.h"
|
#include "icsneo/device/tree/neovired2/neovired2.h"
|
||||||
#include "icsneo/device/tree/plasion/neoviion.h"
|
#include "icsneo/device/tree/plasion/neoviion.h"
|
||||||
#include "icsneo/device/tree/plasion/neoviplasma.h"
|
#include "icsneo/device/tree/plasion/neoviplasma.h"
|
||||||
|
#include "icsneo/device/tree/rada2b/rada2b.h"
|
||||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue