Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!65Refactor portexpander code + new function for setting multiple pins at once
Pipeline #1722 passed
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment