Metadata-Version: 2.3
Name: gpio_manager
Version: 1.1.3
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
License-File: LICENSE
Summary: Rust bindings for the rppal crate to manage GPIO pins on a Raspberry Pi.
Keywords: Raspberry PI 5,Raspberry PI 4,GPIO
Author: Rylan Meilutis
Author-email: rylan.meilutis@gmail.com
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

## Description

- These are rust binding around
  the [RPPAL - Raspberry Pi Peripheral Access Library](https://github.com/golemparts/rppal) crate that gives access to
  gpio, pwm, spi, and more.
  As of current, the only provided bindings are for the gpio library.
  Support for the other functions may come later on.
- These bindings allow you to call the rust code from python in a way that looks like any other python object

## Features

- Able to make multiple objects that can call the gpio without generating errors
- Support for event driven io using callbacks
- Supports software pwm
- Allows for setting up pins as input or output
- Works with multiple platforms

## Usage

- To use you need to first create a GPIOManager object, this can be done by calling
  ```manager = gpio_manager.GPIOManager()```.
- To set up a pin as input with the pull-up resistor enabled on the pin
  ```manager.add_input_pin(BUTTON_PIN, gpio_manager.IPinState.PULLUP)```.
- To set up a pin as output run ```manager.add_output_pin(LED_PIN)```.
- To set an output pin to the low state run ```manager.set_output_pin(LED_PIN, gpio_manager.OPinState.LOW)```.
- To assign a callback to an input pin
  ```manager.assign_callback(BUTTON_PIN, gpio_manager.TriggerEdge.FALLING, button_callback)```.
- To wait on an input pin to trigger an edge ```manager.wait_for_edge(BUTTON_PIN, gpio_manager.TriggerEdge.FALLING)```.
- To set pwm on an output pin run ```manager.set_pwm(PWM_PIN, PERIOD_MS, PULSE_WIDTH_US)```.
- To reset a pin to its default state run ```manager.reset_pin(PIN)```.
- To set all outputs to low and clear all interrupts run ```manager.cleanup()```.

## Warranty

- This library is provided as is and is not guaranteed to work in all cases.

## Support

- If you have any issues with the library please contact me in class or via the discussion board on brightspace.

## Coming Soon

- Support for UART
- support for SPI
- Support for hardware PWM
- Support for I2C
- Documentation on readthedocs.io

