Modbus Driver fixing multiRequest

This commit is contained in:
Emanuele Trabattoni
2025-07-10 16:01:10 +02:00
parent 4b97e6535d
commit 8f701ce81a
7 changed files with 158 additions and 191 deletions

View File

@@ -9,6 +9,11 @@ namespace drivers
writeRegister(TCA9554_CONFIG_REG, TCA9554_OUT_MODE); // set all pins as output (relay mode for this board)
}
TCA9554PWR::~TCA9554PWR() {
writeRegister(TCA9554_OUTPUT_REG, Low); // set all pins to Low state
writeRegister(TCA9554_CONFIG_REG, TCA9554_OUT_MODE); // set all pins as output (relay mode for this board)
}
const bool TCA9554PWR::writeRegister(const uint8_t reg, const uint8_t val)
{
if (m_i2c.write(m_address, reg, {val}))

View File

@@ -35,6 +35,7 @@ namespace drivers
};
TCA9554PWR(I2C &i2c, const uint8_t address);
~TCA9554PWR();
const bool setOut(const uint8_t channel, const bool state);
const bool setPort(const uint8_t state);