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:
kjohannes-intrepidcs
2023-11-30 15:56:18 -05:00
committed by GitHub
co-authored by Francesco Valla
parent 02f1b4592e
commit 0497b361ef
21 changed files with 562 additions and 3 deletions
@@ -229,6 +229,32 @@ public:
};
}
const LIN_SETTINGS* getLINSettingsFor(Network net) const override {
auto cfg = getStructurePointer<neovifire3_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);
case Network::NetID::LIN5:
return &(cfg->lin5);
case Network::NetID::LIN6:
return &(cfg->lin6);
case Network::NetID::LIN7:
return &(cfg->lin7);
case Network::NetID::LIN8:
return &(cfg->lin8);
default:
return nullptr;
}
}
protected:
ICSNEO_UNALIGNED(const uint64_t*) getTerminationEnables() const override {
auto cfg = getStructurePointer<neovifire3_settings_t>();