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

ModalAI Forum

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

Voxl-IO questions (GPIO & i2c)

Scheduled Pinned Locked Moved Unsolved VOXL SDK and Software
3 Posts 3 Posters 836 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

        Reading along? Create a free ModalAI Forum account to join in.

        With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.

        Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.

        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

        • Don't have an account? Register

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