← Documents Documentation/userspace-api/gpio/gpio-v2-line-set-values-ioctl.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API

GPIO_V2_LINE_SET_VALUES_IOCTL

요청된 출력 line의 mask 기반 논리 값 설정, ACTIVE_LOW 매핑과 EPERM 제약을 설명합니다.

Source pathDocumentation/userspace-api/gpio/gpio-v2-line-set-values-ioctl.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

gpio-v2-line-set-values-ioctl.rst:1-54

요청된 출력 line의 mask 기반 논리 값 설정, ACTIVE_LOW 매핑과 EPERM 제약을 설명합니다.

원문의 호출 형식, 구조체, flag, buffer 정책, 오류 코드와 줄 좌표를 보존해 전문 번역했습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 .. _GPIO_V2_LINE_SET_VALUES_IOCTL:
4
5 *****************************
6 GPIO_V2_LINE_SET_VALUES_IOCTL
7 *****************************
8
9 Name
10 ====
11
12 GPIO_V2_LINE_SET_VALUES_IOCTL - Set the values of requested output lines.
13
14 Synopsis
15 ========
16
17 .. c:macro:: GPIO_V2_LINE_SET_VALUES_IOCTL
18
19 ``int ioctl(int req_fd, GPIO_V2_LINE_SET_VALUES_IOCTL, struct gpio_v2_line_values *values)``
20
21 Arguments
22 =========
23
24 ``req_fd``
25 The file descriptor of the GPIO character device, as returned in the
26 :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
27
28 ``values``
29 The :c:type:`line_values<gpio_v2_line_values>` to set with the ``mask`` set
30 to indicate the subset of requested lines to set and ``bits`` set to
31 indicate the new value.
32
33 Description
34 ===========
35
36 Set the values of requested output lines.
37
38 The values set are logical, indicating if the line is to be active or inactive.
39 The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between logical
40 values (active/inactive) and physical values (high/low).
41 If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then active is high and inactive
42 is low. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then active is low and
43 inactive is high.
44
45 Only the values of output lines may be set.
46 Attempting to set the value of an input line is an error (**EPERM**).
47
48 Return Value
49 ============
50
51 On success 0.
52
53 On error -1 and the ``errno`` variable is set appropriately.
54 Common error codes are described in error-codes.rst.
55

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름, 호출 형식, 인자

1-31

`GPIO_V2_LINE_SET_VALUES_IOCTL`은 요청된 출력 line들의 값을 설정합니다. 호출 형식은 `int ioctl(int req_fd, GPIO_V2_LINE_SET_VALUES_IOCTL, struct gpio_v2_line_values *values)`입니다.

`values.mask`는 요청에 포함된 line 가운데 변경할 부분집합을 지정하고, `values.bits`는 각 선택된 line에 설정할 새 논리 값을 지정합니다. `req_fd`는 `GPIO_V2_GET_LINE_IOCTL`에서 받은 요청 디스크립터입니다.

Set values bit 집합
항목설명
req_fdGPIO v2 line request descriptor
values.mask설정할 requested output line 부분집합
values.bits선택된 line의 새 논리 값

mask로 대상을 고르고 bits로 새 값을 전달합니다.

.. SPDX-License-Identifier: GPL-2.0

.. _GPIO_V2_LINE_SET_VALUES_IOCTL:

*****************************
GPIO_V2_LINE_SET_VALUES_IOCTL
*****************************

Name
====

GPIO_V2_LINE_SET_VALUES_IOCTL - Set the values of requested output lines.

Synopsis
========

.. c:macro:: GPIO_V2_LINE_SET_VALUES_IOCTL

``int ioctl(int req_fd, GPIO_V2_LINE_SET_VALUES_IOCTL, struct gpio_v2_line_values *values)``

Arguments
=========

``req_fd``
    The file descriptor of the GPIO character device, as returned in the
    :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.

``values``
    The :c:type:`line_values<gpio_v2_line_values>` to set with the ``mask`` set
    to indicate the subset of requested lines to set and ``bits`` set to
    indicate the new value.

논리 값 매핑과 출력 전용 제약

32-47

설정 값은 논리 active/inactive입니다. `GPIO_V2_LINE_FLAG_ACTIVE_LOW`가 논리 값과 물리 high/low 사이의 매핑을 제어합니다.

`ACTIVE_LOW`가 없으면 active는 high, inactive는 low입니다. `ACTIVE_LOW`가 있으면 active는 low, inactive는 high입니다.

출력 line의 값만 설정할 수 있습니다. 입력 line의 값을 설정하려고 하면 `EPERM` 오류가 발생합니다.

Set values 논리 매핑
항목설명
ACTIVE_LOW 미설정 + active물리 high
ACTIVE_LOW 미설정 + inactive물리 low
ACTIVE_LOW 설정 + active물리 low
ACTIVE_LOW 설정 + inactive물리 high
입력 line 설정EPERM

동일한 논리 값도 ACTIVE_LOW에 따라 반대 물리 level이 됩니다.


Description
===========

Set the values of requested output lines.

The values set are logical, indicating if the line is to be active or inactive.
The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between logical
values (active/inactive) and physical values (high/low).
If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then active is high and inactive
is low.  If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then active is low and
inactive is high.

Only the values of output lines may be set.
Attempting to set the value of an input line is an error (**EPERM**).

반환값

48-54

성공하면 0을 반환합니다. 실패하면 -1을 반환하고 `errno`를 설정하며 공통 오류 코드는 `error-codes.rst`에 설명되어 있습니다.

Return Value
============

On success 0.

On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.