Skip to content

Add GPIO support #5

@gwdehaan

Description

@gwdehaan

on IO :
When I look at the RPI.GPIO and https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/FT232H.py (and pyftfi) the instance is a spichannel or a pin. Up until now the instance in my implementation has been the USBISS module itself :

t=GPIO('COM3', 'input', 'output', 'input', 'adc')
# default GPIO function for pin 1..4
t.SetPinOn(2) # set Led connected to pin 2

RPI / pyftdi / FT232H.py

#init
led = gpio.GPIO(17)
led.setDirection(1)
led.setValue(1)

Would you agree to the following :

t=GPIO('COM3')
led = t.IO.pin(2) #
led.setDirection(OUTPUT)
led.setValue(HIGH)  

We can discuss the exact names for the methods.
SPI / I2C / Serial are modes that have a single instance and fixed HW pins associated, whereas GPIO is configurable per pin as input, output or ADC.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions