1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00

restructure SSI sensor

This commit is contained in:
andreas
2024-11-25 19:40:47 +01:00
parent d5a1c9c4ae
commit 38acd5a30b
6 changed files with 82 additions and 89 deletions

View File

@@ -92,13 +92,14 @@ class SSIDevice{
class SSISensor : public SensorTemplate<BUSTYPE,SensorBase::SPI>{
std::unique_ptr<SSIDevice> device;
protected:
public:
int bits=12;
int mask=0xffff;
int cs=-1;
int clock=0;
bool act=false;
float fintv=0;
protected:
virtual bool initSSI(GwLog*logger,const SPIBus *bus,
int clock,int cs, int bits){
mask= (1 << bits)-1;
@@ -125,9 +126,8 @@ class SSISensor : public SensorTemplate<BUSTYPE,SensorBase::SPI>{
}
public:
SSISensor(GwApi *api,const String &prfx, int host):SensorTemplate<BUSTYPE,SensorBase::SPI>(api,prfx)
SSISensor(GwApi *api,const String &prfx):SensorTemplate<BUSTYPE,SensorBase::SPI>(api,prfx)
{
busId=host;
}
virtual bool isActive(){return act;};
virtual bool initDevice(GwApi *api,BUSTYPE *bus){