mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-09-20 07:58:39 +02:00
LIN: Add wakeup request
This commit is contained in:
committed by
Kyle Schwarz
parent
3a6501d116
commit
d95a17b360
@@ -34,6 +34,7 @@ struct LINStatusFlags {
|
||||
bool HasUpdatedResponderOnce = false;
|
||||
bool BusRecovered = false;
|
||||
bool BreakOnly = false;
|
||||
bool WakeupRequest = false;
|
||||
};
|
||||
|
||||
class LINMessage : public Frame {
|
||||
@@ -45,7 +46,8 @@ public:
|
||||
LIN_BREAK_ONLY = icsneoc2_lin_msg_type_break_only,
|
||||
LIN_SYNC_ONLY = icsneoc2_lin_msg_type_sync_only,
|
||||
LIN_UPDATE_RESPONDER = icsneoc2_lin_msg_type_update_responder,
|
||||
LIN_ERROR = icsneoc2_lin_msg_type_error
|
||||
LIN_ERROR = icsneoc2_lin_msg_type_error,
|
||||
LIN_WAKEUP_REQUEST = icsneoc2_lin_msg_type_wakeup_request
|
||||
};
|
||||
|
||||
static void calcChecksum(LINMessage& message);
|
||||
|
||||
@@ -47,7 +47,8 @@ struct HardwareLINPacket {
|
||||
uint16_t ResponderByteFerr : 1; //Framing error in one of our responder bytes.
|
||||
uint16_t TxAborted : 1;//!< This transmit was aborted.
|
||||
uint16_t BreakOnly : 1;
|
||||
uint16_t : 2;
|
||||
uint16_t WakeupRequest : 1; //!< LIN wakeup pulse.
|
||||
uint16_t : 1;
|
||||
} CoreMiniBitsLIN;
|
||||
|
||||
uint8_t data[8];
|
||||
|
||||
@@ -118,6 +118,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const LIN_SETTINGS* getLINSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radcomet2_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::LIN_01:
|
||||
return &(cfg->lin1);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<bool> isT1SPLCAEnabledFor(Network net) const override {
|
||||
const ETHERNET10T1S_SETTINGS* t1s = getT1SSettingsFor(net);
|
||||
if(t1s == nullptr)
|
||||
|
||||
@@ -115,6 +115,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const LIN_SETTINGS* getLINSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radcomet3_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::LIN_01:
|
||||
return &(cfg->lin1);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const ETHERNET_SETTINGS2* getEthernetSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radcomet3_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
|
||||
@@ -381,6 +381,7 @@ typedef enum _icsneoc2_lin_msg_type_t {
|
||||
icsneoc2_lin_msg_type_sync_only = 4,
|
||||
icsneoc2_lin_msg_type_update_responder = 5,
|
||||
icsneoc2_lin_msg_type_error = 6,
|
||||
icsneoc2_lin_msg_type_wakeup_request = 7,
|
||||
} _icsneoc2_lin_msg_type_t;
|
||||
|
||||
typedef uint8_t icsneoc2_lin_msg_type_t;
|
||||
@@ -409,6 +410,7 @@ typedef uint32_t icsneoc2_lin_err_flags_t;
|
||||
#define ICSNEOC2_LIN_STATUS_HAS_UPDATED_RESPONDER_ONCE 0x20
|
||||
#define ICSNEOC2_LIN_STATUS_BUS_RECOVERED 0x40
|
||||
#define ICSNEOC2_LIN_STATUS_BREAK_ONLY 0x80
|
||||
#define ICSNEOC2_LIN_STATUS_WAKEUP_REQUEST 0x100
|
||||
|
||||
typedef uint32_t icsneoc2_lin_status_flags_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user