sysfs is the lowest level at which you can manipulate GPIO in the latest kernels. This may be a little tedious, but it offers several advantages over the old API:
- No ugly ioctl
- Script can be easily written (think about startup scripts)
- "" // , .
, C , :
int gpio_open(int number, int out);
int gpio_close(int gpio);
int gpio_set(int gpio, int up);
int gpio_get(int gpio, int *up);
int gpio_poll(int gpio, int rising_edge, int timeout);
.