gpio-v2-line-get-values-ioctl.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. _GPIO_V2_LINE_GET_VALUES_IOCTL:
  3. *****************************
  4. GPIO_V2_LINE_GET_VALUES_IOCTL
  5. *****************************
  6. Name
  7. ====
  8. GPIO_V2_LINE_GET_VALUES_IOCTL - Get the values of requested lines.
  9. Synopsis
  10. ========
  11. .. c:macro:: GPIO_V2_LINE_GET_VALUES_IOCTL
  12. ``int ioctl(int req_fd, GPIO_V2_LINE_GET_VALUES_IOCTL, struct gpio_v2_line_values *values)``
  13. Arguments
  14. =========
  15. ``req_fd``
  16. The file descriptor of the GPIO character device, as returned in the
  17. :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
  18. ``values``
  19. The :c:type:`line_values<gpio_v2_line_values>` to get with the ``mask`` set
  20. to indicate the subset of requested lines to get.
  21. Description
  22. ===========
  23. Get the values of requested lines.
  24. The values returned are logical, indicating if the line is active or inactive.
  25. The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between physical
  26. values (high/low) and logical values (active/inactive).
  27. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then high is active and low is
  28. inactive. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then low is active and
  29. high is inactive.
  30. The values of both input and output lines may be read.
  31. For output lines, the value returned is driver and configuration dependent and
  32. may be either the output buffer (the last requested value set) or the input
  33. buffer (the actual level of the line), and depending on the hardware and
  34. configuration these may differ.
  35. Return Value
  36. ============
  37. On success 0 and the corresponding :c:type:`values.bits<gpio_v2_line_values>`
  38. contain the value read.
  39. On error -1 and the ``errno`` variable is set appropriately.
  40. Common error codes are described in error-codes.rst.