pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


gpio_set
Posted by Anonymous on Thu 19th Mar 2020 08:47
raw | new post

  1. int set_gpio_pin_value_fd(int pin_fd, int value)
  2. {
  3.         if (pin_fd == -1) {
  4.         //test_log("Error: set_gpio_pin_value_fd: Pin fd not open!");
  5.                 return -1;
  6.         }
  7.         struct gpiohandle_data data = { { (__u8)value } };
  8.         int res = ioctl(pin_fd, GPIOHANDLE_SET_LINE_VALUES_IOCTL, &data);
  9.         if (res == -1) {
  10.         //test_log("gpio pin value cannot be set: %s.", strerror(errno));
  11.                 return -1;
  12.         }
  13.         return 0;
  14. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at