Add license information to files. Mostly automated with: find src/ -name '*.[c,h]' | xargs sed -i '1s,^,// SPDX-License-Identifier: GPL-3.0-only\n\n,' find src/ -name '*.mk' | xargs sed -i '1s,^,# SPDX-License-Identifier: GPL-3.0-only\n\n,'
20 lines
369 B
C
20 lines
369 B
C
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#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);
|
|
}
|
|
}
|