Commit 46637b26 authored by Woazboat's avatar Woazboat Committed by Florian Kargl
Browse files

feat(portexpander): New function for setting multiple pins at once

parent 8a5926b5
......@@ -105,3 +105,12 @@ void portexpander_set(uint8_t pin, uint8_t value)
portexpander_write(PE_C_OUTPUT_PORT, output_state);
}
}
void portexpander_set_mask(uint8_t mask, uint8_t values)
{
if (detected) {
output_state &= ~(mask & ~values);
output_state |= mask & values;
portexpander_write(PE_C_OUTPUT_PORT, output_state);
}
}
......@@ -7,6 +7,7 @@
void portexpander_init(void);
uint8_t portexpander_get(void);
void portexpander_set(uint8_t pin, uint8_t value);
void portexpander_set_mask(uint8_t mask, uint8_t values);
bool portexpander_detected(void);
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment