Organize into arch, board, and ec modules
This commit is contained in:
17
src/ec/it8587e/gpio.c
Normal file
17
src/ec/it8587e/gpio.c
Normal file
@ -0,0 +1,17 @@
|
||||
#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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user