Files
system76-embedded-controller/src/ec/it8587e/gpio.c
2019-09-29 20:13:03 -06:00

18 lines
327 B
C

#include <ec/gpio.h>
bool gpio_get(struct Gpio * gpio) {
if (*(gpio->data) & gpio->value) {
return true;
} else {
return false;
}
}
void gpio_set(struct Gpio * gpio, bool value) {
if (value) {
*(gpio->data) |= gpio->value;
} else {
*(gpio->data) &= ~(gpio->value);
}
}