mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
LIN: Settings API (#62)
* Settings: add APIs for LIN configuration Add getter/setter for LIN configuration: - baudrate - commander resistor ON/OFF - mode (SLEEP, SLOW, NORMAL, FAST) * Device: add LIN settings getter for devices with LIN * LIN: add setup to LIN example * LIN: settings minor tweaks from PR --------- Co-authored-by: Francesco Valla <francesco.valla@mta.it>
This commit is contained in:
co-authored by
Francesco Valla
parent
02f1b4592e
commit
0497b361ef
@@ -212,6 +212,24 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
const LIN_SETTINGS* getLINSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<neovifire3flexray_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::LIN:
|
||||
return &(cfg->lin1);
|
||||
case Network::NetID::LIN2:
|
||||
return &(cfg->lin2);
|
||||
case Network::NetID::LIN3:
|
||||
return &(cfg->lin3);
|
||||
case Network::NetID::LIN4:
|
||||
return &(cfg->lin4);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
ICSNEO_UNALIGNED(const uint64_t*) getTerminationEnables() const override {
|
||||
auto cfg = getStructurePointer<neovifire3flexray_settings_t>();
|
||||
|
||||
Reference in New Issue
Block a user