Expand description
§jetsongpio
A Rust library for controlling GPIO pins on NVIDIA Jetson platforms.
This is a Rust implementation of the Jetson.GPIO
Python library, using the Linux GPIO character device API (/dev/gpiochipX).
§Quick Start
use jetsongpio::{GPIO, Direction, Level, Mode};
let gpio = GPIO::new();
gpio.setmode(Mode::BOARD)?;
gpio.setup(vec![18], Direction::OUT, Some(Level::LOW), None)?;
gpio.output(vec![18], vec![Level::HIGH])?;
gpio.cleanup(None)?;§Pin Numbering
Two modes are supported:
Mode::BOARD— physical pin number on the 40-pin headerMode::BCM— BCM numbering
Python’s CVM / TEGRA_SOC modes are intentionally not implemented:
they key the channel map by pin-name string, which doesn’t fit this port’s
integer-channel API.
Structs§
- Channel
Info - Event
Manager - Event manager for GPIO edge detection
- GPIO
- A thread-safe struct that holds state information about the GPIO pins.
- Jetson
Info - PWM
- Hardware PWM controller for a GPIO channel.
Enums§
- Direction
- Specifies the GPIO pin direction.
- Edge
- Edge detection types
- Level
- Specifies the GPIO pin value in output mode.
- Mode
Functions§
Type Aliases§
- Edge
Callback - Callback signature for edge-detection events.