Coder Social home page Coder Social logo

jetson-tk1-gpio's Introduction

Intro

This is a python library for interacting with Nvidia Jetson TK1 GPIO. This library is *specifically for Jetson TK1 only and not for other versions, If you are looking for a GPIO library for other Jetson variant checkout this repository

I have built this around the sysfs interface for GPIO's and inpired by the NVIDIA's official GPIO library for TX1, TX2, Nano etc Jetson versions.

Setup file system permission

Please follow the guide in NVIDIA/Jetson-GPIO readme to setup file system permissions

Usage

This library provides a GPIO class definition which you can create gpio objects out of that, An instance work as one GPIO pin and you can, setup, set data flow direction(mode), output status that is, if out direction whther output needs to be high(~1.8v) or low(~0.0v) etc and finaly cleanup the GPIO pin(unexport).

  • To initialize a GPIO pin (Create an GPIO object), You need to provide, sysfs filename number (i:e if gpio165 give 165) as the first argument, and the mode (direction) and optionaly you can provide the output initial state
Port sysfs filename Physical pin
GPIO_PH1 gpio57 Pin 50 on J3A1
GPIO_PU6 gpio166 Pin 58 on J3A2
GPIO_PU5 gpio165 Pin 55 on J3A2
GPIO_PU4 gpio164 Pin 52 on J3A2
GPIO_PU3 gpio163 Pin 49 on J3A2
GPIO_PU2 gpio162 Pin 46 on J3A2 (Disabled by default)
GPIO_PU1 gpio161 Pin 43 on J3A2
GPIO_PU0 gpio160 Pin 40 on J3A2

~Source

  fan = GPIO(165,GPIO.OUT)
  • Setup pin, This call will export the pin and set the direction as well (if direction is given when creating the GPIO object)
  fan.setup()
  • Debug the pin, If /sys/kernel/debug/gpio is assessable, Will print the content of it , else will print the object properties
  fan.debug()
  • Set output, Set the output of the pin either GPIO.HIGH or GPIO.LOW
fan.setOutput(GPIO.HIGH)
  • Cleanup after all, Will unexport the pin from sysfs
fan.cleanup()

Warning

This is in very early stage of development , and not intended to be used in any serious work :)

jetson-tk1-gpio's People

Contributors

tmkasun avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

molonky500

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.