From ca59c2465a98eff9c2bc0e2b49262544868cc44f Mon Sep 17 00:00:00 2001 From: embeddev Date: Wed, 4 Mar 2026 22:40:14 +0300 Subject: [PATCH] vault backup: 2026-03-04 22:40:14 --- Linux/Programm/GPIO Kernel control.md | 29 --------------------------- 1 file changed, 29 deletions(-) diff --git a/Linux/Programm/GPIO Kernel control.md b/Linux/Programm/GPIO Kernel control.md index ded6062..e69de29 100644 --- a/Linux/Programm/GPIO Kernel control.md +++ b/Linux/Programm/GPIO Kernel control.md @@ -1,29 +0,0 @@ -#include - -void main() { - struct gpiod_chip *chip; - struct gpiod_line *line; - int req, value; - - chip = gpiod_chip_open("/dev/gpiochip0"); - if (!chip) - return -1; - - line = gpiod_chip_get_line(chip, 3); - if (!line) { - gpiod_chip_close(chip); - return -1; - } - - req = gpiod_line_request_input(line, "gpio_state"); - if (req) { - gpiod_chip_close(chip); - return -1; - } - - value = gpiod_line_get_value(line); - - printf("GPIO value is: %d\n", value); - - gpiod_chip_close(chip); -} \ No newline at end of file