Classes | Functions | Variables
gpio_control.gpio_control_utils Namespace Reference

Classes

class  _GenericInputPin
 
class  _GenericOutputPin
 
class  GpioControl
 

Functions

def _configure_input
 
def _configure_output
 
def _num2word
 
def _to_valid_ros_topic_name (input_string)
 
def configure_bus (device)
 
def configure_cleanup (device)
 

Variables

int _DEFAULT_RATE_VAL = 10
 
bool _IMPORTED_ADAFRUIT_BBIO = False
 
bool _IMPORTED_GPIO_API = False
 
bool _IMPORTED_ONION_GPIO = False
 
bool _IMPORTED_PIGPIO = False
 
dictionary _num2words1
 
list _num2words2 = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety']
 
list VALID_DEVICES
 

Detailed Description

Control GPIO pins via ROS. Made to be as generic as possible, allowing the same node to be
used in multiple configurations/devices.

@author cst <chris thierauf, christopher.thierauf@tufts.edu>
@version 0.0.1
@license Apache 2.0
@copyright Christopher Thierauf 2020.

The copyright holder uses this copyright to release the code in accordance with the license of
this repository, which is a Free and Open Source license: you may use, modify, and share this
code in any way you see fit as described by the terms of the license. You are not legally
obligated to provide attribution, but it would be greatly appreciated.

Function Documentation

def gpio_control.gpio_control_utils._configure_input (   pin,
  device 
)
private

Definition at line 155 of file gpio_control_utils.py.

def gpio_control.gpio_control_utils._configure_output (   pin)
private

Definition at line 195 of file gpio_control_utils.py.

def gpio_control.gpio_control_utils._num2word (   num)
private

Definition at line 91 of file gpio_control_utils.py.

def gpio_control.gpio_control_utils._to_valid_ros_topic_name (   input_string)
private
Convert input to a valid ROS name (alphabetic). This is necessary because ROS best practice is
to have topic names be only alphabetic (hyphens/slashes optional). Most GPIO pins will have
numbers in them, which can be an issue.

Definition at line 245 of file gpio_control_utils.py.

def gpio_control.gpio_control_utils.configure_bus (   device)
Configure a GPIO bus for the specific hardware we're dealing with. Return an object of the
appropriate hardware type, if the specific implementation requires that.

Definition at line 281 of file gpio_control_utils.py.

def gpio_control.gpio_control_utils.configure_cleanup (   device)
If the device in question requires cleanup functions, give them a run.

Definition at line 321 of file gpio_control_utils.py.

Variable Documentation

int gpio_control.gpio_control_utils._DEFAULT_RATE_VAL = 10
private

Definition at line 47 of file gpio_control_utils.py.

bool gpio_control.gpio_control_utils._IMPORTED_ADAFRUIT_BBIO = False
private

Definition at line 52 of file gpio_control_utils.py.

bool gpio_control.gpio_control_utils._IMPORTED_GPIO_API = False
private

Definition at line 54 of file gpio_control_utils.py.

bool gpio_control.gpio_control_utils._IMPORTED_ONION_GPIO = False
private

Definition at line 53 of file gpio_control_utils.py.

bool gpio_control.gpio_control_utils._IMPORTED_PIGPIO = False
private

Definition at line 51 of file gpio_control_utils.py.

dictionary gpio_control.gpio_control_utils._num2words1
private
Initial value:
1 = {1: 'One', 2: 'Two', 3: 'Three', 4: 'Four', 5: 'Five',
2  6: 'Six', 7: 'Seven', 8: 'Eight', 9: 'Nine', 10: 'Ten',
3  11: 'Eleven', 12: 'Twelve', 13: 'Thirteen', 14: 'Fourteen',
4  15: 'Fifteen', 16: 'Sixteen', 17: 'Seventeen', 18: 'Eighteen', 19: 'Nineteen'}

Definition at line 84 of file gpio_control_utils.py.

list gpio_control.gpio_control_utils._num2words2 = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety']
private

Definition at line 88 of file gpio_control_utils.py.

list gpio_control.gpio_control_utils.VALID_DEVICES
Initial value:
1 = [
2  # pi support via pigpio
3  'pi',
4  # jetson support also via pigpio
5  'jetson',
6  # beaglebone support via Adafruit_BBIO
7  'beaglebone-experimental',
8  # onion support via onionGpio, though I don't know how popular an option this is. 'onion-experimental', # Support of standard Linux systems via the LFS 'generic', # Don't actually do anything, just print to the screen
9  'simulated'
10 ]

Definition at line 31 of file gpio_control_utils.py.



gpio_control
Author(s):
autogenerated on Thu Apr 22 2021 02:55:39