Add power off command to I2cDev_PPmod class (#3152)

This commit is contained in:
Totoo
2026-04-23 13:18:56 +02:00
committed by GitHub
parent 1dafdd5a26
commit c9f310f548
2 changed files with 12 additions and 1 deletions
+8
View File
@@ -242,4 +242,12 @@ std::vector<uint8_t> I2cDev_PPmod::downloadStandaloneApp(uint32_t index, size_t
return ret;
}
bool I2cDev_PPmod::send_poweroff_command() {
if (isLocked()) return false; // device is busy
Command cmd = Command::COMMAND_POWER_OFF;
uint8_t tmp = 0; // result of the ack. 0 = no, 1 = ok
i2c_read((uint8_t*)&cmd, 2, &tmp, 1);
return (tmp == 1);
}
} // namespace i2cdev