Skip to main content

Crate jetsongpio

Crate jetsongpio 

Source
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:

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§

ChannelInfo
EventManager
Event manager for GPIO edge detection
GPIO
A thread-safe struct that holds state information about the GPIO pins.
JetsonInfo
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§

get_model

Type Aliases§

EdgeCallback
Callback signature for edge-detection events.