Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. Voxl-IO questions (GPIO & i2c)

Voxl-IO questions (GPIO & i2c)

Scheduled Pinned Locked Moved Software Development
3 Posts 3 Posters 727 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitmol
    wrote on last edited by
    #1

    I have a few questions about the voxl-io library, and I would love if you could help me:

    1.1. Missing ability to GPIO interrupt (or missing documentation?)
    1.2. Missing ability to control of Pull Up/Down (Is the hardware exist to do so?, or missing documentation?)
    1.3. Need clarification in the i2c api, can I write to a device without specifying a designated register?
    	For example in the smbus linux library: (https://www.kernel.org/doc/html/latest/i2c/smbus-protocol.html)
    		i2c_smbus_write_byte(...): Writes a single byte to a device
    		i2c_smbus_write_byte_data(...): Writes a single byte to a designated register on the device
    
    1 Reply Last reply
    0
    • modaltbM Offline
      modaltbM Offline
      modaltb
      ModalAI Team
      wrote on last edited by
      #2

      Hi @amitmol ,

      The VOXL is based on the snapdragon 820, built for smart phones, and has a bit less control than a microcontroller with configurability....

      • Interrupt- not out of the box as far as I know
      • pull up/down - this is a device tree modification likely, not something quick
      • on this platform, we use voxl-io to send/receive the I2C commands to the sDSP, so it's what's exposed there presently only unless it's added later
      1 Reply Last reply
      0
      • Chad SweetC Offline
        Chad SweetC Offline
        Chad Sweet
        ModalAI Team
        wrote on last edited by
        #3

        We have example Python code in voxl-modem to control the B2B GPIO

        ## All GPIO pins need to be exported before they can be used
        #
        def gpio_export(num):
            subprocess.call("echo " + num + " > /sys/class/gpio/export",
                            stderr=FNULL, shell=True)
        
        ## Each GPIO has to have its direction set prior to use
        # @param num  pin number
        # @param direction 'in' or 'out'
        #
        def gpio_direction_map(num, direction):
            subprocess.call("echo " + direction + " > /sys/class/gpio/gpio" \
                            + num + "/direction",
                            stderr=FNULL, shell=True)
        
        ## Set a value to an 'out' gpio
        #
        def set_gpio(num, value):
            subprocess.call("echo " + value + " > /sys/class/gpio/gpio" + num + "/value",
                            stderr=FNULL, shell=True)
        
        ##  Reads a GPIO pin
        #   @apram pin
        #       pin number
        #   @return
        #       integer value [0,1]
        def gpio_read_int(pin_int):
            gpio_file = '/sys/class/gpio/gpio' + str(pin_int) + '/value'
            value = subprocess.check_output(['cat', gpio_file]).strip()
            return int(value)
        
        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        ModalAI
        Categories Recent Tags ModalAI.com Docs
        © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups