allow input preload and state toggling

This commit is contained in:
Siwat Sirichai 2024-06-21 21:34:51 +07:00
parent b778fb6a02
commit 4ea2122f6e
5 changed files with 26 additions and 1 deletions

View file

@ -306,4 +306,13 @@ void DigitalOutputCard::saveStateToFRAM() {
if(!framBinded) return;
uint16_t packed = packStates();
this->fram->write16(framAddress, packed);
}
/**
* @brief Toggle the state of the specified pin
*
* @param pin The pin to toggle
*/
void DigitalOutputCard::toggleState(uint8_t pin) {
this->setState(pin, !this->state_buffer[pin]);
}