Skip to content

Commit 4e6a00e

Browse files
authored
[Jetson.GPIO] Update to 2.1.12 (#14849)
1 parent be7e7c5 commit 4e6a00e

File tree

7 files changed

+68
-30
lines changed

7 files changed

+68
-30
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# The high level module can only be imported on a Jetson SBC
2-
1+
# stubtest produces false positives for Jetson.GPIO-related modules in CI
2+
# The high-level Jetson.GPIO library can only be imported on Jetson SBC,
3+
# and requires specific system permissions (/dev/gpiochip0 access).
34
Jetson.GPIO
4-
# error: Jetson.GPIO failed to import. RuntimeError: The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this. It is also possible that /dev/gpiochip0 does not exist. Please check if that file is present.
5-
65
Jetson.GPIO.gpio
7-
# error: Jetson.GPIO.gpio failed to import. RuntimeError: The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this. It is also possible that /dev/gpiochip0 does not exist. Please check if that file is present.
6+
Jetson.GPIO.gpio_pinmux_lookup
87

98
# This builtin error doesn't need to be re-exported
109
Jetson.GPIO.gpio_event.InterruptedError
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from typing import Final
2+
3+
BOARD: Final = 10
4+
BCM: Final = 11
5+
TEGRA_SOC: Final = 1000
6+
CVM: Final = 1001
7+
8+
PUD_OFF: Final = 20
9+
PUD_DOWN: Final = 21
10+
PUD_UP: Final = 22
11+
12+
HIGH: Final = 1
13+
LOW: Final = 0
14+
15+
RISING: Final = 31
16+
FALLING: Final = 32
17+
BOTH: Final = 33
18+
19+
UNKNOWN: Final = -1
20+
OUT: Final = 0
21+
IN: Final = 1
22+
HARD_PWM: Final = 43

stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
from collections.abc import Callable, Sequence
2-
from typing import Final, Literal
2+
from typing import Literal
33

4-
BOARD: Final = 10
5-
BCM: Final = 11
6-
TEGRA_SOC: Final = 1000
7-
CVM: Final = 1001
8-
9-
PUD_OFF: Final = 20
10-
PUD_DOWN: Final = 21
11-
PUD_UP: Final = 22
12-
13-
HIGH: Final = 1
14-
LOW: Final = 0
15-
16-
RISING: Final = 31
17-
FALLING: Final = 32
18-
BOTH: Final = 33
19-
20-
UNKNOWN: Final = -1
21-
OUT: Final = 0
22-
IN: Final = 1
23-
HARD_PWM: Final = 43
4+
from .constants import *
245

256
model = ...
267
JETSON_INFO = ...

stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ctypes
2+
from dataclasses import dataclass
23
from typing import Final, Literal
34

45
from .gpio_pin_data import ChannelInfo
@@ -70,3 +71,13 @@ def request_handle(line_offset: int, direction: Literal[0, 1], initial: Literal[
7071
def request_event(line_offset: int, edge: int, consumer: str) -> gpioevent_request: ...
7172
def get_value(line_handle: int) -> int: ...
7273
def set_value(line_handle: int, value: int) -> None: ...
74+
@dataclass
75+
class PadCtlRegister:
76+
is_gpio: bool
77+
is_input: bool
78+
is_tristate: bool
79+
def __init__(self, value: int) -> None: ...
80+
@property
81+
def is_bidi(self) -> bool: ...
82+
83+
def check_pinmux(ch_info: ChannelInfo, direction: int) -> None: ...

stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ JETSON_THOR_REFERENCE: Final = "JETSON_THOR_REFERENCE"
1515

1616
JETSON_MODELS: list[str]
1717

18-
JETSON_ORIN_NX_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]]
18+
JETSON_ORIN_NX_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None, int]]
1919
compats_jetson_orins_nx: Sequence[str]
2020
compats_jetson_orins_nano: Sequence[str]
2121

22-
JETSON_ORIN_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]]
22+
JETSON_ORIN_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None, int]]
2323
compats_jetson_orins: Sequence[str]
2424

2525
CLARA_AGX_XAVIER_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]]
@@ -49,8 +49,27 @@ compats_jetson_thor_reference: Sequence[str]
4949
jetson_gpio_data: dict[str, tuple[list[tuple[int, str, str, int, int, str, str, str | None, int | None]], dict[str, Any]]]
5050

5151
class ChannelInfo:
52+
channel: int
53+
chip_fd: int | None
54+
line_handle: int | None
55+
line_offset: int
56+
direction: int | None
57+
edge: int | None
58+
consumer: str
59+
gpio_name: str
60+
gpio_chip: str
61+
pwm_chip_dir: str
62+
pwm_id: int
63+
reg_addr: int | None
5264
def __init__(
53-
self, channel: int, line_offset: int, gpio_name: str, gpio_chip: str, pwm_chip_dir: str, pwm_id: int
65+
self,
66+
channel: int,
67+
line_offset: int,
68+
gpio_name: str,
69+
gpio_chip: str,
70+
pwm_chip_dir: str,
71+
pwm_id: int,
72+
reg_addr: int | None = None,
5473
) -> None: ...
5574

5675
ids_warned: bool
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from collections.abc import Iterable
2+
3+
def lookup_mux_register(
4+
gpio_pin: int, pin_defs: Iterable[tuple[int, str, str, int, int, str, str, str | None, int | None, int]]
5+
) -> int: ...
6+
def main() -> None: ...

stubs/Jetson.GPIO/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "2.1.11"
1+
version = "2.1.12"
22
upstream_repository = "https://github.com/NVIDIA/jetson-gpio"

0 commit comments

Comments
 (0)